supermerc Posted March 11, 2007 Share Posted March 11, 2007 Hey im not soo good with php and I dont know what is wrong with this code this is error im getting Parse error: syntax error, unexpected '<' in /home/randomy/public_html/welcome.php on line 6 <?php session_start(); require("config.php"); require("functions.php"); <table border="0"> <tr> <td>echo "Welcome, '.$_SESSION['s_name'].'";</td> </tr> <tr> <td>echo "You are logged in as '.$_SESSION['s_username'].'";</td> </tr> <tr> <td> </td> </tr> <tr> <td>echo "<a href="members.php">Members</a>";</td> </tr> <tr> <td>echo "<a href="inbox.php">Inbox</a>"; $message = mysql_query("SELECT COUNT(*) FROM myPMs WHERE opened != 'y' AND to_id = '{$_SESSION['s_id']}'") or die ("My SQL Error: <br />". mysql_error()); $msgs = mysql_fetch_array($message); if ($msgs['COUNT(*)'] > 0) { // News Msgs Found echo "<img src=\"images/envelope.gif\" />"; } ; </td> </tr> <tr> <td>echo "<a href="edit_profile.php">My Profile</a>";</td> </tr> <tr> <td>echo "<a href="logout.php">Logout</a>";</td> </tr> </table> ?> Quote Link to comment Share on other sites More sharing options...
jeremywesselman Posted March 11, 2007 Share Posted March 11, 2007 What kind of error message do you get? Quote Link to comment Share on other sites More sharing options...
supermerc Posted March 11, 2007 Author Share Posted March 11, 2007 Re read post I made an edit Quote Link to comment Share on other sites More sharing options...
interpim Posted March 11, 2007 Share Posted March 11, 2007 use single quotes instead of double quotes when you are echoing html Quote Link to comment Share on other sites More sharing options...
supermerc Posted March 11, 2007 Author Share Posted March 11, 2007 Changed them to single and getting same error this is what i got now <?php session_start(); require("config.php"); require("functions.php"); <table border="0"> <tr> <td>echo 'Welcome, '.$_SESSION['s_name'].'';</td> </tr> <tr> <td>echo 'You are logged in as '.$_SESSION['s_username'].'';</td> </tr> <tr> <td> </td> </tr> <tr> <td>echo '<a href="members.php">Members</a>';</td> </tr> <tr> <td>echo '<a href="inbox.php">Inbox</a>'; $message = mysql_query("SELECT COUNT(*) FROM myPMs WHERE opened != 'y' AND to_id = '{$_SESSION['s_id']}'") or die ("My SQL Error: <br />". mysql_error()); $msgs = mysql_fetch_array($message); if ($msgs['COUNT(*)'] > 0) { // News Msgs Found echo "<img src=\"images/envelope.gif\" />"; } ; </td> </tr> <tr> <td>echo '<a href="edit_profile.php">My Profile</a>';</td> </tr> <tr> <td>echo '<a href="logout.php">Logout</a>';</td> </tr> </table> ?> Quote Link to comment Share on other sites More sharing options...
jeremywesselman Posted March 11, 2007 Share Posted March 11, 2007 <?php session_start(); require("config.php"); require("functions.php"); ?> <table border="0"> <tr> <td>Welcome, <?php echo $_SESSION['s_name']; ?></td> </tr> <tr> <td>You are logged in as <?php echo $_SESSION['s_username']; ?></td> </tr> <tr> <td> </td> </tr> <tr> <td><a href="members.php">Members</a></td> </tr> <tr> <td><a href="inbox.php">Inbox</a> <?php $message = mysql_query("SELECT COUNT(*) FROM myPMs WHERE opened != 'y' AND to_id = '{$_SESSION['s_id']}'") or die ("My SQL Error: <br />". mysql_error()); $msgs = mysql_fetch_array($message); if ($msgs['COUNT(*)'] > 0) { // News Msgs Found echo "<img src=\"images/envelope.gif\" />"; } ?> </td> </tr> <tr> <td><a href="edit_profile.php">My Profile</a></td> </tr> <tr> <td><a href="logout.php">Logout</a></td> </tr> </table> You're hopping in and out of php and html. Here is your script fixed like it should be. If you are going to use php to echo stuff, you have to echo ALL the HTML, not just the link. Jeremy Quote Link to comment Share on other sites More sharing options...
supermerc Posted March 11, 2007 Author Share Posted March 11, 2007 Thanks, again lol Quote Link to comment 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.