Bonjour,
j'ai une fonction show qui me permet(tra) d'afficher un "master" , le resultat d'un select. (plusieurs lignes en retour) chacune de ces lignes comporte un lien vers une page détail.php qui donne plus de precisions.
voici le code :$this->link vaut :Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 function show(){ $rtn = "<TABLE class=grid cellSpacing=1 width='100%' border=0><TBODY>"; $rtn .= $this->header(); if ($this->result){ for($i = 0 ; $i< $this->nr ; $i++){ $row = mysql_fetch_array($this->result); echo $this->link."<br>"; eval($this->link); echo $lien; $rtn .= "<a href=".$lien.">"; $data = $i%2+1; $rtn .="<tr class=data".$data.">"; for($j=0; $j < $this->nf; $j++){ $fn = mysql_field_name ($this->result, $j); $rtn .= "<td noWrap align=middle>".$row[$fn]."</td>"; } $rtn .="</tr></a>"; } }else{ //return "pas de resultats"; } $rtn .= "</TBODY></TABLE>"; return $rtn; }// end show
mon message d'erreur est :Code:\$lien = "detail.php?id=$row['ID']";
j'ai retrituré ce code pour que le lien fonctionne sans succes.Code:
1
2
3
4
5
6
7
8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in h:\easyphp1-8\www\tfe\OO\master.inc(36) : eval()'d code on line 1 Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in h:\easyphp1-8\www\tfe\OO\master.inc(36) : eval()'d code on line 1 Notice: Undefined variable: lien in h:\easyphp1-8\www\tfe\OO\master.inc on line 37 Notice: Undefined variable: lien in h:\easyphp1-8\www\tfe\OO\master.inc on line 38
QQn a une idée?(Kirkis? Mr N. ? ;-) )
Merci d'avance