473,396 Members | 2,029 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,396 software developers and data experts.

Silent death - code stops processing but I get no errors

I've had buffer problems before where a script dies silently but no
error message ever reaches my screen, because of buffering issues.
Perhaps that is happening now. The other possibility, which I want to
ask this group about, is if after the closing </html> tag it is simply
impossible to get more HTML sent to a browser?

I've pages that are rendered by functions that are put into one of
three arrays, pageEventStart, pageEventMiddle, and pageEventEnd. All
the functions in pageEventStart are currently working correctly.
pageEventMiddle contains just one function, called renderPage, which
gets all the content for the page out of the database and sends it to
the visitors web browser. That too is working. The functions in
pageEventEnd don't seem to be working, and it is hard to figure out
why without error messages.

pageEventStart has functions like putNewCommentInDatastore. These type
things need to happen before any HTML is sent to the browser, or the
new comment won't show up when the page loads.

pageEventMiddle is where HTML is sent to the visitors web browser.

pageEventEnd mostly has functions like updateNumberOfViewsForPage,
which increments the number of times a page has been viewed. I save
this stuff for after the page has been sent to the browser, to reduce
the number of database calls needed to get info the visitor. The idea
is to speed things up.

So I ask, if I have an echo statement after the closing </html> should
it show up?

Interestingly, when I hit the 3 arrays below with print_r() I see that
all the correct values are there, including updateNumberOfViewsForPage
in pageEventEnd.


class McPageRender {

var $controllerForAll;
var $globalsObject;
var $pageEventStart;
var $pageEventMiddle;
var $pageEventEnd;

/*
* 09-26-03 -
* This is the most crucial object in the software. It is called into
* existence in McControllerForAll, which calls its runMainLoop
function. Everything else, all other functions, are
* called because someone has put a string representation of the
function name into one of these 3 variables:
* $pageEventStart
* $pageEventMiddle
* $pageEventEnd
*/
function McPageRender() {
$this->controllerForAll = new McControllerForAll();
$this->globalsObject =
$this->controllerForAll->getObject("McGlobals");
$this->pageEventStart = $this->globalsObject->getPageEventStart();
$this->pageEventMiddle = $this->globalsObject->getPageEventMiddle();
$this->pageEventEnd = $this->globalsObject->getPageEventEnd();
}

function runMainLoop() {
// 05-13-03 - the architexture of this software is simple, put your
functions in one of these 3 arrays:
//
// $pageEventStart - this is for functions that must execute before
any HTML is sent to the browser - stuff dealing with cookies, for
instance.
//
// $pageEventMiddle - this is for functions that should appear on
screen. Often, I assume, this would be in conjunction with
renderPageCancel=true. XML sitemaps, for instance. renderPage(), too,
most obviously.
//
// $pageEventEnd - this is for functions that should execute after
all the HTML is sent to the visitor. updateNumTimesArticleViewed()
would be an example.

// 05-07-03 - it's time to get serious about architexture, so we're
going to enforce the ban on $choiceMade
// 06-21--03 - nice idea but hopeless. There's too much code that's
been written using choiceMade. We'd have to rewrite the whole
// program if we wanted to definitely, absolutely, ban it from here.
We must find another path to security.
// rule that $choiceMade can never be used on this page.
//if ($choiceMade) die ("The programmer has made a mistake by using
the variable choiceMade on this page, where it is not allowed.");

// 09-17-03 - this function is getting moved to $pageRender today -
lk
for ($i=0; $i < count($this->pageEventStart); $i++) {
$function = $this->pageEventStart[$i];
if (!function_exists($function))
$this->controllerForAll->import($function, "n");
if (!function_exists($function)) {
print "The software is looking for a function called $function.
It's possible that you don't really need this function, in which case,
find the file that's calling for it and remove that file. First look
in the folder mcGlobalEvents, as it is likely to have unneeded files.
If, however, you need the function, then you need to reinstall the
software. Remember you can always find a copy at <a
href=\"http://www.publicDomainSoftware.org/\">Public Domain
Software</a>.";
} else {
$function();
}
}

for ($i=0; $i < count($this->pageEventMiddle); $i++) {
$function = $this->pageEventMiddle[$i];
if (!function_exists($function))
$this->controllerForAll->import($function, "n");
if (!function_exists($function)) {
print "The software is looking for a function called $function.
It's possible that you don't really need this function, in which case,
find the file that's calling for it and remove that file. First look
in the folder mcGlobalEvents, as it is likely to have unneeded files.
If, however, you need the function, then you need to reinstall the
software. Remember you can always find a copy at <a
href=\"http://www.publicDomainSoftware.org/\">Public Domain
Software</a>.";
} else {
$function();
}

}

for ($i=0; $i < count($this->pageEventEnd); $i++) {
$function = $this->pageEventEnd[$i];
if (!function_exists($function))
$this->controllerForAll->import($function, "n");
if (!function_exists($function)) {
print "The software is looking for a function called $function.
It's possible that you don't really need this function, in which case,
find the file that's calling for it and remove that file. First look
in the folder mcGlobalEvents, as it is likely to have unneeded files.
If, however, you need the function, then you need to reinstall the
software. Remember you can always find a copy at <a
href=\"http://www.publicDomainSoftware.org/\">Public Domain
Software</a>.";
} else {
$function();
}
}
}
}
Jul 17 '05 #1
1 2835
Hi lawrence!

On 24 Oct 2003 18:51:50 -0700, lk******@geocities.com (lawrence)
wrote:
I've had buffer problems before where a script dies silently but no
error message ever reaches my screen, because of buffering issues.
Yeah, I had that too. I use a debugging function which simply prints
what I want and runs flush(). But you can set it somewhere to flush
automatically, which is not as efficient.

Have you set error_reporting (E_ALL);

????
Perhaps that is happening now. The other possibility, which I want to
ask this group about, is if after the closing </html> tag it is simply
impossible to get more HTML sent to a browser?
You can definitely send more whatever you want, but if the browser
displays it is another question. Look up W3C for a definition.

...

HTH, Jochen
--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #2

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

Similar topics

0
by: Joe Shear | last post by:
Hi, Has anyone ever had any problems with MySQL w/ all InnoDB tables just stop processing queries? There doesn't seem to be any pattern to it, it happens at times of relatively high load (load...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
0
by: blkwebman | last post by:
I'm trying to create a "standalone" install package (without any of the dialog boxes that a standard setup package would have). I think I understand how to do it in VB6 (using PDCmdLn.exe); I have...
9
by: Jens Jensen | last post by:
Hello all, I need some design advice for my web service. I' have written a web service that exposes a function that takes some parameters and return an xml.
0
by: rb.online | last post by:
Hi all, I rencently had trouble finding a bug in an email processing script because of an error that pass silently in the email module. The get_payload() method in the email.message module...
1
by: ashore | last post by:
Under Win32/Vista, PHP 5, I have a batch of files to convert and I'm trying to script that in PHP. The following fails silently - while the hand-entered version - sans the escapes of course -...
0
by: WebCM | last post by:
PDO offers 3 modes of displaying errors: - silent mode - no errors - warnings - Warning: - exceptions - Exception: Which of them is the fastest and the most adequate for applications like CMS...
28
by: Joey Martin | last post by:
One of my servers got hacked with the SQL injection due to poor coding. So, I had someone write a stored procedure and new code. But, to me, it looks just as flawed, even using the stored...
112
by: istillshine | last post by:
When I control if I print messages, I usually use a global variable "int silent". When I set "-silent" flag in my command line parameters, I set silent = 1 in my main.c. I have many functions...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.