ok here,s the problem i'm having ...
The echo in the top of my code is the login box ... but i'd like it to show first and if the email is entered then it shows the text "Successfully Logged In!" or "Nope".
The other thing is that when i open this code in my browser it automatically says "Succesfully Logged In!" even if nothing as been entered.
I'm pretty sure it can work with some IF or elseIF ... but i really don't know how to structure my code ...
Any help would be appreciated ... thanks !
<?
echo "
<form method=post action=''>
Email :<b></b> <br>
<input type=text size=15 name='email'>
<br>
<input type=submit name=submit value='Login'>
<input type=reset name=reset value='Clear'>
<br>
</form> ";
if ($submit = "Login")
{
mysql_connect ('localhost', '', '') or
die ("Could not connect to database");
mysql_select_db("***") or
dir ("Could not select database");
$result=mysql_query("select * from nlAbonnes where email='$email'")
or die ("cant do it");
if(mysql_num_rows($result) >= 1)
{
printf("Successfully Logged In!");
}else{
print("Nope");
}
}
?>
😕