Bom, sou iniciante e costumo pegar scripts prontos e fazer algumas modificações para ter o resultado que desejo, no script abaixo eu consegui deixar tudo como eu queria, mas não estou conseguindo ir para a área de administração, simplesmente não sai da pagina de login, já tentei de tudo sem sucesso (tudo que conheço), gostei muito do resultado final e realmente gostaria de usar esse script. se puderem me ajudar a resolver esse problema ficarei muito grato.
Meu servidor está com php 4
pasta admin arquivo index.php
<?
$requiredUserLevel = array(0,1,2);
$cfgProgDir ='phpSecurePages/';
include($cfgProgDir ."secure.php");
setcookie("login", $_POST[entered_login]);
setcookie("pass", $_POST[entered_password]);//include("path.php");
include("../config.php");
$cidade =1;?><tablewidth="800"border="0"align="center"cellpadding="0"cellspacing="0"class="text"><tr><tdwidth="776"height="92"background="../images/layout/topo-bg.jpg"><tablewidth="800"height="90"border="0"cellpadding="0"cellspacing="0"><tr><tdwidth="300"background="../images/layout/logo_admin.png"> </td><tdwidth="237"align="right"> </td><tdwidth="263"align="right"> </td></tr></table></td></tr></table><tablewidth="800"border="0"align="center"cellpadding="0"cellspacing="0"bgcolor="#262626"><tr><tdheight="16"><p><fontcolor="#FFFFFF">
<? $sql = mysql_query("SELECT * FROM phpsp_users where user='$login'");
$dados = mysql_fetch_array($sql);
$usernivel ="$dados[userlevel]";
$idfranquia ="$dados[id_franquia]";
$idusuarios ="$dados[primary_key]";//echo $idfranquia;?>
Olá <b><? echo $dados[nome];?></b> (<?
$sql2=mysql_query("SELECT * FROM franquias WHERE id='$dados[id_franquia]'");
$dados2=mysql_fetch_array($sql2);
echo $dados2[cidade];?>), seja bem vindo!
<tdalign="right"><ahref="logout.php"><fontcolor="#FFFFFF">Sair</font> </a></td></tr></table><tablewidth="800"border="0"align="center"cellpadding="0"cellspacing="0"background="../images/layout/tb_admin_fundo.gif"><tr><td><tablewidth="800"border="0"align="center"cellpadding="0"cellspacing="0"><tr><tdwidth="200"align="left"valign="top"bgcolor="#FFFFFF"><? include("menu.php");?></td><tdalign="center"valign="top"bgcolor="#666666"><? include("query_string.php");?></td></tr></table></td></tr></table><tablewidth="800"border="0"align="center"cellpadding="0"cellspacing="0"><tr><tdwidth="789"height="24"align="center"bgcolor="#262626"class="branco"><fontcolor="#CCCCCC">FSOL WEB ® 2012 - Todos os Direitos Reservados</font></td></tr></table>
<?
$cfgIndexpage ='index.php';// page to go to, if login is cancelled// Example: if your main page is http://www.mydomain.com/index.php// the value would be $cfgIndexpage = '/index.php'
$admEmail ='cbourbon@hotmail.com';// E-mail adres of the site administrator// (This is being showed to the users on an error, so you can be notified by the users)
$noDetailedMessages =true;// Show detailed error messages (false) or give one single message for all errors (true).// If set to 'false', the error messages shown to the user describe what went wrong.// This is more user-friendly, but less secure, because it could allow someone to probe// the system for existing users.
$passwordEncryptedWithMD5 =false;// Set this to true if the passwords are encrypted// with the MD5 algorithm// (not yet implanted, expect this in a next release)
$languageFile ='brazil.php';// Choose the language file
$bgImage ='bg_lock.gif';// Choose the background image
$bgRotate =false;// Rotate the background image from list// (This overrides the $bgImage setting)/****** Lists ******/// List of backgrounds to rotate through
$backgrounds[]='bg_lock.gif';
$backgrounds[]='bg_lock2.gif';
$backgrounds[]='bg_gun.gif';/****** Database ******/
$useDatabase =true;// choose between using a database or data as input/* this data is necessary if a database is used */if($HTTP_SERVER_VARS["REMOTE_ADDR"]!="127.0.0.1"){
$cfgServerHost ='localhost';// MySQL hostname
$cfgServerPort ='';// MySQL port - leave blank for default port
$cfgServerUser ='MY USER';// MySQL user
$cfgServerPassword ='MY SENHA';// MySQL password
$cfgDbDatabase ='MY BANCO';// MySQL database name containing phpSecurePages table}else{
$cfgServerHost ='localhost';// MySQL hostname
$cfgServerPort ='';// MySQL port - leave blank for default port
$cfgServerUser ='MY USER';// MySQL user
$cfgServerPassword ='MY SENHA';// MySQL password
$cfgDbDatabase ='MY BANCO';// MySQL database name containing phpSecurePages table}
$cfgDbTableUsers ='phpsp_users';// MySQL table name containing phpSecurePages user fields
$cfgDbLoginfield ='user';// MySQL field name containing login word
$cfgDbPasswordfield ='password';// MySQL field name containing password
$cfgDbUserLevelfield ='userlevel';// MySQL field name containing user level// Choose a number which represents the category of this users authorization level.// Leave empty if authorization levels are not used.// See readme.txt for more info.
$cfgDbUserIDfield ='primary_key';// MySQL field name containing user identification// enter a distinct ID if you want to be able to identify the current user// Leave empty if no ID is necessary.// See readme.txt for more info./****** Database - PHP3 ******//* information below is only necessary for servers with PHP3 */
$cfgDbTableSessions ='phpsp_sessions';// MySQL table name containing phpSecurePages sessions fields
$cfgDbTableSessionVars ='phpsp_sessionvars';// MySQL table name containing phpSecurePages session variables fields/****** Data ******/
$useData =false;// choose between using a database or data as input/* this data is necessary if no database is used */
$cfgLogin[1]='root';// login word
$cfgPassword[1]='root';// password
$cfgUserLevel[1]='1';// user level// Choose a number which represents the category of this users authorization level.// Leave empty if authorization levels are not used.// See readme.txt for more info.
$cfgUserID[1]='';// user identification// enter a distinct ID if you want to be able to identify the current user// Leave empty if no ID is necessary.// See readme.txt for more info.
$cfgLogin[2]='';
$cfgPassword[2]='';
$cfgUserLevel[2]='';
$cfgUserID[2]='';
$cfgLogin[3]='';
$cfgPassword[3]='';
$cfgUserLevel[3]='';
$cfgUserID[3]='';/**************************************************************//* End of phpSecurePages Configuration *//**************************************************************/// https supportif(getenv("HTTPS")=='on'){
$cfgUrl ='https://';}else{
$cfgUrl ='http://';}// getting other login variables
$cfgHtmlDir = $cfgProgDir;if($message) $messageOld = $message;
$message =false;// Create a constant that can be checked inside the files to be included.// This gives an indication if secure.php has been loaded correctly.
define("LOADED_PROPERLY",true);// include functions and variablesfunction admEmail(){// create administrators email linkglobal $admEmail;return("<A HREF='mailto:$admEmail'>$admEmail</A>");}
include($cfgProgDir ."lng/". $languageFile);
include($cfgProgDir ."session.php");// choose between login or logoutif($logout &&!($HTTP_GET_VARS["logout"]|| $HTTP_POST_VARS["logout"])){// logout
include($cfgProgDir ."logout.php");}else{// loading login check
include($cfgProgDir ."checklogin.php");}
echo $HTTP_GET_VARS["logout"];?>
Pergunta
cesarbourbon
Olá pessoal.
Bom, sou iniciante e costumo pegar scripts prontos e fazer algumas modificações para ter o resultado que desejo, no script abaixo eu consegui deixar tudo como eu queria, mas não estou conseguindo ir para a área de administração, simplesmente não sai da pagina de login, já tentei de tudo sem sucesso (tudo que conheço), gostei muito do resultado final e realmente gostaria de usar esse script. se puderem me ajudar a resolver esse problema ficarei muito grato.
Meu servidor está com php 4
pasta admin arquivo index.php
arquivo config.php
ARQUIVO SECURE.PHP
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.