UBB.Dev
Posted By: Pilgrim subscriptions.php mySQL error - 04/07/2005 1:48 AM
I suspect my hosting ISP has changed how their crons are run because I've been using the same subscriptions.php script for 3 years and it has worked fine. The error that came via e-mail is:

[:"red"]Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/the-highway/forum/cron/php/subscriptions.php on line 192[/]

Here's the section of that script referred to below. I can't find anything wrong with it. Suggestions?

Code
$to       = $config['emailaddy'];<br />	$subject  = "Subscription Count";<br />	$msg      = "$count Number of subscriptions sent out!\n";<br />	----->$headers  = "From: $config['emailaddy'] <$config['emailaddy']>$newline";<-----<br />	$headers .= "Sender: $config['emailaddy']$newline";<br />	$headers .= "Reply-to: $config['emailaddy']$newline";<br />	$headers .= "X-Mailer: $config['emailaddy']$newline";<br />	$headers .= "Return-Path: <$config['emailaddy']>$newline";<br />	mail("$to","$subject","$msg",$headers);


Jeff
Posted By: AllenAyres Re: subscriptions.php mySQL error - 04/07/2005 7:34 AM
Hey Pilgrim - long time no see

Have you not updated any files recently? Possible they've updated their php recently?
Posted By: JoshPet Re: subscriptions.php mySQL error - 04/07/2005 8:55 AM
Try changing this:
Code
<br />$headers  = "From: $config['emailaddy'] <$config['emailaddy']>$newline";<-----<br />	$headers .= "Sender: $config['emailaddy']$newline";<br />	$headers .= "Reply-to: $config['emailaddy']$newline";<br />	$headers .= "X-Mailer: $config['emailaddy']$newline";<br />	$headers .= "Return-Path: <$config['emailaddy']>$newline";<br />


to this:
Code
<br />$headers  = "From: {$config['emailaddy']} <{$config['emailaddy']}>$newline";<-----<br />	$headers .= "Sender: {$config['emailaddy']}$newline";<br />	$headers .= "Reply-to: {$config['emailaddy']}$newline";<br />	$headers .= "X-Mailer: {$config['emailaddy']}$newline";<br />	$headers .= "Return-Path: <{$config['emailaddy']}>$newline";<br />


Basically putting { and } around any array inside of a quote string.
© UBB.Developers