Yes, the file is included. I wrote an echo() in the file I wanted to include and it had an output.
functions.php :
Code:
<?
function doDB()
{
global $conn;
$conn = mysql_connect("localhost", "costas", "thrilos") or die(mysql_error());
mysql_select_db("userauth", $conn) or die(mysql_error());
}
function check($user, $pass)
{
global $conn, $sq_res;
$sq = "select user_id from users where username = '$user' && enc = '$pass'";
$sq_res = mysql_query($sq, $conn) or die(mysql_error());
}
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>
members.php :
Code:
<?
session_start();
include_once("http://localhost/auth/functions.php");
$username = $_POST[username];
$password = $_POST[password];
$enc = md5($password);
doDB();
check($username, $enc);
if (mysql_num_rows($sq_res) == 1)
{
$valid_user = $username;
$pass = $enc;
$_SESSION[USER_LOGIN_VAR] = $valid_user;
$_SESSION[USER_PASS_VAR] = $pass;
// Some HTML Code
}
else
{
// Some HTML Code
}
?>
Bookmarks