Ir para conteúdo
Fórum Script Brasil

Seto Sampaio

Membros
  • Total de itens

    3
  • Registro em

  • Última visita

Sobre Seto Sampaio

Seto Sampaio's Achievements

0

Reputação

  1. <?php error_reporting (E_ALL & ~ E_NOTICE & ~ E_DEPRECATED); /* tramento de advertencia para que não exiba*/ # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_painel_config = "localhost"; $database_painel_config = "imobi"; $username_painel_config = "root"; $password_painel_config = "vertrigo"; $painel_config = mysql_pconnect($hostname_painel_config, $username_painel_config, $password_painel_config) or trigger_error(mysql_error(),E_USER_ERROR); ?> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- troquei essa conxeção acima mysql por essa abaixo mysqli...porem meu sistema de login parou de funcionar até agora não conseguir resolver. aparesce a seguinte mesangem, "Access denied for user ''@'localhost' (using password: NO)" --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <?php $host = "localhost"; $usuario = "root"; $senha = "vertrigo"; $bb = "imobi"; $mysqli = new mysqli($host, $usuario, $senha, $bb); if($mysqli->connect_errno) echo "Falha na conexão;(".$mysqli->connect_errno.") ".$mysqli->connect_error; //ini_set('display_errors',false); ?> --------------------------------------------------------------------------------------------------------------------------------------------- abaixo codigo do sistema de login. desde já agradeço ajuda... <?php require_once ('Connections/conexao.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['usuario'])) { $loginUsername=$_POST['usuario']; $password=$_POST['senha']; $MM_fldUserAuthorization = "usuarioNivel"; $MM_redirectLoginSuccess = "admin/painel.php"; $MM_redirectLoginFailed = "admin/erro.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_painel_config, $painel_config); $LoginRS__query=sprintf("SELECT email, senha, usuarioNivel FROM quimovel_clientes WHERE email=%s AND senha=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $painel_config) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = mysql_result($LoginRS,,'usuarioNivel'); if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="UTF-8"/> <title>site</title> <link rel="stylesheet" type="text/css" href="estilo-login.css"> <?php include "Connections/config.php";?> <?php include "js/scripts.php"; ?> <?php include "funcoes.php"; ?> </head> <body> <body> <div id="box"> <div id="header"> <div id="header_topo"> <a href="index.php"><img src="images/qui-logo.png" alt="Home" title="home"/></a> <ul> <li><a href="index.php?pg=cidades">Comprar</a></li> <li><a href="index.php?pg=anunciar">Cadastrar</a></li> <li><a href="index.php?pg=contatos">Contatos</a></li> </ul> </div> </div> <section id="corpologin"> <fieldset> <legend>Fazer Login</legend> <form name="central_anunciante" action="<?php echo $loginFormAction; ?>" method="POST"> <label> <input type="text" name="usuario" placeholder="Digite seu E-mail" required pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"/> </label> <label> <span class="senha_txt"></span> <input type="password" name="senha" class="senha" placeholder="Digite sua senha"required="required" maxlength="100" /> <p><a href="index.php?pg=contatos">Esqueci minha senha</a></p> </fieldset> <fieldset id="btn"> <input type="submit" name="Enviar" Value="Entrar" class="btn"/> </fieldset> </label> </form> </section> </div> <footer id="rodape"> </Footer> </body>
  2. Verdade estava olhando sobre o assunto, obrigado
  3. Olá pessoal solicito ajuda se possivél nessa busca com paginação, onde até funciona a busca mas quanto a paginção não aparesce resultado na proxima pagina. sou novato no assunto, e não consegui descobrir o porquê grato... <?php function quimovel_categoria2(){ include"Connections/config.php"; $imovelStatus = 'completo'; $operacao = $_POST['operacao']; $dataVal = date('Y-m-d H:m:s'); $pag = "$_GET[pag]"; if($pag >= '1'){ $pag = $pag; }else{ $pag = '1'; } $maximo = '1'; //RESULTADOS POR PÁGINA $inicio = ($pag * $maximo) - $maximo; $sql = 'SELECT * FROM quimovel_imoveis WHERE imovelStatus = :imovelStatus AND imovelTermino >= :dataVal AND imovelTipo = :imovelTipo ORDER BY imovelId DESC LIMIT '.$inicio.','.$maximo; try{ $query = $conecta->prepare($sql); $query->bindValue(':dataVal',$dataVal,PDO::PARAM_STR); $query->bindValue(':imovelStatus',$imovelStatus,PDO::PARAM_STR); $query->bindValue(':imovelTipo',$operacao,PDO::PARAM_STR); $query->execute(); $resultado = $query->fetchAll(PDO::FETCH_ASSOC); }catch(PDOexception $error_imovels){ echo 'Erro ao selecionar os imoves!'; } foreach($resultado as $res){ $imovelID = $res['imovelId']; $tipo = $res['imovelTipo']; $negocio = $res['imovelNegocio']; $valor = $res['imovelValor']; $thumb = $res['imovelThumb']; $titulo = $res['imovelTitulo']; $cidade = $res['imovelCidade']; echo '<li>'; echo '<fieldset><a href="index.php?pg=single&imovel='.$imovelID.'"><img src="timthumb.php?src=midias/'.$thumb.'&h=100&w=150&zc=1" alt="'.$titulo.'" title="'.$titulo.'" border="0" /></a>'; echo '<h2><a href="index.php?pg=single&imovel='.$imovelID.'">'.$titulo.'</a></h2>'; echo '<h3><a href="index.php?pg=single&imovel='.$imovelID.'">Valor R$'.$valor.'</a></h3>'; echo '<a href="index.php?pg=single&imovel='.$imovelID.'" class="veja_mais">'.$cidade.'</a>'; echo '</li></fieldset>'; } if ($res == 0) { echo "<h1>Não foi encontrado resultados para: '$operacao'</h1>"; } error_reporting (E_ALL & ~ E_NOTICE & ~ E_DEPRECATED); /* tramento de advertencia para que não exiba*/ $con = mysql_connect("localhost", "root", "vertrigo"); //<<<<<< criei uma variavel puxando a conexão direto e o banco>>>>>>>> mysql_select_db("imobi", $con); //USE A MESMA SQL QUE QUE USOU PARA RECUPERAR OS RESULTADOS //SE TIVER A PROPRIEDADE WHERE USE A MESMA TAMBÉM $sql_res = mysql_query("SELECT * FROM quimovel_imoveis WHERE imovelStatus = 'completo' ORDER BY imovelId DESC"); $total = mysql_num_rows($sql_res); $paginas = ceil($total/$maximo); $links = '2'; //QUANTIDADE DE LINKS NO PAGINATOR echo "<a href=\"index.php?pg=categorias&amp;pag=1\">Primeira Página</a>&nbsp;&nbsp;&nbsp;"; for ($i = $pag-$links; $i <= $pag-1; $i++){ if ($i <= 0){ }else{ echo"<a href=\"index.php?pg=categorias&amp;pag=$i\">$i</a>&nbsp;&nbsp;&nbsp;"; } }echo "$pag &nbsp;&nbsp;&nbsp;"; for($i = $pag +1; $i <= $pag+$links; $i++){ if($i > $paginas){ }else{ echo "<a href=\"index.php?pg=categorias&amp;pag=$i\">$i</a>&nbsp;&nbsp;&nbsp;"; } } echo "<a href=\"index.php?pg=categorias&amp;pag=$paginas\">Última página</a>&nbsp;&nbsp;&nbsp;"; } ?>
×
×
  • Criar Novo...