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
}
?>


Link to comment
Share on other sites

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...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.