Jump to content
Fórum Script Brasil
  • 0

Script de Busca


Ljrbrasil

Question

Pessoal

localizei este script de busa e estou precisando mas não consegui utiliza-lo. Fiz todas as configuraçoes necessarias mas o mesmo não consegue fazer a busca.

alguém poderia me ajuda gostaria de buscar um numero de telefone e ele localizar o cliente e a data e plano.

From.php

<form action="consulta.php" method="post">
  <p> 
    <input name="localizacao" type="text">
  </p>
  <p>
    <input type="submit" name="Submit" value="ok">
  </p>
</form>
consulta.php
<?
//**************************************************************************
function conectar($dbNome)
{
  $db = mysql_connect("SERVIDOR MYSQL","USUÁRIO MYSQL","SENHA MYSQL "); //mysql_connect("domain","login","password")
  mysql_select_db($dbNome);

  if (!$db)
  {
    echo("Erro de conexão ".mysql_error()."\n");
    exit;
  }
}

//**************************************************************************

function bg_cell($contador)
{
    $resto = $contador % 2;
    if ($resto == '1')
        echo "#EEEEEE";
    else
        echo "#DDDDDD"; 
}

//**************************************************************************

$dbNome = "NOME DO BANCO DE DADOS";
conectar($dbNome);

$sql = ("select * from livrodevisitas where acesso LIKE '$localizacao'");
$result = mysql_query ($sql);

?>

<head>
<STYLE>
A{
        COLOR: #003366; TEXT-DECORATION: none
}
A:visited {
        COLOR: #003366; TEXT-DECORATION: none
}
A:hover {
        COLOR: red; TEXT-DECORATION: none
}

</STYLE>
</head>
<body>
<p align="center"><strong><font color="#999999" size="5"><tt>MYSQL Search</tt></font></strong></p>
<TABLE WIDTH="58%" BORDER="1" align="center" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="#000000">
  <?php
       $contador = '1';
    while ( $valor = mysql_fetch_array($result) )
    {
?>
  <TR  BGCOLOR="<?php bg_cell($contador);?>"> 
    <TD WIDTH="113" bgcolor="#CCCCCC"> <div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Campo 
        1 :</strong></font></div></TD>
    <TD WIDTH="333" bgcolor="#FFFFFF"> <div align="left"><font face="Times New Romam"><strong><font color="#999999"> 
         <?php echo $valor["campo1"];?></font></strong></font></div></TD>
  </TR>
  <TR  BGCOLOR="<?php bg_cell($contador);?>"> 
    <TD WIDTH="113" bgcolor="#CCCCCC"> <div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Campo 
        2 :</strong></font></div></TD>
    <TD WIDTH="333" bgcolor="#FFFFFF"> <div align="left"><font face="Times New Romam"><strong><font color="#999999"> <?php echo $valor["campo2"];?></font></strong></font></div></TD>
  </TR>
  <TR  BGCOLOR="<?php bg_cell($contador);?>"> 
    <TD WIDTH="113" bgcolor="#CCCCCC"> <div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Campo 
        3 *:</strong></font></div></TD>
    <TD WIDTH="333" bgcolor="#FFFFFF"> <div align="left"><font face="Times New Romam"><strong><font color="red"> <?php echo $valor["campo3"];?></font></strong></font></div></TD>
  </TR>
  <?php
    $contador++;
    } //end while
?>
</TABLE>
<p>* Campo a ser buscado.</p>
<p> </p>
<p>dúvidas: lyppe@pop.com.br</p>
<p align="center"> </p>
</body>

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...