hi again, just changing admin area of site over to css, not sure if to post in here or client side. i think here more appoprate?
here is my script before and after and the new one does not do anything! can anyone see why?????
thanx
before:
Code: Select all
<?php session_start(); ?>
<html>
<head>
<title>Admin - Login</title>
</head>
<body>
<form method=post action="<?echo $PHP_SELF?>">
<table width="157" border=0 cellpadding=2 cellspacing=0>
<!--DWLayoutTable-->
<tr>
<td width="75" height="49" align="center" valign="middle"> <div align="left"><img src="../Website_Pics/cessna.jpg" width="69" height="32"></div></td>
<td colspan="2" valign="middle"><font size="4" face="Linenstroke">Login</font></td>
<tr>
<td height="26" colspan="2" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif">Username:</font></td>
<td width="60" valign="top"><input type="text" name="username" size=10></td>
<tr>
<td height="26" colspan="2" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif">Password:</font></td>
<td valign="top"><input type="password" name="password" size=10></td>
<tr>
<td height="28" colspan="3" align="center" valign="top"> <input type="submit" name="submit" value="Log In"></td>
<tr>
<td height="5"></td>
<td width="7"></td>
<td></td>
</tr>
</table>
</form>
<?php
$username = $_POST["username"];
$password = $_POST["password"];
if(!empty($_POST['submit']))
{
$db = mysql_pconnect('', '', '') or die ("Could not connect to database");
mysql_select_db('models') or die ("Could not select database!");
$sql = "select * from user where name = '$username'";
$result = mysql_query($sql,$db) or die("Execution failed: ".mysql_error());
while ($row=mysql_fetch_array($result))
{
if ($row["password"]== $_POST["password"])
{
echo " ('Successfully Logged In!<a href='admin.php'>Click Here</a>') ";
$_SESSION["name"] = $username;
$_SESSION["loggedin"] = "set";
}
else
{
echo "wrong password";
}
}
}
?>
</body>
</html>after:
Code: Select all
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Model Aircraft</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
#Login {
margin-left: 5em;
font: 11px/18px Verdana, Arial, Helvetica, sans-serif;
}
input {
width: 11em;
height: 12px;
}
input.button {
width: 5em;
height: 22px;
background-color: #e6e6e6;
border-color: #ccc #666 #666 #ccc;
cursor: pointer;
}
</style>
</head>
<body>
<form method=post action="<?echo $PHP_SELF?>">
<!-- Begin Login Div -->
<div id="Login">
Usersname <br />
<input type="text" name="username"> <br />
Password <br />
<input type="password" name="password"> <br /> <br />
<input type="submit" name="mailSend" value="Send" class="button" />
<!-- End Login Div -->
</div>
</form>
<?php
$username = $_POST["username"];
$password = $_POST["password"];
if(!empty($_POST['submit']))
{
$db = mysql_pconnect('', '', '') or die ("Could not connect to database");
mysql_select_db('models') or die ("Could not select database!");
$sql = "select * from user where name = '$username'";
$result = mysql_query($sql,$db) or die("Execution failed: ".mysql_error());
while ($row=mysql_fetch_array($result))
{
if ($row["password"]== $_POST["password"])
{
echo " ('Successfully Logged In!<a href='admin.php'>Click Here</a>') ";
$_SESSION["name"] = $username;
$_SESSION["loggedin"] = "set";
}
else
{
echo "wrong password";
}
}
}
?>
</body>
</html>