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. 

Get only domain name from email using PHP.

public function getDomainName ( $business_email ){ $domain_name = substr ( strrchr ( $email , "@" ), 1 ); echo $...