Re: [PHP] Fastest templating mechanism
Evert, Have you looked at smarty (http://smarty.php.net) ? It doesn't do exactly what you're talking about but it seems to be the "Fastest templating mechanism" that I've tested; probably one of the most versatile as well. Cheers! -Joe www.joewollard.com Evert | Rooftop Solutions wrote: Hi all, I'm working on a template system which works a bit like a text translation block. The data looks for example like: beginblock endblock beginauthor endauthor The list is going to be very large, it will have several overlays and not all pages need all items in the list. (usually just a fraction) What will be the smartest way to implement this? I need a low-memory cost and fast solution I can do it with a php script, like: $list = array( 'beginblock' => '', etc. ); but this will use up too much memory. I could additionally do it with a textfile, but if I need to loop through it at every lookup it will be slow.. What are your suggestions? regards, Evert
[PHP] using sockets to load a streaming windows media file
Hi there, is there anyway possible to load a streaming windows media file via a socket connecting to output its contents to the browser or a windows media object. My issue is I am spitting out an asx playlist file however for some freak reason, whenever i put control logic around where i am outputting the playlist the player craps out saying playlist file format not recognised. Which is why I want to try out this way execpt socket transport doesnt understand mms :) Ie the file would look like mms://thefile -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST long texts to PHP
Hi, On 5/7/05, Marek Kilimajer <[EMAIL PROTECTED]> wrote: > First of all, don't hijack threads. Instead of replying to a message, > create a new one. i agree with him > > SED wrote: > > I need to POST long texts through a form to PHP but the text cuts down to > > around 64.000 characters. Is there any way to allow longer texts (like in > > php.ini)? > > This is browser limit. Most, if not all, browsers limit textarea field > length to this value. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- bala> balachandar muruganantham blog> lynx http://chandar.blogspot.com web> http://www.chennaishopping.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST long texts to PHP
On Sat, May 7, 2005 10:42 am, SED said: > I need to POST long texts through a form to PHP but the text cuts down to > around 64.000 characters. Is there any way to allow longer texts (like in > php.ini)? In addition to the browser limitations on a TEXTAREA, web servers are free to limit POST data to anything larger than X where X is some number I forgot. Call it 64K for fun. If you need THAT much text, make it a file upload. http://php.net/manual/features.file-upload.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Barcodes [Solved]
Hi JAson, I'm leaving tomorrow for CA to do some of the testing and workflow. I'll let you know how it turns out. -- Mike On 5/6/05, Jason Barnett <[EMAIL PROTECTED]> wrote: > Mike Smith wrote: > > On 4/18/05, Eric Wood <[EMAIL PROTECTED]> wrote: > > > >>- Original Message - > >>From: "Mike Smith" > >>I'm using a script to generate the barcodes (3 of 9 or Code39): > >>http://www.sid6581.net/cs/php-scripts/barcode/ > >> > >>This script seems to limit the input barcode to 15 characters... um... > >>-eric woo > >> > >>-- > >>PHP General Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > The sample on the website will display image to small for 16 > > characters. There is an options to adjust the widthXheight of the > > generated image to display more I found the longest part number we had > > and based my image width on that (+5). There are other options > > (phpclasses, hotscripts), but this works for now. I may evaluate some > > other options as I get into it. > > > > -- > > Mike > > Hey, did you do any more testing with this? My company has gone through > a lot of the parts identification process for our accounting system and > we're eager to get barcoding set up as well. Our platform of choice is > Windows (yeah, yeah) so it would be great to hear some feedback about > that OS if you've tested on it... > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fastest templating mechanism
Hi all, I'm working on a template system which works a bit like a text translation block. The data looks for example like: beginblock endblock beginauthor endauthor The list is going to be very large, it will have several overlays and not all pages need all items in the list. (usually just a fraction) What will be the smartest way to implement this? I need a low-memory cost and fast solution I can do it with a php script, like: $list = array( 'beginblock' => '', etc. ); but this will use up too much memory. I could additionally do it with a textfile, but if I need to loop through it at every lookup it will be slow.. What are your suggestions? regards, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reducing size of htm output
Seems I'm going a bit too far here :) The URL quotes which states to denote JS between comment tags is from the HTML 4.0 page. I've been reading lots of XHTML recommendations lately, and have become accustomed to those. In those, when a
Re: [PHP] POST long texts to PHP
First of all, don't hijack threads. Instead of replying to a message, create a new one. SED wrote: I need to POST long texts through a form to PHP but the text cuts down to around 64.000 characters. Is there any way to allow longer texts (like in php.ini)? This is browser limit. Most, if not all, browsers limit textarea field length to this value. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST long texts to PHP
I need to POST long texts through a form to PHP but the text cuts down to around 64.000 characters. Is there any way to allow longer texts (like in php.ini)? Regards, SED -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] compiling dynamic extensions without root access
On 08/05/2005, at 1:03 AM, Rory Browne wrote: I believe(although I stand to be corrected, that there is a threading MLM on apache 2 - this would rule out dl() AFAIK We're not using Apache2 yet coz of the thread issue with php however i am setting up a prefork setup for development. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reducing size of htm output
Besides, whether or not it's considered good practice to comment out js to non-js-capable browsers, a lot of people do it. And for the record, I wouldn't condone the removal of comments from code that someone may need to read sometime. HTML outputted from php is generally however only meant for the browser to parse, and not for humans to read. Which brings me to another suggestion: If you have a lot of long javascript variable/function names, you could maybe find a way to automagicly (I mean automaticly, but automagicly sounds cooler) shorten local variables, function names, and perhaps other stuff, although I think for the most part linking the JS, so that it is cacheable is probably a better option. How about using xml/xslt to only pass on the content that is unique to each page to the browser. You could use an ob handler to make sure that the browser was capable of using xslt, and if not parse the xslt on the server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reducing size of htm output
> excuse me? since when is this considered /good/ practice??? > It's one of those things that are concidered /bad/ practice according to > w3... Hmmm, didn't know the w3c had an opinion on the usage of tags to delimit javascript. I've always been recommended to use them, to hide the script from browsers that don't support javascript, just like I use , or to show messages to browsers that don't support script or frames. Can you reference the message/memo/whatever from the w3c that discourages them. I believe perhaps you took either it or my suggestion out of context, because I can't fathom a reason why you wouldn't want to hide js from non-js-capable browsers. > and > > you have the additional talk of replacing out // and /* .. */ > > comments. > > > > but if you really want to do it then: > > > > function ob_whitespace_removal($str){ > > // would need to dbl_check regex/modifiers > > return ob_gzhandler(preg_replace("/\s+/m", " ", $str)); > > } > > > > should work, Although for purists/modularity output buffer stacking > > may be a cleaner technique > > > > Re: Internet Explorer Problems: > > if you check the ob_start or ob_gzhandler pages on the php > > manual(online version) then you'll find a user-submitted comment > > saying that MSIE doesn't cache compressed stuff. This doesn't matter > > for a dynamic website. Try googling, but don't say ob_gzhandler, since > > this is (allegedly) a problem with IE/gzip compatability, and not the > > ob_gzhandler implemention(ie search for gzip and not ob_gzhandler). > > > > > > On 5/7/05, Kirsten <[EMAIL PROTECTED]> wrote: > > > >>>preg_replace('/s+/', ' ', $html); > >>> > >>>but watch out, this js code will work: > >>> > >>>var v > >>>alert(v) > >>> > >>>this one will not: > >>> > >>>var v alert(v) > >> > >>Sure > >>but now: how do I access the htm output of the current executing script > >>before it is send to the user? > >> > >>Thanks again > >> > >> > 1) Is there any function to do this (I'm using PHP 4.2) ? Or maybe some > >> > >>user > >> > has already done it? > 2) Is it true that ob_start("ob_gzhandler") can cause problems on IE > >> > >>5.5+? > >> > >>>don't know. but you can detect these browsers and turn compression off > >> > >>-- > >>PHP General Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > > > >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random but ordered..
Ryan A wrote: Hey, I have been screwing around with this code for around a day and am hitting a wall, any help would be appreciated. Basically, I am working on a site that queries the DB for companies and the plans the company is offering, the DB is quite big (a few thousand records in each of the 20 tables) The parameters are taken from the client in the form of a search box and usually gives around 1000 results per query, they results are then displayed like this: company 1 [] plan [] plan [] plan [] plan company 2 [] plan [] plan [] plan company 3 [] plan company 4 [] plan [] plan So far, no problems (even though the code and the design are mixed together in the page) but so far the code is getting the results grouping via $cno, which results in the lowest being displayed first which gives the first companies who joined an edge as they are always getting displayed. Heres the kicker, he wants to have the same display as abovebut randomly from the DB *while still* having pagination.. so new joined companies too get displayed and not shoved at the end of the results. Choices: 1. ORDER_BY RAND(), and keep the full result set (or just the ids) in session 2. add another column, display_order, and update it at regular intervals to random values. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reducing size of htm output
M. Sokolewicz wrote: > Rory Browne wrote: > >> What might be more useful is stripping out comments, If you don't use >> javascript it is simply a case of replacing all with >> a blank space. If you do though it's more complicated since it is >> considered good practice to place js inside blocks, > > > excuse me? since when is this considered /good/ practice??? > It's one of those things that are concidered /bad/ practice according to w3... Interesting. On a page titled "W3C Recommendations" I must be misinterpreting the W3C's examples of hiding scripts from browsers ... http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.3.2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Random but ordered..
Hey, I have been screwing around with this code for around a day and am hitting a wall, any help would be appreciated. Basically, I am working on a site that queries the DB for companies and the plans the company is offering, the DB is quite big (a few thousand records in each of the 20 tables) The parameters are taken from the client in the form of a search box and usually gives around 1000 results per query, they results are then displayed like this: company 1 [] plan [] plan [] plan [] plan company 2 [] plan [] plan [] plan company 3 [] plan company 4 [] plan [] plan So far, no problems (even though the code and the design are mixed together in the page) but so far the code is getting the results grouping via $cno, which results in the lowest being displayed first which gives the first companies who joined an edge as they are always getting displayed. Heres the kicker, he wants to have the same display as abovebut randomly from the DB *while still* having pagination.. so new joined companies too get displayed and not shoved at the end of the results. To see the code used presently (stripped down to a few lines) : http://jappz.com/testing.phpp To see the output from the above : http://jappz.com/testing.html Any suggestions, classes, code, links or general help would be appreciated. Thanks, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.6 - Release Date: 5/6/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5, mySQL and Win XP. I NEED HELP
Hi, If you are using localhost, i dont think u need to specify the port number. Localhost would be enough. Also pls check the user privileges and all in the database. ..Deep.. --- Oscar Andersson <[EMAIL PROTECTED]> wrote: > I have made a instal of the latest mySQL and PHP 5 > on my computer. > I have made the following changes to my php.ini file > > extension=php_mysql.dll > extension_dir = "c:\php\" > > and i have put the php_mysql. and libmysql.dll in > c:\php\ and in c:\windows > to > > Now i try this in my php-file > $con = mysql_connect("localhost:3306", "buddy", > "bestbuddy"); > > I cant connect to mySQL. I dont know what is wrong. > mySQL listen to port > 3306. I have tried with my IP to. I get this warning > Warning: mysql_connect() [function.mysql-connect]: > Too many open links (0) > in myfilename.php. > > > I hope for help > Oscar Andersson > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Java in PHP5
Ok So I am looking at two possibilities of java integration, one via command line and one using the extension. I dont particularly want the experimental pecl extensions in my php therefore I want it dynamically loaded. I cant for the life of me find the Java extension, would anyone know where to find it ? Its not on the pecl site ? Let me know thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: expression between vertical bars
* Jan <[EMAIL PROTECTED]>: > Could someone explain to me the use of the vertical bar in > expressions like "|<[^>]+>(.*)]+>|U". I understand that the > vertical bars are used to separate the expression from the modifier, > but can't find any documentation about the reasons and rules to do > this. This works in the PCRE functions, and has to do with the P in PCRE -- Perl. In perl, when performing a regexp, you can use whatever character you desire to act as 'quotes' surrounding it. The typical one is a forward slash, but when you are going to be matching forward slashes, this can be inconvenient (the following examples are all perl, with a PHP version follwing): if ( /http:\/\/www.php.net\// ) # perl if (preg_match('/http:\/\/www.php.net\//', $url)) # PHP You get what's called 'leaning toothpick' syndrome. So, to make things easier, you can specifiy a different regex delimiter: if ( m|http://www.php.net| )# perl if (preg_match('|http://www.php.net|', $url)# PHP (In perl, the 'm' indicates you're doing a match operation, and needs to be present if you're using a delimiter other than a slash; it's not necessary in PHP as it's implied.) The modifier occurs after the delimiters -- and this can happen regardless of delimiter: if ( m|http://www.php.net|U ) # perl if (preg_match('|http://www.php.net|U', $url) # PHP if ( /http:\/\/www.php.net\//U ) # perl if (preg_match('/http:\/\/www.php.net\//U', $url) # PHP If you want more information on this, pick up a copy of "Mastering Regular Expressions" or "Programming Perl", both from O'Reilly Press. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reducing size of htm output
On 5/7/05, M. Sokolewicz <[EMAIL PROTECTED]> wrote: > Rory Browne wrote: > > > First of all as Rasmus said, this 'compression' is barely(if at all) > > going to make a difference, after your pages have been compressed wth > > gzip, > > > > There are two reasons for this: > > 1 compression techniques detect repeated strings(such as spaces or > > newlines), and replaces them with one instance of that string, and a > > record of how many times it appears. > > 2 Because Rasmus said so, and considering his long-time involvement > > with the php project(as founder), he probably knows what he'e talking > > about. > > > > What might be more useful is stripping out comments, If you don't use > > javascript it is simply a case of replacing all with > > a blank space. If you do though it's more complicated since it is > > considered good practice to place js inside blocks, > > excuse me? since when is this considered /good/ practice??? > It's one of those things that are concidered /bad/ practice according to > w3... Stripping out the comments from the source (file.php) is bad. But I see no reason why not to strip them out from the output to the user. Most users would never see them. And those that would- are probably trying to reverse-engineer your site anyway. For debugging, you could simply comment out the comment-parser. Dotan Cohen http://LyricsList.com/ http://Music-Liriks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: buffering headers before send
"M. Sokolewicz" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > ob_start buffers both `normal` output AND headers. Humm, now it works... Is there something else that must be set, so that ob_start() works or not? Something like an php.ini entry? Here is the listing of ob_start.php5 "; $x = ob_get_clean(); ob_start(); header("X-Sample-Test: foo"); $h[0] = headers_sent(); $h[1] = headers_list(); echo "hallo second"; echo $x; $x = ob_get_clean(); ob_start(); echo "hallo third"; echo $x; header("X-Sample-Test: foo2"); $h[2] = headers_sent(); $h[3] = headers_list(); ob_end_flush(); echo ""; var_dump($h); echo ""; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reducing size of htm output
On 5/7/05, M. Sokolewicz <[EMAIL PROTECTED]> wrote: > Rory Browne wrote: > > > First of all as Rasmus said, this 'compression' is barely(if at all) > > going to make a difference, after your pages have been compressed wth > > gzip, > > > > There are two reasons for this: > > 1 compression techniques detect repeated strings(such as spaces or > > newlines), and replaces them with one instance of that string, and a > > record of how many times it appears. > > 2 Because Rasmus said so, and considering his long-time involvement > > with the php project(as founder), he probably knows what he'e talking > > about. > > > > What might be more useful is stripping out comments, If you don't use > > javascript it is simply a case of replacing all with > > a blank space. If you do though it's more complicated since it is > > considered good practice to place js inside blocks, > excuse me? since when is this considered /good/ practice??? > It's one of those things that are concidered /bad/ practice according to > w3... > > and > > you have the additional talk of replacing out // and /* .. */ > > comments. > > > > but if you really want to do it then: > > > > function ob_whitespace_removal($str){ > > // would need to dbl_check regex/modifiers > > return ob_gzhandler(preg_replace("/\s+/m", " ", $str)); > > } > > > > should work, Although for purists/modularity output buffer stacking > > may be a cleaner technique > > > > Re: Internet Explorer Problems: > > if you check the ob_start or ob_gzhandler pages on the php > > manual(online version) then you'll find a user-submitted comment > > saying that MSIE doesn't cache compressed stuff. This doesn't matter > > for a dynamic website. Try googling, but don't say ob_gzhandler, since > > this is (allegedly) a problem with IE/gzip compatability, and not the > > ob_gzhandler implemention(ie search for gzip and not ob_gzhandler). > > > > > > On 5/7/05, Kirsten <[EMAIL PROTECTED]> wrote: > > > >>>preg_replace('/s+/', ' ', $html); > >>> > >>>but watch out, this js code will work: > >>> > >>>var v > >>>alert(v) > >>> > >>>this one will not: > >>> > >>>var v alert(v) > >> > >>Sure > >>but now: how do I access the htm output of the current executing script > >>before it is send to the user? > >> > >>Thanks again > >> > >> > 1) Is there any function to do this (I'm using PHP 4.2) ? Or maybe some > >> > >>user > >> > has already done it? > 2) Is it true that ob_start("ob_gzhandler") can cause problems on IE > >> > >>5.5+? > >> > >>>don't know. but you can detect these browsers and turn compression off > >> > >>-- > >>PHP General Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > > > >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Dotan Cohen http://LyricsList.com/ http://Music-Liriks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] compiling dynamic extensions without root access
On 07/05/2005, at 3:16 AM, Rory Browne wrote: It depends: What webserver are you using? PHP/Apache will let you load extensions using .htaccess, which can be your own extensions, located in a directory that you have write access to. I've never tried it but something like php_extension_dir /home/yourname/php_extensions php_extension your_php_extension.so should do the trick. If you don't mind modding your php code, to take account of the fact that these extensions aren't available by default, you can create a function to load dynamic modules, using the extension_loaded() and dl() functions (see the examples on www.php.net/dl ). Bare in mind that this will not run in certain webservers, noteably Zeus, and IIS. Its apache 1.3, 2.0 is not a goer until threading support is available unless it is already ? What I was asking is, are we able to run say phpize as a non root user and build a module that can be dynamically loaded ? I wouldnt mind checking out the PHP5 soap extension , but getting an admin to install it will take forever. Lemme know thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] expression between vertical bars
Hello, Could someone explain to me the use of the vertical bar in expressions like "|<[^>]+>(.*)]+>|U". I understand that the vertical bars are used to separate the expression from the modifier, but can't find any documentation about the reasons and rules to do this. Thanks, Jan
[PHP] Re: Reducing size of htm output
Rory Browne wrote: First of all as Rasmus said, this 'compression' is barely(if at all) going to make a difference, after your pages have been compressed wth gzip, There are two reasons for this: 1 compression techniques detect repeated strings(such as spaces or newlines), and replaces them with one instance of that string, and a record of how many times it appears. 2 Because Rasmus said so, and considering his long-time involvement with the php project(as founder), he probably knows what he'e talking about. What might be more useful is stripping out comments, If you don't use javascript it is simply a case of replacing all with a blank space. If you do though it's more complicated since it is considered good practice to place js inside blocks, excuse me? since when is this considered /good/ practice??? It's one of those things that are concidered /bad/ practice according to w3... and you have the additional talk of replacing out // and /* .. */ comments. but if you really want to do it then: function ob_whitespace_removal($str){ // would need to dbl_check regex/modifiers return ob_gzhandler(preg_replace("/\s+/m", " ", $str)); } should work, Although for purists/modularity output buffer stacking may be a cleaner technique Re: Internet Explorer Problems: if you check the ob_start or ob_gzhandler pages on the php manual(online version) then you'll find a user-submitted comment saying that MSIE doesn't cache compressed stuff. This doesn't matter for a dynamic website. Try googling, but don't say ob_gzhandler, since this is (allegedly) a problem with IE/gzip compatability, and not the ob_gzhandler implemention(ie search for gzip and not ob_gzhandler). On 5/7/05, Kirsten <[EMAIL PROTECTED]> wrote: preg_replace('/s+/', ' ', $html); but watch out, this js code will work: var v alert(v) this one will not: var v alert(v) Sure but now: how do I access the htm output of the current executing script before it is send to the user? Thanks again 1) Is there any function to do this (I'm using PHP 4.2) ? Or maybe some user has already done it? 2) Is it true that ob_start("ob_gzhandler") can cause problems on IE 5.5+? don't know. but you can detect these browsers and turn compression off -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: buffering headers before send
Claudio wrote: Hi, is there a way to buffering headers before sending like "ob_start()" ? Thanks, Claudio ob_start buffers both `normal` output AND headers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Reducing size of htm output
First of all as Rasmus said, this 'compression' is barely(if at all) going to make a difference, after your pages have been compressed wth gzip, There are two reasons for this: 1 compression techniques detect repeated strings(such as spaces or newlines), and replaces them with one instance of that string, and a record of how many times it appears. 2 Because Rasmus said so, and considering his long-time involvement with the php project(as founder), he probably knows what he'e talking about. What might be more useful is stripping out comments, If you don't use javascript it is simply a case of replacing all with a blank space. If you do though it's more complicated since it is considered good practice to place js inside blocks, and you have the additional talk of replacing out // and /* .. */ comments. but if you really want to do it then: function ob_whitespace_removal($str){ // would need to dbl_check regex/modifiers return ob_gzhandler(preg_replace("/\s+/m", " ", $str)); } should work, Although for purists/modularity output buffer stacking may be a cleaner technique Re: Internet Explorer Problems: if you check the ob_start or ob_gzhandler pages on the php manual(online version) then you'll find a user-submitted comment saying that MSIE doesn't cache compressed stuff. This doesn't matter for a dynamic website. Try googling, but don't say ob_gzhandler, since this is (allegedly) a problem with IE/gzip compatability, and not the ob_gzhandler implemention(ie search for gzip and not ob_gzhandler). On 5/7/05, Kirsten <[EMAIL PROTECTED]> wrote: > >preg_replace('/s+/', ' ', $html); > > > > but watch out, this js code will work: > > > > var v > > alert(v) > > > > this one will not: > > > > var v alert(v) > > Sure > but now: how do I access the htm output of the current executing script > before it is send to the user? > > Thanks again > > > > > > > > > 1) Is there any function to do this (I'm using PHP 4.2) ? Or maybe some > user > > > has already done it? > > > 2) Is it true that ob_start("ob_gzhandler") can cause problems on IE > 5.5+? > > > > don't know. but you can detect these browsers and turn compression off > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] buffering headers before send
Hi, is there a way to buffering headers before sending like "ob_start()" ? Thanks, Claudio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php