Dracolas Posted January 29, 2010 Share Posted January 29, 2010 if ($crank <= 4) {echo "<a href="addwar.php">Add War Report</a>"}; if ($crank <= 2) {echo "<a href="addnews.php">Add News</a>"}; why is this giving me the error of Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' Quote Link to comment https://forums.phpfreaks.com/topic/190283-unexpected-t_string/ Share on other sites More sharing options...
akitchin Posted January 29, 2010 Share Posted January 29, 2010 you're using all double-quotes. on the first line, when the echo statement reaches the second ", it think it's done echoing. so it wonders just what exactly you're trying to do after the echo. to fix it, either escape the double quotes within the echo statement, or convert the double quote delimiters to single quotes. have a look in the PHP manual about strings and variables. Quote Link to comment https://forums.phpfreaks.com/topic/190283-unexpected-t_string/#findComment-1003897 Share on other sites More sharing options...
KevinM1 Posted January 29, 2010 Share Posted January 29, 2010 if ($crank <= 4) {echo "<a href="addwar.php">Add War Report</a>"}; if ($crank <= 2) {echo "<a href="addnews.php">Add News</a>"}; why is this giving me the error of Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' Your use of double quotes within the echo statements is wrong. You also have the semicolons in the wrong spot. Easiest solution is: if ($crank <= 4) { echo "<a href='addwar.php'>Add War Report</a>"; } Quote Link to comment https://forums.phpfreaks.com/topic/190283-unexpected-t_string/#findComment-1003898 Share on other sites More sharing options...
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.