Un autre webmaster qui a fait la même chose sous phpnuke m'a passé son code :
function doGetFFBaPage() {
//echo $_GET["sort"];
// trier license (NU), nom (N), prenom (P), simple (affS), moyS
(SMN), double (affD), moyD (DMN), mixte (affM), moyM (MMN)
// inverser pour les moyennes
$arraytoinv = array ("req[SMN-ord]", "req[DMN-ord]",
"req[MMN-ord]"); // params a trier
$sort = $_GET["sort"];
if (!isset($sort)) {
$sort = "req[N-ord]";
}
$toinv = str_replace("-ord", "-tri", $sort); // changer le nom du
param
$inv = (in_array($sort, $arraytoinv)?"-1":"1");
$i++;
$postedFields = array(
'req[VILLE-val]' => 'chambery',
'VILLE-wh' => "VILLE = '%s'",
'req[NU-aff]' => $i++,
'req[N-aff]' => $i++,
'req[P-aff]' => $i++,
'req[affS-aff]' => $i++, // affichage classement simple
'req[affD-aff]' => $i++,
'req[affM-aff]' => $i++,
'req[SMN-aff]' => $i++, // affichage de la moyenne simple
'req[DMN-aff]' => $i++,
'req[MMN-aff]' => $i++,
'req[ACTIF-val]' => 'O',
$sort => 1,
$toinv => $inv);
// on met en forme les champs pour l'envoi du formulaire fictif
$post = array();
foreach ($postedFields as $field=>$value) {
$post[] = urlencode($field).'='.urlencode($value);
}
$postedString = implode('&', $post);
$ch = curl_init("
http://www.ffba.net/cppp_clt.php3");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 80);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postedString);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
Je fais comment pour l'incorporer dans le fichier index ??
Ce que je veux faire c'est de partir de cette page :
http://www.ffba.net/cppp_clt.php3 pour avoir ca :
http://bcantibes.free.fr/classement.phpDésolé mais je suis un noob sous php
