if (isset($_GET["opt"])) { if ($_GET["opt"] == "fichep") { $sqlmainname=mysql_query("SELECT * from ".$tableproduits." where id='".$_GET["refp"]."'"); $nomchamp = "ptitre"; } else { $sqlmainname=mysql_query("SELECT * from ".$tablepages." where id='".$_GET["refp"]."'"); $nomchamp = "nompage"; } while($rowmainname=mysql_fetch_array($sqlmainname)) { if ($rowmainname["tagtitlepage"] == "" ) { $lemetat = $defaulttat; } else { $lemetat =$rowmainname["tagtitlepage"];} if ($rowmainname["tagdescpage"] == "" ) { $lemetad = $defaulttad; } else { $lemetad =$rowmainname["tagdescpage"];} if ($rowmainname["tagkeypage"] == "" ) { $lemetak = $defaulttak; } else { $lemetak =$rowmainname["tagkeypage"];} $nomdelapage=$rowmainname[$nomchamp]; } } elseif (isset($_GET["refp"])) { $reqmeta=mysql_query("SELECT nompage,tagtitlepage,tagdescpage,tagkeypage from $tablepages where id='".$_GET["refp"]."'"); while($metarow=mysql_fetch_array($reqmeta)) { if ($metarow["tagtitlepage"] == "" ) { $lemetat = $defaulttat; } else { $lemetat =$metarow["tagtitlepage"];} if ($metarow["tagdescpage"] == "" ) { $lemetad = $defaulttad; } else { $lemetad =$metarow["tagdescpage"];} if ($metarow["tagkeypage"] == "" ) { $lemetak = $defaulttak; } else { $lemetak =$metarow["tagkeypage"];} $nomdelapage=$metarow["nompage"]; } } else { $lemetat = $defaulttat; $lemetad = $defaulttad; $lemetak = $defaulttak; } ?>