Friday, 18 April 2014

PHP: give alert popup then redirect the page

Do something like
header("Location: index.php?Message=" . urlencode($Message));
Then on index.php...
if (isset($_GET['Message'])) {
    print $_GET['Message'];
In other words, index.php will always check if it's being passed a message in the url. If there is one, display it. Then, just pass the message in the redirect
if you really want to use a modal popup, generate the js...
if (isset($_GET['Message'])) {
    print '<script type="text/javascript">alert("' . $_GET['Message'] . '");</script>';

Get only domain name from email using PHP.

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