I have this form and added it to my host and also added a db in PHPMyAdmin.
So I created a db called “the_form” and created a table called: form and added a id and a first_name to that table….so…
something is missing that when i hit submit I only get : “please fill out the whole form”
index:
[CODE]
<form action=”set.php” method=”post”>
<input name=”first_name” type=”text” value=”” />
</form>
set.php:
[code=php]
<?php
include ‘add.php’;
$first_name = $_POST[‘first_name’];
if (!$_POST[‘submit’]) {
echo “please fill out the whole form”;
header(‘Location: index.html’);
} else {
mysql_query(“INSERT INTO form (`ID`, `first_name`)
VALUES(NULL,’$first_name’)”) or die(mysql_error());
echo “user is added”;
header(‘Location: index.html’);
}
?>
add.php:
[CODE]
<?php
$dbhost = ‘localhost’;
$username = ‘admin’;
$password = ”;
$db = ‘the_form’;
$conn = mysql_connect($dbhost,$username, $password);
mysql_select_db($db);
?>
Any ideas?