ciao a tutti.sto faccendo un profilo.php...ho creato una diagramma sql dove ho salvato le informazioni degli user.ho fatto la connessione del php con sql...ma il programma mi dice undefined variable :username e undefined variable:email...questo e il mio codice php
Spero di avere una risposta al piu presto possibile.
Grazie in anticipo
PHP:
<?php
mysql_connect("localhost","root","1234");
mysql_select_db("albguide");
if(isset($_POST['submit']))
{
$user_id=$_REQUEST['user_id'];
$get=mysql_query("SELECT * FROM user WHERE user_id='$user_id'");
$username = $_GET['username'];
$email=$_GET['email'];
}
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FF00CC" text="#000000">
<p align="center"></p>
<p align="center">My Profile</p>
<p align="center">
<div class="widget"align="center">
<html>
<head>
<script type="text/javascript">
function updatepicture(pic){
document.getElementById('image').setAttribute("src",pic);
}
</script>
</head>
<body>
<form action='upload.php' method='post' enctype='multipart/form-data'target="iframe">
<input type='file' id='file' name='image'/>
<input type='submit' id='submit' value='Upload'/>
</form>
<img style="min-height:250;min-width:300;max-height:250px;"id="image"/><br/><br/><br/></p>
<iframe style="display:none;" name="iframe"></iframe>
</body>
</html>
<p align="center"></p>
<div class="widget"align="center">
<h2>Username</h2>
<p align="center"></p>
<p align="center"><?php echo $username ?></p>
<p align="center">
<h2>Email</h2>
<p align="center"></p>
<p align="center"><?php echo $email ?></p>
<p align="center">
<form action='editsetting.php' method='post' enctype='multipart/form-data'>
<input type='submit' id='submit' value='Settings'/>
</div>
</form>
</body>
</html>
Grazie in anticipo
Ultima modifica di un moderatore: