Version complète: sur le forum Webmaster Hub : Pafiledb
Webmaster Hub > Création et exploitation de Sites Internet > Les langages du Net > PHP
Florian
Bonjour, j'ai des problèmes avec Pafiledb. J'ai éssayé de le personnaliser au gout du design de mon site. tout s'est adapté à mon design. Le seul problème c'est au moment de me connecté à mon panneau d'administration il me marque une erreur j'aurais besoin de votre aide. Si quelqu'un s'y connait bien au niveau de ce script je lui donnerais mes infos de connection au panneau d'administration du pafiledb. Merci d'avance wink.gif
Dan
Salut Florian,

Et si tu nous donnais l'erreur renseignée... ?
On pourrait peut-être t'aider.

Dan
Florian
Ah désolé voici donc l'erreur
CODE
Warning: Cannot modify header information - headers already sent by (output started at /var/www/free.fr/b/f/sensationride/pafiledb.php:8) in /var/www/free.fr/b/f/sensationride/includes/admin/login.php on line 36

Warning: Cannot modify header information - headers already sent by (output started at /var/www/free.fr/b/f/sensationride/pafiledb.php:8) in /var/www/free.fr/b/f/sensationride/includes/admin/login.php on line 38


L'adresse du site (test) http://sensationride.free.fr wink.gif
Dan
C'est une erreur classique. En fait, avant l'appel à la fonction header (ou au cookie), tu as dû faire un écho vers le browser.

Assures-toi que tu n'as pas le moindre caractère envoyé vers le browser avant d'envoyer une entête ou de mettre un cookie (même un simple espace suffit pour créer l'ereur).

Dan
Dan
Regarde surtout du côté du fichier /var/www/free.fr/b/f/sensationride/pafiledb.php (vers la ligne 8)
Tu as dû laisser un espace quelque part... ou afficher un message d'erreur.
Florian
Sur ma ligne 8 de la page pafiledb.php c'est en fait une ligne de code de mon site et pas du script en question je vous laisse découvrir le script de cette page

CODE
<link href="/FoireFM.css" rel="stylesheet" type="text/css">
<table width="558" align="center" cellspacing="5">

     <tr>
       <td colspan="2" valign="top"><table width="97%"  border="0" cellpadding="0" cellspacing="0">
         <tr>
           <td width="4%" rowspan="4"><img src="/Images/Ban/01.jpg" width="20" height="110"></td>
           <td><img src="/Images/Ban/02.jpg" width="40" height="20"></td>
           <td width="8%" rowspan="2" valign="top"><img src="/Images/Ban/05.jpg" width="40" height="50"></td>
           <td width="5%" rowspan="4" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
             <tr>
               <td><img src="/Images/Ban/08.jpg" width="30" height="20"></td>
             </tr>
             <tr>
               <td><a href="http://www.foirefm.net/foirefmwm.asx"><img src="/Images/Ban/09.jpg" width="30" height="30" border="0"></a></td>
             </tr>
             <tr>
               <td><img src="/Images/Ban/10.jpg" width="30" height="60"></td>
             </tr>
           </table></td>
           <td width="75%" rowspan="4" valign="top"><img src="/Images/Ban/11.jpg" width="826" height="110"></td>
         </tr>
         <tr>
           <td width="8%"><a href="http://www.foirefm.net/foirefmwinamp.m3u"><img src="/Images/Ban/03.jpg" width="40" height="30" border="0"></a></td>
         </tr>
         <tr>
           <td rowspan="2"><img src="/Images/Ban/04.jpg" width="40" height="60"></td>
           <td width="8%" valign="top"><a href="http://www.foirefm.net/foirefmreal.ram"><img src="/Images/Ban/06.jpg" width="40" height="40" border="0"></a></td>
         </tr>
         <tr>
           <td valign="top"><img src="/Images/Ban/07.jpg" width="40" height="20"></td>
         </tr>
       </table></td>
  </tr>
     <td width="150" valign="top"><? include 'Menu.php'; ?></td>
   <td width="806" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
     <tr>
       <td><img src="/Images/Arrondi3.gif" width="20" height="20"></td>
       <td class="Cadre0">&nbsp;</td>
       <td><img src="/Images/Arrondi4.gif" width="20" height="20"></td>
     </tr>
     <tr>
       <td colspan="3" class="Cadre0">     <br><div class="Texte"><?php
/*
 paFileDB 3.1
 ©2001/2002 PHP Arena
 Written by Todd
 todd_AT_phparena.net
 http://www.phparena.net
 Keep all copyright links on the script visible
 Please read the license included with this script for more information.
*/

if (file_exists("./install.php")) { die("Error: The file install.php (paFileDB installer) still exists on the server! This is a security risk! Please delete the file to continue using paFileDB."); }
/*---------------------
If register_globals is off, we'll extract all of the superglobals so they can be used.
---------------------*/
if (!@ini_get('register_globals')) {
extract($_GET);
extract($_POST);
extract($_COOKIE);
extract($_SERVER);
}

$starttime = microtime();
$starttime = explode(" ",$starttime);
$starttime = $starttime[1] + $starttime[0];
$authmethod = "cookies"; //Set this to 'cookies' to use cookies to log you in (recommended.) If you're having problems with cookies, set this to 'sessions' and make sure a 'sessions' directory exists and is CHMODed to 777 (on *nix servers)
if ($authmethod == "sessions") {
session_save_path("./sessions");
session_start();
}
require "./includes/mysql.php";
require "./includes/functions.php";
$pafiledb_sql->connect($db);
$config = $pafiledb_sql->query($db,"SELECT * FROM $db[prefix]_settings",1);
$str = array();
require "./lang/$config[13].php";
if ($login == "do") { include "./includes/$action/login.php"; exit; }
if ($ad == "logout") { include "./includes/admin/logout.php"; exit; }
if ($tm == "logout") { include "./includes/team/logout.php"; exit; }
$logged = "";
require "./includes/admin/auth.php";
require "./includes/team/auth.php";
if ($action == "download") {
include "./includes/download.php";
exit();
}
if ($logged == 1 && $ad == "backupdb") {
include "includes/admin/backupdb.php";
exit();
}
?>
<html>
<head>
<!--Download database powered by paFileDB 3.1. Visit http://www.phparena.net/pafiledb for your own free copy!-->
<!--If you're actually reading these comments, then you need a life....................-->
<title>paFileDB 3.1</title>
<style type="text/css">
<?php include "./styles/$config[11]/style.css"; ?>
</style>
<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<center>
<!--Begin main table-->
<table width="100%" height="99%" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFCC00" class="table">
<tr>
<td width="100%" height="100%" valign="top">
<!--Begin header table-->
<table width="100%" height="100" border="0" cellpadding="2" cellspacing="0" class="table">
<tr>
<td width="25%" valign="center" align="center">
<a href="/pafiledb.php"><img src="styles/<?php echo $config[11]; ?>/images/logo.gif" border="0"></a>
</td><td width="75%" valign="center" align="right">
<a href="/pafiledb.php?action=search"><img src="styles/<?php echo $config[11]; ?>/images/search.gif" border="0"></a>&nbsp;&nbsp;<a href="/pafiledb.php?action=stats"><img src="styles/<?php echo $config[11]; ?>/images/stats.gif" border="0"></a>&nbsp;&nbsp;<a href="<?php echo $config[5]; ?>"><img src="styles/<?php echo $config[11]; ?>/images/homepage.gif" border="0"></a>
</td></tr></table>
<!--End header table-->
<!--Begin page table-->
<?php
if ($logged == 1 && $ad != "logout") {
$width = 100;
} else {
$width = 80;
}
?>
<table width="<?php echo $width; ?>%" height="30" border="0" cellpadding="2" cellspacing="0" class="table" align="center">
<tr>
<td width="100%" valign="top" align="left" colspan="2">
<?php
$disable = $config[16];

if ($logged)
$disable = 0;
if ($action == "admin")
$disable = 0;
if ($teamlogged == 1 && $action !== "team")
tmlocbar("",$tuser,$str);
if ($teamlogged == 1 && $action == "team")
tmlocbar("<a href=\"pafiledb.php\" class=\"small\">$config[1]</a> :: $str[teamcenter]",$tuser, $str);
if (!$disable) {
switch ($action) {
 case category:
  include "./includes/category.php";
 break;
 case file:
  include "./includes/file.php";
 break;
 case viewall:
  include "./includes/viewall.php";
 break;
 case search:
  include "./includes/search.php";
 break;
 case license:
  include "./includes/license.php";
 break;
 case rate:
  include "./includes/rate.php";
 break;
 case admin:
  include "./includes/admin.php";
 break;
 case team:
  include "./includes/team.php";
 break;
 case email:
  include "./includes/email.php";
 break;
 case stats:
  include "./includes/stats.php";
 break;
 default:
  include "./includes/main.php";
 break;
}
} else {
?>
<table width="100%" border="1" cellpadding="2" cellspacing="0" class="headertable" bordercolor="#000000">
<tr><td width="100%" colspan="2" class="headercell"><center><b>paFileDB</b></center></td></tr>
<tr><td width="5%" class="datacell" align="center" valign="middle"><img src="styles/<?php echo $config[11]; ?>/images/error.gif" border="0"></td><td width="95%" class="datacell"><?php echo $str[isdisabled]; ?>
</td></tr></table>
<?php
}
?>
</td></tr>
<tr>
<td width="50%" align="left">
<?php jumpmenu($db,$HTTP_SERVER_VARS['REQUEST_URI'],$pafiledb_sql,$str); ?>
</td><td width="50%" align="right"><?php echo "$str[time] $config[8]"; ?></td></tr></table>
<!--End page table-->
<!--Begin footer table-->
<table width="100%" height="30" border="0" cellpadding="2" cellspacing="0" class="footer">
<tr>
<td width="100%" valign="center" align="center">
<?php echo $str[power]; ?> paFileDB 3.1<br>2002 <a href="http://www.phparena.net" class="small" target="phparena">PHP Arena</a>
</td></tr>
<tr><td width="100%" valign="center" align="center">
<?php
$endtime = microtime();
$endtime = explode(" ",$endtime);
$endtime = $endtime[1] + $endtime[0];
$stime = $endtime - $starttime;
if ($config[12] == 1) {
?>
<table width="30%" border="1" cellpadding="2" class="stats" bordercolor="#000000">
<tr><td width="50%" align="left"><?php echo $str[exectime]; ?>:</td><td width="50%" align="right"><?php echo round($stime,4); ?> Seconds</td></tr>
<tr><td width="50%" align="left"><?php echo $str[numqueries]; ?>:</td><td width="50%" align="right"><?php echo $query_count; ?> Queries</td></tr>
</table>
<?php
if ($showqueries == 1) {
 ?>
 <p>
 <table width="100%" border="1" cellpadding="2" class="headertable" bordercolor="#000000">
 <tr><td width="100%" class="headercell" align="center"><b>Queries Used</b></td></tr>
 <?php echo $queries_used; ?>
 </table>
 <?php
}
}
?>
</table>
<!--End footer table-->
<!--End main table-->
</td></tr></table>

         <br>
         <br>
       </div></td>
     </tr>
     <tr>
       <td colspan="3" align="left" class="Cadre0"><div align="center">. : : Code, Design et Securisation par <a href="mailto:icedragon85_AT_hotmail.fr">[Nox] Ice Dragon 85 </a> : : .</div></td>
       </tr>
     <tr>
       <td width="2%" align="left"><div align="center"><img src="/Images/Arrondi2.gif" width="20" height="20"></div></td>
       <td width="96%" class="Cadre0"><div align="center"></div></td>
       <td width="2%" align="right"><img src="/Images/Arrondi.gif" width="20" height="20"></td>
     </tr>
   </table>
     <br>
</td>

</table>


Voilà wink.gif
Dan
Salut Florian,

C'est en fait le code de la ligne 36 du fichier /var/www/free.fr/b/f/sensationride/includes/admin/login.php qui envoie soit un header, soit un cookie. Mais comme il y a déjà eu des données envoyées au navigateur par le fichier pahfiledb.php, tu as ce message "headers already sent".

Je ne pense pas que le fichier pahfiledb que tu donnes en exemple soit correct... il manque le début de fichier.
Tu as un écho de <table> au début de fichier, et un <html><head>... vers le milieu. Ce n'est pas normal.
A mon avis, c'est toi qui a rajouté ce code au début !
Florian
Sur mon script pafiledb.php j'ai justa rajouté le script de mon site rien de plus.

Pour la page login.php je vais regarder mais je n'y est pas touché ça me parait étrange unsure.gif
Dan
CITATION(Florian @ jeudi 21 juillet 2005, 15h28)
Sur mon script pafiledb.php j'ai justa rajouté le script de mon site rien de plus.
*

C'est ce qui se trouve en début de fichier ? Parce que c'est là que ça foire.
Florian
Oui tout ça
CODE
<link href="/FoireFM.css" rel="stylesheet" type="text/css">
<table width="558" align="center" cellspacing="5">

    <tr>
      <td colspan="2" valign="top"><table width="97%"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="4%" rowspan="4"><img src="/Images/Ban/01.jpg" width="20" height="110"></td>
          <td><img src="/Images/Ban/02.jpg" width="40" height="20"></td>
          <td width="8%" rowspan="2" valign="top"><img src="/Images/Ban/05.jpg" width="40" height="50"></td>
          <td width="5%" rowspan="4" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td><img src="/Images/Ban/08.jpg" width="30" height="20"></td>
            </tr>
            <tr>
              <td><a href="http://www.foirefm.net/foirefmwm.asx"><img src="/Images/Ban/09.jpg" width="30" height="30" border="0"></a></td>
            </tr>
            <tr>
              <td><img src="/Images/Ban/10.jpg" width="30" height="60"></td>
            </tr>
          </table></td>
          <td width="75%" rowspan="4" valign="top"><img src="/Images/Ban/11.jpg" width="826" height="110"></td>
        </tr>
        <tr>
          <td width="8%"><a href="http://www.foirefm.net/foirefmwinamp.m3u"><img src="/Images/Ban/03.jpg" width="40" height="30" border="0"></a></td>
        </tr>
        <tr>
          <td rowspan="2"><img src="/Images/Ban/04.jpg" width="40" height="60"></td>
          <td width="8%" valign="top"><a href="http://www.foirefm.net/foirefmreal.ram"><img src="/Images/Ban/06.jpg" width="40" height="40" border="0"></a></td>
        </tr>
        <tr>
          <td valign="top"><img src="/Images/Ban/07.jpg" width="40" height="20"></td>
        </tr>
      </table></td>
 </tr>
    <td width="150" valign="top"><? include 'Menu.php'; ?></td>
  <td width="806" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><img src="/Images/Arrondi3.gif" width="20" height="20"></td>
      <td class="Cadre0">&nbsp;</td>
      <td><img src="/Images/Arrondi4.gif" width="20" height="20"></td>
    </tr>
    <tr>
      <td colspan="3" class="Cadre0">     <br><div class="Texte">


Mais je ne vois pas vraiment en quoi il pourrais y avoir un problème ce script fait appel a ma page de menu et a ma bannière wink.gif
Dan
Tu as rajouté ce pavé au dessus des balises <html> et <body> qui se trouvent plus loin dans le document.

Comme le code php est exécuté après l'envoi de ces lignes vers le terminal, cela te donne une erreur "headers already sent"....

C'est ce que j'essaie de te faire comprendre depuis hier. whistling.gif

Déplace ce pavé pour le mettre après <body>

Dan
Florian
Ok merci je vais essayé et je vous tiens au courant wink.gif
Florian
Bon comme j'avais dis que je vous tiendrais au courant en effet tout refonctionne correctement merci beaucoup
Ceci est une version "bas débit" de notre forum. Pour voir la version complète avec plus d'information, la mise en page et les images, veuillez cliquer ici.