Friday, 18 April 2014

Javascript Confirm Delete in One PHP File (on href)


You can set the onclick attribute of the link. If the function returns false, the link will not proceed.

<a href="deletephone.php?id=' . $row['id'] . '" onclick="return confirm('Are you sure?');">Delete Phone</a>


Here, the confirm() function will return true if the user pressed OK, and false if the user pressed Cancel.

Get only domain name from email using PHP.

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