Login issue in this code when i enter to the login page the login form still visible how can i solve this problem ?
[PHP]
<?php if(!($_SESSION['userLOGIN'])){ ?>
<form method='post' action='Login.p hp' id="LOGINFORM" >
Username:
<input name='user' type='text' id='user' size='20' maxlength='15' />
<br />
Password:
<input name='pass' type='password' id='pass' size='20' maxlength='15' />
<br />
<span style='color: 999933;font-size: 9px;'><a href='#'>Forget Password</a> / <a href='Signup.ph p'>Signup</a></span>
<input type='submit' name='button' id='button' value='Login' />
</form>
<?php } ?>
<?php
if($_SESSION['userLOGIN']){
echo "Welcome ".$_SESSION['userLOGIN']." You are now logging in <input name='' type='button' value='GO' onclick='alert( )'/>";
}else{
$userLOGIN = $_POST['user']; $userLOGIN = secure($userLOG IN);
$passLOGIN = $_POST['pass']; $passLOGIN = secure($passLOG IN);
if($userLOGIN == "" || $passLOGIN == ""){
echo "<span class='RED'>Ple ase Fill all fields</span>";
}else{
include_once("C onnections/conection.php") ;
$result=mysql_q uery("SELECT username,Passwo rd FROM users WHERE username='$user LOGIN' && Password=PASSWO RD('$passLOGIN' )",$myConnectio n);
if(mysql_num_ro ws($result)==1) {
echo "Welcome $userLOGIN you are now logedin";
session_registe r("userLOGIN" );
}else{
echo "<span class='RED'>You r not registerd in this site please try again or <a href='Signup.ph p'>Signup</a></span>";
}
}
}
?>[/PHP]
[PHP]
<?php if(!($_SESSION['userLOGIN'])){ ?>
<form method='post' action='Login.p hp' id="LOGINFORM" >
Username:
<input name='user' type='text' id='user' size='20' maxlength='15' />
<br />
Password:
<input name='pass' type='password' id='pass' size='20' maxlength='15' />
<br />
<span style='color: 999933;font-size: 9px;'><a href='#'>Forget Password</a> / <a href='Signup.ph p'>Signup</a></span>
<input type='submit' name='button' id='button' value='Login' />
</form>
<?php } ?>
<?php
if($_SESSION['userLOGIN']){
echo "Welcome ".$_SESSION['userLOGIN']." You are now logging in <input name='' type='button' value='GO' onclick='alert( )'/>";
}else{
$userLOGIN = $_POST['user']; $userLOGIN = secure($userLOG IN);
$passLOGIN = $_POST['pass']; $passLOGIN = secure($passLOG IN);
if($userLOGIN == "" || $passLOGIN == ""){
echo "<span class='RED'>Ple ase Fill all fields</span>";
}else{
include_once("C onnections/conection.php") ;
$result=mysql_q uery("SELECT username,Passwo rd FROM users WHERE username='$user LOGIN' && Password=PASSWO RD('$passLOGIN' )",$myConnectio n);
if(mysql_num_ro ws($result)==1) {
echo "Welcome $userLOGIN you are now logedin";
session_registe r("userLOGIN" );
}else{
echo "<span class='RED'>You r not registerd in this site please try again or <a href='Signup.ph p'>Signup</a></span>";
}
}
}
?>[/PHP]
Comment