Jump to content

Email verification - at least verify its in e mail form


jduke6

Recommended Posts

function isValidEmail($email){

return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email);

}

 

How do I incorporate the code above into my code?? 

 

<?php 

error_reporting(E_ALL ^ E_NOTICE); 
?>
<?php
// make sure the form has actually been submitted . . .
if( strtolower($_SERVER['REQUEST_METHOD']) === 'post' ) { 


// 1. Create a database connection
$connection = mysql_connect("localhost", "root", "maven777");
if(!$connection){
	die("Database connection failed: " .mysql_error());
}

// 2. Select a database to use
$db_select = mysql_select_db("homesloans", $connection);
if(!$db_select){
	die("Database selection failed: " .mysql_error());
}

$radius = ($_POST['radius']);
$type = ($_POST['type']);
$price = ($_POST['price']);
$bedrooms = ($_POST['bedrooms']);
$bathrooms = ($_POST['bathrooms']);
$parking = ($_POST['parking']);
$city = ($_POST['city']); 
$details = ($_POST['details']);
$firstname = ($_POST['firstname']);
$lastname = ($_POST['lastname']);
$email = ($_POST['email']);
$phone = ($_POST['phone']);





$query="INSERT INTO leads (leadid, city, radius, type, price, bedrooms,
bathrooms, parking, details, firstname, lastname, email, phone)

VALUES('NULL', '[$city]', '[$radius]', '[$type]', '[$price]', '[$bedrooms]',
		'[$bathrooms]', '[$parking]', '[$details]', '[$firstname]', '[$lastname]', 		            '[$email]', '[$phone]')";

mysql_query($query) or die ('Error updating database');

echo "Database Successfully Updated."; // not necessarily. The only way to know for sure is to check  that mysql_affected_rows() > 0
}
?>


jduke6, I am not hijacking your post.

 

cssfreakie, joel24

Can you give your comments about this article?

 

http://www.eddieoneverything.com/articles/validating-an-email-address-with-phps-filter_var-isnt-perfect.php

 

Thank you.

https://bugs.php.net/bug.php?id=49576 see comments...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.