Jump to content

[SOLVED] PHP Script works on one host, not another


webspinner

Recommended Posts

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

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";

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.