Jump to content

Recommended Posts

Hi on my website i have a link so you can see every member thats on that website and when you click the name it shows the profile. I have changed then template / look of it when you click on the user profile but i get this error.

 

Parse error: syntax error, unexpected T_LNUMBER in /home/a6651052/public_html/members.php on line 51

 

 

<?
ob_start();
include("config.php");
if (!$_GET[user])
{
$getuser = mysql_query("SELECT * from users order by id asc");
while ($user = mysql_fetch_array($getuser))
{
// gets all the users information. 
echo ("<a href=\"members.php?user=$user[username]\">$user[username]</a><br />\n");
// links to a page to view the user's profile.
}
}
ELSE
{
$usernum = mysql_num_rows($getuser);
if ($usernum == 0)
{
echo ("User Not Found");
}
else
{
$profile = mysql_fetch_array($getuser);
echo ("<table width="500" border="1">;
<tr>
<td bgcolor="#990000">
<center>$profile[username]'s Profile:</center></td>
</tr>
</table>
<table width="500" border="1">
<tr>
<td>
Username: $logged[username]</td>
<td>
Last Login: 00-00-0000</td>
</tr>
<tr>
<td>
Reg Date: 00-00-0000</td>
<td>
Location: $profile[location]</td>
</tr>
<td>
Msn: $profile[msn]</td>
<td>
Aim Messanger: $profile[aim]</td>
</tr>
<tr>
<td>
Emial: $profile[email]</td>
<td>
Friend?</td>
</tr>
<tr>
</table>
<table width="500" border="1">
<tr>
<td bgcolor="#990000">
<center><b>Content</b></center></td>
</tr>
</table>
<table width="500" border="1">
<tr>
<td>
$profile[content]</td>
</tr>
</table>");
}
}
?>

 

Please Help Thanks

Link to comment
https://forums.phpfreaks.com/topic/155417-solved-help-with-members/
Share on other sites

There may be other problems, but you have got double-quotes inside of a double-quoted string. You either need to escape them or use single-quotes.

 

Edit: and the posted code produces an entirely different error message on a different line than what you posted, so either the code or the error does not match what you are expecting help with.

for people who don't indent, you should at least make life a little easier on youself and look into variable interpolation .. not a good practice for people just starting out, but if you're not going to indent...

 

<?PHP
//stuff here...
echo <<<HTML
<table width="500" border="1">
<tr>
<td bgcolor="#990000">
<center>$profile[username]'s Profile:</center></td>
</tr>
</table>
<table width="500" border="1">
<tr>
<td>
Username: $logged[username]</td>
<td>
Last Login: 00-00-0000</td>
</tr>
<tr>
<td>
Reg Date: 00-00-0000</td>
<td>
Location: $profile[location]</td>
</tr>
<td>
Msn: $profile[msn]</td>
<td>
Aim Messanger: $profile[aim]</td>
</tr>
<tr>
<td>
Emial: $profile[email]</td>
<td>
Friend?</td>
</tr>
<tr>
</table>
<table width="500" border="1">
<tr>
<td bgcolor="#990000">
<center><b>Content</b></center></td>
</tr>
</table>
<table width="500" border="1">
<tr>
<td>
$profile[content]</td>
</tr>
</table>
HTML;
//stuff here...
?>

 

and when using opening php tags, use <?php instead of just <?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.