webspinner Posted April 5, 2007 Share Posted April 5, 2007 I have a script named "sendmail.php". I think it's pretty straightforward. When I hit the script directly on one host, I get the expected "output=error". However, on the host where it's not working, I get: Parse error: parse error in d:\webspace\ADMIN\URL\WWW\sendmail.php on line 10 Here's line 10: $body .= "<a href="%%link%%" title="%%title%%">%%linkdescription%%</a>" . "\n"; Is there something broken here? Thanks, Rick Link to comment https://forums.phpfreaks.com/topic/45754-solved-php-script-works-on-one-host-not-another/ Share on other sites More sharing options...
kenrbnsn Posted April 5, 2007 Share Posted April 5, 2007 Please post the first 10 lines of the script between tags. Ken Link to comment https://forums.phpfreaks.com/topic/45754-solved-php-script-works-on-one-host-not-another/#findComment-222232 Share on other sites More sharing options...
webspinner Posted April 5, 2007 Author Share Posted April 5, 2007 Sorry... <? if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['user_mail']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_name'])) { $to = $HTTP_POST_VARS['sender_mail']; $subject = "Check out my music!" . "\n"; $body = "Hi! Check the music out on my web site. " . "http://mywebsite.com" . "\n"; $body .= "\n"; $body .= stripslashes($HTTP_POST_VARS['sender_message']) . "\n"; $body .= "\n"; $body .= "<a href="%%link%%" title="%%title%%">%%linkdescription%%</a>" . "\n"; Link to comment https://forums.phpfreaks.com/topic/45754-solved-php-script-works-on-one-host-not-another/#findComment-222239 Share on other sites More sharing options...
webspinner Posted April 6, 2007 Author Share Posted April 6, 2007 Anyone have any thoughts on this? Something that might work in one version of PHP and not another? When I hit the same script at these two different locations, I get different responses. Help a newbie? Thx, Rick Link to comment https://forums.phpfreaks.com/topic/45754-solved-php-script-works-on-one-host-not-another/#findComment-222939 Share on other sites More sharing options...
kenrbnsn Posted April 6, 2007 Share Posted April 6, 2007 You should be using $_POST instead of $HTTP_POST_VARS. Ken Link to comment https://forums.phpfreaks.com/topic/45754-solved-php-script-works-on-one-host-not-another/#findComment-222943 Share on other sites More sharing options...
webspinner Posted April 6, 2007 Author Share Posted April 6, 2007 I swapped out all instances of $HTTP_POST_VARS with $_POST and moved the file back to the server. Same error. -Rick Link to comment https://forums.phpfreaks.com/topic/45754-solved-php-script-works-on-one-host-not-another/#findComment-222954 Share on other sites More sharing options...
webspinner Posted April 9, 2007 Author Share Posted April 9, 2007 Can anyone offer some ideas why this might not be working? Thx, Rick Link to comment https://forums.phpfreaks.com/topic/45754-solved-php-script-works-on-one-host-not-another/#findComment-225001 Share on other sites More sharing options...
kenrbnsn Posted April 9, 2007 Share Posted April 9, 2007 In this line: <?php $body .= "<a href="%%link%%" title="%%title%%">%%linkdescription%%</a>" . "\n"; ?> you have too many double quotes with escaping them, change it to: <?php $body .= '<a href="%%link%%" title="%%title%%">%%linkdescription%%</a>' . "\n"; ?> It shouldn't have worked on either machine. Ken Link to comment https://forums.phpfreaks.com/topic/45754-solved-php-script-works-on-one-host-not-another/#findComment-225040 Share on other sites More sharing options...
webspinner Posted April 9, 2007 Author Share Posted April 9, 2007 Ken, Many thanks. Works now. What a relief. Best, Rick Link to comment https://forums.phpfreaks.com/topic/45754-solved-php-script-works-on-one-host-not-another/#findComment-225060 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.