Jump to content

Sha256 Login Php [Help!]


danielrrm

Recommended Posts

Hi, I've this code, and it runs ok, but the passwords on my SQL are encrypted on SHA256 and I need my login to read them. ples help :sweat: . I need this urgently

 

<?php
$err_1 = '';
$err_2 = '';
$err_3 = '';
if (isset($_POST['logon']))
{
if ($_POST['hidden'] == "log")
{
$sql = "SELECT account FROM accounts WHERE account = '". secu($_POST['login']) ."'";
$sql = mysql_query($sql);
$sql = mysql_num_rows($sql);
if ($sql != NULL)
{
$donnees = mysql_fetch_array(mysql_query("SELECT * FROM accounts WHERE account = '".secu($_POST['login'])."'"));
if (secu($_POST['passlog']) == $donnees['pass'])
{
 $_SESSION['login'] = $donnees['account'];
 $_SESSION['level'] = getinfo($_SESSION['login'], "level");
 $_SESSION['guid'] = $donnees['guid'];
 $_SESSION['vip'] = $donnees['vip'];	
}
else
{
$err_1 = TRUE;
$err_1 = '<img alt="Contraseña incorrecta" title="Contraseña incorrecta" class="icon_li"src="'.$url_images.''.$url_devtool.'delete.png"> ';
}
}
else
{
$err_2 = TRUE;
$err_2 = '<img alt="Nombre de cuenta ['.secu($_POST['login']).'] incorrecta !" title="Nombre de cuenta ['.secu($_POST['login']).'] incorrecta !" class="icon_li"src="'.$url_images.''.$url_devtool.'delete.png"> ';
}
}
else
{
$err_3 = TRUE;
$err_3 = '<img class="icon_li"src="'.$url_images.''.$url_devtool.'delete.png"> ';
}
}


if (isset($_GET['deco']))
{
if(isset($_SESSION['login']) OR isset($_SESSION['level']))
{
session_start();
session_unset();
session_destroy();
$_SESSION=array();
print("<script type=\"text/javascript\">setTimeout('location=(\"".$lien_home."\")' ,0);</script>");
}
}


echo '<div id="menuLeft">';

if(isset($_SESSION['login']) AND isset($_SESSION['level'])){

echo '<div>';
echo '<div class="quotetitle">';
echo '<img type="button" value="Afficher" onclick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'none\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Cacher\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'block\'; this.innerText = \'\'; this.value = \'Afficher\'; }" src="'.$url_images.''.$url_titleMenu.'titleMenu_5.png">';
 echo '</div>';
echo '<div class="quotecontent">';
echo '<div style="display:;">';
echo '<div id="menuLeft_line">';
echo '<ul style="margin-left:-40px;margin-bottom:-1px;margin-top:-1px;" class="niveau1">';
echo '<li><img class="icon_li"src="'.$url_images.''.$url_devtool.'user.png"> Mi Cuenta';
 echo '<ul class="niveau2">';
 // echo '<a href="#"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'construction.png"> Mis Parametros</li></a>';
 echo '<a href="'.$lien_vip.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'star.png"> <b>V.I.P</b> : ';
 if($_SESSION['vip'] < $levelVIP) { echo '<span style="color: #ff0000;"><b>Non</b></span>'; } else { echo '<span style="color: #00ae08;"><b>Oui</b></span>'; }
 echo '</li></a>';
 echo '</ul>';
 echo '</li>';
 echo '<li><img class="icon_li"src="'.$url_images.''.$url_devtool.'cadeau.png"> Mis puntos (<b>'.getinfo($_SESSION['login'],"points").'</b>)';
 echo '<ul class="niveau2">';
 echo '<a href="'.$lien_plus.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'plus.png"> En mas +</li></a>';
 echo '<a href="'.$lien_shop.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'cart.png"> El uso</li></a>';
 if($_SESSION['vip'] < $levelVIP) { echo '<a href="'.$lien_vip.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'star.png"> Ser miembro <b>V.I.P</b></li></a>'; } else { }
 echo '</ul>';
 echo '</li>';
 echo '<a href="index.php?pages=shop"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'cart.png"> <b>Boutique</b>';
 // echo '<ul class="niveau2">';
 // echo '<a href="index.php?pages=shop&cat=1"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'ico_dofus.png"> Dofus</li></a>';
 // echo '<a href="index.php?pages=shop&cat=2"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'ico_fam.png"> Familiares</li></a>';
 // echo '<a href="index.php?pages=shop&cat=3"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'ico_ite.png"> Items</li></a>';
 // echo '<a href="index.php?pages=shop&cat=4"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'ico_obv.png"> Objevivos</b></li></a>';
 // echo '<a href="index.php?pages=shop&cat=5"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'ico_arm.png"> Armas</li></a>';
 // echo '</ul>';
 echo ' <img style="float:right;margin-top:-2px;margin-right:-3px;" src="'.$url_images.''.$url_devtool.'ico_news.png"></li></a>';
 // echo '<li><img class="icon_li"src="'.$url_images.''.$url_devtool.'email.png"> Mensajeria (<b>0</b>)';
 // echo '</li>';
 echo '<li><img class="icon_li"src="'.$url_images.''.$url_heads.'0.png"> Mis personajes';
 echo '<ul class="niveau2">';
 $sql = "SELECT * FROM personnages WHERE account='".$_SESSION['guid']."' ORDER BY level DESC";
 $req = mysql_query($sql) or die ('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
 while($data=mysql_fetch_assoc($req))
 {
	 echo '<a href="'.$lien_pperso.'?id='.$data["guid"].'"><li>';
	 include ("module/wichClass_iconli.php");
	 echo '[<b>'.$data["level"].'</b>] '.$data["name"].'<i style="float: right;">';
	 include ("module/wichClass_sexe.php");
	 echo '</i></li></a>';
 }
 echo '</ul>';
 echo '</li>';
echo '<a href="'.$lien_vote.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'kamas.png"> <b>Vote & Gane</b> <img style="float:right;margin-top:-2px;margin-right:-3px;" src="'.$url_images.''.$url_devtool.'ico_news.png"></li></a>';
if($_SESSION['level'] >= $levelNEWS) {
 echo '<li><img class="icon_li"src="'.$url_images.''.$url_devtool.'construction.png"> Administration';
 echo '<ul class="niveau2">';
 echo '<a href="'.$lien_ADMIN_news.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'add.png"> Escribir una noticia</li></a>';
 echo '<a href="#"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'config.png"> Gestion de la boutique</li></a>';
 echo '<a href="'.$lien_ADMIN_hisPts.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'terminal.png"> Historial de puntos</li></a>';
 echo '<a href="'.$lien_ADMIN_hisShop.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'log.png"> Historial de la boutique</b></li></a>';
 echo '<a href="#"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'server.png"> Lista de miembros <b>VIP</b></li></a>';
 echo '<a href="'.$lien_ADMIN_commentaire.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'database.png"> Manejar comentarios</li></a>';
 echo '</ul>';
 echo '</li>';
}
echo '<a href="'.$_SERVER['PHP_SELF'].''.$lien_logout.'"><li><img class="icon_li"src="'.$url_images.''.$url_devtool.'close.png"> Desconectar</li></a>';
echo '</ul>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';

} else {

echo '<div>';
echo '<div class="quotetitle">';
echo '<img type="button" value="Afficher" onclick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'none\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Cacher\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'block\'; this.innerText = \'\'; this.value = \'Afficher\'; }" src="'.$url_images.''.$url_titleMenu.'titleMenu_4.png">';
 echo '</div>';
echo '<div class="quotecontent">';
echo '<div style="display:;">';
echo '<div id="menuLeft_line">';
echo '<center>';
echo '<form action="#" method="post">';
 if ($err_2 == TRUE) { echo $err_2; }
 if ($err_3 == TRUE) { echo $err_3; }
 echo '<input class="color_input" type="text" name="login" value="Mi cuenta" onfocus="this.value=\'\'"/>';
 if ($err_1 == TRUE) { echo '<br />'.$err_1.''; }
 if ($err_3 == TRUE) { echo '<br />'.$err_3.''; }
 echo '<input class="color_input" type="password" name="passlog" value="Contraseña" onfocus="this.value=\'\'"/>';
 echo '<input name="hidden" type="hidden" value="log" />';
 if ($err_3 == TRUE) { echo '<br />'.$err_3.''; }
 echo '<input class="color_input_sub" type="submit" name="logon" value="Conectarse" type="submit"/>';
echo '</form>';
echo '</center><hr />';
echo '<a href="index.php?pages=lost&lost=1"><li>Contraseña olvidada? ? <img style="float:right;margin-top:-2px;margin-right:-3px;" src="'.$url_images.''.$url_devtool.'ico_news.png"></li></a>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';

}

echo '<div>';
echo '<div class="quotetitle">';
echo '<img type="button" value="Afficher" onclick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'none\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Cacher\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'block\'; this.innerText = \'\'; this.value = \'Afficher\'; }" src="'.$url_images.''.$url_titleMenu.'titleMenu_1.png">';
 echo '</div>';
echo '<div class="quotecontent">';
echo '<div style="display:;">';
echo '<div id="menuLeft_line">';
echo '<a href="'.$lien_home.'"><li>Inicio</li></a>';
//echo '<a href="'.$lien_presentation.'"><li>Presentación</li></a>';
//echo '<ul style="margin-left:-40px;margin-bottom:-0px;margin-top:-0px;" class="niveau1">';
//echo '<li>Mises à jour';
// echo '<ul class="niveau2">';
// echo '<a href=""><li>Continuar...</li></a>';
// echo '<a href=""><li>MAJ Del servidor</li></a>';
// echo '<a href=""><li>MAJ Del sitio</li></a>';
// echo '</ul>';
//echo '</li>';
//echo '</ul>';
echo '<a href="'.$lien_histoire.'"><li>Mapa de '.$title.'</li></a>';
echo '<a href="'.$lien_staff.'"><li>El equipo <img style="float:right;margin-top:-2px;margin-right:-3px;" src="'.$url_images.''.$url_devtool.'ico_news.png"></li></a>';
echo '<a href="'.$lien_cgu.'"><li>Reglamento</li></a>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';

echo '<div>';
echo '<div class="quotetitle">';
echo '<img type="button" value="Afficher" onclick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'none\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Cacher\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'block\'; this.innerText = \'\'; this.value = \'Afficher\'; }" src="'.$url_images.''.$url_titleMenu.'titleMenu_2.png">';
 echo '</div>';
echo '<div class="quotecontent">';
echo '<div style="display:;">';
echo '<div id="menuLeft_line">';
echo '<ul style="margin-left:-40px;margin-bottom:-1px;margin-top:-1px;" class="niveau1">';
echo '<a href="'.$lien_getin.'"><li>Descargas</li></a>';
if(isset($_SESSION['login']) AND isset($_SESSION['level'])){
}
else
{
 echo '<a href="'.$lien_home.'"><li>Inscripcion</li></a>';
}
echo '<a href="'.$lien_home.'"><li>Foro</li></a>';
echo '<a href="'.$lien_home.'"><li>Xat</li></a>';
 echo '<li>Ladder';
 echo '<ul class="niveau2">';
 echo '<a href="'.$lien_home.'"><li>Personajes</li></a>';
 echo '<a href="'.$lien_home.'"><li>Gremios</li></a>';
 echo '<a href="'.$lien_home.'"><li>Votos <img style="float:right;margin-top:-2px;margin-right:-3px;" src="'.$url_images.''.$url_devtool.'ico_news.png"> </li></a>';
 echo '</ul>';
 echo '</li>';
echo '</ul>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';

echo '<div>';
echo '<div class="quotetitle">';
echo '<img type="button" value="Afficher" onclick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'none\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Cacher\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'block\'; this.innerText = \'\'; this.value = \'Afficher\'; }" src="'.$url_images.''.$url_titleMenu.'titleMenu_3.png">';
 echo '</div>';
echo '<div class="quotecontent">';
echo '<div style="display:;">';
echo '<div id="menuLeft_line">';
echo '<ul style="margin-left:-40px;margin-bottom:-1px;margin-top:-1px;" class="niveau1">';
// echo '<li>Avantages';
 // echo '<ul class="niveau2">';
 // echo '<a href="#"><li>Cambiar nombre</li></a>';
 // echo '<a href="#"><li>Cambiar sexo</li></a>';
 // echo '<a href="#"><li>Cambiar raza</li></a>';
 // echo '</ul>';
// echo '</li>';
echo '<a href="'.$lien_home.'"><li>Drizzard</li></a>';
//echo '<a href="'.$lien_world.'"><li>Mapa del mundo</li></a>';
echo '</ul>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<center><a target="blank" href="https://www.facebook.com/pages/"><img border="0" src="images/devtool/fb.png"></a> <a target="blank" href="http://www.youtube.com/user"><img border="0" src="images/devtool/yt.png"></a> <a target="blank" href="'.$lien_rpg.'"><img border="0" src="images/devtool/rpg.png"></a></center>';
echo '</div>';


?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.