pemdas21 Posted December 31, 2006 Share Posted December 31, 2006 Here is the code for the php:<?PHP$email = $HTTP_POST_VARS[email];$Person = $HTTP_POST_VARS[Person];if ($Person == "John Smith") {$mailto = "[email protected]";}if ($Person == "George Smith") {$mailto = "[email protected]";}// repeat the above If statement as many times as the persons$mailsubj = $HTTP_POST_VARS[Subject];$Message = $HTTP_POST_VARS[Message];$mailhead = "From: $email\n";$mailbody = "$Message\n". "\n". "Email sent through our Web Mail form\n" ;mail($mailto, $mailsubj, $mailbody, $mailhead);?>Here are the errors:Notice: Use of undefined constant email - assumed 'email' in C:\Sites\www.orrita.com\new\emails.php on line 2Notice: Undefined index: email in C:\Sites\www.orrita.com\new\emails.php on line 2Notice: Use of undefined constant Person - assumed 'Person' in C:\Sites\www.orrita.com\new\emails.php on line 3Notice: Use of undefined constant Subject - assumed 'Subject' in C:\Sites\www.orrita.com\new\emails.php on line 89Notice: Use of undefined constant Message - assumed 'Message' in C:\Sites\www.orrita.com\new\emails.php on line 90Notice: Undefined variable: mailto in C:\Sites\www.orrita.com\new\emails.php on line 95Warning: mail(): SMTP server response: 554 Error: no valid recipients in C:\Sites\www.orrita.com\new\emails.php on line 95 Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/ Share on other sites More sharing options...
fert Posted December 31, 2006 Share Posted December 31, 2006 simple enough $mailto is empty and so the email isn't being sent Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/#findComment-150232 Share on other sites More sharing options...
trq Posted December 31, 2006 Share Posted December 31, 2006 Your missing quotes. eg;[code=php:0]$email = $HTTP_POST_VARS[email];[/code]should be...[code=php:0]$email = $HTTP_POST_VARS['email'];[/code]Also be aware that $HTTP_POST_VARS has long been depricated in favour of $_POST. Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/#findComment-150233 Share on other sites More sharing options...
pemdas21 Posted December 31, 2006 Author Share Posted December 31, 2006 wait, so what does the script look like completely fixed? Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/#findComment-150246 Share on other sites More sharing options...
trq Posted December 31, 2006 Share Posted December 31, 2006 I dunno, rewrite it and see. Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/#findComment-150247 Share on other sites More sharing options...
pemdas21 Posted December 31, 2006 Author Share Posted December 31, 2006 <?PHP$email = $HTTP_POST_VARS['email'];$Person = $HTTP_POST_VARS['Person'];if ($Person == "John Smith") {$mailto = "[email protected]";}if ($Person == "George Smith") {$mailto = "[email protected]";}// repeat the above If statement as many times as the persons$mailsubj = $HTTP_POST_VARS['Subject'];$Message = $HTTP_POST_VARS['Message'];$mailhead = "From: $email\n";$mailbody = "$Message\n". "\n". "Email sent through our Web Mail form\n" ;mail($mailto, $mailsubj, $mailbody, $mailhead);?> Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/#findComment-150248 Share on other sites More sharing options...
trq Posted December 31, 2006 Share Posted December 31, 2006 If I must...[code]<?php if (isset($_POST['email') && isset($_POST['Person']) && isset($_POST['Message']) && isset($_POST['Subject'])) { $email = $_POST['email']; $Person = $_POST['Person']; if ($Person == "John Smith") { $mailto = "[email protected]"; } if ($Person == "George Smith") { $mailto = "[email protected]"; } $mailsubj = $_POST['Subject']; $Message = $_POST['Message']; $mailhead = "From: $email\n"; $mailbody = "$Message\n\nEmail sent through our Web Mail form\n" ; mail($mailto, $mailsubj, $mailbody, $mailhead); }?>[/code] Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/#findComment-150250 Share on other sites More sharing options...
pemdas21 Posted January 1, 2007 Author Share Posted January 1, 2007 Parse error: parse error, unexpected $end in C:\Sites\www.orrita.com\emails.php what does that mean? Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/#findComment-150571 Share on other sites More sharing options...
Nhoj Posted January 1, 2007 Share Posted January 1, 2007 That usually means you are missing a closing brace or ';' somewhere in your coding. Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/#findComment-150582 Share on other sites More sharing options...
chronister Posted January 1, 2007 Share Posted January 1, 2007 Missing ] in line 1.[code]if (isset($_POST['email']) [/code] Link to comment https://forums.phpfreaks.com/topic/32355-help-php-errors/#findComment-150699 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.