Jump to content

another code..got a problem...can someone help me again


cruxaders

Recommended Posts

When i try to run the page...i ddnt see anything...its just a plane white background..

is there a problem in my code

 

<?php
$con = mysql_connect ("localhost","root","");
if(!$con)
{
die ('could not connect:' . mysql_error());
}
mysql_select_db ("users", $con);

$username = "sample";

$sql = "SELECT * FROM `users` WHERE `id`='".username."'";
					$res = mysql_query($sql) or die(mysql_error());

	while($row = mysql_fetch_assoc($res))
{
						$imagename = $_FILES['image']['imagename'];
$tmp_name = $_FILES['image']['tmp_name'];
$location = "avatar/".$imagename;
move_uploaded_file($tmp_name,$location);
$avatar = mysql_query("SELECT imagelocation FROM `users` WHERE `id`='".$username."'")or die(mysql_error());
	$row3 = mysql_fetch_assoc($avatar);
	$location = $row3['imagelocation'];


echo"<table width=\"686\" height=\"178\" border=\"0\">";
  echo"<tr>
    <td width=\"160\" height=\"30\">First Name</td>
    <td width=\"321\">" . $row['name'] . "</td>
  </tr>";
  echo"<tr>
    <td height=\"31\">Email Address</td>
    <td>" . $row['email'] ."</td>
  </tr>";
  echo"<tr>
    <td height=\"28\">Username</td>
    <td>" . $row['username'] ."</td>
  </tr>";
  echo"<tr>
    <td height=\"30\">ProfilePic</td>
    <td> </td>
  </tr>";
  echo"<tr>
    <td><table width=\"100\" border=\"0\" align=\"center\">
  <tr>
    <td><img src =\"$location\" width=\"100\" hieght=\"100\"></td>
  </tr>";
echo"</table></td>";
   echo"<td><form id=\"form1\" name=\"form1\" enctype=\"multipart/form-data\" method=\"post\" action=\"\">
        <input type=\"file\" name=\"image\" id=\"image\" />";
    echo"</form></td>
  </tr>
</table>";
}
mysql_close($con);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.