
<?php

include'connect_db.php';
   include'function.php';

   if(isset($_POST['btnsubmit']))
   {
            $username=$_SESSION['Username'];
       $result = mysql_query("SELECT * FROM user where Username='$username'");
	
$username= $_POST["username"];
$name= $_POST["name"];
$age= $_POST["age"];
$email= $_POST["email"];
$city= $_POST["city"];
$password= $_POST["password"];


  $sql="Update user SET Name = '$name', Age= '$age', Email = '$email', City='$city', Username='$username', Password ='$password' where Username='$username'";
  $result=mysql_query($sql);

  
echo "<script language='javascript'>
		alert('succesffully updated!!') 
		
		</script>";
		
					$r=MyProfile();
				
				header("location: Profile.php");
		  $result = mysql_query("SELECT * FROM user where Username='$username'");
		    while($r=mysql_fetch_array($result))
    {
    $name=$r[0];
	$age=$r[1];
	 $email=$r[2];
	$city=$r[4];
	$username=$r[6];

    }		
		
     }

	
	 ?>
	 
<html>
<title> Ramones </title>
<head>
<link rel="stylesheet" type="text/css" href="default.css" />

</head>
<body>

<div id="nav">
<ul>
	<li><a href="index.php">Home</a></li>
	<li><a href="Profile.php">Profile</a></li>
	<li><a href="#">Contact us</a></li>
	<li><a href="logout.php">Log out</a></li>
	
</ul>
</div>

<div id="wrapper">

<div id="container">

	<div id="content">
		<div id="sidebar">
			<div class="widget">
	<div class="widgettitle">
	<h2>Pages</h2></div>
	<ul>
	<li><a href="index.php">Home</a></li>
	<li><a href="Profile.php">Profile</a></li>
	<li><a href="#">Contact us</a></li>
	<li><a href="logout.php">Log out</a></li>
	<li><a href="#">Sitemap</a></li>
	</ul>
</div>
<div class="widget">			
<div class="textwidget">
<center>
<a href="#">
<img  width="80px"  src="http://ghostcallers.com/wp-content/uploads/2012/05/fb.png"/></a>

<a href="#">
<img width="80px" src="http://ghostcallers.com/wp-content/uploads/2012/05/tw.png"/></center></a></div>
	</div>
	</div>
		<div id="article">

					
			<h2 class="title">Profile</h2>	
			
		<div style="float: left; 
			padding: 3px 3px 3px 3px;
			background:black;
			width:300px;
			height: 300px;
			border-radius: 10px;
			margin-bottom: 10px;
			margin-top: 10px;
			margin-right: 20px;">
			<img src="http://assets.diylol.com/hfs/1d8/7d7/f4c/resized/like-a-sir-birthday-meme-generator-a-190d11.jpg"
				style="width:290px;
				height: 290px;
				padding:5px 5px 5px 5px;"/>
		</div>
		<div style="line-height:30px; margin-bottom: 5px; position: relative;margin-top:5px;">
	<form action="edit-profile.php" method="Post">
	
			Name &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <input type="text" size="50" maxlength="50" name="name"><br/>
			
			Age &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" size="50" maxlength="50" name="age"><br/>
			City &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <input type="text" size="50" maxlength="50" name="city"><br/>
			E-mail &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size="50" maxlength="50" name="email"><br/>
			Username  <input type="text" size="50" maxlength="50" name="username"><br/>
			Password &nbsp;  <input type="password" size="50" maxlength="50" name="password"><br/>
		
			<input type="submit"name="btnsubmit" value="SUBMIT" 
			style="width:120px; height:25px; 
			font-weight:bold;font-size:15px;font-family: arial, sans serif;
		margin:20px 20px 0 10px; ">
			<input type="reset"  value="RESET" 
			style="width:120px; height:25px;
			font-weight:bold;font-size:15px; ">
		</form>
	</div>
				<div class="clear"></div>
				
					
		</div>
<div id="footer">
	<small>Copyright &copy; 2012 Philippe Ramones. All Rights Reserved. | 
	<a href="#">Sitemap</a> | 
	<a href="#">Related details</a></small>


</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<div  class="clear"></div>

</div>

<!-- END WRAPPER -->
</body>

</html>