Jump to content

Recommended Posts

Parse error: syntax error, unexpected T_ECHO in /home/a5488351/public_html/profiles.php on line 122

 

<?php require "global_settings.php"; ?>
<title><?php echo $sitetitle; ?></title>
<font face='arial' size='3'></a>
<?php session_start(); ?>
<center>
<style>
a:link {
color:#24374C;
text-decoration:none;
}

a:visited {
color:#24374C;
text-decoration:none;
}

a:active {
outline: none;
color:#24374C;
text-decoration:none;
}

body {background-color:#b0c4de}

div.box {
width:250px;
padding:10px;
border:3px double #000000;
margin:10px;
background-color:#74AFF2;
}

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}

div.menu-blue {
BORDER-RIGHT: #333366 1px solid;
BORDER-LEFT: #6699cc 1px solid;
BORDER-TOP: #6699cc 1px solid;
BORDER-BOTTOM: #333366 1px solid;

FONT-WEIGHT: normal;

COLOR: #ffffff;

BACKGROUND-COLOR: #23559C;
TEXT-DECORATION: none;
font-stretch : condensed;
}

.menu-top  {
BORDER-RIGHT: 1px solid #333366; BORDER-TOP: 1px solid #6699CC; FONT-WEIGHT: normal; BORDER-LEFT: 1px solid #6699CC; COLOR: #FFFFFF; BORDER-BOTTOM: 1px solid #333366; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #23559C; TEXT-DECORATION: none;
font-stretch : condensed
}
</style>
<center>
<div class='menu-blue'>
<div align="center"> 
<table width="600" cellspacing="1" cellpadding="5" style="background-color:#23559C"> 
<tr> 
<td style="background-color:#FFFFFF"> 


    <div align="center"> 
    <table border="0"> 
    
    </form> 
    </table>
<center>
<form action="profiles.php?username="<?php echo $name; ?> method="GET"><br /><br />
Member name:<input type='text' name='name'></form>

</center>
<?php

$name = $_GET['name'];

$connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!");
mysql_select_db("$db") or die("Database fail!");

//display data
$get = mysql_query("SELECT * FROM users WHERE username='$name'");
while ($row = mysql_fetch_assoc($get))

// get data
$signature = $row['signature'];
$posts = $row['post_count'];

$query = mysql_query("SELECT * FROM users WHERE username='$name'");

$numrows = mysql_num_rows($query);

   if ($numrows!=1) {
   echo "<div class='box'><b><span style='color:red'>This user doesn't exists!</span></b></div>"; 
   }
   else
   {

if ($name =="$owner")
    $name = " <img src='crown_gold.gif'></img><b> $owner</b>";

if ($name =="Pie`")
    $name = " <img src='crown_gold.gif'></img><b> Pie`</b>";

if ($name =="Soulze")
    $name = " <img src='crown_gold.gif'></img><b> Soulze</b>";

if ($name =="Palace")
    $name = " <img src='mod_silver.gif'></img><b> Palace</b>";

if ($name =="Pkerown")
    $name = " <img src='mod_silver.gif'></img><b> Pkerown</b>";

if ($name =="ballin") 
    $name = "<img src='gfx.gif'></img><span style='color:#6666FF'><b> ballin<br /></b></span>"

echo "<div class='box'>This is a profile of ";
echo $name;
echo "<br /><br />Signature:<b> ";
echo $signature;
echo "<br /><br /><br />Post count:<b>."$posts."</b></div>";
    }

?>

Link to comment
https://forums.phpfreaks.com/topic/178075-error-why-the-hell/
Share on other sites

New code with the same error.

 

<?php require "global_settings.php"; ?>
<title><?php echo $sitetitle; ?></title>
<font face='arial' size='3'></a>
<?php session_start(); ?>
<center>
<style>
a:link {
color:#24374C;
text-decoration:none;
}

a:visited {
color:#24374C;
text-decoration:none;
}

a:active {
outline: none;
color:#24374C;
text-decoration:none;
}

body {background-color:#b0c4de}

div.box {
width:250px;
padding:10px;
border:3px double #000000;
margin:10px;
background-color:#74AFF2;
}

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}

div.menu-blue {
BORDER-RIGHT: #333366 1px solid;
BORDER-LEFT: #6699cc 1px solid;
BORDER-TOP: #6699cc 1px solid;
BORDER-BOTTOM: #333366 1px solid;

FONT-WEIGHT: normal;

COLOR: #ffffff;

BACKGROUND-COLOR: #23559C;
TEXT-DECORATION: none;
font-stretch : condensed;
}

.menu-top  {
BORDER-RIGHT: 1px solid #333366; BORDER-TOP: 1px solid #6699CC; FONT-WEIGHT: normal; BORDER-LEFT: 1px solid #6699CC; COLOR: #FFFFFF; BORDER-BOTTOM: 1px solid #333366; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #23559C; TEXT-DECORATION: none;
font-stretch : condensed
}
</style>
<center>
<div class='menu-blue'>
<div align="center"> 
<table width="600" cellspacing="1" cellpadding="5" style="background-color:#23559C"> 
<tr> 
<td style="background-color:#FFFFFF"> 


    <div align="center"> 
    <table border="0"> 
    
    </form> 
    </table>
<center>
<form action="profiles.php?username="<?php echo $name; ?>" method="GET"><br /><br />
Member name:<input type='text' name='name'></form>

</center>
<?php

$name = $_GET['name'];

$connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!");
mysql_select_db("$db") or die("Database fail!");

//display data
$get = mysql_query("SELECT * FROM users WHERE username='$name'");
while ($row = mysql_fetch_assoc($get))

// get data
$signature = $row['signature'];
$posts = $row['post_count'];

$query = mysql_query("SELECT * FROM users WHERE username='$name'");

$numrows = mysql_num_rows($query);

   if ($numrows!=1) {
   echo "<div class='box'><b><span style='color:red'>This user doesn't exists!</span></b></div>"; 
   }
   else
   {

if ($name =="$owner")
    $name = " <img src='crown_gold.gif'></img><b> $owner</b>";

if ($name =="Pie`")
    $name = " <img src='crown_gold.gif'></img><b> Pie`</b>";

if ($name =="Soulze")
    $name = " <img src='crown_gold.gif'></img><b> Soulze</b>";

if ($name =="Palace")
    $name = " <img src='mod_silver.gif'></img><b> Palace</b>";

if ($name =="Pkerown")
    $name = " <img src='mod_silver.gif'></img><b> Pkerown</b>";

if ($name =="ballin") 
    $name = "<img src='gfx.gif'></img><span style='color:#6666FF'><b> ballin<br /></b></span>"

echo "<div class='box'>This is a profile of ";
echo $name;
echo "<br /><br />Signature:<b> ";
echo $signature;
echo "<br /><br /><br />Post count:<b>".$posts."</b></div>";
    }

?>

Link to comment
https://forums.phpfreaks.com/topic/178075-error-why-the-hell/#findComment-938965
Share on other sites

he does....

 

$get = mysql_query("SELECT * FROM users WHERE username='$name'");

$row = mysql_fetch_assoc($get);

$posts = $row['post_count'];

echo "<br /><br /><br />Post count:<b>".$posts."</b></div>";

 

I don't see why it wouldn't work, as long as 'post_count' is a field in your users table that has a number of posts?

Link to comment
https://forums.phpfreaks.com/topic/178075-error-why-the-hell/#findComment-938997
Share on other sites

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.