[PHP] ob_start("ob_gzhandler") producing garbage before document header

2009-01-18 Thread Graham Anderson
Hi, using ob_gzhandler produces a 5-8 characters, �“×2���, before the document header. Using ob_start() does not produce the text garbage. Is there a way to get ob_start("ob_gzhandler") to behave? Many thanks in advance Abridged Code: ob_start("ob_gzhandler"); //produces initial text ga

Re: [PHP] ob_start: Capturing STDOUT and STDERR

2008-03-23 Thread Casey
On Sun, Mar 23, 2008 at 6:08 PM, Greg Sims <[EMAIL PROTECTED]> wrote: > Hey There, > > I looked at the ob_start manual and found a segment of code that can be used > to capture the output of a shell script and place it into a log file. One > of the entries indicates this should work for both ST

[PHP] ob_start: Capturing STDOUT and STDERR

2008-03-23 Thread Greg Sims
Hey There, I looked at the ob_start manual and found a segment of code that can be used to capture the output of a shell script and place it into a log file. One of the entries indicates this should work for both STDOUT and STDERR (29-Mar-2007). I wrote the following piece of code to test it out

Re: [PHP] ob_start <> eval?

2007-07-05 Thread blackwater dev
We have short tags enabled as our templates work fine with them. Thanks! On 7/5/07, Larry Garfield <[EMAIL PROTECTED]> wrote: If I understand what you're doing correctly, then it should work and I've done it many times. First thing you should do, though, is switch from short tags to proper ta

Re: [PHP] ob_start <> eval?

2007-07-05 Thread Larry Garfield
If I understand what you're doing correctly, then it should work and I've done it many times. First thing you should do, though, is switch from short tags to proper tags, . If you have short tags disabled, it will not parse I have a template system that takes some data, scrubs it and then wit

[PHP] ob_start <> eval?

2007-07-05 Thread blackwater dev
I have a template system that takes some data, scrubs it and then with a load method includes the required template. I need to add a param so it doesn't simply include but returns the contents of the template in a string with all of the vars populated. I tried: ob_start(); include my template

Re: [PHP] ob_start("ob_gzhandler") and error handling functions

2006-12-21 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-12-20 14:12:11 +: > I include a php file at the beginning of every web page in this site. > This include file has an error handling function and starts output > buffering... > > // Start of Error Handler > error_reporting(E_ALL ^ E_NOTICE); > ini_set('log_errors','

Re: [PHP] ob_start("ob_gzhandler") and error handling functions

2006-12-21 Thread IG
Hi again, Just wandering if someone could help me on this one- I'm quite anxious to get something together. As I said in the last email I just want to use ob_start("ob_gzhandler") but it doesn't seem to work with the error function. I think it might be something to do with not being allowed w

[PHP] ob_start("ob_gzhandler") and error handling functions

2006-12-20 Thread IG
Hi, I include a php file at the beginning of every web page in this site. This include file has an error handling function and starts output buffering... // Start of Error Handler error_reporting(E_ALL ^ E_NOTICE); ini_set('log_errors','1'); function ErrHandler($err,$err_string='',$err_file,

Re: [PHP] ob_start() and a callback function within a class,not updating ob_get_level().

2006-11-22 Thread Mathijs
Richard Lynch wrote: On Thu, November 16, 2006 7:35 am, Mathijs wrote: I have a question about ob_start() and ob_get_level(). When i use ob_start(), and then check ob_get_level(), it shows me 1. This is a normal behavior. Now when i do the following ob_start(array('ClassName', 'ClassMethod')).

[PHP] ob_start() and a callback function within a class, not updating ob_get_level().

2006-11-16 Thread Mathijs
Hello there, I have a question about ob_start() and ob_get_level(). When i use ob_start(), and then check ob_get_level(), it shows me 1. This is a normal behavior. Now when i do the following ob_start(array('ClassName', 'ClassMethod')). It does execute the methode, but it doesn't update ob_get_

Re: [PHP] ob_start & session_start

2005-12-07 Thread Zack Bloom
Sorry it looked like the rest of your email was part of the previous one. To answer your question it is better to call session_start() before ob_start() On 12/8/05, Zack Bloom <[EMAIL PROTECTED]> wrote: > > I have never tried it but if it did work i doubt it would use cookies, it > would probably

Re: [PHP] ob_start & session_start

2005-12-07 Thread Zack Bloom
I have never tried it but if it did work i doubt it would use cookies, it would probably pass it in the addresses or throw an error. On 12/8/05, Joe Harman <[EMAIL PROTECTED]> wrote: > > I guess this was just out of general curiousity... If you started > 'session_start()' after 'ob_start()' would

Re: [PHP] ob_start & session_start

2005-12-07 Thread Chris Shiflett
Zack Bloom wrote: Sure, ob_start begins a buffer allowing you to display content in the browser before your script has finished executing. Calling ob_start() turns on PHP's output buffering. In other words, it buffers output from the moment this function is called until the buffer is flushed

Re: [PHP] ob_start & session_start

2005-12-07 Thread Curt Zirzow
On Thu, Dec 08, 2005 at 01:23:40AM -0500, Joe Harman wrote: > > So, the question is really... in what order is the best way to do > this... I would think that you always want to start a session first... > but then again, you guys are the experts... i am sure someone knows a > reason when you shoul

Re: [PHP] ob_start & session_start

2005-12-07 Thread Joe Harman
I guess this was just out of general curiousity... If you started 'session_start()' after 'ob_start()' would the sessions work correctly? k.. maybe I am still confused... lol... I normally do session_start() before the ob_start()... Zack Said : 'yes, it will display the content in the buffer

Re: [PHP] ob_start & session_start

2005-12-07 Thread Zack Bloom
Sure, ob_start begins a buffer allowing you to display content in the browser before your script has finished executing. This is useful when loading a time intensive page to tell the user to wait. When you create a session (provide php is not configured otherwise) php attempts to store a cookie w

Re: [PHP] ob_start & session_start

2005-12-07 Thread Chris Shiflett
Joe Harman wrote: Okay...makes sense after you spelled it out to me. That didn't make sense to me (and I missed the original reply). Mind elaborating? :-) Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ -- PHP General Mailing List (http://www.php.net/) To unsu

Re: [PHP] ob_start & session_start

2005-12-07 Thread Joe Harman
Okay.. makes sense after you spelled it out to me... LOL... I always start my session first.. so, that must why i have never had any problems Cheers & Thanks! Joe On 12/7/05, Zack Bloom <[EMAIL PROTECTED]> wrote: > yes, it will display the content in the buffer before creating the session. > If

[PHP] ob_start & session_start

2005-12-07 Thread Joe Harman
Hello, Something just crossed my mind about using output buffering is there any reason why you should start a session before calling ob_start() ??? Just curious which way would be the proper way of doing it... or doesn't it matter? Thanks -- Joe Harman - * My programs never have bug

[PHP] ob_start and ob_get_contents buffering problem

2005-10-07 Thread Dasdan
question: I try to buffer the output of the 'system/views/main.php' into $contents. and then do a print. Problem is that the contents of the system/views/main.php are printed 2 times. Someone who can explain me? following the contents of testfile.php and main.php, php.ini settings concerning ob_ ..

Re: [PHP] ob_start changed from php4 to php5?

2005-08-19 Thread Marten Lehmann
Hello! I'm also guessing that it's the LAST line of the file with the "encodeDomain" function in it that you "include" in your test.php I'm also guessing that there's a NEWLINE character after the final ?> in that file on your 5.0.4 box, but that NEWLINE character is *NOT* there on your 4.0 box

Re: [PHP] ob_start changed from php4 to php5?

2005-08-18 Thread Jasper Bryant-Greene
Richard Lynch wrote: Warning: Cannot modify header information - headers already sent in test.php on line 4 I'm guessing that the error message has MORE information than that -- like the line number of the file in which the output occurred. I'm also guessing that it's the LAST line of the fil

Re: [PHP] ob_start changed from php4 to php5?

2005-08-17 Thread Richard Lynch
On Wed, August 17, 2005 10:12 am, Marten Lehmann wrote: > I have a function catching the output of a script: > > function encodeDomain ($domain) { > ob_start(); > system("echo '$domain'"); > $output = ob_get_contents(); > ob_end_clean(); > } > > And I have a php-

Re: [PHP] ob_start changed from php4 to php5?

2005-08-17 Thread Rory Browne
This doesn't help with your ob problem, but if you simply want to capture the output of the system cmd, then you can use $output = shell_exec($command) instead of system() IIRC. On 8/17/05, Marten Lehmann <[EMAIL PROTECTED]> wrote: > Hello, > > I have a function catching the output of a script: >

[PHP] ob_start changed from php4 to php5?

2005-08-17 Thread Marten Lehmann
Hello, I have a function catching the output of a script: function encodeDomain ($domain) { ob_start(); system("echo '$domain'"); $output = ob_get_contents(); ob_end_clean(); } And I have a php-script using this function: http://www.php.net";); ?> While this w

Re: [PHP] ob_start callback preg_replace

2004-06-02 Thread Marek Kilimajer
John Kaspar wrote: Can someone help me with preg_replace? I want to convert all numbers either 8 or 9 digits in length, into a link. Such that when it sees: John Doe, 456890123, is a new employee. It converts it to: John Doe, 456890123, is a new employee. function callback($buffer) { // crea

[PHP] ob_start callback preg_replace

2004-06-02 Thread John Kaspar
Can someone help me with preg_replace? I want to convert all numbers either 8 or 9 digits in length, into a link. Such that when it sees: John Doe, 456890123, is a new employee. It converts it to: John Doe, 456890123, is a new employee. function callback($buffer) { // create id links retur

[PHP] ob_start() and session_start() conflicts

2004-02-17 Thread Duncan
Hi, I am currently working on a download script, where I use a session variable to make sure that the downloaded file cannot be linked directly. However, this protection is not mandatory, so that a download can also be created, which can be initiated via a direct link. So, I'm using the followi

RE: [PHP] Ob_start question

2003-09-03 Thread Beauford.2005
Yep, that's it. I thought I had this as it was working at one time, but obviously some spaces got added. Thanks. -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: September 3, 2003 11:13 AM To: PHP Subject: Re: [PHP] Ob_start question * Thus wrote Beauford

Re: [PHP] Ob_start question

2003-09-03 Thread Curt Zirzow
* Thus wrote Beauford.2005 ([EMAIL PROTECTED]): > I am getting this error: > > Warning: session_start() [function.session-start]: Cannot send session > cache limiter - headers already sent (output started at > /usr/local/apache/php/includes/2004server.inc:24) in > /usr/local/apache/php/includes/re

RE: [PHP] Ob_start question

2003-09-03 Thread Ford, Mike [LSS]
On 03 September 2003 12:50, Beauford.2005 contributed these pearls of wisdom: > This is line 5.. > > $email_error = "If the problem persists email HREF=mailto:[EMAIL PROTECTED]>Webmaster"; > > but I believe the error message refers to line 5 of > restricted.in, not 2004server.inc. > > Thi

Re: [PHP] Ob_start question

2003-09-03 Thread John W. Holmes
Beauford.2005 wrote: I am getting this error: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/local/apache/php/includes/2004server.inc:24) in /usr/local/apache/php/includes/restricted.inc on line 5 I have ob_start

RE: [PHP] Ob_start question

2003-09-03 Thread Beauford.2005
m: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] Sent: September 3, 2003 5:20 AM To: 'Beauford.2005'; PHP Subject: RE: [PHP] Ob_start question On 03 September 2003 03:11, Beauford.2005 contributed these pearls of wisdom: > I am getting this error: > > Warning: session_start() [func

RE: [PHP] Ob_start question

2003-09-03 Thread Ford, Mike [LSS]
On 03 September 2003 03:11, Beauford.2005 contributed these pearls of wisdom: > I am getting this error: > > Warning: session_start() [function.session-start]: Cannot send > session cache limiter - headers already sent (output started at > /usr/local/apache/php/includes/2004server.inc:24) in > /u

Re: [PHP] Ob_start question

2003-09-02 Thread Raditha Dissanayake
Most common cause of this problem is whitespace before the ' I am getting this error: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/local/apache/php/includes/2004server.inc:24) in /usr/local/apache/php/includes/r

[PHP] Ob_start question

2003-09-02 Thread Beauford.2005
I am getting this error: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/local/apache/php/includes/2004server.inc:24) in /usr/local/apache/php/includes/restricted.inc on line 5 I have ob_start(); and ob_end_flush(

RE: [PHP] ob_start and transparent sessions 4.3.2

2003-08-25 Thread Wouter van Vliet
Oorspronkelijk bericht- -> Van: Miek Lohmann [mailto:[EMAIL PROTECTED] -> Verzonden: vrijdag 22 augustus 2003 18:41 -> Aan: [EMAIL PROTECTED] -> Onderwerp: [PHP] ob_start and transparent sessions 4.3.2 -> -> -> Hi, -> -> I've got a strange problem with e

[PHP] ob_start and transparent sessions 4.3.2

2003-08-25 Thread Miek Lohmann
Hi, I've got a strange problem with enabled transparent sessions for my scripts. Before upgrading to PHP 4.3.2 I could use output buffering (ob_start()) and sessions without problems. Meanwhile with this new version the PHPSESSID is NOT appended to any link like html - tag (a href or something lik

Re: [PHP] ob_start problem

2003-03-22 Thread Larry E. Ullman
Warning: ob_gzhandler() [ref.outcontrol]: output handler 'ob_gzhandler' cannot be used twice in /blahblah/includes/bottom.inc on line 25 I can't speak as to why this would only happen occasionally, but I believe that you should comment out the output_buffering line in the php.ini file when using

Re: [PHP] ob_start problem

2003-03-21 Thread Mr Percival
That is what I thought, but it isnt.. after doing some testing it seems to only do it the first time the page is loaded in the session, if i hit refresh then the problem doesnt occur. is it possible that it has anything to do with the session_start and session_name that is used at the top of th

Re: [PHP] ob_start problem

2003-03-21 Thread Justin French
*guess* you're including the footer twice, or are calling ob_end_flush() more than once. not anywhere near sure though!! Justin 21/03/03 11:33 PM, Mr Percival ([EMAIL PROTECTED]) wrote: > Hi, > > I have a page that has an include at the top of the page and an include at the > bottom of th

[PHP] ob_start problem

2003-03-21 Thread Mr Percival
Hi, I have a page that has an include at the top of the page and an include at the bottom of the page. in the top include file I have added the command: ob_start("ob_gzhandler"); in the bottom include I have added: ob_end_flush(); <-- i thought this was supposed to be run to clean up at the

Re: [PHP] ob_start -- output buffer problem

2003-03-10 Thread Ernest E Vogelsinger
At 11:22 09.03.2003, Alex Lance said: [snip] >here's my example: > > >$x = new test(); > >echo "hey"; > >// IF next line is uncommented so it manually flushes >// then the finish method WILL get called. But I need >// get around calling anything at the *end*

Re: [PHP] ob_start -- output buffer problem

2003-03-10 Thread Jim Lucas
e the ob_get_contents(); or ob_end_clean(); then PHP waits until everything is done, and then flushes. Jim - Original Message - From: "Alex Lance" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, March 09, 2003 2:22 AM Subject: [PHP] ob_start -- output buffer problem

[PHP] ob_start -- output buffer problem

2003-03-09 Thread Alex Lance
Hi all, to quote from http://www.php.net/manual/en/function.ob-start.php > void ob_start ( [string output_callback]) > > An optional output_callback function may be specified. This function > takes a string as a parameter and should return a string. The function > will be called when ob_end_flu

[PHP] ob_start strangness

2003-01-24 Thread Serge Paquin
Hello, I am trying to get ob_start to work the way I expect but I am running into some problems. Take the following example code: /* Start of code snippet */ function ob_spit_content_length ($buffer) { $len=strlen($buffer); if($len>0) Header( "Content-Length: $le

Re: [PHP] ob_start

2002-07-14 Thread Kevin Waterson
On Sun, 14 Jul 2002 10:35:13 -0400 "John Holmes" <[EMAIL PROTECTED]> wrote: > Shouldn't gzip be in quotes, here?? The second argument to strstr... indeed, that fixes that.. thanks now, I have a problem with mozilla and netscape. Although they both accept the ob_start("ob_gzhandler"); netscape

Re: [PHP] ob_start

2002-07-14 Thread Andrew Brampton
erson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, July 14, 2002 3:34 PM Subject: [PHP] ob_start > I wish to compress some data using > ob_start("ob_gzhandler"); > > I use > if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip))

RE: [PHP] ob_start

2002-07-14 Thread John Holmes
> I wish to compress some data using > ob_start("ob_gzhandler"); > > I use > if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip)) { Shouldn't gzip be in quotes, here?? The second argument to strstr... > ob_start("ob_gzhandler"); > } else { > ob_start(); > } > but the compression is nev

[PHP] ob_start

2002-07-14 Thread Kevin Waterson
I wish to compress some data using ob_start("ob_gzhandler"); I use if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip)) { ob_start("ob_gzhandler"); } else { ob_start(); } but the compression is never used.. obstart is always used withouth the gz_handler is there a way around this? or am

[PHP] ob_start('gz_handler') and session_start()

2002-06-05 Thread Jason Caldwell
Is there a way to make ob_start('gz_handler') work with session_start()? I got them each working independently -- however, when I try to compress a session -- my page just comes up blank. Or, is there another alternative? -- I'd like to use sessions and I'd (definitely) like to compress my pag

Re: [PHP] ob_start() and ob_gzhandler

2002-05-17 Thread Jason Wong
On Saturday 18 May 2002 02:48, Jason Soza wrote: > Either way, is there any way to tell if my output is really being > compressed by ob_gzhandler? If you have NN4.X use view source, if the source is empty then compression is active. If you're using some form of un*x then: lynx --mime_header

Re: [PHP] ob_start() and ob_gzhandler

2002-05-17 Thread Rasmus Lerdorf
t; > Either way, is there any way to tell if my output is really being > compressed by ob_gzhandler? > > Jason Soza > > - Original Message - > From: Miguel Cruz <[EMAIL PROTECTED]> > Date: Friday, May 17, 2002 10:39 am > Subject: Re: [PHP] ob_start() and ob_gz

Re: [PHP] ob_start() and ob_gzhandler

2002-05-17 Thread Jason Soza
TED]> Date: Friday, May 17, 2002 10:39 am Subject: Re: [PHP] ob_start() and ob_gzhandler > On Fri, 17 May 2002, Jason Soza wrote: > > Am I doing something wrong? Shouldn't the ob_start() by itself > just > > load all output into a buffer and not display it until I call

Re: [PHP] ob_start() and ob_gzhandler

2002-05-17 Thread Miguel Cruz
On Fri, 17 May 2002, Jason Soza wrote: > Am I doing something wrong? Shouldn't the ob_start() by itself just > load all output into a buffer and not display it until I call ob_flush > ()? Or when you get to the end of execution... http://php.net/ob_implicit_flush miguel -- PHP General Ma

Re: [PHP] ob_start() and ob_gzhandler

2002-05-17 Thread Robert Cummings
Jason Soza wrote: > > Just wondering what would cause the following: > I have a 512/128 cable connection through my ISP that I'm hosting my > sites through. I have a 10gb/mo transfer limit (u/l and d/l) so when I > saw mention of the ob_gzhandler (and mod_gzip for Apache), that kind of > got me i

[PHP] ob_start() and ob_gzhandler

2002-05-17 Thread Jason Soza
Just wondering what would cause the following: I have a 512/128 cable connection through my ISP that I'm hosting my sites through. I have a 10gb/mo transfer limit (u/l and d/l) so when I saw mention of the ob_gzhandler (and mod_gzip for Apache), that kind of got me interested in it. Anyway, I

[PHP] ob_start("ob_gzhandler") and require_once

2002-05-04 Thread bob
can ob_start("ob_gzhandler") function be nested ? after echo 'test' , does it continue to includes and evaluates c.php? for example: a.php b.php c.php main.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] ob_start()

2001-09-03 Thread Jeroen Olthof
Can I increase speed by using this to buffer output ? kind regards Jeroen Olthof -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]