<?php
if (isset($_POST['submitted'])) {
session_start();
$dbc = mysql_connect('localhost', 'root', 'root')
or die('Failed to connect to MYSQL Server');
mysql_select_db("test", $dbc);
$email = mysql_real_escape_string(trim($_POST['email']), $dbc);
$_SESSION["email"] = $email;
$query = "INSERT INTO download (email) VALUES ('$email')";
$result = mysql_query($query, $dbc)
or die (mysql_error($dbc));
mysql_close($dbc);
Header( "Location: thanks.php" );
exit;
}
?>
|