Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (16 sloc) 552 Bytes
<?php
$email_id=$_POST ['email_id'];
@mysql_connect(localhost, "root","" ) or die("Cannot Connect");
@mysql_select_db(openspace) or die("Unable to query database");
if(!filter_var("$email_id", FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>"/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9]+.[A-Za-z]{2,4}$/"))))
{
echo " email is invalid";
}
else
{
$query="insert into contact_info(email_id) values ('$email_id')";
@mysql_query($query) or die("This Operation Cannot be performed");
echo "Record inserted.";
}
mysql_close();
?>