Friday, 18 April 2014

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. 

Software Developer in php (3 - 5 years , 2.00 - 12.00 Lacs) interview question Neosoft Technologies

Laravel 5 Eloquent Explained in the Simplest Way Facades in Laravel. Why and How? How to Register & Use Laravel Service Providers ...