Hi all,
I have written a piece of code which validates a username, to see if it is empty.
If it is empty, the user is given a simple message and an option to go back.
It is not empty, the user is given the option to proceed.
The problem i have here is that the options to 'go back' and 'proceed' appear, no matter what.
How can i split it so the right option appears for the right if statement.
Here is the code:
<html>
<?
$filter = @$HTTP_POST_VARS["filter"];
if(empty( $filter))
{
echo'<p align = Left class="error">Error</p>';
echo '<br />Please enter your username<br />';
}
?>
<form method="POST" action="userrequest_login.php">
<input type="submit" value="Return to Login">
<br>
</form>
<form method="POST" action="userview.php">
<?
if($filter!='')
echo 'Welcome ';
echo $filter;
?>
<p><input type="submit" value="Please Enter to Proceed"></p>
</form>
</html>
I have also attached how the image looks.
And, if possible how can i auto-direct the user instead of the user pressing the option'proceed'
Thank you.
Adi