Skip to content

Instantly share code, notes, and snippets.

@shaina7837
Created October 5, 2013 01:57
Show Gist options
  • Save shaina7837/6835668 to your computer and use it in GitHub Desktop.
Save shaina7837/6835668 to your computer and use it in GitHub Desktop.
A program to make a form using php and MySql.
<!DOCTYPE HTML>
<html>
<head> <title> form </title>
</head>
<body>
<form action="insert.php" method="post">
Firstname: <input type="text" name="firstname">
Lastname: <input type="text" name="lastname">
Age: <input type="text" name="age">
<input type="submit" name="submit">
</form>
</body>
</html>
<?php
$cont = mysql_connect("localhost","root","shine");
$select = mysql_select_db("ff");
mysql_query("INSERT INTO data_form
(Firstname, Lastname, age) VALUES('$firstname', '$lastname','$age') ")
or die(mysql_error());
echo "value inserted";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment