Alright, let me just get this out of the way right now. Yes, I am a student. And yes, I am working on a project for class… HOWEVER: I am not posting the full project asking for help. I am simply posting what I am having trouble with. So please, DO NOT start saying that Im trying to get everyone to do my work for me. Simply because that isnt true. So if your going to try to flame or bash me right now, stop reading and leave this post.
For those of you who are genuinly interested in helping me figure out this problem, here it is:
Last week when I submitted my code, it worked fine. I submitted my information and it printed out the receipt with all the information I need. Now I need to add to that code to add more information. Somewhere along the line, something got messed up and I cannot figure out why. The page no longer prints the receipt, but instead it prints me this:
“); //if(!empty($name)) //{die(‘ERROR: Please enter your name.’); //} //else{ //echo $name; //}; if (!empty($name) == true) { echo “ERROR: Please enter your name.”; } else { echo $name; } print (”
“); if(empty($address)) {die(‘ERROR: Please enter your address.’); } else{ echo $address; }; print (”
“); if(empty($city)) {die(‘ERROR: Please enter your city.’); } else{ echo $city; }; print (”
“); if(empty($state)) {die(‘ERROR: Please enter your state.’); } else{ echo $state; }; print (”
“); if(empty($zip)) {die(‘ERROR: Please enter your zip code.’); } else{ echo $zip; }; print (”
“); //if (!preg_match(’/^\([0-9]{3}\) [0-9]{3}-[0-9]{4}$/’, $phone)); //{die(‘ERROR: Please provide your phone number in form (ddd) ddd-dddd.’); //} if ( !preg_match(”/^\([0-9]{3}\) [0-9]{3}-[0-9]{4}$/", $phone ) ) {die(“ERROR: Please provide your phone number in form (ddd) ddd-dddd.”); } ?>
Here is the php file thats giving me this:
<?php extract($_POST); echo 'Here is your order.'; print (""); //if(!empty($name)) //{die('ERROR: Please enter your name.'); //} //else{ //echo $name; //}; if (!empty($name) == true) { echo "ERROR: Please enter your name."; } else { echo $name; }; print ("
"); if(empty($address)) {die('ERROR: Please enter your address.'); } else{ echo $address; }; print ("
"); if(empty($city)) {die('ERROR: Please enter your city.'); } else{ echo $city; }; print ("
"); if(empty($state)) {die('ERROR: Please enter your state.'); } else{ echo $state; }; print ("
"); if(empty($zip)) {die('ERROR: Please enter your zip code.'); } else{ echo $zip; }; print ("
"); //if (!preg_match('/^\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}$/', $phone)); //{die('ERROR: Please provide your phone number in form (ddd) ddd-dddd.'); //} if ( !preg_match("/^\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}$/", $phone ) ) {die("ERROR: Please provide your phone number in form (ddd) ddd-dddd."); }; ?>
Can someone please help me figure out what I did wrong? This is only the first step of a long list of problems Im running in to and Im starting to get extremely discouraged.