Code: Select all
$clicked = $_POST['email'];
if ($clicked) {
$sql = "INSERT INTO emails (emails) VALUES ('$_POST[email]')";
mysql_query($sql);
$blah = "Thank You, your email has been added to our list.";
}
mysql_close($con);Code: Select all
<form method="post" name="blah" action="<?php echo $PHP_SELF; ?>">
<input type="text" size="30" name="email" id="email" class="ex"> <input type="submit" value="submit" class="submit">
</form><?php echo $blah; ?>Also can you show me how to use mysql_real_escape_string in this script? I tried putting it in and it would come up with the message thank you message, but it wasn't really entering the email address in.
Thanks alot in advance