This is the email form code
Email:<br>
<input type="text" name="email"size=20><br>
Now my action code:
Code: Select all
<?
//MySQL Variables.
$host = "hostname";
$login_name = "username";
$password = "password";
//Connecting to MYSQL
MySQL_connect("$host","$login_name","$password");
//Select the database
MySQL_select_db("bandsandmembers") or die("Could not select database");
//Assign contents of form to variables
$bandname = $_POSTї'band_name'];
$description = $_POSTї'description'];
$history = $_POSTї'history'];
$influences = $_POSTї'influences'];
$genra = $_POSTї'genra'];
$email = $_POSTї'email'];
$website = $_POSTї'website'];
$sql = "INSERT INTO nuke_bands (band_name, description, history, influences, genra, email, website) VALUES ('$bandname','$description','$history','$influences','$genra','#email','$website')";
$result = mysql_query($sql);
//Code to check if statement executed properly and display message
if ($result) {
header("Location: http://naild.com/localmm/modules.php?name=Band_List&file=sent");
} else {
echo("An error has occured");
}
//Close connection with MySQL
MySQL_close()
?>