I am no expert and I am trying to do a simple login system for a website using php 5.4.9 in Microsoft's webmatrix . I seem to have done the connect.php file correctly . but there is something wrong with what is inside the second IF instruction in this login.php file, the database is connected and selected correctly but when I login in with a valid infos from my database table "Tmembers", the prog jumps to "you r not a member, please sign in" when it should say "you have successfully logged in", here is the code please help me out :
<?php
session_start();
$user = $_POST['user'];
$pwd = $_POST['pwd'];
include "connect.php";
if ($user && $pwd){
// infos provided
$queryget=mysql_query("SELECT * FROM Tmembers WHERE user='$user' AND pwd='$pwd'");
$numrows=mysql_num_rows("$queryget");
if ($numrows !=0){
$_SESSION['user'] =$user;
echo "you have successfully logged in .";
}
else echo "you r not a member, please sign in ";
}
else{
echo "you didn't enter any entries !!!";
include "connect.php";
}
?>