My php page doesn't seem to be successfully passing variable between ".php" page and ".inc" page. The php script page was working until my web host upgraded from php 4 to php 5. All of a sudden, my script no longer worked. Am I missing something obvious? I am not a very sophisticated php user so please provide a php for dummies type answer. Any help would be appreciated.
Here is my php script page.
<?php
include ("mike.inc");
session_start();
session_register('username','password');
// GAIN ACCESS
if (isset($HTTP_POST_VARS['gainaccess']))
{
// Connect to the database server
$connection = mysql_connect($host,$user,$databasepassword)
or die ("couldn't connect to database server");
// Connect to MYSQL
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");
// Here is where we check to see if the username and password are in the database
$sql = "SELECT username FROM authorization WHERE (username='$username' and password = '$password' and eventauth = 'yes')";
$result = mysql_query($sql)
or die ("Couldn't execute query.");
$num = mysql_numrows($result);
if ($num < 1)
{
$sql = "SELECT username FROM authorization WHERE username='$username' and password = '$password'";
$result = mysql_query($sql)
or die ("Couldn't execute query.");
$num = mysql_numrows($result);
if ($num < 1)
{
$sql = "SELECT username FROM authorization WHERE username='$username'";
$result = mysql_query($sql)
or die ("Couldn't execute query.");
$num = mysql_numrows($result);
if ($num < 1)
{
$message1 = "The username you provided, '$username', is not authorized to send the current issue of BlackNYC to the BlackNYC subscriber base. Thanks.";
include ("eventdebug.inc");
}
else
{
$message1 = "The password you entered does not match the username you supplied.";
include ("eventdebug.inc");
}
}
else
{
$message1 = "The username you entered is not authorized to update the BlackNYC event database.";
include ("eventdebug.inc");
}
}
else
{
include ("eventdebug.inc");
}
}
else
{
include ("eventdebug.inc");
}
?>