unexpected T_VARIABLE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nitroxman
Forum Newbie
Posts: 8
Joined: Mon Mar 08, 2004 1:17 am

unexpected T_VARIABLE

Post by nitroxman »

Can't for the life of me find the error in this line of code.

I get the ol' Parse error: parse error, unexpected T_VARIABLE in / site here /z_purple.php on line 14



Code: Select all

LINE 6   $email = $HTTP_POST_VARSї'email'];
LINE 7   $name = $HTTP_POST_VARSї'name'];
LINE 8   $mobile = $HTTP_POST_VARSї'mobile'];
LINE 9   $feildone = $HTTP_POST_VARSї'feildone'];
LINE 10  $feildtwo = $HTTP_POST_VARSї'feildtwo'];
LINE 11
LINE 12 // Sends an email to us via the Admin Address
LINE 13 $ourSubject = "Newsletter Sign Up from Website";
LINE 14 $ourBody = "A visitor of our "$sitename" website has left the LINE following information";
LINE 15 $ourBody .= "\nname:".$name;
LINE 16 $ourBody .= "\nemail:".$email;
LINE 17 $ourBody .= "\nmobile:".$mobile;
LINE 18 $ourBody .= "\nfeildone:".$feildone;
LINE 19 $ourBody .= "\nfeildtwo:".$feildtwo;

I've tried single ' and double " I've put in the .varible and no dot.

I'm using Edit Plus to work on the file.
Last edited by nitroxman on Mon Mar 08, 2004 1:33 am, edited 1 time in total.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Try $ourBody = 'A visitor of our "'.$sitename.'" website has left the LINE following information';
nitroxman
Forum Newbie
Posts: 8
Joined: Mon Mar 08, 2004 1:17 am

Post by nitroxman »

Thanks, that revealed a new one on Line 25, will use that convention to correct other line.

My understanding was the you don't put a dot in for teh first varible.

Hmm can't distinguish ' from " when they are together while using Edit Plus

Could be

Single then double '"
double then single "'

or three

single '''



Cheers!
nitroxman
Forum Newbie
Posts: 8
Joined: Mon Mar 08, 2004 1:17 am

Post by nitroxman »

nitroxman wrote:Thanks, that revealed a new one on Line 25, will use that convention to correct other line.

My understanding was the you don't put a dot in for teh first varible.

Hmm can't distinguish ' from " when they are together while using Edit Plus

Could be

Single then double '"
double then single "'

or three

single '''


OK, I'm up to line 32 now.

Has anyone got examples of links wheich are varibles?

Code: Select all

$theirBody .= "<a href='$siteaddress.'>".$sitename."</a></font></p>";


Cheers!
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

$alink = '<a href="'.$siteaddress.'">'.$sitename.'</a>';
nitroxman
Forum Newbie
Posts: 8
Joined: Mon Mar 08, 2004 1:17 am

Post by nitroxman »

Cheers!

I've fixed line 32 with

Code: Select all

$theirBody .= "<a href=".$siteaddress.">".$sitename."</a></font></p>";
Thank you all.
Post Reply