IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Lien en erreur 500


Sujet :

Langage PHP

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    Décembre 2012
    Messages
    335
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2012
    Messages : 335
    Points : 70
    Points
    70
    Par défaut Lien en erreur 500
    Bonjour,
    j'ai construis une architecture en mvc
    dans ma vue un bouton (nouvelle action) est supposé m'emmener ailleurs sauf qu'il m'envoie vers une page blanche!
    j'ai donc ouvert une console et il m'affiche cette erreur:
    [10:49:42,514] GET http://doumer.airsystems.thales/PERSO/yq/controller/display_new.php?page=new [HTTP/1.0 500 Internal Server Error 0ms]
    voici l'ensemble de mes fichiers:

    index.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    <?php 
     
    ini_set("display_errors", "on");
    error_reporting(E_ALL);
    session_start();
    $_SESSION['c'] = "Se connecter";
    $_SESSION['i'] = "S'inscrire";
    require_once ("controller/display.php");
    principal();
     
    ?>
    display.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <?php
     
    session_start();
    require ('model/base.php');
    require ('model/user.php');
    require ('view/view.php');
    ini_set("display_errors", "on");
    error_reporting(E_ALL);
     
    function principal () {
     
     
    	mfprincipal();
    	vfprincipal();     
     
    };
     
    function verif_connect() {
     
    	$login = $_POST['login'];
    	$pass = $_POST['pass'];
    	$_SESSION['c'] = connect($login,$pass);
    	vfprincipal();
     
    };
     
    function new_a () {
     
    	id_suivant ();
    	fnew ();
     
    };
     
    ?>
    display_new.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <?php
     
    require_once ("display.php");
     
     
    $page = $_GET['page'];
     
    switch ($page) {
     
    	case 'actu':
    		principal();
    		break;
    	case 'new':
    		new_a ();
    		break;
    };
     
    ?>
    view.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    <?php
     
    function vfprincipal () {
    	echo ("
    		<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
    
    		<html xmlns='http://www.w3.org/1999/xhtml'>
    
    			<head>
    				<link rel='icon' href='view/images/favicon.ico' />
    				<title>Plan d'Organisation du Travail</title>
    				<meta charset='utf-8'>
    				<script type='text/javascript' src='view/js/principal.js'></script>
    				<link type='text/css' rel='stylesheet' href='view/css/styles/principal.css' />
    			</head>
    		<body>
    		<header>
    			<img src='view/images/logo_thales.gif' alt='logo THALES' title='THALES'>
    			<h1><span class='ombre'>THALES</span> Air Systems</h1>
    			<a href='controller/display_new.php?page=actu' title='Actualiser'>Actualiser</a>			<h2>Plan d'Organisation du Travail</h2>
    			<p id='date&heure'><br />
    	");
    	echo (date('l j F Y, H:i'));
    	echo ("
    			</p>
    		</header>
    
    		<body>
    
    		<section>
    
    			<article>
    				<table>
    					<tr>
    						<th>ID</th>
    						<th>Theme Bis (JPB)</th>
    						<th>Contact(s)</th>
    						<th>Results</th>
    						<th>Problem or Positive point</th>
    						<th>The Recommandations</th>
    						<th>Actions (to implement<br />the candidates lessons learnt)</th>
    						<th>Departement</th>
    						<th>Will be<br />exploited ? (Y/N)</th>
    						<th>Priority</th>
    						<th>Responsible</th>
    						<th>Number<br />workers</th>
    						<th>State</th>
    						<th>Submit<br />Date</th>
    						<th>Solve<br />Date</th>
    						<th>Started work<br />Date</th>
    						<th>Verified<br />Date</th>
    						<th>Last<br />Analysis<br />Date</th>
    						<th>Reject<br />Date</th>
    						<th>Target<br />Date</th>
    						<th>Closure<br />Date</th>
    						<th>Results of the<br />Action</th>
    						<th>Comments</th>
    						<th>DO</th>
    					</tr>");
    						while ($line = mysql_fetch_array($_SESSION ['result'], MYSQL_ASSOC)) {
        							echo "\t<tr>\n";
        								foreach ($line as $col_value) {
     									       echo "\t\t<td>$col_value</td>\n";
     								   }
      							echo "\t</tr>\n";
    						}
    					echo "</table>\n
    				</article>
    	";
     
    	include ("view/templates/aside.php");
     
    	echo ("
    		</section>
    		</body>
    		</html>
    	");
    };
     
    function fnew () {
    	echo ("
    		<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
    
    		<html xmlns='http://www.w3.org/1999/xhtml'>
    
    			<head>
    				<link rel='icon' href='view/images/favicon.ico' />
    				<title>Plan d'Organisation du Travail</title>
    				<meta charset='utf-8'>
    				
    				<link type='text/css' rel='stylesheet' href='view/css/styles/new.css' />
    			</head>
    		<body>
    		<header>
    			<img src='view/images/logo_thales.gif' alt='logo THALES' title='THALES'>
    			<h1><span class='ombre'>THALES</span> Air Systems</h1>
    			<a href='controller/display_new.php?page=actu' title='Retour'>Retour</a>
    			<h2>Create, Update or Delete action</h2>
    			<p id='date&heure'><br />
    	");
    	echo (date('l j F Y, H:i'));
    	echo ("
    			</p>
    		</header>
    		<body>
    		<section>
    
    			<article>
    				<p id='idnom'>ID :</p>
    				<p id='encadre'>
    	");
    	echo $_SESSION['id'];
    	echo("
    				</p>
    
    				<fieldset>
    					<legend>CREATE ACTION</legend>
    				<form>
    					<label for='dep' class='gr1'>Departement :</label>
    					<select name='dep' />
    						<option value='sw'>SW</option>
    						<option value='system'>System</option>
    						<option value='am'>Ameliorations</option>
    						<option value='other'>Other</option>
    					</select>
    					<label for='tb' class='gr1'>Theme Bis(JPB) :</label>
    					<input name='tb' type='text' />
    
    					<br />
    
    					<label> for='prob' class='gr2'>Problem or Positive point :</label>
    					<textarea name='prob' cols='20'rows='5' ></textarea>
    					<label> for='res' class='gr2'>The Results :</label>
    					<textarea name='res' cols='20'rows='5' ></textarea>
    					
    					<br />
    
    					<label> for='con' class='gr3'>Contact(s) :</label>
    					<textarea name='con' cols='20'rows='5' ></textarea>
    					<label> for='rec' class='gr3'>The Recommandationss :</label>
    					<textarea name='rec' cols='20'rows='5' ></textarea>
    
    					<br />
    
    					<label> for='ac' class='gr4'>Actions (to implement the candidates lessons learnt) :</label>
    					<textarea name='ac' cols='20'rows='5' ></textarea>
    					<label for='resp' class='gr4'>Responsible :</label>
    					<input name='resp' type='text' />
    					<label for='nbw' class='gr4'>Number of workers :</label>
    					<input name='nbw' type='number' />
    
    					<br />
    
    					<label for='s' class='gr5'>State :</label>
    					<select name='s' />
    						<option value='submitted'>Submitted</option>
    						<option value='solved'>Solved</option>
    						<option value='verified'>Verified</option>
    						<option value='analysed'>Analysed</option>
    						<option value='reject'>Reject</option>
    						<option value='started'>Started work</option>
    						<option value='closed'>Closed</option>
    					</select>
    					<label for='e' class='gr5'>Will be exploited :</label>
    					<input name='e' type='text' />
    					<label for='pr' class='gr5'>Priority :</label>
    					<input name='pr' type='number' />
    
    					<br />
    
    					<label for='tb' class='gr1'>Theme Bis(JPB) :</label>
    					<input name='tb' type='text' />
    				</form>
    				</fieldset>
    			</article>		
    		</section>
    		</body>
    	</html>
    	");
    };
    aside.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <aside>
    	<button id="connect"> <?php echo $_SESSION['c']; ?> </button>
     
    	<form id="fc" method="post" action="controller/display_new.php?page=connect">
    		<label for="login">Your login</label>
    		<input name="login" type="text" /><br />
    		<label for="pass">Your password</label>
    		<input name="pass" type="pass" /><br />		
    		<input type='submit' value='Valider'>
    	</form>
     
    	<br />
     
    	<button id="ins"><?php echo $_SESSION['i']; ?></button>
     
    	<form id="fi" method="post" action="controller/display_new.php?page=ins">
    		<label for="login">Your login</label>
    		<input name="login" type="text" /><br />
    		<label for="pass">Your password</label>
    		<input name="pass" type="pass" /><br />		
    		<label for="name">Your name</label>
    		<input name="name" type="text" /><br />
    		<input type='submit' value='Valider'>
    	</form>
     
    	<form action="controller/display_new.php" method="get">
    		<input type="submit" value="Nouvelle action" />
    		<input name='page' style='visibility:hidden;' value='new'     >
    	</form>
    <button><a href="controller/display.php?page=new">Nouvelle action</button>
    </aside><aside>
    	<button id="connect"> <?php echo $_SESSION['c']; ?> </button>
     
    	<form id="fc" method="post" action="controller/display_new.php?page=connect">
    		<label for="login">Your login</label>
    		<input name="login" type="text" /><br />
    		<label for="pass">Your password</label>
    		<input name="pass" type="pass" /><br />		
    		<input type='submit' value='Valider'>
    	</form>
     
    	<br />
     
    	<button id="ins"><?php echo $_SESSION['i']; ?></button>
     
    	<form id="fi" method="post" action="controller/display_new.php?page=ins">
    		<label for="login">Your login</label>
    		<input name="login" type="text" /><br />
    		<label for="pass">Your password</label>
    		<input name="pass" type="pass" /><br />		
    		<label for="name">Your name</label>
    		<input name="name" type="text" /><br />
    		<input type='submit' value='Valider'>
    	</form>
     
    	<form action="controller/display_new.php" method="get">
    		<input type="submit" value="Nouvelle action" />
    		<input name='page' style='visibility:hidden;' value='new'     >
    	</form>
    <button><a href="controller/display.php?page=new">Nouvelle action</button>
    </aside>
    et base.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    <?php
     
    function mfprincipal() {
     
    		require("configsql.php");
    		$link = mysql_connect ($hote,$log,$pwd) or die("Erreur de connexion: ".mysql_error()); 
    		mysql_select_db($bd,$link);
     
    	$req = "select ac.id, ac.themebis(jpb), con.name, ac.results, ac.problemorpositivepoint, am.therecommandations, am.actions, dep.name, dec.willbeexploited, dec.priority, pers.responsible, pers.numworkers, statut.libelle, d.submitdate, d.solvedate, d.starteddate, d.verifdate,d.lastanalysisdate, d.rejectdate, d.targetdate, d.closuredate, am.resultsoftheaction, com.comments
    from action ac, ameliorations am, contact con, comments com, dates d, decision dec, departement dep, personne pers,statut 
    inner join d on ac.id = d.id#
    inner join am on ac.id = am.id#
    inner join dep on ac.id = dep.id#
    inner join dec on ac.id = dec.id#
    inner join con on ac.id = con.id#
    inner join com on ac.id = com.id#
    inner join pers on ac.id = pers.id#
    inner join statut on ac.id = statut.id#
    order by asc ac.id";
    	$_SESSION['result'] = mysql_query ($req, $link);
     
    };
     
    function id_suivant () {
     
    		require("configsql.php");
    		$link = mysql_connect ($hote,$log,$pwd) or die("Erreur de connexion: ".mysql_error()); 
    		mysql_select_db($bd,$link);
    		$_SESSION['id'] = mysqli_insert_id($link) + 1;
     
     
    };
     
    ?>

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Erreur 500 est une erreur générique du serveur web qui se produit notamment quand
    - une erreur PHP a lieu mais PHP est configuré pour ne pas afficher les erreurs => verifie qu'ils sont actifs et consulte tes logs PHP
    - un fichier .htaccess contient des erreurs

  3. #3
    Membre régulier
    Profil pro
    Inscrit en
    Décembre 2012
    Messages
    335
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2012
    Messages : 335
    Points : 70
    Points
    70
    Par défaut
    première ment les erreurs sont activées, et même deux fois : index.php et display.php
    ensuite il faut que tu m'explique ce que tu veux dire par là :
    consulte tes logs PHP
    enfin je ne comprend pas pourquoi tu me parles de fichier htaccess

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Erreur 500
    Par Neuromancien2 dans le forum Langage
    Réponses: 3
    Dernier message: 11/10/2005, 23h41
  2. XMLC_ReleaseXMLApplication : Erreur 500 ?
    Par Sylvain James dans le forum XMLRAD
    Réponses: 1
    Dernier message: 09/05/2005, 23h35
  3. [tomcat] Erreur 500 à l'appel de la servlet
    Par Kyti dans le forum Tomcat et TomEE
    Réponses: 26
    Dernier message: 06/04/2005, 09h37
  4. [web] [CGI][Easyphp] erreur 500
    Par nico72 dans le forum Web
    Réponses: 11
    Dernier message: 29/07/2004, 20h08
  5. Réponses: 6
    Dernier message: 28/10/2002, 11h34

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo