Code : Tout sélectionner
http://monsite.fr/reponse/crapeauCode : Tout sélectionner
RewriteEngine OnCode : Tout sélectionner
RewriteBase /ton-dossierCode : Tout sélectionner
RewriteBase /Code : Tout sélectionner
RewriteRule ^reponse/crapeau$ reponse.php?Nom=crapeau [L]Code : Tout sélectionner
RewriteRule ^reponse/([0-9]+)$ reponse.php?Choix=$1 [L]Code : Tout sélectionner
RewriteEngine On
RewriteBase /
RewriteRule ^reponse/crapeau$ reponse.php?Nom=crapeau [L]
RewriteRule ^reponse/([0-9]+)$ reponse.php?Choix=$1 [L]Code : Tout sélectionner
RewriteEngine On
RewriteBase /
RewriteRule ^reponse/crapeau$ reponse.php?Nom=crapeau [L]
RewriteRule ^reponse/([0-9]+)$ reponse.php?Choix=$1 [L]
Code : Tout sélectionner
<?php include 'Includes/Haut.php'; ?>
<?php include("Includes/Base_Donnees.php");
$id = mysql_real_escape_string($_GET['Choix']);
$id = $_GET["Choix"] ;
//requête SQL:
$req = "SELECT pages.Id_Pages, Nom_Pages, Texte_Pages, Cle1, Cle2, Cle3, Cle4
FROM pages
WHERE pages.Id_Pages = ".$id;
//exécution de la requête:
$result = mysql_query($req) or die($req."<br />\n".mysql_error());
//affichage des données:
while($Mon_Resultat = mysql_fetch_array($result))
{ ?>
<div class="border-title" alt="<?php echo $Mon_Resultat['Nom_Pages']; ?>" title="<?php echo $Mon_Resultat['Nom_Pages']; ?>"> <h2><?php echo $Mon_Resultat['Nom_Pages']; ?><span> </span> </h2> </div>
<h4><?php echo $Mon_Resultat['Texte_Pages']; ?></h4>
<!--Liste des Mot clés -->
<aside class="widget widget_tag_cloud">
<h3 class="widgettitle"> <a href="#" title="">Mot Clés</a> </h3>
<div class="tagcloud">
<p alt="<?php echo $Mon_Resultat['Cle1']; ?>" title="<?php echo $Mon_Resultat['Cle1']; ?>"><?php echo $Mon_Resultat['Cle1']; ?></p>
<p alt="<?php echo $Mon_Resultat['Cle2']; ?>" title="<?php echo $Mon_Resultat['Cle2']; ?>"><?php echo $Mon_Resultat['Cle2']; ?></p>
<p alt="<?php echo $Mon_Resultat['Cle3']; ?>" title="<?php echo $Mon_Resultat['Cle3']; ?>"><?php echo $Mon_Resultat['Cle3']; ?></p>
<p alt="<?php echo $Mon_Resultat['Cle4']; ?>" title="<?php echo $Mon_Resultat['Cle4']; ?>"><?php echo $Mon_Resultat['Cle4']; ?></p>
</div>
</aside>
<!--Liste des Mot clés -->
<?php ;
} ?>
</ul>
<?php include 'Includes/Bas.php'; ?> Code : Tout sélectionner
<?php
$req = "SELECT * FROM pages WHERE Id_Categories = 6 ORDER BY RAND( ) LIMIT 0,6 " ;
$result = mysql_query($req) or die($req."<br />\n".mysql_error());
//affichage des données:
while($Mon_Resultat = mysql_fetch_array($result)){?>
<li><?php echo"<a href=\"reponse.php?Choix=".$Mon_Resultat['Id_Pages']."\">".$Mon_Resultat['Nom_Pages']."</a>";?></li>
<?php ; } ?>Code : Tout sélectionner
SELECT pages.Id_Pages, Nom_Pages, Texte_Pages, Cle1, Cle2, Cle3, Cle4 FROM pages WHERE pages.Id_Pages =
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3$req = "SELECT Id_Pages, Nom_Pages, Texte_Pages, Cle1, Cle2, Cle3, Cle4
FROM pages
WHERE Id_Pages = ".$id;
PS: le code suivant n'est pas sécurisé:$id = mysql_real_escape_string($_GET['Choix']);
$id = $_GET["Choix"] ;
On en parle après