f5をクリックした後の再送信を防ぐ方法
アップロード後に f5 php を防止したい
私は試しheader();
てみるinclude '';
しかし、機能していません!
解決策はありますか?
私のフォーム
<form id="pic-form" enctype="multipart/form-data" action="pic.php" method="POST">
<input name="uploadedfile" id="pic-upload" type="file"/>
<input type="submit" value="upload" id="submit" name="submit"/>
</form>
私のphpコード
<? include 'var.php';
if(isset($_POST['submit']) and $_SERVER['REQUEST_METHOD'] == "POST"){
if($terms == 'yes'){
if ((($_FILES["uploadedfile"]["type"] == "image/jpeg")
|| ($_FILES["uploadedfile"]["type"] == "image/jpg")
|| ($_FILES["uploadedfile"]["type"] == "image/x-png")
|| ($_FILES["uploadedfile"]["type"] == "image/gif")
|| ($_FILES["uploadedfile"]["type"] == "image/png"))
&& ($_FILES["uploadedfile"]["size"] < $max_file_size)
&& in_array($extension, $formats))
{
move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],
$uploaded );
echo '<img src="'.$url.$uploaded.'"/>';
echo '<h3>'.$url.$short.'</h3>';
}
elseif(!empty ($_FILES["uploadedfile"]["error"])){
echo '<h3>Please choose file to upload it!</h3>'; // if you don't choose file
}
elseif(!in_array($extension, $formats)){
echo '<h3>This extension is not allowed!</h3>'; // if you choose file not allowed
}
elseif($_FILES["uploadedfile"]["size"] = $max_file_size ){
echo "Big size!"; // if you choose big file
}
}
}
?>