Trying to write code and getting errors

Posted by Jowlstar on Oct 14, 2005

Alright so im writing code and I go to upload it and I get a parse error that says

Parse error: parse error, unexpected T_VARIABLE in /web/sites/tdavid/webmastercookbook.com/courses/php101/jowl/1b1.php on line 7.

I’m unsure of what a T variable is so can anyone help me, I looked at my line 7 and don’t see any errors, here is line 7:

PHP:

1 
2 $my_favorite_website= ‘<a href="http://www.orting.com/">Orting</a>’;
3 

Both spawn and I have run into the same problem and we have also had many errors but have worked through them, I will ask ChefTD about a T variable later on in the show today.

I fixed it by changing my code to this, i figured out i was missing a closing tag.

PHP:

1 
2 print$my_favorite_website= ‘<a href="http://www.orting.com/">Orting</a>’;
3 

Update 1:15pm PST: I just learned that I was not suppose to put a print out in front of the dollar sign and that the code up there is still wrong. (from ChefTD: Yes, you can put print in front of the $string, but you were trying to print and then assign at the same time, which is not what you wanted to do.)

Update 1:20pm PST: (from ChefTD) Jowl, here is what you want to do:

PHP:

1 
2 $my_favorite_website= ‘<a href="http://www.orting.com/">Orting</a>’;
3 echo($my_favorite_website);
4