Pesquisar na Comunidade
Mostrando resultados para as tags ''portal''.
Encontrado 2 registros
-
Faaaaala Galera beleza? seguinte sou novo aqui no fórum, e já venho trazer a vocês uma baita dúvida do caralhoo que não consigo resolver kkkk :/ Tenho um sistema de classificados porém não consigo criar paginação. vou colocar o código completo da minha home aqui abaixo e identificar o pedaço que faz a consulta no banco e retorna os anúncios beleza ? quem puder ajudar :) ================================================================================ INDEX.PHP ================================================================================ <?php include_once("config/conexao.php"); /* Script Desenvolvido por RENAN VINICIUS renanvin@live.com renan@megaperes.com.br FAVOR MANTER OS CRÉDITOS */ ?> <!-- Desenvolvido por RENAN VINICIUS renanvin@live.com --> <!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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Listar Anúncios</title> <link rel="stylesheet" type="text/css" href="style.css" /> <link href="estilo.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function ver_anuncio(ID){ window.open('ver_anuncio.php?ID='+ ID +'','page','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=900,height=550'); } function enviar_anuncio(){ window.open('cadastrar_anuncio.php','page','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=550,height=500'); } </script> </head> <body> <div id="header"> <div id="logo">Radar'Car<img src="images/RadarGreen.gif" width="25" height="25" title="" rel=""></div> <div id="header-superior"> <div id="header-superior-content"> <div id="header-paginas"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Ajuda</a></li> <li><a href="#">Meus Anúncios</a></li> <li><a href="#">Minha Conta</a></li> <li><a href="#">Contato</a></li> </ul> </div><!-- fim header-paginas --> <div id="header-social"> <a href="javascript: enviar_anuncio();"><div id="bt_inserir_anuncio"><div class="btn_cor">INSERIR ANÚNCIO</div></div></a> <!-- <a href=""><img src="images/icon-twiter.png" width="30" height="30" rel="" title="" /></a> <a href=""><img src="images/icon-youtube.png" width="30" height="30" rel="" title="" /></a> <!-- <a href=""><img src="images/icon-instagram.png" width="30" height="30" rel="" title="" /></a> --> </div><!-- fim header-social --> </div></div></div> <div id="anuncios" align="center"> <table width="800" border="0" align="center" cellpadding="3" cellspacing="3" bgcolor="#F8F8F8"> <tr> <td width="210" height="28" align="center" valign="middle" bgcolor="#666" style="color:#ccc;">Veículos</td> <td width="569" align="center" valign="middle" bgcolor="#666" style="color:#ccc;">Anúncios</td> </tr> <tr> <td height="29" align="left" valign="top"> <?php $categorias = mysql_query("SELECT * FROM categorias ORDER BY nome ASC"); while($lnc = mysql_fetch_object($categorias)): ?> <div id="menu_categorias"><a href="?categoria=<?php echo $lnc->ID; ?>"><?php echo $lnc->nome; ?></a></div> <?php endwhile; ?> <br /> <div align="center"><a href="javascript: enviar_anuncio();" class="botao" style="text-decoration:none;">Cadastre seu anúncio (<strong>GRÁTIS</strong>)</a></div> <br /> </td> <td align="left" valign="top"> <br /> <table width="100%" border="0"> <tr> <td width="20%"><div align="right">Faça sua busca: </div></td> <td width="80%" align="left"> <form name="busca" method="post" action=""> <input name="query" type="text" class="form" id="query" /> <input name="buscar" type="submit" class="botao" id="buscar" value="Buscar" /> </form> </td> </tr> </table> <br /> <!-- FAZ A BUSCA NO BANCO --> <?php if(@$_POST){ $sql = mysql_query("SELECT * FROM anuncios WHERE descricao LIKE '%".$_POST["query"]."%' ORDER BY ID DESC"); }else{ if(empty($_GET["categoria"])){ $sql = mysql_query("SELECT * FROM anuncios WHERE status = 'Ativo' AND ID ORDER BY RAND() LIMIT 3"); }else{ $sql = mysql_query("SELECT * FROM anuncios WHERE categoria = '".strip_tags($_GET["categoria"])."' AND status = 'Ativo' ORDER BY I DESC"); } } if(mysql_num_rows($sql) == false){ echo '<div align="center"><br /><strong>Nenhum anúncio encontrado.</strong><br /></div>'; }else{ while($ln = mysql_fetch_object($sql)){ ?> <table width="100%" border="0" id="borda_anuncio"> <tr id="borda_anuncio"> <td width="2%" height="110" align="center" valign="middle"><img src="uploads/<?php echo $ln->thumb; ?>" width="140" height="90" /></td> <td width="98%" align="left" valign="top"> <div align="left" style="margin:5px; font-size:14px;" id="titulo"> <div class="titulo_anuncio"> <h1><a href="javascript: ver_anuncio(<?php echo $ln->ID; ?>);" ><?php echo truncate(strip_tags($ln->descricao), 100); ?>...</a></h1> </div </div> <div align="left" style="margin:5px; font-size:11px;">Data: <strong><?php echo str_replace("-", "/", inverteData($ln->data)); ?></strong></div> <div align="left" style="margin:5px; font-size:11px;">Enviado por: <strong><?php echo $ln->nome; ?></strong></div> <div align="left" style="margin-left:5px; margin-top:10px;"><a href="javascript: ver_anuncio(<?php echo $ln->ID; ?>);" class="botao" style="text-decoration:none;">Ver anúncio</a></div> </td> </tr> </table> <?php } ?> <?php } ?> </td> </tr> </table> </div> <!-- FIM DOS ANUNCIOS --> <div id="paginacao"> </div> </body> </html> ================================================================================== FAZ A BUSCA NO BANCO E RETORNA OS ANUNCIOS ================================================================================== <?php if(@$_POST){ $sql = mysql_query("SELECT * FROM anuncios WHERE descricao LIKE '%".$_POST["query"]."%' ORDER BY ID DESC"); }else{ if(empty($_GET["categoria"])){ $sql = mysql_query("SELECT * FROM anuncios WHERE status = 'Ativo' AND ID ORDER BY RAND() LIMIT 3"); }else{ $sql = mysql_query("SELECT * FROM anuncios WHERE categoria = '".strip_tags($_GET["categoria"])."' AND status = 'Ativo' ORDER BY I DESC"); } } if(mysql_num_rows($sql) == false){ echo '<div align="center"><br /><strong>Nenhum anúncio encontrado.</strong><br /></div>'; }else{ while($ln = mysql_fetch_object($sql)){ ?> <table width="100%" border="0" id="borda_anuncio"> <tr id="borda_anuncio"> <td width="2%" height="110" align="center" valign="middle"><img src="uploads/<?php echo $ln->thumb; ?>" width="140" height="90" /></td> <td width="98%" align="left" valign="top"> <div align="left" style="margin:5px; font-size:14px;" id="titulo"> <div class="titulo_anuncio"> <h1><a href="javascript: ver_anuncio(<?php echo $ln->ID; ?>);" ><?php echo truncate(strip_tags($ln->descricao), 100); ?>...</a></h1> </div </div> <div align="left" style="margin:5px; font-size:11px;">Data: <strong><?php echo str_replace("-", "/", inverteData($ln->data)); ?></strong></div> <div align="left" style="margin:5px; font-size:11px;">Enviado por: <strong><?php echo $ln->nome; ?></strong></div> <div align="left" style="margin-left:5px; margin-top:10px;"><a href="javascript: ver_anuncio(<?php echo $ln->ID; ?>);" class="botao" style="text-decoration:none;">Ver anúncio</a></div> </td> </tr> </table> <?php } ?> <?php } ?> A DÚVIDA É COMO CRIAR PAGINAÇÃO COM CÓDIGO ACIMA ?
-
ola Pessoal Estou com um problema em um script php, a pagina carrega normalmente, mas quando tento entrar no painel administrativo simplesmente não sai da tela de login para a tela do painel de administracao. posto aqui os scripts INDEX ADMIN <? $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;?> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="text"> <tr> <td width="776" height="92" background="../images/layout/topo-bg.jpg"><table width="800" height="90" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="300" background="../images/layout/logo_admin.png"> </td> <td width="237" align="right"> </td> <td width="263" align="right"> </td> </tr> </table></td> </tr> </table> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#262626"> <tr> <td height="16"><p><font color="#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! <td align="right"><a href="logout.php"><font color="#FFFFFF">Sair</font> </a> </td> </tr> </table> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/layout/tb_admin_fundo.gif"> <tr> <td><table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="200" align="left" valign="top" bgcolor="#FFFFFF"><? include("menu.php");?></td> <td align="center" valign="top" bgcolor="#666666"><? include("query_string.php");?> </td> </tr> </table></td> </tr> </table> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="789" height="24" align="center" bgcolor="#262626" class="branco"><font color="#CCCCCC">FSOL WEB ® 2012 - Todos os Direitos Reservados</font></td> </tr> </table> PAGINA secure.php <? $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 = 'MEU USER'; // MySQL user $cfgServerPassword = 'MINHA SENHA'; // MySQL password $cfgDbDatabase = 'MEU BANCO'; // MySQL database name containing phpSecurePages table } else { $cfgServerHost = 'localhost'; // MySQL hostname $cfgServerPort = ''; // MySQL port - leave blank for default port $cfgServerUser = 'MEU USER'; // MySQL user $cfgServerPassword = 'MINHA SENHA'; // MySQL password $cfgDbDatabase = '*****MEU 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 support if (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 variables function admEmail() { // create administrators email link global $admEmail; return("<A HREF='mailto:$admEmail'>$admEmail</A>"); } include($cfgProgDir . "lng/" . $languageFile); include($cfgProgDir . "session.php"); // choose between login or logout if ($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"]; ?> ARQUIVO CONFIG.PHP <? // conexão com o banco $server = "localhost"; $user = "MEU USER"; $senha = "MINHA SENHA"; $banco = "MEU BANCO"; $conexao = mysql_connect("$server", "$user", "$senha"); $db = mysql_select_db("$banco"); // termina conexão com o banco $pasta = "galeria"; $sql = mysql_query("SELECT * FROM config WHERE id='1'"); while ($linha = mysql_fetch_array($sql)) { $tsite = $linha[tsite]; // nome do site $usite = $linha[usite]; // url do site, ex: http://www.seusite.com.br/galeria/ $fonte = $linha[fonte]; // fonte do site $tfonte = $linha[tfonte]; // tamanho da fonte usada $tfonte2 = $linha[tfonte2]; // tamanho da fonte usada $ttitulo = $linha[ttitulo]; // tamanho dos titulos do site $ttitulo2 = $linha[ttitulo2]; // tamanho dos titulos do site $coronmouse = $linha[coronmouse]; // cor quando passar o mouse em cima dos links #999999 $cortexto = $linha[cortexto]; // cor do texto $corcelula1 = $linha[corcelula1]; // cor dacelula 1 $corcelula2 = $linha[corcelula2]; // cor da celula 2 $corfundosite = $linha[corfundosite]; // cor de fundo do site $qts_thumbs = $linha[qts_thumbs]; // Total de fotos q será exibido do lado esquerdo $qts_colunas = $linha[qts_colunas]; // total de colunas q será exibido $qts_ultimos = $linha[qts_ultimos]; // total de eventos q ficarão nas ultimas coberturas $img_fundo = $linha[img_fundo]; $loginho = $linha[loginho]; $telefone = "11 - 2233-4455"; $meuemail = "cbourbon@hotmail.com"; $corporyth = "© 2012 - www.weberadiososite"; } ?> <head> <SCRIPT language="JavaScript1.2"> var URLSite = window.location.href; var TituloSite = document.title; function addfav(){ if (document.all) window.external.AddFavorite(URLSite,TituloSite); } </SCRIPT> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title><? echo $tsite?></title> <style type="text/css"> body { background-image: url(images/bg.jpg); background-position: top; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; font-family: <?=$fonte?>; font-size: <?=$tfonte?>; color: <?=$cortexto?>; } body,td,th { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; font-family: <?=$fonte?>; font-size: <?=$tfonte?>; color: <?=$cortexto?>; } .branco {color: #FFFFFF} .pequeno { font-size: 8px; color: #999999; } .titulos { font-size: <?=$tfonte?>; color: <?=$coronmouse?>; } a:link, a:active, a:visited { color: <?=$cortexto?>; text-decoration: none; } a:hover { color: <?=$coronmouse?>; text-decoration: underline; } .input { height: 20; width: 145; border: 1px solid #333333; font-family: <?=$fonte?>; font-size: <?=$tfonte?>; color: #000000; } </style> </HEAD> <body> <script src="<? echo $usite?>janelas_popup.js" language="JavaScript"></script>
-
- painel
- não conecta
-
(e %d mais)
Tags: