Cases a cocher et boutons radios

sofi81 Messages postés 2 Date d'inscription mercredi 13 juin 2007 Statut Membre Dernière intervention 13 juin 2007 - 13 juin 2007 à 17:11
coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 - 13 juin 2007 à 17:40
salt a tous;
voila j'ai cree un formulaire ou je dois cocher soit des cases ou selectionner des boutons radios; apres je dois afficher tous ce que jai selectionner sous forme de liste mais le probleme c'est qu'il me ramene rien voila !!!!
voila mon bout de code

<?
if(empty($page))
$page = 1;
else
 $page=$_GET['page'];


$chox1=$_GET['vente'];
$chox2=$_GET['location'];
$chox3=$_GET['echange'];
if ($chox1=="" && $chox2=="" && $chox3=="")
{
$chox1="1";
$chox2="2";
$chox3="3";


}
$agence=$_GET['agence'];
$trans=$_GET['type_transaction'];




$deb=$_GET['datdeb'];
 if(deb=="")
 $deb=date('d/m/y');
$dfin=$_GET['datfin'];
 if($dfin=="")
 $dfin=date('d/m/y');
 
 /*$prixmin=$_GET['prixmin'];
 if($prixmin=="")
 $prixmin=0;
 
 if($prixmax=="")
 $prixmax=1000000000;*/
 $wil=$_GET['wilaya'];
 $prix=$_GET['prix_appartement'];


//----------------------------------------------------------------


// Déclaration des variables
$nb_rep_pages=5; // Nombre de réponses par pages


//on se connecte à la base de donnée
include("../../classe/sql.php");
// Initialisation des variables


if(empty($fin)){
if(isset($bien))
{$bien=$_GET['bien'];


if($type_client=="tous")
 {
 
$sql = "select count(*) as num_appt from appartement where wilaya='$wilaya' and date>='$deb' and date<='$dfin' and type_transaction='$trans' in ('$chox1','$chox2','$chox3')";


}
else
if($type_client=="particulier")
 {


$sql = "select count(*) as num_appt from appartement where wilaya='$wilaya'  and type_client='$type_client'  and date>='$deb' and date<='$dfin' and type_transaction='$trans' in ('$chox1','$chox2','$chox3')";


}
else
if($type_client=="agence")
 {


$sql = "select count(*) as num_appt from appartement where type_client='$type_client' and num_client='$agence' and wilaya='$wilaya' and type_transaction='$trans' and date>='$deb' and date<='$dfin' and type_transaction='$trans' in ('$chox1','$chox2','$chox3','$chox4','$chox5') ";


}
$p = @mysql_query($sql);
$fin = @mysql_result($p,"0","num_appt");
}
}
// Déclaration de la variable début
$debut = ($page - 1) * $nb_rep_pages;


if($type_client=="tous")
 {
 
//la requète de selection des messages
$req = mysql_query("SELECT *  from appartement where wilaya='$wilaya'  and date>='$deb' and date<='$dfin'  and type_transaction='$trans' in ('$chox1','$chox2','$chox3') ORDER BY date DESC LIMIT $debut,$nb_rep_pages ") or die ("erreur requete");


}
else
if($type_client=="particulier")
{
$req = mysql_query("SELECT *  from appartement where wilaya='$wilaya'  and date>='$deb' and date<='$dfin' and type_client='particulier' and type_transaction='$trans' in ('$chox1','$chox2','$chox3') ORDER BY date DESC LIMIT $debut,$nb_rep_pages ") or die ("erreur requete");
}
else
if($type_client=="agence")
 {
 $req = mysql_query("SELECT *  from appartement where wilaya='$wilaya' and date>='$deb' and date<='$dfin' and type_client='agence' and num_client='$agence' and type_transaction='$trans' in ('$chox1','$chox2','$chox3') ORDER BY date DESC LIMIT $debut,$nb_rep_pages ") or die ("erreur requete");
 }


 


// Ici on calcul le nombre de page
$nbpages = ceil($fin / $nb_rep_pages); // Ici on arrondi


// Affichage par page :)
 
?>
merci de votre aide

3 réponses

coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 44
13 juin 2007 à 17:18
if(empty($page))
$page = 1;
else
 $page=$_GET['page'];

=>

if(empty($_GET['page']))
$page = 1;
else
 $page=$_GET['page'];

ensuite, parfois t'as des @ parfois des or die pour tes requettes... vire tout les @ met des or die partout... on y vera deja plus clair

ensuite, dit si t'as un message d'erreur.

<hr />une recherche sur exalead vous aurait peut-etre evite de poser cette question

In a dream, I saw me, drop dead...
U were there, U cried...
It was just a dream,
if I die, U won't cry, maybe, U'll be happy
0
sofi81 Messages postés 2 Date d'inscription mercredi 13 juin 2007 Statut Membre Dernière intervention 13 juin 2007
13 juin 2007 à 17:37
voila je l'est fait
<?
if(empty($page))
$page = 1;
else
 $page=$_GET['page'];


$chox1=$_GET['vente'];
$chox2=$_GET['location'];
$chox3=$_GET['echange'];
if ($chox1=="" && $chox2=="" && $chox3=="")
{
$chox1="1";
$chox2="2";
$chox3="3";


}
$agence=$_GET['agence'];
$trans=$_GET['type_transaction'];




$deb=$_GET['datdeb'];
 if(deb=="")
 $deb=date('d/m/y');
$dfin=$_GET['datfin'];
 if($dfin=="")
 $dfin=date('d/m/y');
 
 /*$prixmin=$_GET['prixmin'];
 if($prixmin=="")
 $prixmin=0;
 
 if($prixmax=="")
 $prixmax=1000000000;*/
 $wil=$_GET['wilaya'];
 $prix=$_GET['prix_appartement'];


//----------------------------------------------------------------


// Déclaration des variables
$nb_rep_pages=5; // Nombre de réponses par pages


//on se connecte à la base de donnée
include("../../classe/sql.php");
// Initialisation des variables


if(empty($fin)){
if(isset($bien))
{$bien=$_GET['bien'];


if($type_client=="tous")
 {
 
$sql = "select count(*) as num_appt from appartement where wilaya='$wilaya' and date>='$deb' and date<='$dfin' and type_transaction='$trans' in ('$chox1','$chox2','$chox3')";


}
else
if($type_client=="particulier")
 {


$sql = "select count(*) as num_appt from appartement where wilaya='$wilaya'  and type_client='$type_client'  and date>='$deb' and date<='$dfin' and type_transaction='$trans' in ('$chox1','$chox2','$chox3')";


}
else
if($type_client=="agence")
 {


$sql = "select count(*) as num_appt from appartement where type_client='$type_client' and num_client='$agence' and wilaya='$wilaya' and type_transaction='$trans' and date>='$deb' and date<='$dfin' and type_transaction='$trans' in ('$chox1','$chox2','$chox3','$chox4','$chox5') ";


}
$p = mysql_query($sql);
$fin = mysql_result($p,"0","num_appt");
}
}
// Déclaration de la variable début
$debut = ($page - 1) * $nb_rep_pages;


if($type_client=="tous")
 {
 
//la requète de selection des messages
$req = mysql_query("SELECT *  from appartement where wilaya='$wilaya'  and date>='$deb' and date<='$dfin'  and type_transaction='$trans' in ('$chox1','$chox2','$chox3') ORDER BY date DESC LIMIT $debut,$nb_rep_pages ");


}
else
if($type_client=="particulier")
{
$req = mysql_query("SELECT *  from appartement where wilaya='$wilaya'  and date>='$deb' and date<='$dfin' and type_client='particulier' and type_transaction='$trans' in ('$chox1','$chox2','$chox3') ORDER BY date DESC LIMIT $debut,$nb_rep_pages ") ;
}
else
if($type_client=="agence")
 {
 $req = mysql_query("SELECT *  from appartement where wilaya='$wilaya' and date>='$deb' and date<='$dfin' and type_client='agence' and num_client='$agence' and type_transaction='$trans' in ('$chox1','$chox2','$chox3') ORDER BY date DESC LIMIT $debut,$nb_rep_pages ");
 }


 


// Ici on calcul le nombre de page
$nbpages = ceil($fin / $nb_rep_pages); // Ici on arrondi


// Affichage par page :)
 
?>
0
coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 44
13 juin 2007 à 17:40
t'as rien fait pour ma premiere remarque...

<hr />une recherche sur exalead vous aurait peut-etre evite de poser cette question

In a dream, I saw me, drop dead...
U were there, U cried...
It was just a dream,
if I die, U won't cry, maybe, U'll be happy
0
Rejoignez-nous