Here is a little more information if this helps...
I have the following form:
Code:
<form method="post">
<input type="text" name="cust_name" value="Enter your name" onFocus="clearText(this)" onBlur="clearText(this)" />
<input type="text" name="email_address" value="Enter your email address" onFocus="clearText(this)" onBlur="clearText(this)" />
<select name="format">
<option value="">Mail Format</option>
<option value="html">HTML</option>
<option value="text">TEXT</option>
</select>
<input class="submit" type="submit" value="" />
</form>
I would like to run the following when the user clicks the submt button.
Code:
<?php
$name=$_POST['cust_name'];
$email=$_POST['email_address'];
$format=$_POST['format'];
mysql_connect("localhost", "myDB", "myPassword") or die(mysql_error());
mysql_select_db("gridiron_sportsgear") or die(mysql_error());
mysql_query("INSERT INTO `email_subscribers` VALUES ('$name', '$email', '$format')");
?>
Once the record has been entered into the DB I would like an alert to show stating the record was entered successfully. Once they click OK they will be returned to the page they were on when they submitted the form.
Right now when I submit it the form nothing is getting added to the DB? Any idea why?