This might seem stupid, but I have this simple php code, and it is not echoeing the message to the screen, neither is redirecting the page. I am not sure why. I tested the db connection and it is working, also the user and password used for test exist in the db (of course info changed here for security). What am I doing wrong? What am I missing?
<?php
session_start();
include_once("C:/webroot/connect.php");
if (isset($_POST['submit'])){
//$user=$_POST["httpd_username"];
$user="usernameXYZ";
//$pass=$_POST["httpd_password"];
$pass="passXYZ";
$query= "SELECT * FROM regtrack_users WHERE user_name='$user' and password='$pass'";
$result =pg_query($query) or die ("Unable to connect to db");
$numrows=(pg_num_rows($result));
if($numrows>0){
$row=pg_fetch_assoc($result);
$dbuser=$row['user_name'];
$dbpass=$row['pass'];
echo "$dbuser and $dbpass";
}
header("Location:login.php");
}
?>