ARCHIVO: sas.php
Código PHP:
<?php error_reporting(0);
// start the session
session_save_path("sessions");
session_start();
include ("config.php");
$pass = $pass; // Set the password.
$cookiename = 'pass'; // Optional change: Give the cookie a name. Default is sascookie
$msg = 'Password incorrect.'; // Optional change: Error message displayed when password is incorrect. Default is "Password incorrect".
if (isset($_REQUEST['logout'])) {
session_destroy();
header("Location: index.php"); /* Redirect browser */
exit;
}
/* FUNCTIONS */
$encrypt_pass=md5($pass); // encrypt password
function setmycookie() {
global $cookiename,$encrypt_pass;
$_SESSION[$cookiename] = $encrypt_pass;
$_SESSION['auth'] = "yes";
}
function show_login_page($msg) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Ninja Blog 4.8 › Login</title>
<?php include ("config.php"); ?>
<link rel="stylesheet" href="styles/<?php echo "$style"; $i ++ ; ?>/admin.css" type="text/css" />
<head>
</head>
<body>
<div id="login">
<img src="styles/<?php echo "$style"; $i ++ ; ?>/images/loginlogo.png"><br />
<form name="loginform" id="loginform" action="" method="post">
<p><label>Username:<br /> <input type="text" name="" id="pwd" value="<?php echo $name ?>" size="20" tabindex="2" disabled /></label></p>
<p><label>Password:<br /> <input type="password" name="password" id="pwd" value="" size="20" tabindex="2" /></label></p>
<p>
<label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />
Remember me</label></p>
<p class="submit">
<input type="submit" name="submit" id="submit" value="Login »" tabindex="4" />
<input type="hidden" name="sub" value="sub">
<ul>
<li><a href="index.php" title="Are you lost?">« Back to blog</a></li>
</ul>
</p>
</form>
</div>
</body>
</html>
<?php }
/* END FUNCTIONS */
$errormsg='';
if (substr($_SERVER['REQUEST_URI'],-7)!='sas.php') {// if someone tries to request sas.php
if (isset($_POST['sub'])) { // if form has been submitted
$submitted_pass=md5($_POST['password']); // encrypt submitted password
if ($submitted_pass<>$encrypt_pass) { // if password is incorrect
$errormsg=$msg;
show_login_page($errormsg);
exit();
} else { // if password is correct
setmycookie();
}
} else {
if (isset($_SESSION[$cookiename])) { // if cookie isset
if ($_SESSION[$cookiename]==$encrypt_pass) { // if cookie is correct
// do nothing
} else { // if cookie is incorrect
show_login_page($errormsg);
exit();
}
} else { // if cookie is not set
show_login_page($errormsg);
exit();
}
}
} else {
echo '';
}
?>
ARCHIVO: links.php -->para agregfar una link al blog
Código PHP:
<?php
require('sas.php');
include ('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Estas Viendo mis links Favoritos en BuscaxTremo.Com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="styles/<?php echo $style ?>/admin.css" />
</head>
<style type="text/css">* html { overflow-x: hidden; }</style>
</head>
<body>
<div id="wphead">
<h1><?php echo $title ?> <span>(<a href="index.php">Ver Blog »</a>)</span></h1>
</div>
<div id="user_info">
<p>Hola: <?php echo $name; ?> bienvenida de nuevo. [<a href="login.php?logout=1" title="Log out of this account">Salir</a>, <a href="profile.php">Mi Perfil</a>] </p>
</div>
<ul id="adminmenu">
<li><a href='login.php' >Tablero de Control </a></li>
<li><a href='post.php'>Escribir Entrada </a></li>
<li><a href='personal.php' >Configuración Personal </a></li>
<li><a href='links.php'>Paginas</a></li>
<li><a href='theme.php'>Themes para el Blog </a></li>
</ul>
<div class="wrap">
<h2>Links</h2>
<form action="postlinks.php" method="post">
<p>Agrega Tus Links Favoritos .</p>
<p>
<label>Texto a mostrar :<br /> <input type="text" name="text" id="pwd" value="" size="20" tabindex="2" /></label></p>
<p>
<label>Url de la pagina (usa el http://):<br /> <input type="text" name="url" id="pwd" value="" size="20" tabindex="2" /></label></p>
<p class="submit">
<input type="submit" name="submit" id="submit" value="Guardar Detalles »" tabindex="4" />
</p>
</form>
<div id="footer">
<p> Powered by <a href="http://www.buscaxtremo.com/GrupoBenQuin/index.php"> Ben Quin Designs</a> This is a port of <a href="http://wordpress.org/">WordPress</a> <br />
<a href="xml.php">Entries (RSS)</a> <a href="entries/">"lo-fi" Version</a>
<!-- <?php echo "$i"; ?> queries. <?php echo "$totaltime"; ?> seconds. -->
</p>
</div>
</body>
</html>
Código PHP:
<?php require('sas.php'); ?>
<?php include ('config.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Logged in - Dashboard</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="styles/<?php echo $style ?>/admin.css" />
</head>
<style type="text/css">* html { overflow-x: hidden; }</style>
</head>
<body>
<div id="wphead">
<h1><?php echo $title ?> <span>(<a href="index.php">View site »</a>)</span></h1>
</div>
<div id="user_info"><p>Hello. [<a href="login.php?logout=1" title="Log out of this account">Sign Out</a>, <a href="profile.php">My Account</a>] </p></div>
<ul id="adminmenu">
<li><a href='login.php' >Dashboard</a></li>
<li><a href='post.php'>Write</a></li>
<li><a href='personal.php' >Personal Settings</a></li>
<li><a href='links.php' class="current">Pages</a></li>
<li><a href='theme.php' >Theme</a></li>
</ul>
<div class="wrap">
<h2>Links</h2>
<?php
$your_data = '
<li><a href="'.$_POST['url'].'">'.$_POST['text'].'</a></li>';
$fp = fopen("pages/blogroll.txt", "a");
fwrite($fp, $your_data);
fclose($fp);
?>
Your blogroll has been updated, <?php echo $name; ?>.
<div id="footer">
<p> Blog Creado por BuscaXtremo.Com
<Br />
© 2007-09</p>
</div>
</body>
</html>
para que se den cuenta mas omenos cual es mi problema. gracias por sus respuestas de antemano
http://www.buscaxtremo.com/blog2/index.php
entrar con contraseña 44024929 el user ya sale puesto pero por siacaso es mary