PHP: give alert popup then redirect the page
code goes this
if($_FILES['file']['size'] > 200000) //any file size, 200 kb in this case
{
echo "<script type='javascript'>alert('File size larger than 200 KB')</script>";
}
header("Location: index.php");
The browser will be redirected to index.php
page anyway, no
matter the file is successfully uploaded or not. Its just that the
popup will appear if the file is of larger size.
Comments
Post a Comment