spicey Posted August 9, 2008 Share Posted August 9, 2008 This is my first time using PHP and when I test the form online, I get the following error. Any suggestions? Parse error: syntax error, unexpected '@' in /mnt/w0106/d00/s28/b02d7599/ This is my simple code: ?php $name = $_REQUEST['name'] ; $organization = $_REQUEST['organization'] ; $email = $_REQUEST['email'] ; $telephone = $_REQUEST['telephone'] ; $date_required = $_REQUEST['date_required'] ; $checkbox_adult = $_REQUEST['checkbox_adult'] ; $adults = $_REQUEST['adults'] ; $checkbox_children = $_REQUEST['checkbox_children'] ; $children = $_REQUEST['children'] ; $leaving_from = $_REQUEST['leaving_from'] ; $destination = $_REQUEST['destination'] ; $return_to = $_REQUEST['return_to'] ; $time_departure = $_REQUEST['time_departure'] ; $time_return = $_REQUEST['time_return'] ; $additional_info = $_REQUEST['additional_info'] ; $checkbox_email = $_REQUEST['checkbox_email'] ; $checkbox_telephone = $_REQUEST['checkbox_telephone'] ; mailto ([email protected], "Quote Request", $message, "From: $email" ); header ( "Location: http://www.website.ca/thankyou.html"); php?> Link to comment https://forums.phpfreaks.com/topic/118948-help-new-to-php-first-timer-parse-error-unexpected/ Share on other sites More sharing options...
CaptainChainsaw Posted August 9, 2008 Share Posted August 9, 2008 try quoting the email address: mailto ("[email protected]", "Quote Request", $message, "From: $email" ); Link to comment https://forums.phpfreaks.com/topic/118948-help-new-to-php-first-timer-parse-error-unexpected/#findComment-612503 Share on other sites More sharing options...
spicey Posted August 9, 2008 Author Share Posted August 9, 2008 I tried what you suggested, now I get this error. Any suggestions? Fatal error: Call to undefined function: mailto() Link to comment https://forums.phpfreaks.com/topic/118948-help-new-to-php-first-timer-parse-error-unexpected/#findComment-612516 Share on other sites More sharing options...
kenrbnsn Posted August 9, 2008 Share Posted August 9, 2008 The function is "mail", not "mailto". Ken Link to comment https://forums.phpfreaks.com/topic/118948-help-new-to-php-first-timer-parse-error-unexpected/#findComment-612524 Share on other sites More sharing options...
spicey Posted August 9, 2008 Author Share Posted August 9, 2008 Thanks for the help! Now my error has moved to the "header" line - last one...to read this: Warning: Cannot modify header information - headers already sent by .... I've deleted any extra lines just in case the spaces was the issue - but I still get this warning error. Any other suggestions? You guys are fantastic in responding!!!!! Link to comment https://forums.phpfreaks.com/topic/118948-help-new-to-php-first-timer-parse-error-unexpected/#findComment-612543 Share on other sites More sharing options...
genericnumber1 Posted August 9, 2008 Share Posted August 9, 2008 You cut out the important part of the error line... we can't really help with specifics without it Make sure there's no output to the browser ANYWHERE above the header line. Also: it's ?> not php?> Link to comment https://forums.phpfreaks.com/topic/118948-help-new-to-php-first-timer-parse-error-unexpected/#findComment-612544 Share on other sites More sharing options...
dezkit Posted August 9, 2008 Share Posted August 9, 2008 <?php $name = $_REQUEST['name'] ; $organization = $_REQUEST['organization'] ; $email = $_REQUEST['email'] ; $telephone = $_REQUEST['telephone'] ; $date_required = $_REQUEST['date_required'] ; $checkbox_adult = $_REQUEST['checkbox_adult'] ; $adults = $_REQUEST['adults'] ; $checkbox_children = $_REQUEST['checkbox_children'] ; $children = $_REQUEST['children'] ; $leaving_from = $_REQUEST['leaving_from'] ; $destination = $_REQUEST['destination'] ; $return_to = $_REQUEST['return_to'] ; $time_departure = $_REQUEST['time_departure'] ; $time_return = $_REQUEST['time_return'] ; $additional_info = $_REQUEST['additional_info'] ; $checkbox_email = $_REQUEST['checkbox_email'] ; $checkbox_telephone = $_REQUEST['checkbox_telephone'] ; mail("[email protected]", "Quote Request", $message, "From: $email" ); header ( "Location: http://www.website.ca/thankyou.html"); ?> Link to comment https://forums.phpfreaks.com/topic/118948-help-new-to-php-first-timer-parse-error-unexpected/#findComment-612567 Share on other sites More sharing options...
dannyb785 Posted August 9, 2008 Share Posted August 9, 2008 This is my first time using PHP and when I test the form online, I get the following error. Any suggestions? Parse error: syntax error, unexpected '@' in /mnt/w0106/d00/s28/b02d7599/ This is my simple code: ?php $name = $_REQUEST['name'] ; $organization = $_REQUEST['organization'] ; $email = $_REQUEST['email'] ; $telephone = $_REQUEST['telephone'] ; $date_required = $_REQUEST['date_required'] ; $checkbox_adult = $_REQUEST['checkbox_adult'] ; $adults = $_REQUEST['adults'] ; $checkbox_children = $_REQUEST['checkbox_children'] ; $children = $_REQUEST['children'] ; $leaving_from = $_REQUEST['leaving_from'] ; $destination = $_REQUEST['destination'] ; $return_to = $_REQUEST['return_to'] ; $time_departure = $_REQUEST['time_departure'] ; $time_return = $_REQUEST['time_return'] ; $additional_info = $_REQUEST['additional_info'] ; $checkbox_email = $_REQUEST['checkbox_email'] ; $checkbox_telephone = $_REQUEST['checkbox_telephone'] ; mailto ([email protected], "Quote Request", $message, "From: $email" ); header ( "Location: http://www.website.ca/thankyou.html"); php?> I take it you're new, and that's fine and all (we all were once), but I see tons of threads where the error message said either "unexpected symbol" and it gives the symbol, and all it took was looking at the code for that symbol and seeing the error easily. Or it'd say "error on line 41" and there'd be a majorly obvious messup. All I'm saying is that problem solving is always trial and error with php and I'd high recommend trying to fix the problem by yourself(spend a good bit of time) before making a thread about it. Link to comment https://forums.phpfreaks.com/topic/118948-help-new-to-php-first-timer-parse-error-unexpected/#findComment-612607 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.