Akenatehm Posted November 29, 2008 Share Posted November 29, 2008 Hey Guys, I am trying to make a contact form email.php script. Here is the error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/kaurlcom/public_html/relay/relay_site/email.php on line 40 Here is the code: <?PHP if(isset($_POST['submit'])) { $name=$_POST['name']; $email=$_POST['email']; $description=$_POST['description']; if(strlen($name)<1) { print "You did not enter a Name."; } else if(strlen($email)<1) { print "You did not enter a password."; } else if(strlen($description)<1) { print "You did not enter a Description."; } else { $subject = "Contact Enquiry From:" '$email'; $message = "Name: '$name' \n Email: '$email' \n Description: '$description;' \n"; $from = "From: '$email' \n"; mail ("codycarnachan@kauridigital.com" , $subject, $message, $from); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/ Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 <?PHP should be <?php $subject = "Contact Enquiry From:" '$email'; is your problem Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/#findComment-701546 Share on other sites More sharing options...
Akenatehm Posted November 29, 2008 Author Share Posted November 29, 2008 Whats the difference between php and PHP and what do you mean by the second comment, you didn't change anything.. Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/#findComment-701548 Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 <?PHP should be <?php..... I mean I guess <?PHP works, but it's kinda unorthodox. Yeah, I didn't fix it for a reason. Fix it your self. It's not hard. Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/#findComment-701550 Share on other sites More sharing options...
Akenatehm Posted November 29, 2008 Author Share Posted November 29, 2008 I have no idea what it is. I barely know any PHP and I have barely only just started. Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/#findComment-701552 Share on other sites More sharing options...
Akenatehm Posted November 29, 2008 Author Share Posted November 29, 2008 Don't worry, I fixed it myself. Awesome! Thanks for Making me Look at it Myself. Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/#findComment-701554 Share on other sites More sharing options...
Akenatehm Posted November 29, 2008 Author Share Posted November 29, 2008 Is there a way to make it auto redirect somewhere? Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/#findComment-701556 Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 http://php.net/header And the Location header would be the one you want. header("Location: http://google.com/"); for example. Or you could use a meta tag. Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/#findComment-701560 Share on other sites More sharing options...
Akenatehm Posted November 29, 2008 Author Share Posted November 29, 2008 Sweet thanks. Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/#findComment-701567 Share on other sites More sharing options...
corbin Posted November 29, 2008 Share Posted November 29, 2008 No problem. Quote Link to comment https://forums.phpfreaks.com/topic/134726-solved-email-script-errors/#findComment-701574 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.