Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

55 lines (46 sloc) 1.316 kb
<HTML>
<HEAD>
<TITLE>New Document</TITLE>
</HEAD>
<BODY>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("openspace", $con);
$hs = $_POST['high_school'];
$col = $_POST['college'];
$eid = $_POST['e_id'];
$emp = $_POST['employer'];
$oth= $_POST['other_details'];
if(!filter_var("$hs", FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>"/^[a-zA-Z]+$/"))))
{
echo " High school is invalid";
die('Error ' . mysql_error());
}
if(!filter_var("$col", FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>"/^[a-zA-Z]+$/"))))
{
echo " college is invalid";
die('Error ' . mysql_error());
}
if(!filter_var("$emp", FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>"/^[a-zA-Z]+$/"))))
{
echo " employer is invalid";
die('Error ' . mysql_error());
}
if(!filter_var("$oth", FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>"/^[a-zA-Z0-9_.-]+$/"))))
{
echo " Details are invalid";
die('Error ' . mysql_error());
}
else
{
$query = "UPDATE `education_work_info` SET high_school='$hs',college='$col',employer='$emp',other_details='$oth' where e_id='$eid'";
mysql_query($query);
echo mysql_affected_rows();
}
?>
</BODY>
</HTML>
Jump to Line
Something went wrong with that request. Please try again.