Hi, could you guys help me out to understand this. I am a beginner PHP learner. I created this form and try to learn about urlencode () Form: And create this PHP script ( handle_post.php) to run the form. It gives me this error which starts at the $name = urlencode($name); I am learning it from a book and i did what the book told me to and i still do not understand what i did. can anyone help? thanks.
hurmm usually php process files (script) does not have html in it its just php code nothing else. For Example this is a simple process form script below i used for a site i built. below you will see $zip and other form fields replace them and add yours, then put the code below into a php page and its done, be sure to put in your domain name (for return back or the thank you page for the contact and also where it says email put in your email address so it will notify you of the form contents. <?php @extract($_POST); $name = stripslashes ($name); $email = stripslashes ($email); $subject = stripslashes ($subject); $text = stripslashes ($text); $message = $subject . "\n" . $name . "\n" . $address . "\n" . $city . "\n" . $state . "\n" . $zip . "\n" . $phone . "\n" . $services ."\n" . $month1 . $month . "\n" . $day1 . $day . "\n" . $year1 . $year . "\n" . $time . "\n" . $email . "\n" . $text; mail ('email address here',$subject,$message,"From: $name <$email>"); header ("location:domainnamehere"); ?> Code (markup):
i don't think that is the cause of it. The book i am learning from does that as well. The whole quote that i put up is in exact code as shown in the book.
i dunno i just put in the code i used for my contact page i made for a site, so you can use that process stuff i posted if you like and configure it for your site.
Hi junaids, The main point of the problem is not the ";" but thanks for pointing out. It is the "urlencode" which doesn't work and show error in that line.
this code false at line 28? have beter <?print "<div> Thank you, $name for your posting: <p>$posting</p> </div> "; ?> this is true
Oh , that is the retype of the code to post it here. Yes, the bracket is initially close and it does not work.. that is not the cause of the problem.
The only syntax errors you have in the script is the missign semi-colon on line 25 and the missing closed bracket on line 29.... I have fixed these on a test server and the script works ok. If you are still seeing a problem, what error are you getting?
It might be easier for us to help if you copy & paste your code in rather than retype it. It's hard to find the problem areas within your code, without seeing the exact code you're using...
The code is at the very first post. It is from my dreamweaver, sorry i meant, i type it in my dreamweaver and then copy and paste it here. I have filled up the missing colon and brackets. But i still get the error. I am using XAMPP to test out my code. Is it because of that?
oh i get the script working already. i do not know what went wrong but everything is fine now. Thanks for your help guys.