[PHP]<?
include ("dbconn.php ");
$userid = $_POST['userid'];
$password = $_POST['password'];
$select = "SELECT * FROM plus_signup WHERE userid='$userid ' AND password = '$password'";
echo "Select : $select"; //I get the above Qurey executed here....
$result = odbc_exec($conn ,$select);
if($rec=odbc_fe tch_array($resu lt))//records found....Check if userid and password matches.
{
echo "output something...!";// this value gets printed.
//After this, there is no exection at all...........
if(($rec['userid']==$userid)&&($r ec['password']==$password))
{
$deptid = $rec['deptid'];
echo "deptid".$depti d;
exit();
include "include/newsession.php" ;
echo "<p class=data> <center>Success fully,Logged in<br><br><a href='logout.ph p'> Log OUT </a><br><br><a href=welcome.ph p>Click here if your browser is not redirecting automatically or you don't want to wait.</a><br></center>";
print "<script>";
print " self.location=' welcome.php';"; // Comment this line if you don't want to redirect
print "</script>";
}
}
else {
session_unset() ;
echo "<font face='Verdana' size='2' color=red>Wrong Login. Use your correct Userid and Password and Try <br><center><in put type='button' value='Retry' onClick='histor y.go(-1)'></center>";
}
//include ("footer.php ");
?>[/PHP]
Iam using 2 if conditions in php MSSQL and i get no result for the second if...Any idea?
You can see my comments of what is the output i get.
Thanks....
include ("dbconn.php ");
$userid = $_POST['userid'];
$password = $_POST['password'];
$select = "SELECT * FROM plus_signup WHERE userid='$userid ' AND password = '$password'";
echo "Select : $select"; //I get the above Qurey executed here....
$result = odbc_exec($conn ,$select);
if($rec=odbc_fe tch_array($resu lt))//records found....Check if userid and password matches.
{
echo "output something...!";// this value gets printed.
//After this, there is no exection at all...........
if(($rec['userid']==$userid)&&($r ec['password']==$password))
{
$deptid = $rec['deptid'];
echo "deptid".$depti d;
exit();
include "include/newsession.php" ;
echo "<p class=data> <center>Success fully,Logged in<br><br><a href='logout.ph p'> Log OUT </a><br><br><a href=welcome.ph p>Click here if your browser is not redirecting automatically or you don't want to wait.</a><br></center>";
print "<script>";
print " self.location=' welcome.php';"; // Comment this line if you don't want to redirect
print "</script>";
}
}
else {
session_unset() ;
echo "<font face='Verdana' size='2' color=red>Wrong Login. Use your correct Userid and Password and Try <br><center><in put type='button' value='Retry' onClick='histor y.go(-1)'></center>";
}
//include ("footer.php ");
?>[/PHP]
Iam using 2 if conditions in php MSSQL and i get no result for the second if...Any idea?
You can see my comments of what is the output i get.
Thanks....
Comment