I have a domain name lets say www.fake.com.
This address gets forwarded to lets say www.real.com
When I try and login at www.fake.com (URL masking enabled) It won't let me in; howeverwhen I disable URL masking I can login without any problems.
I really need to mask the URL as I dont want the real domain name appearing. Any ideas on what could be causing this?
Here is the login form code:
<form action="cgi-bin/checkuser.php" method="post">
<table width="30%" border="0">
<tr>
<td colspan = "2"> </td>
</tr>
<tr>
<td><span class = "bodytext">Username</span></td>
<td><input name="username" type="text" size="7" maxlength="7"></td>
</tr>
<tr>
<td><span class = "bodytext">Password</span></td>
<td><input name="password" type="password" size="7" maxlength="7"></td>
</tr>
<tr>
<td> </td>
<td><input name="login" type="submit" value="Log-in"></td>
</tr>
</table>
</form>
Here is code that checks login Info:
<?
// Convert to simple variables
$username = $_POST['username'];
$password = $_POST['password'];
if((!$username) || (!$password)){
header("Location: ../login.html");
exit();
}
require ('mysql_connect.php'); //connect to the db
// check if the user info validates the db
$sql = mysql_query("SELECT * FROM ffaControl WHERE username='$username' AND password='$password'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
// Register a session variable
session_register('username');
$_SESSION['userID'] = $username;
mysql_close(); // Close the database connection.
header("Location: ../vessels.php");
}
} else {
header("Location: ../login.html");
exit();
}
?>
If a login is successful then it will take me to vessels.php at the top of which is the following code (ensuring that user has logged in)
<?
session_start();
include '../cgi-bin/sessionchecker.php';
session_checker();
?>
I suspect that the problem lies because I am using sessions but I can't be sure. Is there a workaround I could use?
Thanks in advance,
John