ob_get_contents(); ??

ob_get_contents(); ?? - PHP - Programmation

Marsh Posté le 29-05-2007 à 15:26:02    

salut à tous
 
Voici mon probleme : je tente de debugger un script pour un jeu en ligne mais je coince sur un élément (qui doit etre un detail)
 
voici les deux codes :
 
Dans le fichier 1, lignes qui nous interessent :

Code :
  1. // config check
  2. ob_start();
  3. require "secret/config.php";
  4. $config_content = ob_get_contents();
  5. ob_end_clean();


 
Dans le fichier config :
 

Code :
  1. <?php
  2. $dbusername = "monnom";
  3. $dbpassword = "xxx";
  4. $dbname = "monnom";
  5. $dbhost = "localhost";
  6. $dbtablename = "galaxy";
  7. $utablename = "usertable";
  8. $playertable = "players";
  9. $allytable = "alliances";
  10. $noticetable = "notices";
  11. $reporttable = "reports";
  12. $iptablename = "iptable";
  13. $shouttable = "shoutbox";
  14. $allyhistory = "alliances_history";
  15. $playerhistory = "players_history";
  16. $old_dbname = "monnom";
  17. $old_dbtablename = "tabelle";
  18. $old_utablename = "tabelle2";
  19. $old_pstablename = "tabelle3";
  20. $old_astablename = "tabelle4";
  21. $old_noticetable = "tabelle5";
  22. $old_reporttable = "tabelle6";
  23. $old_iptablename = "tabelle7";
  24. $old_shouttable = "tabelle8";
  25. $old_allyhistory = "tabelle9";
  26. if (isset($_SESSION['s_userid']) && is_numeric($_SESSION['s_userid'])) {
  27. $query = "UPDATE $utablename SET last_action=now() WHERE id='".$_SESSION['s_userid']."'";
  28. mysql_connect($dbhost,$dbusername,$dbpassword);
  29. mysql_select_db($dbname);
  30. mysql_query($query);
  31. mysql_close();
  32. }
  33. ?>


 
Dans le fichier 1, la commande !empty($config_content) me retourne true et j'ai du mal à comprendre pourquoi car le fichier config ne contient aucune erreur.. Merci de bien vouloir m'aider
++

Reply

Marsh Posté le 29-05-2007 à 15:26:02   

Reply

Marsh Posté le 29-05-2007 à 16:02:26    

Euh... il sert à quoi l'output buffering là, si l'autre script n'output rien ?

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed