Daron Posted April 19, 2011 Posted April 19, 2011 there is a unexpected T_String on line 2. i scanned but dont see the problem, can someone help me. print "<center><font size='4' face='Arial, Helvetica, sans-serif'>Mail Box</font><hr width=90%><table width=90% border=0><tr> <td width=20% align=center>> <a href="http://mailbox.php?action=compose" target="_blank"> Compose</a></td> <td width=20% align=center>> <a href="http://mailbox.php?action=outbox" target="_blank"> Outbox</a></td> <td width=20% align=center>> <a href="http://mailbox.php?action=archive" target="_blank"> Save</a></td> <td width=20% align=center>> <a href="http://mailbox.php?action=delall" target="_blank"> Delete All</a></td> <td width=20% align=center>> <a href="http://mailbox.php?action=mailhome" target="_blank"> Inbox</a></td> Quote
Djkanna Posted April 19, 2011 Posted April 19, 2011 print ' <a href=""><a> '; or print " <a href=''></a>"; Quote
rulerofzu Posted April 19, 2011 Posted April 19, 2011 Basically you cannot use the same quotes in your code print "<a href=" will not work print "<a href=' will work print '<a href=' will not work print '<a href=" will work You may wish to consider why keep it in your PHP code anyway. There is always the option to end the PHP code ?> and just use HTML 1 Quote
Daron Posted April 19, 2011 Author Posted April 19, 2011 ah i see! *new thing learned* thanx for the quick responses. Quote
rulerofzu Posted April 19, 2011 Posted April 19, 2011 At the end of the day it all comes down to personal preference. Personally I like to echo<<<EOT and use HTML Quote
Djkanna Posted April 19, 2011 Posted April 19, 2011 At the end of the day it all comes down to personal preference. Personally I like to echo<<<EOT and use HTML And I like to keep the PHP & HTML separate. :P Quote
rulerofzu Posted April 19, 2011 Posted April 19, 2011 Your just too cool for school though DJK :D Quote
SHAD Posted April 19, 2011 Posted April 19, 2011 I know echo is slightly faster then print but what's the point of having single and double quotes for echo and print? Quote
rulerofzu Posted April 19, 2011 Posted April 19, 2011 Its to do with the use of variables but there is very very little in it with regards to speed or memory usage Quote
Equinox Posted April 22, 2011 Posted April 22, 2011 Actually, with the amount people use it, you'd be surprised. It's not to do with the use of variables, that would be within the quote. Double quotes will look for a variable whereas single quotes won't. They are both language constructs, and echo is better to use simply because it's shorter to write. The difference in speed is minor unless you used it millions of times in one go. Quote
Equinox Posted April 22, 2011 Posted April 22, 2011 Yes, I know - but I was just explaining the specifics. Knowledge is power. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.