[Resolvido] Tirar base64_encode e md5
Oi tudo bem!!!
Queria tirar " base64_encode e md5 " da pagina access_admin.php, para inserir senha e login, sem proteção, fiz mudanças mais não consegui, venho pedir mais uma vez ajuda.
Agradeço desde Já.
access_admin.php
<?php
ini_set("display_errors", "1");
session_start();
include("./cfg/connect.inc.php");
if (isset($_POST["authorize"]))
{
if (!strcmp(base64_encode($_POST["login"]), ADMIN_LOGIN) && !strcmp(md5($_POST["password"]), ADMIN_PASS)) //Quero tirar base64_encode e md5
{
$_SESSION["log"] = ADMIN_LOGIN;
$_SESSION["pass"] = ADMIN_PASS;
header("Location: produto.php");
}
else $errorStr = "Invalido Login ou Senha";
}
?>
<html>
<head>
<link rel=STYLESHEET href="style1.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Administrator login</title></head>
<body>
<center>
<?php
if (isset($errorStr)) echo "<font color=red><b>$errorStr</b></font>";
?>
<form name="form1" method="post" action="access_admin.php">
<table width="319" border="0" cellpadding="2" cellspacing="1" bgcolor="#333333">
<tr bgcolor="#CCCCCC">
<td colspan="2" align=center><h4><font size="7">BEM VINDO</font></h4></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right"> </td>
<td>
<div align="center">
<input name="login" type="text"<?php if (isset($_POST["login"])) echo ' value="'.str_replace("\"",""",stripslashes($_POST["login"])).'"';?>>
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right"> </td>
<td>
<div align="center">
<input name="password" type="password">
</div></td>
</tr>
</table>
<p>
<input type="hidden" name="authorize" value="1">
<input type="submit" value="ENTRE">
</p>
</form>
<p><font color="#FF0000" size="4"></font></p>
</center>
</body>
</html>
connect.inc.php
<?php
//database connection settings
define('DB_HOST', 'xxxxxxxxx');
define('DB_USER', 'xxxxxxxxx');
define('DB_PASS', 'xxxxxxxx');
define('DB_NAME', 'xxxxxxxxxxx');
define('ADMIN_LOGIN', 'bWlsbGVuaXVubg=='); //Login
define('ADMIN_PASS', '3b82fe3f8ab2dda087e9219d555e31c4'); //senha
//database tables
include("./cfg/tables.inc.php");
?>
Queria que ficasse assim
<?php
//database connection settings
define('DB_HOST', 'xxxxxxxxx');
define('DB_USER', 'xxxxxxxxx');
define('DB_PASS', 'xxxxxxxx');
define('DB_NAME', 'xxxxxxxxxxx');
define('ADMIN_LOGIN', 'admin'); //Login
define('ADMIN_PASS', '123456'); //senha
//database tables
include("./cfg/tables.inc.php");
?>
Obrigado!!!
Foi dificil mais encontrei.
Ficou assim:
access_admin.php
<?php
ini_set("display_errors", "1");
session_start();
include("./cfg/connect.inc.php");
if (isset($_POST["authorize"]))
{
if (!strcmp(($_POST["login"]), ADMIN_LOGIN) && !strcmp(($_POST["password"]), ADMIN_PASS)) //aqui que mudei...somente
{
$_SESSION["log"] = ADMIN_LOGIN;
$_SESSION["pass"] = ADMIN_PASS;
header("Location: produto.php");
}
else $errorStr = "Invalido Login ou Senha";
}
?>
<html>
<head>
<link rel=STYLESHEET href="style1.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Administrator login</title></head>
<body>
<center>
<?php
if (isset($errorStr)) echo "<font color=red><b>$errorStr</b></font>";
?>
<form name="form1" method="post" action="access_admin.php">
<table width="319" border="0" cellpadding="2" cellspacing="1" bgcolor="#333333">
<tr bgcolor="#CCCCCC">
<td colspan="2" align=center><h4><font size="7">BEM VINDO</font></h4></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right"> </td>
<td>
<div align="center">
<input name="login" type="text"<?php if (isset($_POST["login"])) echo ' value="'.str_replace("\"",""",stripslashes($_POST["login"])).'"';?>>
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right"> </td>
<td>
<div align="center">
<input name="password" type="password">
</div></td>
</tr>
</table>
<p>
<input type="hidden" name="authorize" value="1">
<input type="submit" value="ENTRE">
</p>
</form>
<p><font color="#FF0000" size="4"><strong>Atenção Apenas Clique no botão ENTRE</strong></font></p>
</center>
</body>
</html>
Obrigado.
Topico Encerrado.
Discussão (0)
Carregando comentários...