I'm not sure why this isn't working, but it's giving me no output. I have a
form which requests email and city to pull up a listing, then Email that
address with their password. I'm doing an extract($_POST) to get the data
from the previous form. When I test it I enter a known invalid email/city
combination, yet I get a blank area where the first message should be. This
is what's not working:
include('dbconn ect.php');
if (Submit == "Remind Me") {
$query="SELECT ID,firstname,ci ty,email,passwd from artists
WHERE email='$email' AND city='$city'";
$result=mysql_q uery($query) or die(mysql_error ("Could not execute
query."));
// verify that the Email/city combination exists
if (mysql_num_rows ($result) < 1) {
echo "<P> </P>
We cannot find that Email address and city combination in our
database.
Please use your browser's \"Back\" button and check your entry.<BR>
For best results, cut and paste the information from your listing to
ensure
that you don't have any typographical errors. If you continue to
have
difficulties, please <A HREF=\"mailto:W ebmaster@domain .com\">
Email the Webmaster</A>.<BR>";
//break 2; (commented out in case it was causing the problem)
} else {
// pull listing from database
while($row = mysql_fetch_arr ay($result)) {
$artistID = $row['artistID'];
$firstname = $row['firstname'];
$city= $row['city'];
$email = $row['email'];
$passwd = $row['passwd'];
// generate Email
$headers .= "From: Webmaster <Webmaster@doma in.com>\n";
$headers .= "To: $firstname <$email>\n";
$headers .= "X-Sender: <Webmaster@doma in.com>\n";
$headers .= "X-Mailer: domain.com\n"; //mailer
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <Webmaster@doma in.com>\n";
//Uncomment this to send html format
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$message = "
...message text is here...
mail($to......) ;
}
form which requests email and city to pull up a listing, then Email that
address with their password. I'm doing an extract($_POST) to get the data
from the previous form. When I test it I enter a known invalid email/city
combination, yet I get a blank area where the first message should be. This
is what's not working:
include('dbconn ect.php');
if (Submit == "Remind Me") {
$query="SELECT ID,firstname,ci ty,email,passwd from artists
WHERE email='$email' AND city='$city'";
$result=mysql_q uery($query) or die(mysql_error ("Could not execute
query."));
// verify that the Email/city combination exists
if (mysql_num_rows ($result) < 1) {
echo "<P> </P>
We cannot find that Email address and city combination in our
database.
Please use your browser's \"Back\" button and check your entry.<BR>
For best results, cut and paste the information from your listing to
ensure
that you don't have any typographical errors. If you continue to
have
difficulties, please <A HREF=\"mailto:W ebmaster@domain .com\">
Email the Webmaster</A>.<BR>";
//break 2; (commented out in case it was causing the problem)
} else {
// pull listing from database
while($row = mysql_fetch_arr ay($result)) {
$artistID = $row['artistID'];
$firstname = $row['firstname'];
$city= $row['city'];
$email = $row['email'];
$passwd = $row['passwd'];
// generate Email
$headers .= "From: Webmaster <Webmaster@doma in.com>\n";
$headers .= "To: $firstname <$email>\n";
$headers .= "X-Sender: <Webmaster@doma in.com>\n";
$headers .= "X-Mailer: domain.com\n"; //mailer
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <Webmaster@doma in.com>\n";
//Uncomment this to send html format
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$message = "
...message text is here...
mail($to......) ;
}
Comment