I really need help with this PHP code that is not working , What is wrong with this PHP code ?
-
Ok ... I have created just one form that enters a code and depending on the specific area codes , it will display the price per weight of what you want to be shipped .. but wen I click on the SUBMIT BUTTON , NOTHING gets displayed on the PHP form .. Nothing at all .. Help would be very much appreciated . Here is the FORM code : <html> <head> <title> form </title> </head> <body> <h1> Please select a status code or enter a bank balance </h1> <form action="region.php" method="post"> Enter area code : <input type="text" name="areacode" size="20" /> <input type="submit" value="Check status" /> <input type="reset" value="Clear form" /> </body> </html> HERE is the PHP code <html> <head> <title> Change Cash Calculator </title> </head> <body> <?php if ($areacode == 508 || $areacode == 617) { $switchcase =1; } else if($areacode == 207 || $areacode == 603) { $switchcase =2; } else ( $areacode == 404 || $areacode == 706) switchcase = 3; switch($switchcase) { case 1: echo " The price of the following location is going to be : $2.50 per pound "; break; case 2: echo " The price of the following location is going to be : $ 3.50 per pound"; break; case 3: echo "The price of the following location is going to be : $ 5.00 per pound"; } ?> </body> </html>
-
Answer:
you left off a dollar sign on one of your "switchcase" where it says switchcase = 3. Also, what is $areacode? you need to tell PHP what this variable is, it can't guess. $areacode = $_POST['areacode'];
none at Yahoo! Answers Visit the source
Related Q & A:
- What's wrong with this PHP Twitter API POST?Best solution by Stack Overflow
- I did something really bad and now i need help please help me.Best solution by Yahoo! Answers
- I need help with writing up the Java Code.Best solution by Yahoo! Answers
- Anybody psychic or clairvoyant? I really need some help and advice please. Please see question below?Best solution by Yahoo! Answers
- I really need some help writing my personal statement for a nursing program.Best solution by cmu.edu
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.