I am getting an error like- "[15-Apr-2011 02:29:33] PHP Parse error: syntax error, unexpected T_ECHO in... (bla bla bla)... on line 13". Line 13 is the mail() command so the problem probably is with $msg, which is the line before. My research shows that the problem is I am missing a (") or "}" or something similar. My php is not finding it, instead seeing the end of php (?>).
Simplest of web forms not working, lots of hints
22
I am getting an error like- "[15-Apr-2011 02:29:33] PHP Parse error: syntax error, unexpected T_ECHO in... (bla bla bla)... on line 13". Line 13 is the mail() command so the problem probably is with $msg, which is the line before.
My research shows that the problem is I am missing a (") or "}" or something similar. My php is not finding it, instead seeing the end of php (?>).
Triple checked everything, can't see anything missing. It is the simplest of forms you will ever see, might take you only a second to figure out what I can't. I would really apprecite if you take a glance at the codes and point me to a solution.
Here are the codes-
Web Form:
PHP codes:
The only difference is that I replaced "myemail@yahoo.com" with a real email adress
You can also check out the whole issue here- Web Design Questions: Simple web form not working
Thanks a lot guys for taking a look. Looking forward to your comments or thoughts on this.
My research shows that the problem is I am missing a (") or "}" or something similar. My php is not finding it, instead seeing the end of php (?>).
Triple checked everything, can't see anything missing. It is the simplest of forms you will ever see, might take you only a second to figure out what I can't. I would really apprecite if you take a glance at the codes and point me to a solution.
Here are the codes-
Web Form:
Code:
<form action="contact.php" method="post" id="contactform"> <ol> <li><label for="firstname">Name</label><br/> <input name="firstname" type="text" /></li><br/> <li><label for="email">Email</label><br/> <input name="email" type="text" /></li><br/> <li><label for="comment">Comment</label><br/> <textarea row="6" cols="50" name="comment"></textarea></li><br/> <input value="send" type="submit" /> </ol> </form>
PHP codes:
Code:
<html> <head> <title>this was a try</title> </head> <body> <?php $name = $_POST['firstname']; $email = $_POST['email']; $comment = $_POST['comment']; $to = 'myemail@yahoo.com'; $subject = 'test'; $msg = "$name sent you a message from $email and said $comment"; mail($to, $subject, $msg, 'From:' . $email); echo 'Thanks for you comment.<br/>'; echo 'Your message has been sent from' . $email . '<br/>'; echo 'We will get back to you with in 48 hours or less.'; ?> </body> </html>
The only difference is that I replaced "myemail@yahoo.com" with a real email adress
You can also check out the whole issue here- Web Design Questions: Simple web form not working
Thanks a lot guys for taking a look. Looking forward to your comments or thoughts on this.
- omerbsh
- THK
- Casey Moore
- [1] reply
- omerbsh
- [1] reply
- THK
- Casey Moore
- THK
- [1] reply
- Fred_Acker
- THK
- Evan-M
- THK
- SteveJohnson
- [1] reply
- THK
- SmartWeb
- oknoorap
- THK
- Evan-M
- [1] reply
- lordspace
- carrickwarrior Banned
Next Topics on Trending Feed
-
22