goldenwaters
Member
Hello friends,
I have been going through some php tutorials but i find this particular part really tasking: Its using html forms with php. see this code For example,
<?php
$name=$_POST['first_name'];
if($name=='myname'){
echo "Welcome";
}
else{
echo "Sorry, you are not registered";
}
?>
This code should prevent the user if he has an incorrect ID.
Now, my problem is that even after clicking SUBMIT or F5, the else part still comes up. I tried using this other code on top of the IF STATEMENT to rectify it:
if(isset($_POST['submit'])){
}
But still, this seem not to have any effect at all.
Please what do I do?
Thanks,
Golden Waters
I have been going through some php tutorials but i find this particular part really tasking: Its using html forms with php. see this code For example,
<?php
$name=$_POST['first_name'];
if($name=='myname'){
echo "Welcome";
}
else{
echo "Sorry, you are not registered";
}
?>
This code should prevent the user if he has an incorrect ID.
Now, my problem is that even after clicking SUBMIT or F5, the else part still comes up. I tried using this other code on top of the IF STATEMENT to rectify it:
if(isset($_POST['submit'])){
}
But still, this seem not to have any effect at all.
Please what do I do?
Thanks,
Golden Waters