Code works in reverse order...
| From: | Dhaval Desai | Date: | Wed, 18 Jul 2001 17:12:32 +0000 |
| Subject: | Code works in reverse order... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-58479@lists.php.net to get a copy of this message | ||
Hello everybody
The below code is going crazy..and doing the reverse
thing...
when the value of $check!="" for example still it
shows thankyou.html page. But if I reverse the code
meaning if($check!="") then insert into database..it
doesn't do that it does the reverse thing. Is
something wrong with the code?
Thank You
Dhaval Desai
<?php
$connect = mysql_connect();
$query = "select email from newsletter where
email='$email'";
$execute = mysql_db_query("database", "$query");
$check = mysql_num_rows($execute);
if($check!="")
{
$insert = "insert into newsletter
(name,email,country) VALUES
('$name','$email','$country')";
$putin = mysql_db_query("database", "$insert");
if($putin)
{
header ("Location: ./thankyou.html");
}
}
else
{
header ("Location: ./sorry.html");
}
?>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/