![]() |
why does this php page only work sometimes ?
<noob-alert />
I am trying to do my first DB fetches from a web page (.../forum/example.php) and am using this code: <html><head></head><body> <?php error_reporting(7); echo("Latest posts<p>"); include( "global.php"); $latestthread=$DB_site->query("SELECT title,threadid,dateline FROM thread ORDER BY dateline DESC LIMIT 20"); while ($latestthreads=$DB_site->fetch_array($latestthread)) { echo ("$latestthreads[title]<br>"); } ?> </body></html> Now the strange thing is it only works sometimes, at other times I get a standard error template (including some goobledigook about being "Unable to add cookies, header already sent") back from PHP which I assume means it could not get the data for some reason ? Perhaps relevant: the forum directory is a passworded realm for my apache server, but IE correctly asks me for the pw/login for example2.php (I have a feeling it is the include("global.php") statement that is bombing, since taking everything else but that away i still get the error) The server is running on Win2K, and I am browsing from an XP HE/IE 6 client. Thanks Robert |
try,
PHP Code:
|
Quote:
PHP Code:
|
Thanks guys, that was it !
I guess the global.php has to come before any HTML. |
All times are GMT. The time now is 12:34 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|