undefined function: http_build_query
bonjour a tous,
je suis en train de faire mon site et qqun d'ici d'ailleur m'avait gentiment aidé.
mais j'ai recopié ce qu'il m'a donné sans vraiment le comprendre, tout marchait bien sur mon ordi en test et quand j'ai mis ca sur OVH ils disent :
Fatal error: Call to undefined function: http_build_query() in /home.10.21/professil/www/resultat.php on line 47
qqun peut il m'aider???
voila le code : la ligne 47 est la ligne marquée ligne posant probleme
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
<?php
define('NB_PAR_PAGE', 20);
$departement = $_REQUEST['departement']; /* Ugly hack */
$poste = $_REQUEST['choixposte']; /* Ugly hack */
$db = mysql_connect('serveur', 'professilbase', '');
mysql_select_db('professilbase', $db);
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
/* Ugly hack */
unset($_REQUEST['page']);
$request = http_build_query($_REQUEST); // LIGNE POSANT PROBLEME
$sql_d = sprintf("
SELECT SQL_CALC_FOUND_ROWS * FROM annonces_entreprise
WHERE annonce_dept ='%s' AND annonce_poste ='%s'
ORDER BY id_annonce DESC
LIMIT %d, %d",
mysql_real_escape_string($departement), mysql_real_escape_string($poste), ($page - 1) * NB_PAR_PAGE, NB_PAR_PAGE);
$req_d = mysql_query($sql_d) or die('Erreur SQL !<br>' . $sql_d . '<br>' . mysql_error());
$req_n = mysql_query('SELECT FOUND_ROWS()');
$res_n = mysql_fetch_row($req_n);
if ($res_n[0] > 0)
{
$derniere_page = ceil($res_n[0] / NB_PAR_PAGE);
echo '<table>'."\n";
echo '<caption> Département : ' . $departement . '</caption>';
echo '<tr>';
echo '<th><b><center>Entreprise</center></b></th>';
echo '<th><b><center>Poste</center></b></th>';
echo '<th><b><center>Ville</center></b></th>';
echo '<th><b><center>Détail</center></b></th>';
echo '</tr>' . "\n";
echo '<tr><td>';
while($res_d = mysql_fetch_assoc($req_d))
{
echo '<tr>';
echo '<td><b>' . $res_d['nom_entreprise'] . '</b></td>';
echo '<td><b>' . $res_d['annonce_poste'] . '</b></td>';
echo '<td><b>' . $res_d['ville_entreprise'] . '</b></td>';
echo '<td><b>' . $res_d['lien_annonce'] . '</b></td>';
echo '</tr><br>' . "\n";
}
echo '</table>' . "\n";
echo '</td></tr>';
echo '</table>';
if ($page > 1) {
printf('<a href="%s?page=%d&%s">Page précédente</a>', basename(__FILE__), $page - 1, $request);
}
for ($i = 1; $i <= $derniere_page; $i++) {
if ($i == $page) {
echo '<b>' . $i . '</b>';
} else {
printf('<a href="%s?page=%d&%s">%d</a>', basename(__FILE__), $i, $request, $i);
}
}
if ($page < $derniere_page) {
printf('<a href="%s?page=%d&%s">Page suivante</a>', basename(__FILE__), $page + 1, $request);
}
} else {
echo "Aucun résultat pour cette recherche";
}
mysql_close();
?> |