Right.
Well, thankyou for confirming that for me. I thought you would be able to, but wasn't sure.
Now, the reason why I am asking, is because I have the following error in my script:
Code:
Warning: open(/tmp/sess_eea81f98dd0422f12d567bce5159c228, O_RDWR) failed: m (2) in C:/PROGRAMMING/eliter/advertsys/index.php on line 4
I have no idea what this means. Then, at the end, I get :
Code:
Warning: open(/tmp/sess_eea81f98dd0422f12d567bce5159c228, O_RDWR) failed: m (2) in Unknown on line 0
Warning: Failed to write session data. Please check that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
However, there is probably an error in the script.
I have sort of taken some of it from a user management script, because I really DO NOt get session management.
SO I reckon loads of it is wrong, it is:
Code:
<?php
$sessiontimeout = "900";
session_start();
session_register("SESSION");
if (! isset($SESSION)) {
$SESSION["sessionstart"] = time();
$SESSION["nicestart"] = date("m-d-Y H:i:s",$SESSION["sessionstart"]);
$SESSION["lastaccessed"] = $SESSION["sessionstart"];
$SESSION["expires"] = $SESSION["sessionstart"] + $sessiontimeout;
$SESSION["loggedin"] = 0;
$SESSION["logintries"] = 0;
$SESSION["remote_addr"] = $REMOTE_ADDR;
} elseif ($SESSION["expires"] > time()) {
$SESSION["lastaccessed"] = time();
$SESSION["expires"] = $SESSION["lastaccessed"] + $sessiontimeout;
} else {
session_destroy();
unset($SESSION);
session_start();
session_register("SESSION");
$SESSION["sessionstart"] = time();
$SESSION["nicestart"] = date("m-d-Y H:i:s",$SESSION["sessionstart"]);
$SESSION["lastaccessed"] = $SESSION["sessionstart"];
$SESSION["expires"] = $SESSION["sessionstart"] + $sessiontimeout;
$SESSION["loggedin"] = 0;
$SESSION["logintries"] = 0;
$SESSION["remote_addr"] = $REMOTE_ADDR;
}
?>
<html>
<title>LOGIN - eliter Advert Management System</title>
<body bgcolor="ffffff" text="000000" topmargin=1 leftmargin=1 rightmargin=1>
<link rel="stylesheet" href="../style.css" TYPE="text/css">
<table cellpadding=0 cellspacing=0 border=0 bgcolor=ffffff width=580>
<tr width=580 valign=top><td width=300>
<img src="titleadvertsys.gif">
</td>
<td width=280>
</td>
</tr></table>
<?php
require("key.php");
if ($SESSION["loggedin"] == 1) {
header("Location: $advertiserhome");
exit;
} else {
if ($SESSION["logintries"] == 0) {
?>
<br><br>
<form action="<?PHP echo($advertiserlogin); ?>" method=post>
<table width="300" border="0" cellspacing="0" cellpadding="4">
<tr>
<td height="4" align="left" width="110" class="tenptbold">Account Name: </td>
<td height="4" width="190">
<input type="text" name="login">
</td>
</tr>
<tr>
<td height="4" align="left" width="110" class="tenptbold">Password: </td>
<td height="4" width="190">
<input type="password" name="adpasswordlogin">
</td>
</tr>
<tr>
<td width="120" class="sevenptverdana" align="left"><a href="<?php echo($forgotpassword); ?>">Forgot your password?</a></td>
<td width="190"> <input type="submit" name="submit" value="Advertiser Login" style="font-family:arial; font-size:10pt">
</td></tr>
</table>
<?php
} elseif ($SESSION["logintries"] < 3) {
$trynum = $SESSION["logintries"] + 1;
?>
<br><br>
<font class=tenptbold>This is login attempt number <?php echo($trynum); ?> .</font><br>.
<form action="<?PHP echo($advertiserlogin); ?>" method=post>
<table width="300" border="0" cellspacing="0" cellpadding="4">
<tr>
<td height="4" align="left" width="110" class="tenptbold">Account Name: </td>
<td height="4" width="190">
<input type="text" name="login">
</td>
</tr>
<tr>
<td height="4" align="left" width="110" class="tenptbold">Password: </td>
<td height="4" width="190">
<input type="password" name="adpasswordlogin">
</td>
</tr>
<tr>
<td width="120" class="sevenptverdana" align="left"><a href="<?php echo($forgotpassword); ?>">Forgot your password?</a></td>
<td width="190"> <input type="submit" name="submit" value="Advertiser Login" style="font-family:arial; font-size:10pt">
</td></tr>
</table>
<?php
} else {
$login = $SESSION["login"];
mysql_connect("$mysqlusername","$connection","$mysqlpassword");
mysql_select_db("$eliterdb");
mysql_query("UPDATE advertisers SET locked='y' WHERE login='$login' ");
?>
<br><br>  <img src=$arrow>
<font class=fourteenpt>ACCOUNT <u><?php echo($username); ?></u> LOCKED.</font><br><br>
<font class=tenpt>You have exceeded the total permitted Login attempts.<br>
To unlock your account, please contact the Administrator via the <a href="$admincontact">Advertiser Support Form</a>.<br><br>
<font class=sevenptverdana>We are sorry for any inconvenience caused, but we are simply taking precautions for the advertisers sake.
<?php
session_destroy();
exit;
}
}
?>
Sorry it is so long :/
-AJ
Bookmarks