• User Attivo

    problema aggiornare pagina

    ciao ragazzi ho questo problema:

    ho una pagina formcontatti in cui ho un elenco di contatti presi dal db, ora se clicco su elimina mi si apre una finestra in cui se digito ok elimina il contatto dalla tabella del db e la finestra si chiude. però il problema è che se non aggiorno la pagina il contatto rimane visualizzato nella pagina formcontatti.io vorrei che dopo che chiudo la finestra mi aggiorni la pagina facendo sparire il contatto.

    mi potete dare un aiuto xfavore xche mi sono bloccato

    Codice PHP:
     		 		[LEFT] 			 <?php 
    

    //Includo i file per la connessione
    //e per la verifica Utente
    require_once('connessione.php');
    require_once('verificalogin.php');

    ?>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript" src="/componente/funzioni.js">
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Documento senza titolo</title></head>

    <body>
    <p><strong>AGGIUNGI NUOVI CONTATTI AL TUO GRUPPO </strong></p>
    <p><a href="formaggiungicontatti.php?idlista=<?=$_GET[idlista]?>">Aggiungi un nuovo contatto</a></td>

    </body>
    </html>
    <?php

    if(IsSet($_SESSION['utenteM'])){

    $user=$_SESSION['utenteM'][0];
    //echo $user;

     $query1 ="Select * from include where idlista = '$_REQUEST[idlista]'";  
     $result1 = mysql_query($query1) or die("Errore nella query1:".mysql_error());  
     $numrows = mysql_num_rows($result1); 
      
    // echo $numrows; 
      
      
      
     $query1 ="Select * from include where idlista = '$_REQUEST[idlista]'";  
     $result1 = mysql_query($query1) or die("Errore nella query1:".mysql_error());  
     for($x=0; $x<$numrows; $x++){ 
     $resrow = mysql_fetch_row($result1); 
     $idutente=$resrow['1']; 
    
     //echo $idutente; 
      
     $query2 ="Select * from utente WHERE idutente = '$idutente'"; 
     $ris=mysql_query($query2) or die("Errore nella query2:".mysql_error()); 
      $row = mysql_fetch_assoc($ris);  
     $nome = $row['nome']; 
    

    //echo "<br>$nome";

     ?> 
      
     <table width="98" border="2"> 
     <tr> 
    
    <td width="86" height="42"><?php  echo $nome; ?></a> 
    

    <td height="40" colspan="4"><a href="formeliminacontatto.php?idutente=<?=$idutente?>" onClick="newWindow(this.href, 'popup', 300, 150, 1, 1, 0, 0, 0, 1, 0); return false;" target="_blank">elimina contatto</a><p> </p></td>

    <?php echo "<br>"; ?></td> 
    </tr> 
    

    </table>

     <?php 
      
         } 
     ?> 
      
     
         
    <?php 
    

    }// chiusura if
    else
    {
    echo "errore";

    }

    ?> [/LEFT]

    Codice PHP:
     		 		[LEFT] 			 <!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>Documento senza titolo</title>
    </head>

    <body>
    <?php
    $idutente= $_REQUEST[idutente];
    //echo $idutente;
    ?>

    Sei sicuro di voler eliminare?
    <form name="formok" method="post" action="eliminacontatto.php">
    <input name="idutente" type="hidden" value="<?php echo $idutente;?>">
    <input name="ok" type="submit" value="ok" onClick="window.close()"/>
    </p>
    </form>
    <form name="formmannulla" method="post" action="modificatutor.php">
    <input name="Input" type="submit" value="annulla" onClick="window.close()";/>
    </form>

    </body>
    </html> [/LEFT]

    Codice PHP:
     		 		 			 <?php 
    

    //Includo i file per la connessione
    //e per la verifica Utente

    require_once('connessione.php');
    require_once('verificalogin.php');

    $idutente = $_POST['idutente'];

    if(IsSet($_SESSION['utenteM'])){

    $query = "DELETE FROM utente WHERE idutente='$_REQUEST[idutente]'";  
    $ris=mysql_query($query) or die("Errore nella query:".mysql_error()); 
     
    $query = "DELETE FROM include WHERE idutente='$_REQUEST[idutente]'";  
    $ris=mysql_query($query) or die("Errore nella query:".mysql_error()); 
      
    //$var = $_REQUEST[idlista]; 
     //echo $var; 
    

    //echo "<br><a href='formliste.php'>Torna all' homepage</a>";

    }else
    {
    echo "errore";

    }

    ?>