Skip to content

Instantly share code, notes, and snippets.

@amitjamadagni
Created June 1, 2013 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitjamadagni/5691169 to your computer and use it in GitHub Desktop.
Save amitjamadagni/5691169 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Information Form</title>
<link rel="stylesheet" media="screen" href="/home/amit/Documents/rtc/s.css" >
</head>
<img src="/home/amit/Pictures/apsrtc_logo.gif">
<body>
<form class="contact_form" action="/var/www/field1.php" method="post" name="contact_form">
<ul>
<li>
<h2>Information Form</h2>
<span class="required_notification">* Denotes Required Field</span>
</li>
<li>
<label for="name">Company *:</label>
<input type="text"name="company" placeholder="APSRTC" required />
</li>
<li>
<label for="name">Name *:</label>
<input type="text" name="name" placeholder="Amit" required />
</li>
<li>
<label for="email">Email *:</label>
<input type="email" name="email" placeholder="me@example.com" required />
</li>
<li>
<button class="submit" name="submit"> Submit </button>
</li>
</ul>
</form>
</body>
</html>
<?php
$con = mysql_connect("127.0.1.1","root","bits");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
echo "connection establish";
$sql="INSERT INTO Information (Company, Name, Email)
VALUES
('$_POST[company]','$_POST[name]','$_POST[email]')";
//$sql="INSERT INTO user_data (First_Name, Last_Name, Name_Of_Organization,Email,Contact_number,Duration_In_Years,MAC_Address,CPU_ID,Motherboard_ID)
//VALUES
//('$_POST[fname]','$_POST[lname]','$_POST[Oname]','$_POST[email]','$_POST[cno]','$_POST[years]''$_POST[mid]','$_POST[cid]','$_POST[mbid]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment