[RESOLU] PROBLÈME AVEC MON SERVEUR

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : [RESOLU] PROBLÈME AVEC MON SERVEUR

Re: PROBLÈME AVEC MON SERVEUR

par CoulOumar2016 » 06 juin 2016, 11:53

MERCI BEAUCOUP

Re: PROBLÈME AVEC MON SERVEUR

par Nizalify » 04 juin 2016, 16:05

Bonjour
if(!emply($page) && in_array($_GET['page'].".php",$pages))
Le nom de la fonction "emply" est erroné, c’est "empty".
if(!empty($page) && in_array($_GET['page'].".php",$pages))
Les messages d'erreur ne sont pas là pour rien, la prochaine fois fait une recherche sur l'erreur qu'il t'indique et tu trouvera facilement le problème

Concernant l'erreur avec "$_GET['page']", il faut tout d’abord vérifier si cet élément existe, avec :
if(isset($_GET['page'])){
    // Si l'élément est instancié, le traitement ici
}
else{

}
Je pense que tu essayes de récupérer un paramètre "GET" qui n'existe pas. Lorsque tu appelles la page tu as quelque chose comme ça comme url ? :

http://www.site.com/index.php?page=valeur

Cordialement

PROBLÈME AVEC MON SERVEUR

par CoulOumar2016 » 04 juin 2016, 15:39

APRES AVOIR SAISIR LE CODE CI-DESSOUS, MON SERVEUR M'AFFICHE CES MESSAGES:
Notice: Underfined index:page in C:\wamp\www\Rsocial\index.php on line 3
ET
Fatal error: Call to underfined function emply() in C:\wamp\www\Rsocial\index.php on line 8

VOICI LE CODE

<?php

$page=htmlentities($_GET['page']);

$pages=scandir('pages');


if(!emply($page) && in_array($_GET['page'].".php",$pages))
{
$content='pages/'.$_GET['page'].".php";
}else{
header("Location:index.php?page=login");
}
?>


<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id='content'>
<?php
include($content);
?>
</div>
</body>
</html>

JE SUIS DEBUTANT EN PHP, AIDEZ MOI S'IL VOUS PLAIT.
NB: Rsocial EST LE NOM DE MON DOSSIER