The Arcive of vBulletin Modifications Site. |
|
why does this php page only work sometimes ? Details »»
|
|||||||||||||||||||||||||
<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 Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
try,
PHP Code:
|
|
#3
|
||||
|
||||
|
Quote:
PHP Code:
|
|
#4
|
|||
|
|||
|
Thanks guys, that was it !
I guess the global.php has to come before any HTML. |
![]() |
|
|