473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Inclusion confusion (Javascript in function?)

Context: I am having a problem with the phpBB package. Currently about
0.4 on the 0-10.0 scale from utter cluelessness to wizardry with respect to
PHP, I find a small debugging package at
http://www.zend.com/zend/tut/tutorial-DebugLib.php
and take the script presented there and name its file debugging.php. It
includes several function definitions, but no other code. So that you don't
have to follow the link, my guess is that the relevant definition is:
function debug_open_window()
{
static $window_opened = FALSE;
if(!$window_opened)
{
?>
<script language="JavaScript">
debugWindow =
window.open("","debugWin","toolbar=no,scrollbars,w idth=600,height=400");
debugWindow.document.writeln('<html>');
debugWindow.document.writeln('<head>');
debugWindow.document.writeln('<title>PHP Remote Debug
Window</title>');
debugWindow.document.writeln('</head>');
debugWindow.document.writeln('<body><font face="verdana,arial">');
debugWindow.document.writeln('<hr size=1 width="100%">');
</script>
<?
$window_opened = TRUE;
}
}

I insert as the first statement of the phpBB's index.php:
include('debugging.php');

and load index.php. The aim is to see whether the debugging code will parse
error-free. I get the following output prior to the expected first page of
our Forum:

Warning: Cannot modify header information - headers already sent by (output
started at [path]/forum/debugging.php:1) in
[path]/forum/includes/page_header.php on line 483

and two more of the same warnings for lines 485 and 486. Each of these
statements is a call to header().

Am I the only one confused, or is the PHP 4.4.2 that my shared linux/Apache
host is running also confused? I am confused because I don't see how simply
defining functions could generate the warnings.

--
For mail, please use my surname where indicated:
st***@surname.reno.nv.us (Steve Brecher)
May 12 '06 #1
3 1391
I wrote:
I find a small debugging package at
http://www.zend.com/zend/tut/tutorial-DebugLib.php
and take the script presented there and name its file debugging.php. It
includes several function definitions, but no other code.


But it does include a space character at the start of the file immediately
before "<?php" and that is what generated the warnings.

--
For mail, please use my surname where indicated:
st***@surname.reno.nv.us (Steve Brecher)
May 12 '06 #2
Steve Brecher wrote:
Context: I am having a problem with the phpBB package. Currently about
0.4 on the 0-10.0 scale from utter cluelessness to wizardry with respect to
PHP, I find a small debugging package at
http://www.zend.com/zend/tut/tutorial-DebugLib.php
and take the script presented there and name its file debugging.php.


Good luck. Beware that debugging phpBB might make you go blind 8-)

May 12 '06 #3
Carved in mystic runes upon the very living rock, the last words of
Steve Brecher of comp.lang.php make plain:
I wrote:
I find a small debugging package at
http://www.zend.com/zend/tut/tutorial-DebugLib.php
and take the script presented there and name its file debugging.php.
It includes several function definitions, but no other code.


But it does include a space character at the start of the file
immediately before "<?php" and that is what generated the warnings.


Always the first thing to suspect, with that sort of problem. The second
thing to suspect is white space after the ?>, and the third thing to
suspect is invisible characters (e.g. control characters) which can creep
in upon occasion.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
May 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Don | last post by:
I was recently handed responsibility for a web site that is a combination of ASP, javascript, and some cgi-bin style programs which generate HTML with javascript. Though I'm new to javascript, the...
16
by: Nathan Funk | last post by:
I used to work as a web designer a couple of years ago, but I haven't been closely in touch in the past years. Has anything changed recently for managing content that is common among many pages...
2
by: icoba | last post by:
I have the following code: A.py ==== from B import B class R: def __str__(self): return "hello world"
9
by: Max | last post by:
This instruction don't work in netscape 6 <script language="javascript" src="/pippo.js"></script> In 4.8 /ie5/ie6 ok !!! Can you help me ? Thanks
1
by: saiprasanthi | last post by:
HI!!! I request you to kindly go through the code... I'm getting an error in line 71 as "Unterminated String Constant" which I'm not able to find out. Please help me at the earliest. ...
1
by: kungfumike | last post by:
Currently having a problem getting JSON to include properly. I When I attempt to call .toJSONstring on an array it was giving me an error. So I resorted to just alerting the array out to the screen...
10
by: Stevo | last post by:
Simplified example code which can be copy/pasted and will exhibit the problem. var ob={id:2}; ob.alertid=function(){alert("id="+this.id);} ob.funcs=; ob.testalert=function(){ this.alertid();...
2
by: VJ | last post by:
I tried to write sample code to get understanding of javascript's prototypal inheritance (along with the variety of function calling choices.. ) During the process, I got myself throughly...
27
by: Erwin Moller | last post by:
Hi group, Consider this simple script (tested on FF3): <script type="text/javascript"> test = 'outer'; for (var i=0;i<2;i++){ alert(test); var test = 'inner'; alert (test);
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.