[SOLVED(kinda)]display failure

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ryuuka
Forum Contributor
Posts: 128
Joined: Tue Sep 05, 2006 8:18 am
Location: the netherlands

[SOLVED(kinda)]display failure

Post by ryuuka »

ok
here i am trying to redesign a website i've been building
and as soon as i start with the php code the site doesn't display anything anymore

wich is weird because i walked through every line of the code and i couldn't discover
a thing. i discovered where the error is though
the whole disaster starts when i'm trying to input php. i am also using tables to make the site instead if the previous one that used <div> tags for this.

the first part of this code is the most important i think so i will post that seperate from the rest.

Code: Select all

error_reporting(E_ALL); 
  ini_set('display_errors', TRUE);

function getmicrotime() {
  list($usec,$sec) = explode(" ",microtime());
  return((float)$usec + (float)$sec);
}
$time = getmicrotime();


$include_index = 1;


session_start();


$db = new COM("ADODB.Connection") or die("Kan ADO niet starten");
$db->Open("dsn=@@@_Inventory;server=sr0005.@@@.net;database=@@@_ICT;Trusted_Connection=yes");

$rs = $db->Execute("select waarde from menu_instellingen");


$s_ItemsPage = $rs->fields['waarde']->value;


$rs->MoveNext();

$s_Titel = $rs->fields['waarde']->value;

$rs->MoveNext();

$s_MenuSkin = $rs->fields['waarde']->value;

$rs->MoveNext();


$s_VoetTekst = $rs->fields['waarde']->value;


$rs->MoveNext();

$rs = $db->Execute("SELECT menu_functie FROM menu_functie");
while (!$rs->EOF) {

 include("system/".($rs->fields['menu_functie']->value).".inc.php");

  $rs->MoveNext();
}

// Start buffering the output
ob_start();


if (!$cache_header = readCache('3_header.cache', 0)) {

  // XHTML
  echo "\n  <head>";
  echo "\n    <title>$titel</title>";
  echo "\n   <SCRIPT src='@@@/show.js' type=text/javascript></SCRIPT>";
  echo "\n    <link href='skin/".$s_MenuSkin."/screen.css\' rel='stylesheet' type='text/css' />";
  echo "\n    <LINK media=print href='@@@/print.css' type=text/css rel=stylesheet>";
  echo "\n    <meta http-equiv=\"MSTHEMECOMPATIBLE\" content=\"no\" />";

  // JAVASCRIPT FUNCTIES
  include("system/javascript_dropdown_page.inc.php");
  include("system/javascript_bevestiging.inc.php"  );
the rest is available on request because i didn't want to clutter this post with another 250 lines.

ps as always the @@@ is the name of the company doesn't make a difference
Last edited by ryuuka on Thu Nov 23, 2006 1:37 am, edited 2 times in total.
User avatar
ferreira.jorge
Forum Newbie
Posts: 11
Joined: Tue Nov 14, 2006 6:13 am
Location: Portugal

Post by ferreira.jorge »

I believe that the session_start(); should be the first thing in your code.
ryuuka
Forum Contributor
Posts: 128
Joined: Tue Sep 05, 2006 8:18 am
Location: the netherlands

Post by ryuuka »

tried it and i'm afraid to say it isn't working

didn't think it would tbh because i've copied all this code from another site
wich also belongs to us. I have only modified the current site and have turned
the div tags with the table rules you see.

so it shouldn't matter
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

I see you are buffering the output. Do you call ob_end_flush() later on in the script to output the browser?
ryuuka
Forum Contributor
Posts: 128
Joined: Tue Sep 05, 2006 8:18 am
Location: the netherlands

Post by ryuuka »

yes right before the dbase connection is closed
ryuuka
Forum Contributor
Posts: 128
Joined: Tue Sep 05, 2006 8:18 am
Location: the netherlands

Post by ryuuka »

solved the problem
it had something to do with the following line:

Code: Select all

if (!$cache_header = readCache('3_header.cache', 0)) {
i have no idea what the problem was but now i removed it, it works.
thanks for the tip on the buffering output it's because of that i noticed this.
Post Reply