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/

-- 
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]

Reply via email to