It was my goal for a a user name and password to be verified through a database and then log the user in accordingly perpetuating this logged in state with session handling. All that is being shown is a blank page and none of the code appears to be executing. Any thoughts would be appreciated. Here is my code:
[CODE]<?php
//start session and initialize loggedin
session_start();
$_SESSION[‘loggedin’]=0;
if (isset ($_POST[‘username’]) && isset ($_POST[‘password’]))
{
$username=$_POST[‘username’];
$password=$_POST[‘password’];
require (‘dbconnect.php’);
$connect = mysql_connect(“$host”,”$login”,”$dbpassword”);
mysql_select_db(“$dbname”);
if (!$connect)
{
die(‘Could not connect: ‘ . mysql_error());
}
else
{
echo ‘Connected successfully to database!<br>’;
}
//create query
$query=”select * from Login where username=’$username’ and password=’$password'”;
$result=mysql_query($query);
//put userID into an array for use
$fetch=mysql_fetch_assoc($foundID);
$currentID=$fetch[“userID”];
if($result->num_rows > 0)
{
$_SESSION[‘loggedin’]=1;
mysql_close($connect);
header(“location: userfunctions.php?userID=”.$currentID);
}
else
{
echo ‘Your user name and password did not match any records found.’;
echo ‘<br>Click <a href=”login.html”>Here</a> to try again.’;
header(“location: login.html”);
}
}
?>