Help with clear variable

I am trying to develop a simple popup but am having an issue with clearing last value.
Main routine:

Upload file ...




============upload.php <?php

// properties of the uploaded file
$name = $_FILES[“myfile”][“name”];
$type = $_FILES[“myfile”][“type”];
$size = $_FILES[“myfile”][“size”];
$temp = $_FILES[“myfile”][“tmp_name”];
$err = $_FILES[“myfile”][“error”];
//echo $err;

if ($err > 0)
die (“Error uploading file! Code $error.”);
else
{
if($type == “video/avi” || $size > 500000) //coditions for the file image/png
{
die(“Format not allowed or file size too big!”);
}
else
{
move_uploaded_file($temp, “uploaded/”.$name);
echo “Upload Complete”;
}
}

?>
================popup_effect.js
$(document).ready(function(){
$("#display_popup").click(function(){
showpopup();
});
$("#cancel_button").click(function(){
hidepopup();
});
$("#close_button").click(function(){
hidepopup();
});

});

function showpopup()
{
$("#popup_box").fadeToggle();
$("#popup_box").css({“visibility”:“visible”,“display”:“block”});
}

function hidepopup()
{
$("#popup_box").fadeToggle();
$("#popup_box").css({“visibility”:“hidden”,“display”:“none”});
}

===========
Issue is when popup runs first time and file is selected and uploaded, have not be able to clear the value before next time popup is executed. You can browse for different file and it will be processed. Am I missing something is trying to clear the old value. Have tried several different things with no luck. Any help would be greatly appreciated.
Rod

Found a solution to the issue.

Sponsor our Newsletter | Privacy Policy | Terms of Service