• User Attivo

    Motore di ricerca

    Ciao a tutti, rieccomi
    vi dico subito che il problema non è tanto ricercare ma far apparire.
    vi spiego:
    un utente inserisce il suo indirizzo email e dovrà ricevere dei risultati
    ho una pagina richiesta_annunci.php
    [PHP]
    <form action="search_richiesta.php" method="post">
    <table width="740" cellpadding="0" cellspacing="0" border="0" bordercolor="#CC0000">
    <tr>
    <td valign="top" height="45">
    <font size="5" face="Palatino Linotype, Arial, Verdana, Century Gothic, Helvetica">
    Richiesta annunci
    </font>
    </td>
    </tr>
    <tr>
    <td height="20">
    <font size="1" face="MS Reference Sans Serif, Palatino Linotype, Arial, Verdana, Century Gothic, Helvetica">
    Inserisci il tuo indirizzo e_mail
    </font>
    </td>
    </tr>
    <tr>
    <td><input type="text" name="txt_richiesta_annunci"
    style="font-family: MS Reference Sans Serif, Palatino Linotype, Arial, Verdana, Century Gothic, Helvetica; font-size: 8pt; width:240px;"></td>
    </tr>
    <tr>
    <td height="40">
    <input type="image" value="richiesta" img src="images/t_invia_3.jpg" border="0" />
    </td>
    </tr>
    </table>
    </form>
    [/PHP]
    Questa punta a search_richiesta.php
    [PHP]
    require 'Config.php';
    require 'Connect.php';
    if(isset($_POST['txt_richiesta_annunci']))
    {
    $r_annunci=trim($_POST['txt_richiesta_annunci']);

    if(get_magic_quotes_gpc())
    {
    $r_annunci=stripslashes($r_annunci);
    }
    $r_annunci=htmlspecialchars($r_annunci);
    $r_annunci=mysql_real_escape_string($r_annunci);

    if(!$r_annunci)
    {
    header('location:'.'index.php?pag=avviso');
    exit;
    }
    else
    {
    $query_richiesta_annunci=mysql_query
    ("Select * From annuncio Where email='$r_annunci'")
    or die("errore nella query;".mysql_error());
    header('location:'.'index.php?pag=visualizza_annunci');
    }
    }
    [/PHP]
    Come potete notare il uso la variabile $pag per caricare la pagina
    Ciò che vorrei sapere è: primo. se è giusto creare una terza pagina (visualizza_annunci) oppure potrei utilizzare una delle due pagine che ho già. secondo. come faccio a passare la variabile $r_annunci alla pagina che visualizzerà i dati?
    a me qualcosa succede ma mi si apre una nuova pagina, anche inserendola in $pag

    ciao da danny