Trying to figure out why a script that worked perfectly well on Linux is not working on Windows server now after I moved it. It has the latest version of PHP installed and there is no reason it should not work on both. I have posted the code snippet, however if you need to see the other parts please let me know.
Thanks
It gives this error
Parse error: syntax error, unexpected $end in C:\inetpub\wwwroot\elitede.com\leisure\index.php on line 176
<?php
require('includes/header.php');?>
<div class="mid_content">
<div class="category">
<?php
if(isset($_POST['submit']))
{
$username = $_POST['user_name'];
$password = md5($_POST['password']);
/*$password = $_POST['password'];*/
$data = new main();
$login = $data->selectData("*","users",$username);
while($result = mysql_fetch_array($login))
{
$name = $result['user_name'];
$pwd = $result['password'];
$id = $result['id'];
$role= $result['role'];
$_SESSION['name'] = $name;
$_SESSION['userID']=$id;
if($username == $name && $password == $pwd && $role == "admin")
{
?>
<script>window.location.href="home.php";</script>
<?php
}
else if($username == $name && $password == $pwd && $role == "user")
{
?>
<script>window.location.href="home.php";</script>
<?php
}
else
{
echo "Invalid Username and Password.";
}
}
}
?>
<script language="javascript" type="text/javascript" src="validation.js"></script>
<div id="contentdiv">
<div id="message"></div>
<div align="center" style=" color: #4682B4;font-weight: bold;margin-bottom: 20px;">
<?php echo $site_name;?><br>Admin Panel</div>
<form name="login" method="post" action="" onsubmit="return validlogin();">
<div align="center">
<table cellpadding="5" cellspacing="5">
<tr>
<td>UserName:</td>
<td><input class="textbox2" style="width:150px;" type="text" name="user_name" id="user_name"></td>
<td id="usermsg"></td>
</tr>
<tr>
<td>Password:</td>
<td><input class="textbox2" style="width:150px;" type="password" name="password" id="password"></td>
<td id="pwdmsg"></td>
</tr>
<tr>
<td> </td>
<td><input class="btnstyle" class="submit" type="submit" value="Login" name="submit"></td>
</div>
</table>
</div>
</form>
</div>
</div>
<!--category end-->
</div>
<!-- <?php require('footer.php'); ?>