Hallo Leute,
habe ein Loginscript das leider mit php5 nicht läuft.
Ich habe mittlerweile rausgefunden das es keine cookies anlegt wie es eigentlich geplant ist.
Ich weis echt nicht mehr weiter.
Mit php4 geht es einwandfrei und das komische ist, lokal mit php5 und xampp funktionierts auch.
Hat jemadn einen Tipp für mich.
Hier mal das Script:
Formular:
Und hier die Seite die den Request verarbeitet:
Ich komm leider nicht weiter.
Gruss
habe ein Loginscript das leider mit php5 nicht läuft.
Ich habe mittlerweile rausgefunden das es keine cookies anlegt wie es eigentlich geplant ist.
Ich weis echt nicht mehr weiter.
Mit php4 geht es einwandfrei und das komische ist, lokal mit php5 und xampp funktionierts auch.
Hat jemadn einen Tipp für mich.
Hier mal das Script:
Formular:
Code:
<?php
include_once("includes/configure.php");
// include the database functions
require(DIR_WS_FUNCTIONS . 'database.php');
// make a connection to the database... now
tep_db_connect() or die('Unable to connect to database server!');
include_once(DIR_WS_INCLUDES . "/admin_login.php");
?>
<html>
<head>
<title>Administration Login</title>
<style type="text/css">
.input{
font-family: Verdana, Arial, sans-serif;
font-size: 10px;
font-weight:none;
background: #fff;
color: #000;
border-left: 1px;
border-right: 1px;
border-top: 1px;
border-bottom: 1px;
border-style: solid;
border-color: #000;
}
.main{
font-family: Verdana, Arial, sans-serif;
font-size: 10px;
font-weight:bold;
background: #fff;
color: #000;
}
.button{
font-family: Verdana, Arial, sans-serif;
font-size: 10px;
background: #fff;
color: #000;
border-left: 1px;
border-right: 1px;
border-top: 1px;
border-bottom: 1px;
border-style: solid;
border-color: #000;
}
</style>
</head>
<body onLoad="document.forms.admin_login.admin_login_name.focus()">
<table cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td height="7" valign="middle" align="center" width="200">
<p> </p>
</td>
<td width="325" height="7" align="center" valign="middle">
<table cellpadding="0" cellspacing="0" width="400">
<tr>
<td colspan="2" width="585"> </td>
</tr>
<tr>
<td height="11" valign="top" width="171"><img src="images/x_login.png" border="0"></td>
<td height="11" valign="top" width="414">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td> </td>
</tr>
<tr>
<td height="11" align="right" valign="bottom"><img src="images/x_login2.png" border="0"></td>
</tr>
<tr>
<td height="11">
<table border=0 cellpadding=0 cellspacing=0 width=100% height=100%>
<tr>
<td width=100% height=100% align="center" valign="middle">
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" name="admin_login">
<table border=0 cellpadding=2 cellspacing=2 width="100%">
<tr>
<td class="main" align="right" width=200>Name:</td>
<td align="right" width=300><input class="input" type="text" name="admin_login_name" size=32></td>
</tr>
<tr>
<td class="main" align="right" width=200>Kennwort:</td>
<td align="right" width=300><input class="input" type="password" name="admin_login_pass" size=32></td>
</tr>
<tr>
<td align="right" width=200> </td>
<td align="right" width=300><input class="button" type="submit" name="admin_login_submit" value="Login"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="11" colspan="2" width="585"> </td>
</tr>
</table>
</td>
<td height="7" align="center" valign="middle"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</body>
</html>
Und hier die Seite die den Request verarbeitet:
PHP:
<?php
// Admin Login/Logout module for osCommerce 2.2ms1 (UNIX)
/////////////////////////////////////////////////////////
$current_page = basename($_SERVER['PHP_SELF']);
if (($current_page <> "login.php") && (empty($admin_logged_in))) {
if (defined("HTTPS_CATALOG_SERVER")) {
$URL = HTTPS_CATALOG_SERVER . dirname($_SERVER['PHP_SELF']) . "/login.php";
}
else {
$URL = HTTP_CATALOG_SERVER . dirname($_SERVER['PHP_SELF']) . "/login.php";
}
header("Location: " . $URL);
}
if(isset($_POST['admin_login_submit'])) {
$SQL = "SELECT COUNT(*) as LoggedIn FROM administrators WHERE ";
$SQL .= "admin_user='$admin_login_name' AND admin_pass=PASSWORD('$admin_login_pass')";
tep_db_connect();
$qhandle = tep_db_query($SQL);
if (!$qhandle)
Die(mysql_error());
$rhandle = tep_db_fetch_array($qhandle);
if (!$rhandle)
Die(mysql_error());
if ($rhandle['LoggedIn'] == "1") {
setcookie("admin_logged_in", "true");
if (defined("HTTPS_CATALOG_SERVER")) {
$URL = HTTPS_CATALOG_SERVER . dirname($_SERVER['PHP_SELF']) . "/index.php";
}
else {
$URL = HTTP_CATALOG_SERVER . dirname($_SERVER['PHP_SELF']) . "/index.php";
}
header("Location: " . $URL);
}
}
?>
Ich komm leider nicht weiter.
Gruss