Salve ho un problema, ho scaricato loginsession20 da html.it e lo volevo mettere sul mio spazio php
ecco qui il codice
Codice PHP:
<?php session_start();
// Data file
$data = "users.txt";
// Absolute path to the data file
$path = "\loginsession20\";
// Enable / Disable user registration: 1 = enabled, 0 = disabled
$registration = 1;
// Main cascading stylesheets
$style = '
html, body {
height: 99%;
font-family: Arial, Verdana;
font-size: 12px;
}
#titlebar {
position: relative;
height: 20px;
width: 260px;
border-top: 1px solid #000000;
border-left: 1px solid #000000;
border-right: 1px solid #000000;
background-color: #ffb71b;
color: #000000;
text-align: center;
font-size: 16px;
}
#foot {
position: relative;
height: 20px;
width: 260px;
color: #000000;
text-align: center;
font-size: 10px;
}
input.text {
width: 220px;
height: 20px;
border: 1px solid #000000;
background-color: #ffeecb;
}
input.btn {
width: 60px;
height: 20px;
border: 1px solid #000000;
background-color: #ffb71b;
color: #000000;
}
input.btn:hover {
cursor: pointer;
}
a {
color: #ffb71b;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
';
$log_style = '
#wrapper {
position: absolute;
height: 185px;
width: 260px;
text-align: center;
color: #000000;
left: 50%;
top: 50%;
margin-left: -130px;
margin-top: -85px;
}
#form {
position: relative;
height: 165px;
width: 260px;
border: 1px solid #000000;
background-color: #fff9eb;
color: #000000;
text-align: left;
}
';
$reg_style = '
#wrapper {
position: absolute;
height: 270px;
width: 260px;
text-align: center;
color: #000000;
left: 50%;
top: 50%;
margin-left: -130px;
margin-top: -135px;
}
#form {
position: relative;
height: 250px;
width: 260px;
border: 1px solid #000000;
background-color: #fff9eb;
color: #000000;
text-align: left;
}
';
// Do not edit below this line
$users = $path . $data;
if (file_exists($users)) {
$records = count(file($users));
}
else {
fopen($users, 'w') or die("Can't open user database.");
}
if (isset($_GET['ls_logout'])) {
unset($_SESSION['ls_id']);
unset($_SESSION['ls_user']);
unset($_SESSION['ls_email']);
}
if (isset($_POST)) {
$login = FALSE;
$register = FALSE;
$errors = '';
foreach ($_POST as $key => $value) {
if ($key == "ls_reg") { $login = FALSE; $register = TRUE; }
else if ($key == "ls_log") { $login = TRUE; $register = FALSE; }
else if ($key == "ls_user") {
if (!eregi('^[[:alnum:]\.\'\-]{3,15}$', $value)) { $u_invalid = 1; }
$user = $value;
}
else if ($key == "ls_email") {
if (!eregi('^[a-zA-Z]+[a-zA-Z0-9_-]*@([a-zA-Z0-9_-]+){1}(\.[a-zA-Z0-9]+){1,2}', $value)) { $e_invalid = 1; }
$email = $value;
}
else if ($key == "ls_pass") {
if (!eregi("^[[:alnum:]\.\'\-]{3,15}$", $value)) { $p_invalid = 1; }
$pass = md5($value);
}
else if ($key == "ls_repeat") { $repeat = md5($value); }
}
}
if ($login == TRUE) {
if (file_exists($users)) {
$lines = file($users);
foreach ($lines as $line_num => $line) {
$array = explode("||",str_replace("\n","",$line));
$c_id = $array[0];
$c_user = $array[1];
$c_email = $array[2];
$c_pass = $array[3];
if ($c_user == $user && $c_pass == $pass) {
$_SESSION['ls_id'] = $c_id;
$_SESSION['ls_user'] = $c_user;
$_SESSION['ls_email'] = base64_decode($c_email);
}
}
if (!isset($_SESSION['ls_id']) || !isset($_SESSION['ls_user']) || !isset($_SESSION['ls_email'])) {
$errors[] = "Invalid Login.";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Login Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
<?php echo $style; ?>
<?php echo $log_style; ?>
</style>
</head>
<body>
<div id="wrapper">
<div id="titlebar">Errors</div>
<div id="form">
<div style="padding:10px;">
<ul style="padding:0px;margin:15px;">
<?php
foreach ($errors as $msg) {
echo "<li style=\"padding:0px;margin:0px;\">$msg</li>";
}
$errors = '';
?>
</ul>
<div style="text-align:center;padding:20px;">
<a href="<?php echo $_SERVER['HTTP_REFERER']; ?>" rel="">Click Here</a> to go back.
</div>
</div>
</div>
<div id="foot"><a href="http://www.myphpscripts.net" rel="">myPHPscripts</a> Login Session 2.0</div>
</div>
</body>
</html>
<?php
exit();
}
}
}
else if ($register == TRUE) {
if (file_exists($users)) {
$lines = file($users);
foreach ($lines as $line_num => $line) {
$array = explode("||",str_replace("\n","",$line));
$c_id = $array[0];
$c_user = $array[1];
$c_email = $array[2];
$c_pass = $array[3];
if ($user == $c_user) { $u_taken = 1; }
if (base64_encode($email) == $c_email) { $e_taken = 1; }
}
***continua sull'altro messaggio***
mi hanno detto di Contattare Altervista e chiedere quale è la path *assoluta* del server sul quale risiedi.
quale è la path?