Je pense que ça vien dta fonction en javascript :
tu a mis
popUp = window.open("result.php?id=id","resultat","width=420,height=255");
je pense que
popUp = window.open("result.php?id=" + id,"resultat","width=420,height=255");
marchera mieu, pq la, il t'ouvrai la fenetre avec comme id : "id" et pa le contenu de la var id
Bye
\* --
Seb -- */
-------------------------------
Réponse au message :
-------------------------------
> Hello à tous, voici mon problème
> j'ai un petit moteur de recherche qui m'affiche des liens
> et lorsque je clique dessus cela doit m'ouvrir une popu
> avec ces données. Mais malheureusement il m'affiche bien
> une popup avec des données mais toujours les mêmes
> meme si je clique sur un lien différent. ( je ne sais plus quoi
> faire,je suis débutant et cela fait 4 jours que je tourne en rond) quelqu' aurait-il une idée (cela me sauverait la vie)
>
> Voici mon code (si quelqu'un veut que je lui envoie le fichier pour qu'il puisse m'aider il n'y a pas de problème)
>
> merci encore!!!!!
>
>
> <HTML>
> <HEAD>
> <TITLE>** Moteur Prêt inter bibliothèque **</TITLE>
> <!-- <LINK href="en-us_main.css" rel=stylesheet type=text/css xmlns=""> -->
> <STYLE>
> BODY { font-family: Verdana; font-size: 12px; color: #1C2D67 }
> TD { font-family: Verdana; font-size: 12px; color: #1C2D67 }
>
> A:link { text-decoration: none}
> A:visited { text-decoration: none}
> A:hover { text-decoration: underline}
> A:active { text-decoration: underline}
> A {font-family: Verdana, Arial, Helvetica;font-size:12px;color:#1C2D67;font-weight:}
>
> A.off {font-family:Verdana;font-size:12px;color:#1C2D67;font-weight:}
> </STYLE>
>
>function OuvrirPopup(id) {
> popUp = window.open("result.php?id=id","resultat","width=420,height=255");
> }
>
>
>
> </script>
> <?php
>
>
> $cfg_nbres_ppage= 10; //nombre de réponse par page
> $cfg_nb_pages = 5; //nombre de n° de page dans la barre de navigation
> $table = 't_principale ';
> $champs = 'id, NomBiblio';
> include("connexion.php");
> require("common.php");
>
> //on regarde si il faut rechercher des mots clés
> $mots = str_replace('%', '', $mots);
> $mots = str_replace('_', '', $mots);
> $mots = trim($mots);
>
> if ($mots != '')
> {
> $where = "WHERE MotCle LIKE '%".addslashes($mots)."%'";
> $criteres = "?mots=".urlencode($mots);
> }
> else
> { $where = '';
> $criteres = "?";
> }
> // Recherche du nombre de lignes
> $sql = 'SELECT count(*) ';
> $sql .= 'FROM '.$table;
> $sql .= $where;
> //echo $sql;
>
> $resultat = mysql_query($sql); //on envoie le résultat de la requête sql à la variable $resultat
> $enr = mysql_fetch_array($resultat);
> //-------------------------------------------------------
> // Zone de recherche
> //------------------------------------------------------
> print "<table border=\"0\" width=\"100%\">
> <tr>
> <td >Moteur de recherche du prêt interbibliothèques <img src=\"img/Search3.gif\" border=\"0\" width=\"26\" height=\"30\" ></td>
> </tr>
> <tr>
> <td ><img src=\"img/yellow_space.gif\" border=\"0\" width=\"34%\" height=\"1\"></td>
> </tr>
> </table>";
>
>
> echo "<FORM METHOD=GET>\n";
> echo "<B>Rechercher</B> ";
> $mots = stripslashes(htmlspecialchars($mots));
> echo "<INPUT TYPE='text' NAME='mots' VALUE=\"".$mots."\">";
> echo " <INPUT TYPE='submit' VALUE='Go !'>";
> echo "</FORM>\n";
>
> if (($nbtotal = $enr[0])==0)
> {
> echo 'Aucune réponse trouvée';
> }
> else
> {
> if (!isset($debut)) $debut=0;
>
> //recherche des réponses
> $sql = 'SELECT '.$champs.' ';
> $sql .= 'FROM '.$table.' ';
> $sql .= $where;
> $sql .= ' ORDER BY id DESC';
> $sql .= ' LIMIT '.$debut.','.$cfg_nbres_ppage;
> // echo $sql;
> $resultat = mysql_query($sql);
> $nbenr = mysql_num_rows($resultat);
>
> //plage de réponses
> $barre_nav = '<TABLE BORDER=0 WIDTH="60%" CELLPADDING=3 CELLSPACING=1>';
> $barre_nav .= '<TR><TD BGCOLOR=#DCDCDC WIDTH="40%" ALIGN="left">';
> $barre_nav .= 'Réponse(s) <b>'.($debut+1).'</b> à <b>'.($debut + $nbenr).'</b>';
> $barre_nav .= ' sur <b>'.$nbtotal.'</b></td>';
>
> //barre de navigation
> $barre_nav .= "<TD BGCOLOR=#FFFF00 ALIGN='left' WIDTH='60%'> ";
> if ($nbtotal > $cfg_nbres_ppage)
> {
> $barre_nav .= barre_navigation($nbtotal, $nbenr,
> $cfg_nbres_ppage,
> $debut, $cfg_nb_pages,
> $criteres);
> }
> $barre_nav .= "</td></tr></table>\n";
>
> //affichage de la barre de navigation
> echo $barre_nav;
> //affichage des données
> $cpt=0;
> echo "<table border=0 cellpadding=2 cellspacing=2 width='60%'>";
> while ($enr = mysql_fetch_array($resultat))
> {
> echo afficher_ligne($debut + $cpt + 1, $enr);
> $cpt++;
> }
> echo "</table>\n";
>
>
>
>
>
>
>
>
> }
> //--------------------------------------------------------------
> // barre de navigation
> //--------------------------------------------------------------
> function barre_navigation($nbtotal, $nbenr,
> $cfg_nbres_ppage,
> $debut, $cfg_nb_pages,
> $criteres)
> {
> // pages 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . 10
> // -------------------------------------------------------------------
> $query = $criteres.'&debut=';
> if ($debut >= ($cfg_nb_pages * $cfg_nbres_ppage))
> {
> $cpt_fin = ($debut / $cfg_nbres_ppage) + 1;
> $cpt_deb = $cpt_fin - $cfg_nb_pages + 1;
> }
> else
> {
> $cpt_deb = 1;
>
> $cpt_fin = (int)($nbtotal / $cfg_nbres_ppage);
> if (($nbtotal % $cfg_nbres_ppage) != 0) $cpt_fin++;
>
> if ($cpt_fin > $cfg_nb_pages) $cpt_fin = $cfg_nb_pages;
> }
>
> for ($cpt = $cpt_deb; $cpt <= $cpt_fin; $cpt++)
> {
> if ($cpt == ($debut / $cfg_nbres_ppage) + 1)
> {
> $barre .= "<b>pages</b> <A CLASS='off'> ".$cpt." </A> ";
> }
> else
> {
> $barre .= "<A HREF='".$query.(($cpt-1)*$cfg_nbres_ppage);
> $barre .= "'> ".$cpt." </A> ";
> }
> }
> return($barre);
> }
> //------------------------------------------------------------------
> // afficher ligne
> //------------------------------------------------------------------
> function afficher_ligne($cpt, $enr)
> {
> //alternance des couleurs des lignes de réponses
> $couleur = ($cpt % 2) ? '#FFFF99' : '#FFFFCC';
>
> echo '<tr bgcolor="'.$couleur.'">';
>
> //n° de réponse
> echo '<td align="right" nowrap width="1%"> <b>'.$cpt.'</b>. </td>';
> // nom de la bibliothèque
> echo '<td align="left" nowrap width="100%"> ';
> // echo "<A HREF='result.php?id=".$enr['id']."'>";
> echo "<A href='javascript:OuvrirPopup($enr[id])'>";
> echo $enr['NomBiblio'];
> echo "</A>";
>
> echo ' </td>';
> echo '</tr>';
> }
>
>
> echo $enr[id];
>
>
>
>
> ?>
>
>
> </head>
> <body>
>
>
> </body>
> </html>
>
>
>