Friday, 9 May 2014

stop inserting data in the database when refreshing the page.

The best way to prevent that is to add header('Location: filename') after your query. Thus in your case,
if (isset($_POST['submit'])) 
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password']; 

mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
//must be inside the condition to prevent too many redirects
header('Location: user_details_page.php');

Get only domain name from email using PHP.

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