Hello there!
I have an iframe that has my image uploader. I would like for the parent page to reload after the image has uploaded. How do I do so?
Here is my code, as you can see I already have echo’s at the bottom. I would like to get rid of those and just replace it with the reload function is what I am thinking:
if(isset($_POST['submit'])){
if (isset ($_FILES['new_image'])){
$imagename = $_FILES['new_image']['name'];
$source = $_FILES['new_image']['tmp_name'];
$timer = time();
$time = $timer.".jpg";
$target = "images/upload_pic/".$time;
move_uploaded_file($source, $target);
$imagepath = $time;
$save = "images/upload_pic/" . $imagepath; //This is the new file you saving
$file = "images/upload_pic/" . $imagepath; //This is the original file
list($width, $height) = getimagesize($file) ;
$modwidth = 280;
$diff = $width / $modwidth;
$modheight = $height / $diff;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 100) ;
$query = "insert into images
(imagepath)values
('$time')";
$result = mysql_query($query, $handle);
echo "<div id='uploadblock'><h2 class='Htext'>UPLOADED PHOTO</h2>";
echo "<p><img src='images/upload_pic/".$time."'><p>";
echo "<span class='Hlinks'><a href='index.php' target='_parent'>ACCEPT PHOTO</a></span></div>";
}
}