Fails to log in on some computers...?
| From: | David Orn Johannsson | Date: | Thu, 21 Mar 2002 11:02:58 +0000 |
| Subject: | Fails to log in on some computers...? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-89484@lists.php.net to get a copy of this message | ||
Could any one tell me why this script fails, only on some computers. It
works fine on all computers at work, but some clients seem to have a
promblem with loging
in, and it is not the passcheck that is failing Im quite sure of that,
so it must be the check for session that is failing so could any one
tell me what could be wrong?
Thanks
<?php
session_start();
session_register("uid");
session_register("sid");
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body bgcolor="#999999" text="#000000">
<p>Dominews</p>
<table width="550" border="0" cellspacing="0"
cellpadding="1"
bgcolor="#000000" align="center">
<tr>
<td>
<table width="100%" border="0" cellspacing="0"
cellpadding="20"
bgcolor="#CCCCCC">
<tr>
<td class="maintext">
<?php
if(!IsSet($stage)){
print("<form name=\"login\"
action=\"$PHP_SELF\">");
print("<input type=\"hidden\"
name=\"stage\" value=\"1\">");
print("<table>");
print("<tr><td
class=\"maintext\"><b>Notendanafn:</b></td><td><input
name=\"check_username\" type=\"text\"></td></tr>");
print("<tr><td
class=\"maintext\"><b>Lykilorð:</b></td><td><input
name=\"check_passwd\"
type=\"password\"></td></tr>");
print("<td> </td><td><input
type=\"submit\" value=\"Skrá inn\"></td></tr>");
print("</table>");
}
else{
include("db_connect.php");
$query = "select id,
passwd, system from users where username = '$check_username'";
$mysql_result =
mysql_query($query, $db);
$row =
mysql_fetch_row($mysql_result);
if((crypt($check_passwd,
'dominos') == $row[1]) && (($system == 0 || $system == 1 ))){
$sid =
session_id();
$uid =
$row[0];
print("<a
href=\"add_item.php\">[Ný grein]</a><br>");
print("<a
href=\"view_edit.php\">[Breyta greinum]</a>");
}
else if($session ==
session_id()){
print("<a
href=\"add_item.php\">[Ný grein]</a><br>");
print("<a
href=\"view_edit.php\">[Breyta greinum]</a>");
}
else{
print("Þú
verður að skrá þig inn. <a href=\"index.php\">[Skrá inn]</a>");
}
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p> </p>
<p> </p>
</body>
</html>
<http://www.atom.is/> ------------------------
Davíð Örn Jóhannssson
Vefforritari
------------------------
Atómstöðin hf.
Garðastræti 37
101 Reykjavík
------------------------
sími: 595-3643
fax: 595-3649
<mailto:david@atom.is> david@atom.is
<http://www.atom.is/> http://www.atom.is
------------------------