Jump to content

[SOLVED] form to database


Lambneck

Recommended Posts

 

I'm just trying to get a form to submit data to mysql database.

I am working with the following but so far no luck

What am I missing here?  :-\

 

mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($database);

if (isset($_POST['Submit'])) 
{

$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];

mysql_query("INSERT INTO $table (col_2, col_3, col_4, col_5) VALUES ('$name', '$email', '$subject', '$message')");

    $user = $_POST['name'];

    echo '<table id=table1><tr><td><b><font size=2>Thank you ' . $user . ', your form was was submitted.</font></b></tr></td>';


}
?>

Link to comment
https://forums.phpfreaks.com/topic/104155-solved-form-to-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.