Déclaration
Nanashi17
Messages postés
245
Statut
Membre
-
Nanashi17 Messages postés 245 Statut Membre -
Nanashi17 Messages postés 245 Statut Membre -
Bonjour,
J'ai un fichier php:
Et j'aimerai déclarer un autre fichier php mais malheureusement quand je déclare un fichier ou ne serait ce qu'une variable je provoque une erreur 500. Comment faire s'il vous plaît ?
Merci d'avance.
J'ai un fichier php:
<?php
require("../protec/passe/conf.php");
$db_link = mysqli_connect($sql_serveur,$sql_user,$sql_passwd,$sql_bdd);
// SELECTION DE L'ENREGISTREMENT CONTENANT L'ID EN COURS
//$requete=mysqli_query($db_link,"select * from $table where id=\"$id\"");
// SI L'ID N'EXISTE PAS
/*if(mysqli_num_rows($requete)==0){
header("Location:$url_erreur");
}*/
require ("lien_ad.php");
?>
<TITLE><? echo "$title"; ?></TITLE>
<script>
function hidestatus(){
window.status='A.R.P.A.E';
return true;
}
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT | Event.MOUSEDOWN);
document.onmouseover=hidestatus;
document.onmouseout=hidestatus;
document.onmousedown=hidestatus;
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Keywords" CONTENT="logement, étudiant, univ, LR, avenue, Jean, Monnet, Minimes, CROUS, IUT, Fac, Université, ARPAE, Sup de Co, EIGSI, Lavoisier, Platin, Francophonie, Maison, La Rochelle, jeunes, études, école, résidences, CRI, nouvelle">
<meta name="Description" CONTENT="Nos Résidences hébergent plus de 1000 étudiants par an pour leurs études dans un cadre de détente et de convivialité">
<meta name="author" content="benni">
<meta name="robots" CONTENT="index,follow">
<meta http-equiv="Content-Language" content="Français">
<link rel="stylesheet" type="text/css" href="../Inscriptions/adminCss.css">
<STYLE type=text/css>
A {
FONT-WEIGHT: bold;
COLOR: #3B6CEE;
TEXT-DECORATION: none
}
A:hover {
FONT-WEIGHT: bold;
TEXT-DECORATION: underline;
COLOR: #FF0000;
}
TD {
FONT-SIZE: 7.5pt;
FONT-FAMILY: Verdana,Geneva,Arial,Helvetica,sans-serif;
}
TD.menu {
FONT-SIZE: 7.5pt;
FONT-FAMILY: Verdana,Geneva,Arial,Helvetica,sans-serif;
FONT-WEIGHT: bold;
COLOR: #FFFFFF;
}
.Style1 {
font-size: 36pt;
color: #FFFFFF;
}
.Style2 {
font-size: 12pt;
font-weight: bold;
}
.Style3 {font-size: 10pt;}
.Style4 {font-size: 12pt;}
.Style5 {
font-size: 10pt;
font-weight: bold;
}
.Style13 {color: #FFFFFF; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; }
</STYLE>
<script language="JavaScript" type="text/JavaScript">
<!--
function loadDesktopConfig()
{
displayLaunchBar();
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function getAjax()
{
var ajax = null;
if(window.XMLHttpRequest) // Firefox
{
ajax = new XMLHttpRequest();
}
else
{
if(window.ActiveXObject) // Internet Explorer
{
ajax = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{ // XMLHttpRequest non supporté par le navigateur
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
return NULL;
}
}
return ajax;
}
function getDomObject(domObjectId)
{
if (document.getElementById)
{
var domObject=document.getElementById(domObjectId);
return domObject;
}
if (document.all && !document.getElementById)
{
var domObject=document.all[domObjectId];
return domObject;
}
if (document.layers)
{
var domObject=document.layers[domObjectId];
return domObject;
}
return NULL;
}
function updateContent(ajax,idDomObject)
{
return function()
{
if(ajax.readyState == 1)
{
var monObjet=getDomObject(idDomObject);
var inner="<img src=\"/Inscriptions/i_animated_loading_32_2.gif\" width=\"32\" height=\"32\" border=\"0\" >";
monObjet.innerHTML=inner;
}
if(ajax.readyState == 4)
{
var monObjet=getDomObject(idDomObject);
monObjet.innerHTML=ajax.responseText;
}
}
}
function displayLaunchBar()
{
var ajax = getAjax();
ajax.open("POST", "../Inscriptions/loadLaunchBar.php", true);
ajax.onreadystatechange = updateContent(ajax,'launchBarDiv');
ajax.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
var launchBar=getDomObject('launchBarDiv');
launchBar.style.visibility='visible';
ajax.send('default');
}
function MoveWindow(event)
{
if(move==1)
{
//alert('positionXDepartSouris'+positionXDepartSouris+'positionYDepartSouris'+positionYDepartSouris);
var fenetre=getDomObject(selectedWindow);
var eventY=event.clientY;
var deltaY=eventY-positionYDepartSouris;
var nouveauY=positionYDepartFenetre+deltaY+'px';
if(deltaY<0)
{
var nouveauY=(Math.abs(positionYDepartFenetre)-Math.abs(deltaY))+'px';
}
else
{
var nouveauY=(Math.abs(positionYDepartFenetre)+Math.abs(deltaY))+'px';
}
var eventX=event.clientX;
// alert('eventX'+eventX+'eventY'+eventY);
// alert('positionXDepartFenetre'+positionXDepartFenetre+'positionYDepartFenetre'+positionYDepartFenetre);
var deltaX=eventX-positionXDepartSouris;
if(deltaX<0)
{
var nouveauX=(Math.abs(positionXDepartFenetre)-Math.abs(deltaX))+'px';
}
else
{
var nouveauX=(Math.abs(positionXDepartFenetre)+Math.abs(deltaX))+'px';
}
//alert('nouveauX'+nouveauX+'nouveauY'+nouveauY);
fenetre.style.top=nouveauY;
fenetre.style.left=nouveauX;
}
}
//-->
</script>
<body onLoad="loadDesktopConfig();" onmousemove="MoveWindow(event);">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="69" align="center" valign="middle" ><table width="100%" border="0" cellpadding="0" cellspacing="0" background="../Image/haut.gif">
<tr>
<td width="152" height="65"><div align="center"> <a href="index.htm" rel="nofollow noopener noreferrer" target="_blank"><img src="../Image/logo.gif" width="55" height="58" border="0" /></a></div></td>
<td width="569" height="65" valign="bottom"><div align="center" class="Style1">
<div align="center"><span class="Style2">Association Rochelaise pour l'Accueil des Etudiants</span></div>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="18"> </td>
</tr>
<tr>
<td height="22" background="../Image/title.gif" class="menu"><div align="center">......:::::
<script language=JavaScript>
<!-- Hide the script from non-Javascript browsers
var date_statement="";
var time_statement="";
var today=new Date();
var month="";
var day="";
var annee;
if (navigator.appName=="Netscape"){
annee=1900;
}
if (navigator.appName=="Microsoft Internet Explorer"){
annee=0;
}
function todays_date() {
var month=today.getMonth();
var day_of_week=today.getDay();
date_statement=""
document.month=""
month++; // So it's now between 1 - 12.
if(month==1) {
january(today.getDate());
document.month="janvier";
}
if(month==2) {
february(today.getDate());
document.month="fevrier";
}
if(month==3) {
march(today.getDate());
document.month="mars";
}
if(month==4) {
april(today.getDate());
document.month="avril";
}
if(month==5) {
may(today.getDate());
document.month="mai";
}
if(month==6) {
june(today.getDate());
document.month="juin";
}
if(month==7) {
july(today.getDate());
document.month="juillet";
}
if(month==8) {
august(today.getDate());
document.month="aout";
}
if(month==9) {
september(today.getDate());
document.month="septembre";
}
if(month==10) {
october(today.getDate());
document.month="octobre";
}
if(month==11) {
november(today.getDate());
document.month="novembre";
}
if(month==12) {
december(today.getDate());
document.month="decembre";
}
document.day=""
if(day_of_week==0)
document.day="dimanche";
if(day_of_week==1)
document.day="lundi";
if(day_of_week==2)
document.day="mardi";
if(day_of_week==3)
document.day="mercredi";
if(day_of_week==4)
document.day="jeudi";
if(day_of_week==5)
document.day="vendredi";
if(day_of_week==6)
document.day="samedi";
}
function january(date) {
if(date==1)
date_statement="";
if(date==26)
date_statement="";
}
function february(date) {
if(date==14)
date_statement="";
}
function march(date) {
if(date==15)
date_statement="";
if(date==17)
date_statement="";
}
function march(date) {
if(date==21)
date_statement="";
if(date==25)
date_statement="";
}
function april(date) {
if(date==1)
date_statement="";
if(date==30)
date_statement="";
}
function may(date) {
if(date==1)
date_statement="";
if(date==17)
date_statement="";
}
function june(date) {
if(date==2)
date_statement="";
if(date==5)
date_statement="";
if(date==10)
date_statement="";
if(date==17)
date_statement="";
if(date==21)
date_statement="";
if(date==23)
date_statement="";
if(date==24)
date_statement="";
}
function july(date) {
if(date==1)
date_statement="";
if(date==4)
date_statement="";
if(date==14)
date_statement="";
if(date==21)
date_statement="";
if(date==23)
date_statement="";
}
function august(date) {
if(date==1)
date_statement="";
}
function september(date) {
if(date==7)
date_statement="";
if(date==21)
date_statement="C'est l'automne !";
}
function october(date) {
if(date==3)
date_statement="";
if(date==12)
date_statement="";
if(date==31)
date_statement="Happy Halloween.";
}
function november(date) {
}
function december(date) {
if(date==21)
date_statement+="Couvrez-vous c'est l'hiver !";
if(date==23)
date_statement+="";
if(date==25)
date_statement="Joyeux Noël!";
if(date==31)
date_statement="Bon réveillon !";
}
function time_of_day() {
var time=today.getHours();
time_statement=""
if(time>=6 && time<8)
time_statement="Déja sur le Net !,"
if(time>=8 && time<12)
time_statement="Bonne matinée,"
if(time>=12 && time<13)
time_statement="Bon appétit,"
if(time>=13 && time<17)
time_statement="Bon après-midi,"
if(time>=17 && time<18)
time_statement="Bon fin d'après-midi,"
if(time>=18 && time<20)
time_statement="Bonsoir et bon appétit,"
if(time>=20 && time<22)
time_statement="Bonsoir,"
if(time>=22 || time<6)
time_statement="Salut les couche-tard,"
}
// -- End Hiding Here -->
</script>
<script language=JavaScript>
<!-- Hide the script from non-Javascript browsers
time_of_day();
todays_date();
document.writeln(""+time_statement+" nous sommes le "+document.day+" "+today.getDate()+" "+document.month+" "+date_statement+" "+(annee+today.getYear())+"");
// -- End Hiding Here -->
</script>
:::::......</div></td>
</tr>
<tr>
<td height="18" align="center" valign="top"> </td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr cellpading="0" cellspacing="0">
<td height="18" align="left" valign="top">
<table width="100%" height="100%" border="0" cellpading="0" cellspacing="0">
<tr valign="top">
<td>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="22" background="../Image/title.gif" class="menu"><div align="center"><span class="Style13"><? echo "$title"; ?></span></div></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="78B1F3">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td height="360" align="center" valign="top" bgcolor="#FFFFFF">
<table width="100%" border="0">
<tr>
<td height="20"><?include("$page");?></td>
</tr>
</table>
<div align="center"> </div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="18" align="left" valign="top"><div align="right"> </div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="22" background="../Image/title.gif" class="menu"><div align="center">Copyright
© 2007 - Tous droits réservés.</div></td>
</tr>
</table>
</body>
Et j'aimerai déclarer un autre fichier php mais malheureusement quand je déclare un fichier ou ne serait ce qu'une variable je provoque une erreur 500. Comment faire s'il vous plaît ?
Merci d'avance.
1 réponse
-
Bonjour,
j'aimerai déclarer un autre fichier php mais malheureusement quand je déclare un fichier ou ne serait ce qu'une variable je provoque une erreur 500
Déclarer un fichier ?? C'est à dire ? Comment tu fais ??
Une variable ???
A la limite.. montre nous le code qui pose problème pour que l'on puisse regarder ce qui ne va pas...
-
inclure* pardon.
Quand je veux faire la moindre chose dans cette partie du code je déclenche une erreur 500:
<?php require("../protec/passe/conf.php"); $db_link = mysqli_connect($sql_serveur,$sql_user,$sql_passwd,$sql_bdd); // SELECTION DE L'ENREGISTREMENT CONTENANT L'ID EN COURS //$requete=mysqli_query($db_link,"select * from $table where id=\"$id\""); // SI L'ID N'EXISTE PAS /*if(mysqli_num_rows($requete)==0){ header("Location:$url_erreur"); }*/ require ("lien_ad.php"); ?>
Par exemple si je fais include 'monFichier';
Paf erreur 500. -
si je fais include 'monFichier';
Paf erreur 500.
Je répète ...
Montre nous le code TEL que tu l'as écrit ... et qui génère une erreur 500.
NB: Au passage, tu peux ajouter, au début de ton code, les instructions suivantes ://Affichage des erreurs PHP error_reporting(E_ALL); ini_set('display-errors','on'):
NB² : Dans le code mit en commentaire (je ne sais pas si tu l'utiliseras ou non....) .. tu utilises des variables ( $id, $url_erreur) .. qui sont déclarées nul-part... (à moins qu'elles ne viennent de ton fichier conf.php ? )
NB3 : Pour la connexion .. tu devrais écrire ceci à la place de ton code actuelrequire_once "../protec/passe/conf.php"; $db_link = @mysqli_connect($sql_serveur,$sql_user,$sql_passwd,$sql_bdd); if (!$db_link) { die('Erreur de connexion : ' . mysqli_connect_error()); } -
-
-
-