here is my code for image upload. after upload successfully i want to go my mainpage.php page . i am using iframe to display upload form. how to go mainpage. please anyone help me for this problem .
<?php
include("connect.php");
$_SESSION['MM_Username'] ;
$username=$_SESSION['MM_Username'];
if(isset($_POST['submit']))
{
//get file attributes
$name=$_FILES['myfile']['name'];
$tmp_name=$_FILES['myfile']['tmp_name'];
if($name)
{
//start upload process
$location="$name";
move_uploaded_file($tmp_name,$location);
$query=mysql_query("UPDATE members SET avatar='$location' WHERE username='$username'");
die();
}
else
{
echo "Please upload a file";
}
}
echo "upload image: <br>
<form action='upload.php' method='POST' enctype='multipart/form-data'>
File:<input type='file' name='myfile'><input type='submit' name='submit' Value='Upload'
</form>";
?>