Forum Moderators: coopster
Im having a problem with my php code not inserting into my database. Im not getting an error message its just not putting the info into my database.
<?php include('dommailinglist.php');
$email = $_POST[‘email’];
if (isset($email) ¦¦ $email<>"") { //is is set or it equals something
// if the product name contains something, meaning that
// the form was submitted, so process it
$sql = "INSERT INTO users (email) VALUES email($email) WHERE id='$email'";
$strResult = mysql_query($sql) or die(mysql_errno() . " : " . mysql_error() . " <strong>Insert Failed for Some Reason</strong>");
}
?>
<TD width="570" height="589" valign="top" id="content"><H1>Newsletter Subscribe / Unsubscribe </H1>
<FORM action="<?php self?>" method="post">
<SPAN class="style69">Enter your name and email address below:</SPAN><BR /><BR />
<SPAN class="style70">NAME:
<SPAN id="sprytextfield1">
<INPUT name="ename" type="text" class="style58" id="elistname" style="width: 140px" size="5" maxlength="50" />
<SPAN class="textfieldRequiredMsg">A value is required.</SPAN><SPAN class="textfieldMinCharsMsg">Minimum number of characters not met.</SPAN></SPAN> <BR />
<BR />
</SPAN>
<SPAN class="style70">EMAIL:</SPAN>
<SPAN class="style70"><SPAN id="sprytextfield2">
<INPUT name="emailaddress" type="text" class="style58" id="emailaddress" style="width: 140px" size="5" maxlength="100" />
<SPAN class="textfieldRequiredMsg">A value is required.</SPAN><SPAN class="textfieldInvalidFormatMsg">Invalid format.</SPAN></SPAN><BR />
<INPUT name="action" type="radio" style="border: 0px;" value="join" checked="CHECKED" />
Subscribe
<INPUT type="radio" name="action" value="leave" style="border: 0px;" />
Unsubscribe </SPAN>
<SPAN class="style70">
</SPAN>
<INPUT type="submit" name="submit" value="Submit"/>
<P align="center" class="style61 style1">
<INPUT type="hidden" name="subject" value="Newsletter Subscribe/Unsubscribe" />
<INPUT type="hidden" name="recipient" value="e-mail address" />
<INPUT type="hidden" name="title" value="Newsletter Subscribe/Unsubscribe">
<INPUT type="hidden" name="redirect" value="url" />
</FORM> </TD>
Thank You in advance
James