Hey everyone,
I'm having trouble to get this code to work as I wanted. My application is running on the top jQuery for mobile framework. The message I'm getting is this "undefined". I enter the right username and password but don't know what is undefined.
<?php
include('funcs/connector.php');
$port = new MySqlDatabase();
$port ->connect('root','','deco3500') or die(mysql_error());
session_start();
$user = mysql_real_escape_string($_POST['username']);
$pass = mysql_real_escape_string($_POST['password']);
$query = "SELECT username, password FROM USERS WHERE `username` = '$user' AND `password`='$pass' ";
$result = mysql_query($query) or mysql_error();
$row = mysql_fetch_assoc($result);
if( $username == $row['username']){
$_SESSION['username'] = $row['username'];
header('Location:index.php');
}else{
echo "this is wrong";
}
?>