Jump to content
Fórum Script Brasil
  • 0

Pesquisar valores usando GET


Well_PHP

Question

Olá pessoal,

Tenho uma página com as seguintes variaveis:

$id,$nome,$endereco,$telefone
Estou tentando pegar o valor de cada página assim:
<a href="noticia.php?id=<?php echo $id ?>">Ver mais</a>
Porém quando clico ele está me dando todas as notícias, ao invés da notícia correspondente a $id
$id       = $_GET["id"]; 
$nome     = $_GET["nome"];
$endereco = $_GET["endereco"];
$telefone = $_GET["telefone"];

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

ESerra, estou fazendo a busca por .TXT

<?php
      
      $id             = $_REQUEST["id"]; 
      $nome       = $_REQUEST["nome"];
      $endereco  = $_REQUEST["endereco"];
      $telefone    = $_REQUEST["telefone"];

$dir = "./";

$abredir = opendir($dir);

while ($id= readdir($abredir)) {
    if ($id!= "." && $id!= ".." && is_file($id) && ereg(".txt", $id)) {
    $abre = fopen($id,"r");

        $le = fread($abre,filesize($id));

        $dado = explode("|",$le);

        $nome      = $dado['0'];
        $endereco = $dado['1'];
        $telefone   = $dado['2'];
        
        $id;
        $id= str_replace(".txt","",$id);

        
?>

Troquei po $_REQUEST , mas não funcionou.

Link to post
Share on other sites

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
      149296
    • Total Posts
      645693
×
×
  • Create New...