Hello to all!
I am new here and also new to PHP.
I amattempting to build a website that will allow "Memeber Only access using a PHP script I found on the internet.
Please go to
http://www.divasoccer.com/CCC_Web/html/members_only.htm, from here click on the "Member Login" link at the upper right corner. You will see that it points to the index.php file. Well, by looking at the code it would seem that the index.php is to pull up a file called login.htm. However when it does, all the pictures are missing (I get the box with the red X).
I downloaded this script and I am trying to make it fit into my website scheme. To see the original script in action, go to
http://www.divasoccer.com/CCC_Web/security/index.php
I am trying to make this fit into my website scheme. Can anybody help me with this?
The PHP code for the index.php is:
<?php
include ("config.php");
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
$action_g = $_GET["a"];
$user = $_POST["loginname"];
$time=time();
if ($action_g == 'LostPassword')
{
if (isset($user))
{
$u_path = "$userdb/profile-{$user}.dat";
if (file_exists($u_path)) {
$uf = fopen($u_path, "r");
$size = filesize($u_path) + 1;
$u_data = fgets($uf, $size);
$u_data = explode("}{", $u_data);
fclose($uf);
list ($email, $fullname, $username, $real_password, $date, $real_ip) = $u_data;
$syndikutcp = date("Y");
$syndikut = "Powered by Download Manager Ultra-Lite Copyright $syndikutcp
www.syndikut.org";
$mailbody = "Hello {$u_data[1]}\n\nYou are receiving this email because you (or someone pretending to be you) have requested your password to be reset for your account at $company.\n\nYour login details are below\n\nUsername: $username\n\nPassword: $real_password\n\n--\nThanks, \n\n$company\n\n $companyurl\n\n___________________________________ ____________________________\n$syndikut";
mail($email, "$company: Lost Pass", $mailbody, "From: $company <{$adminnoreply}>");
$u_data = $email."}{".$fullname."}{".$username."}{".$real_pa ssword."}{".$date."}{".$real_ip."}{";
$uf = fopen($u_path, "w");
fputs($uf, $u_data);
fclose($uf);
}
else
{
include("_inc/lostpwd_error.htm"); exit;
}
include("_inc/lostpwd_done.htm"); exit;
}
include("_inc/lostpwd.htm"); exit;
}
$username = $_POST[user];
$password = $_POST[pass];
$uol=$username;
if ($username && $password)
{
$u_path = "$userdb/profile-{$username}.dat";
if (!file_exists($u_path)) { include ("_inc/login_invalidpwd.htm"); exit; }
$uf = fopen($u_path, "r");
$size = filesize($u_path) + 1;
$u_data = fgets($uf, $size);
$u_data = explode("}{", $u_data);
fclose($uf);
list (, , $real_username, $real_password, , $real_ip) = $u_data;
if ($username == $real_username && $password == $real_password)
{
setcookie ("user", $_POST[user]);
setcookie ("pass", $password);
header("Location: manager.php"); exit;
}
else
{
include ("_inc/login_invalidpwd.htm"); exit;
}
}
if(isset($HTTP_COOKIE_VARS[user]) && ($HTTP_COOKIE_VARS[pass]))
{
header("Location: manager.php"); exit();
}
else
{
include ("_inc/login.htm");
}
?>
Again, thanks in advanced for any help!
Chad