Can I use unset on a button?
What my button does, is uploads images, but if the user uploads an image, It uploads the image and shows the form, plus the previously uploaded images, and if they press refresh instantly after the image uploads, it uploads the image again.
[code=html]<button type=”submit” name=”upload_images”>Upload</button>
[code=php]if(isset($_POST[‘upload_images’])){
foreach ($_FILES[“pictures”][“error”] as $key => $error){
if($error === 0){
$filename = time().$_FILES[“pictures”][“name”][$key];
move_uploaded_file($_FILES[“pictures”][“tmp_name”][$key], “images/userimages/$filename”);
createThumbnail(“images/userimages”, “$filename”, “images/userimages/thumbs”, 100);
mysql_query(“INSERT INTO pictures(`id`, `filename`) VALUES (‘$_SESSION[userid]’, ‘$filename’)”)or die(mysql_error());
}
}
echo'<p>Upload Successful</p>’;
unset($_POST[‘upload_images’]);