Page PHP reste blanche!

Fermé
Tiguil - 21 mars 2012 à 20:30
 Tiguil - 27 mars 2012 à 03:19
Bonjour,

Je me suis procuré un portail pour mon site internet qui utilise le PHP. Cependant, je ne suis pas excellent en PHP. J'ai besoin d'aide, car plusieurs pages ne s'affichent pas lorsque je clique dessus. Il n'y a aucun message d'erreur, seulement une page blanche.

Pour vous donnez une exemple : http://www.mondial.lhse.org/add_article.php

Voila les codes :

<?php include('Connections/settings.php'); ?>
<?php include("includes/sessionInfo.php") ?>
<?php include("includes/functions.php") ?>
<?php include("includes/langfile.php") ?>
<?php include("includes/langs.php") ?>
<?php
switch ($lang){
case 'en':
$l_PageTitle = "Add Article";
$l_Title = "TITLE";
$l_Summary = "SUMMARY";
$l_Content = "CONTENT";
$l_DateCreated = "DATE CREATED";
$l_Submit = "SUBMIT";
$l_Alert1 = "Please enter a title. Please keep the title lest than 30 characters.";
$l_Alert2 = "Please enter a summary. Please keep the title lest than 140 characters.";
$l_Alert3 = "Please enter the content.";
break;

case 'fr':
$l_PageTitle = "Ajouter un article";
$l_Title = "TITRE";
$l_Summary = "SOMMAIRE";
$l_Content = "CONTENU";
$l_DateCreated = "DATE DE CRÉATION";
$l_Submit = "POSTER";
$l_Alert1 = "Veuillez écrire un titre. SVP Gardez le titre à moins de 30 caractères.";
$l_Alert2 = "Veuillez écrire un sommaire. SVP Gardez le sommaire à moins de 140 caractères.";
$l_Alert3 = "Veuillez écrire le contenu.";
break;
}




$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}



if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

$UPLOADED_PHOTO ="";

$uploaddir = "image/headlines/";
$uploadthumb = "image/headlines/thumb/";
$uploadfile = $uploaddir . basename($_FILES['NEW_PHOTO']['name']);
$uploadthumbfile = $uploadthumb . basename($_FILES['NEW_PHOTO']['name']);
include('includes/SimpleImage.php');

if (move_uploaded_file($_FILES['NEW_PHOTO']['tmp_name'], $uploadfile)) {
$image = new SimpleImage();
$image->load($uploadfile);
$image->resize(480,285);
$image->save($uploadfile);
$UPLOADED_PHOTO = basename($_FILES['NEW_PHOTO']['name']);
$thumb = new SimpleImage();
$thumb->load($uploadfile);
$thumb->resize(35,25);
$thumb->save($uploadthumbfile);
}else{
$UPLOADED_PHOTO = $_POST['PHOTO'];
}

$insertSQL = sprintf("INSERT INTO articles (Headline,Content,Summary,Image,DateCreated,Team,League) values (%s,%s,%s,%s,%s,%s,%s)",
GetSQLValueString($_POST['HEADLINE'], "text"),
GetSQLValueString($_POST['CONTENT'], "text"),
GetSQLValueString($_POST['SUMMARY'], "text"),
GetSQLValueString($UPLOADED_PHOTO, "text"),
GetSQLValueString(date("Y-m-d", strtotime(str_replace("/","-",$_POST['DATECREATED']))), "date"),
GetSQLValueString($_SESSION['U_ID'], "int"),
GetSQLValueString($_POST['LEAGUE'], "text"));
$Result1 = mysql_query($insertSQL, $connection) or die(mysql_error());

$last_id=mysql_insert_id();


$insertSQL = sprintf("INSERT INTO participation (DateCreated,Team,Season_ID,Type) values (%s,%s,%s,%s)",
GetSQLValueString(strftime('%Y-%m-%d', strtotime('now')), "date"),
GetSQLValueString($_SESSION['U_Name'], "text"),
GetSQLValueString($_SESSION['current_SeasonID'], "int"),
GetSQLValueString("Article", "text"));
$Result1 = mysql_query($insertSQL, $connection) or die(mysql_error());

$url = $_SESSION['DomainName'].'/news.php?article='.$last_id;

if(isset($_POST['SHARE']) && $_POST['SHARE'] != ""){
require('includes/shorturl.php');
$tinyURL = ShortUrl::create($url,'tinyurl');
$message = $_POST['HEADLINE']." - ".$tinyURL;
}

if(isset($_POST['SHARE']) && $_POST['SHARE'] == "twitter"){
require("twitter/twitteroauth.php");
/* Get user access tokens out of the session. */
$access_token = $_SESSION['access_token'];
$twittter_connection = new TwitterOAuth(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
$response = $twittter_connection->post('statuses/update', array('status' => substr($message, 0, 140)));

} else if(isset($_POST['SHARE']) && $_POST['SHARE'] == "facebook"){
require 'facebook/facebook.php';
//facebook application
$facebook = new Facebook(array(
'appId' => APP_ID,
'secret' => APP_SECRET,
'cookie' => true,
));

//Facebook Authentication part
$user = $facebook->getUser();
if ($user) {
try {
$user = $facebook->api('/me');
//$statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> $message, 'cb' => ''));
$publishStream = $facebook->api("/me/feed", 'post', array(
'message' => $_POST['HEADLINE'],
'link' => $url,
'picture' => $_SESSION['DomainName'].'/images/common/Facebook-share-icon.png',
'name' => $_SESSION['SiteName'],
'description'=> $_POST["SUMMARY"]
)
);
} catch (Exception $e) {
echo $e;
}
}
}

if ($_SESSION['current_Team_ID'] == 0) {
$updateGoTo = "index.php";
} else {
$updateGoTo = "news.php?Team=".$_SESSION['current_Team_ID']."&article=".$last_id;
}

if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title><?php echo $l_PageTitle;?> - <?php echo $_SESSION['SiteName'] ; ?></title>

<link rel="shortcut icon" type="image/png" href="<?php echo $_SESSION['DomainName']; ?>/image/<?php echo $_SESSION['FavIcon'];?>" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/reset.css">
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/html5.css">
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/jquery.accessible-news-slider.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/menu.css"><link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/jquery-ui-1.8.custom.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/header.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/tipsy.css">
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/bubbletip.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/datePicker.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/date.css" />


<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/formly.min.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery.accessible-news-slider.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery.pop.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery.tipsy.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery.ui.core.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery.ui.widget.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery-ui-1.8.custom.min.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/date.js"></script>

<?php if(isset($_SESSION['username'])){ ?>
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/chat.css" />
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/chat.js"></script>
<?php } ?>

<!--[if lte IE 9]>
<script src="<?php echo $_SESSION['DomainName']; ?>/js/html5.js" type="text/javascript"></script>
<script src="<?php echo $_SESSION['DomainName']; ?>/js/jquery.bgiframe.min.js" type="text/javascript"></script>
<![endif]-->

<script type="text/javascript">
$(function(){
$('#cssdropdown li.headlink').hover(
function() { $('ul', this).css('display', 'block'); },
function() { $('ul', this).css('display', 'none'); });
$('.date-pick').datepicker().val(new Date().asString()).trigger('change');
});;
</script>
<script language="javascript">
function checkit(){
if (document.form1.HEADLINE.value.length==0){
alert("<?php echo $l_Alert1;?>");
return false;
}
if (document.form1.SUMMARY.value.length==0){
alert("<?php echo $l_Alert2;?>");
return false;
}
}
</script>
<style media="all" type="text/css">
#container {background-image:url(<?php echo $_SESSION['DomainName']; ?>/image/headers/<?php echo $_SESSION['current_HeaderImage']; ?>); background-color:#<?php echo $_SESSION['current_PrimaryColor'];?>;}
a {color:#<?php echo $_SESSION['current_PrimaryColor']; ?>;}
table.tablesorter thead tr th { background-color: #<?php echo $_SESSION['current_SecondaryColor']; ?>; color:#<?php echo $_SESSION['current_TextColor']; ?>;}
table.tablesorterRates thead tr th { background-color: #<?php echo $_SESSION['current_SecondaryColor']; ?>; color:#<?php echo $_SESSION['current_TextColor']; ?>;}
table.tablesorter thead tr th a{ color:#<?php echo $_SESSION['current_TextColor']; ?>;}
table.tablesorterRates thead tr th a{ color:#<?php echo $_SESSION['current_TextColor']; ?>;}
footer { background-color:#<?php echo $_SESSION['current_PrimaryColor']; ?>;}
#FatFooter { background-color:#<?php echo $_SESSION['current_SecondaryColor']; ?>; color:#<?php echo $_SESSION['current_TextColor']; ?>;}
<?php if ($_SESSION['current_SecondaryColor'] == $_SESSION['current_PrimaryColor']){ echo "#FatFooter a { color:#".$_SESSION['current_TextColor']."; } "; } ?>
h3 {color:#<?php echo $_SESSION['current_PrimaryColor']; ?>;}
#cssdropdown, #cssdropdown ul {background-color:#<?php echo $_SESSION['current_PrimaryColor']; ?>;}
nav {background-color:#<?php echo $_SESSION['current_PrimaryColor']; ?>;}
</style>
</head>

<body>
<div align="center">
<div id="wrapper">
<?php include("includes/header.php"); ?>
<?php include("includes/nav.php"); ?>

<article>
<!-- RIGHT HAND SIDE BAR GOES HERE -->
<!--<aside></aside>-->

<!-- MAIN PAGE CONTENT GOES HERE -->
<section>

<h1><?php echo $l_PageTitle;?></h1>
<br />
<form method="post" name="form1" enctype="multipart/form-data" action="<?php echo $editFormAction; ?>" onsubmit='return checkit()'>

<div class="rowElem">
<label for="HEADLINE"><?php echo $l_Title;?>:</label>
<input type="text" name="HEADLINE" size="80" maxlength="255">
</div>

<div class="rowElem">
<label for="SUMMARY"><?php echo $l_Summary;?>:</label>
<input type="text" name="SUMMARY" size="80" maxlength="255">
</div>

<div class="rowElem">
<label for="CONTENT"><?php echo $l_Content;?>:</label>
<div style="margin-left:140px;">
<?php
if ($_SESSION['RichTextEditor'] == 0){
echo "<textarea name='CONTENT' cols='50' rows='10'></textarea>";
} else {
// Include CKEditor class.
include_once "ckeditor/ckeditor.php";
// The initial value to be displayed in the editor.
$initialValue = '<p>This is some <strong>sample text</strong>.</p>';
// Create class instance.
$CKEditor = new CKEditor();
// Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
// $CKEditor->basePath = '/ckeditor/'
// If not set, CKEditor will try to detect the correct path.
$CKEditor->basePath = 'ckeditor/';
$CKEditor->config['width'] = 800;
// Create textarea element and attach CKEditor to it.
$CKEditor->editor("CONTENT","");
}
?></div>
</div>

<div class="rowElem">
<label for="PHOTO">PHOTO:</label>
<select name="PHOTO" size="1">
<option value="<?php echo $_SESSION['current_HeadlineImage'];?>" selected="selected"><?php echo $_SESSION['current_HeadlineImage'];?> (Default)</option>
<?php
$dir = "image/headlines/";

// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {

echo "<option value='".$file."'>".$file."</option>";
}
closedir($dh);
}
}
?>
</select>

<div class="rowElem">
<label for="NEW_PHOTO">UPLOAD PHOTO:</label>
<input type="file" name="NEW_PHOTO">
</div>

<div class="rowElem">
<label for="LEAGUE">LEAGUE NEWS:</label>
<select name="LEAGUE" size="1">
<option value="True" selected>Add to league news rotator</option>
<option value="False">Team news only</option>
</select>
</div>

<div class="rowElem">
<label for="DATECREATED"><?php echo $l_DateCreated;?>:</label>
<input name="DATECREATED" id="DATECREATED" class="date-pick" />
</div>

<?php if(isset($_SESSION['oauth_provider']) && $_SESSION['oauth_provider'] == 'twitter'){?>
<div class="rowElem">
<input name="SHARE" type="checkbox" value="twitter" /> <img src="image/common/tweet.png" width="55" height="20" alt="Tweet">
<label for="SHARE"></label>
</div>
<?php } else if (isset($_SESSION['oauth_provider']) && $_SESSION['oauth_provider'] == 'facebook'){?>
<div class="rowElem">
<input name="SHARE" type="checkbox" value="facebook" /> <img src="image/common/fb_share.png" width="59" height="18" alt="Share">
<label for="SHARE"></label>
</div>
<?php } else { ?>
<input name="SHARE" type="hidden" value="" />
<?php } ?>


<br /><br />
<br /><br />

<div class="rowElem">
<label for="submit"></label>
<input type="submit" value="<?php echo $l_PageTitle;?>" class="button add">
</div>
<br /><br />

<input type="hidden" name="MM_insert" value="form1">
</form>

</section>
</article>

<?php include("includes/footer.php"); ?>
<?php include("includes/statusBar.php"); ?>
</div>
</div>
</body>
</html>

3 réponses

AssassinTourist Messages postés 5710 Date d'inscription lundi 16 janvier 2012 Statut Contributeur Dernière intervention 29 février 2024 1 311
22 mars 2012 à 09:37
Bonjour,
Déjà avez-vous ces fichiers à l'emplacement décrit :
<?php include('Connections/settings.php'); ?>
<?php include("includes/sessionInfo.php") ?>
<?php include("includes/functions.php") ?>
<?php include("includes/langfile.php") ?>
<?php include("includes/langs.php") ?> 
<?php include("includes/footer.php"); ?>
<?php include("includes/statusBar.php"); ?>

?
0
Mopra-L Messages postés 146 Date d'inscription lundi 29 juin 2009 Statut Membre Dernière intervention 23 mai 2012 6
22 mars 2012 à 10:30
Pour compléter ta réponse : Pour s'assurer que les fichiers sont bien présents, il faudrait plutôt utilise un "require" à la place du "include"
0
Les fichiers sont bien dans le dossier Includes.
0
AssassinTourist Messages postés 5710 Date d'inscription lundi 16 janvier 2012 Statut Contributeur Dernière intervention 29 février 2024 1 311
22 mars 2012 à 16:56
Et le premier dans Connections ? Attention à mettre des majuscules quand il y en a, et des minuscules quand c'est en minuscule.

Cette liste de fichier, vous l'avez modifié pour correspondre à vos besoins ? Par exemple sessionInfo et settings ?
0
Selon le vidéo d'installation, je devais entrer mes informations de mon serveur et tout dans le setting, Ensuite, Aller sur mon site pour configurer le site. J'ai donc fait ce qui est demandé. Tout semble fonctionné, mais 3 ou 4 pages, lors que je clique dessus, la page qui doit s'afficher est blanche. Je ne sais pas quoi fait pour que ca fonctionne et le support technique de mon fournisseur n'est pas terrible.
0
AssassinTourist Messages postés 5710 Date d'inscription lundi 16 janvier 2012 Statut Contributeur Dernière intervention 29 février 2024 1 311
25 mars 2012 à 00:53
Comme l'a dit Mopra-L, remplace tes include par des require_once pour qu'il soit plus causant. Tous tes include (j'en ai vu qu'il traînait au milieu pour intégrer le header et le menu nav)
0
tito23 Messages postés 305 Date d'inscription mardi 10 août 2010 Statut Membre Dernière intervention 16 janvier 2013 4
22 mars 2012 à 10:26
Ajoute
 ini_set("display_errors", 1); error_reporting(E_ALL);
au début de ton code, pour afficher les erreurs
0
J'ai ajouté ce que tu m'as conseillé au début de mon code, mais il n'y a toujours pas de message d'erreur.
0
tito23 Messages postés 305 Date d'inscription mardi 10 août 2010 Statut Membre Dernière intervention 16 janvier 2013 4
23 mars 2012 à 09:24
peut être que les erreurs sont gérées par un fichier htaccess à la racine de l'espace d'hébergement
0
je vérifie
0
Bonjour,
Une virgule de trop dans l'array peut faire bugué un programme :
$facebook = new Facebook(array('appId' => APP_ID, 'secret' => APP_SECRET, 'cookie' => true,));
0
J'ai testé et toujours rien!
0