I would like to be able to type in the username, select a change option and
then update a table that does not contain the username.
auth_user - contains user_id and username
userinfo - contains user_id and the field I want to update
What do I need to do fix this code?
if ($userinfo) {
if ($submit=='Unsubscribe') {
$mail_list='N';
} else {
$mail_list='B';
}
$res=mysql_result("select user_id from auth_user where
username='$username'"); //how do I get this to relate to my next query?
$res=mysql_query("replace into userinfo values
('$user_id','$mail_list')",$dbe);
if ($res) {
print "Email: $username ($mail_list)<br>\n";
} else {
print "Problems adding email to unsubscribe list: ";
print mysql_error()."<br>\n";
}
}
print "<form action=\"dontEmail.php\" method=get>\n";
$sess->hidden_session();
print "Email Address: ";
print "<input type=text size=30 maxlength=100 name=\"username\">\n";
print "<input type=submit name=\"submit\" value=\"Bad Email Address\">
\n";
print "<input type=submit name=\"submit\" value=\"Unsubscribe\"><br>\n";
print "</form>\n";
Thank you
Duffy Betterton
Director of Publications
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]