J'ai un souci pour faire passer un parametre dans une URL :
Je veux faire afficher les annonces suivant leur theme donc je passe le theme des annonce en parametre.
Mon probleme c'est quant je clique sur un lien j'arrive sur la page d'internet explorer (erreur 404).
Pourtant j'ai tout ce qu'il faut dans l'url
http://cadreannonceconsulter_ok.php?choix=accessoires
Voila mon code :
Premier fichier :
<?
$query_annonce="SELECT * FROM annonce ORDER BY choix";
$result_annonce=mysql_query($query_annonce);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Style1 { font-size: 12px;
color: #999999;
}
.Style3 {
font-size: 24px;
color: #CC3333;
font-weight: bold;
font-style: italic;
}
.Style4 {color: #FFFFFF}
-->
</style>
</head>
<body>
<table width="830" height="466" border="0" cellpadding="0" cellspacing="0" background="../images/fondrose1.gif">
<tr>
<td width="34" valign="top"> </td>
<td width="791" height="466" valign="top">
<?
while($val_annonce=mysql_fetch_array($result_annonce)){
echo "<li><a href=\"cadreannonceconsulter_ok.php?choix=".$val_annonce["choix"]."\">".$val_annonce["choix"]."</a></li>";
}
?>
Deuxieme fichier :
<? if(!isset($_GET["choix"])){ $_GET["choix"]="";}
$choix=$_GET["choix"];
$query_annonce="SELECT * FROM annonce WHERE choix='$choix'";
$result_annonce=mysql_query($query_annonce);
while($val_annonce=mysql_fetch_array($result_annonce)){
echo "<h3>".$val_annonce["email"]."</h3>".$val_annonce["annonce"];
} ?>
Merci