473,786 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_wind ow()
{
static $window_opened = FALSE;
if(!$window_ope ned)
{
?>
<script language="JavaS cript">
debugWindow =
window.open("", "debugWin","too lbar=no,scrollb ars,width=600,h eight=400");
debugWindow.doc ument.writeln(' <html>');
debugWindow.doc ument.writeln(' <head>');
debugWindow.doc ument.writeln(' <title>PHP Remote Debug
Window</title>');
debugWindow.doc ument.writeln(' </head>');
debugWindow.doc ument.writeln(' <body><font face="verdana,a rial">');
debugWindow.doc ument.writeln(' <hr size=1 width="100%">') ;
</script>
<?
$window_opened = TRUE;
}
}

I insert as the first statement of the phpBB's index.php:
include('debugg ing.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.r eno.nv.us (Steve Brecher)
May 12 '06 #1
3 1409
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.r eno.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
2763
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 language isn't causing my any headaches but the difference in how code gets processed by different browsers is enough to send me searching for Zoloft. One of the generated pages has this general structure: <html>
16
2013
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 (menus, headers, footers...)? The main options I recall are: - Frames :P - Server-side includes - Dreamweaver templates - PHP includes
2
2741
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
1244
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
1539
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. ------------------------------------------------------------------------------------------------------------------- <%@ Language=VBScript %> <% Response.CacheControl = "no-cache" %> <%Response.Expires = -1%> <%
1
1655
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 and here is what prints out: key is: tmp1, value is: tmp1; key is: tmp2, value is: tmp2; key is: tmp3, value is: tmp3; key is: toJSONstring, value is: function () { var a = , b,
10
1221
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(); //this works this.funcs(); //this doesn't }
2
1306
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 confused. Can anyone explain following behavior here is my code: <html>
27
1700
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
9650
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.