[PHP] function - action
Hallo! I'm working on a project, where we distinguish between functions and actions in design, although in PHP both are implemented as functions. Is there a chance that PHP can use the word action as function? E.g.: public function doSomething() { } public action doSomethingElse() { ... } ... is actually the same but would help to see the design also in the code. TIA, Ralph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Validating Email Conditional
On 02/08/07, CK [EMAIL PROTECTED] wrote: Hi Please see the notes below keeping in mind this RegEX is being used to validate emails for a newsletter signup form. It may not be possible, accommodating some of the formats you provided. If you have the Holy Grail of RegEx please share. Can you reply to the list please? It's exactly the kind of situation that's most annoying - when you try and sign up for a newsletter or register with a site and it refuses to let you because it reckons your email address is invalid, despite the fact you've been sending and receiving mail with it for years. The best advice for validating email addresses is don't do it with a regexp. Send an email to the address with a link in it for them to confirm their registration. On Aug 1, 2007, at 11:08 PM, Robin Vickery wrote: On 02/08/07, CK [EMAIL PROTECTED] wrote: Hi, Would you point out why? As I've tested a range of email address, and have not found one rejected that is formatted correctly. ok, here's a few perfectly valid email addresses off the top of my head. The first one's especially annoying as I use it a lot. The last one's not so common but can be useful if you've got broken dns. [EMAIL PROTECTED] (would you give a hand in accommodating this format?) Yeah, get rid of the regexp completely. Simple eh? [EMAIL PROTECTED] (should be invalid as the domain does not exist) Of course it doesn't - it's an example. that's why the example.museum domain is reserved - to use in examples like this. The point is your regexp won't let anyone with a perfectly valid .museum (or .travel) domain register with your newsletter. o'[EMAIL PROTECTED] (should be invalid as the domain does not exist) Of course it doesn't - it's an example. that's why the example.com domain is reserved - to use in examples like this. The point is that your regexp won't allow anyone with an apostrophe in their name: o'reilly, o'rourke, o'malley etc. [EMAIL PROTECTED] (would you give a hand in accommodating this format?) -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php SHOW
Is there a way to output my data and tables using a php version of SHOW? Doesn't have to be pretty HTML just output to screen Ta, R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] output the schema
Hi, I reword my last post. I want to take the result and generate the field info to the screen e.g id, int(10) name, varchar(30) age, varchar(30). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php SHOW
I mean get the schema. Hulf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there a way to output my data and tables using a php version of SHOW? Doesn't have to be pretty HTML just output to screen Ta, R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php SHOW
Is there a way to output my data and tables using a php version of SHOW? Doesn't have to be pretty HTML just output to screen If you're referring to PHP data types (arrays, strings, ints etc) you could use either var_dump() or print_r(). -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] output the schema
assuming name=database value=MySQL NOT SPECIFIED You would probably want to use the combination of the MySQL query SHOW COLUMNS FROM tablename and the PHP function mysql_field_type(). An example would be: ? //Establish connection and select database here $sql = SHOW COLUMNS FROM myTable; $result = @mysql_query($sql, connection) or die(); //Dummy variable for incrementing current field $count = 0; while($row = mysql_fetch_row($result) { echo Field: .$row[0]. Type: .mysql_field_type($result,$count); $count++; } ? Further information and example usage of mysql_field_type() can be found at: http://us3.php.net/mysql_field_type Additionally, that site's sidebar lists other useful MySQL functions in PHP. /assuming -- N/A -Original Message- From: Hulf [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 6:09 AM To: php-general@lists.php.net Subject: [PHP] output the schema Hi, I reword my last post. I want to take the result and generate the field info to the screen e.g id, int(10) name, varchar(30) age, varchar(30). -- 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] Numbers, Numbers everywhere! Need some Dollar help.
At 12:57 AM +0200 8/3/07, M. Sokolewicz wrote: Now, as mentioned before: You have to decide for yourself if your application is the correct place to check for the stupidity of your users. Check for the ignorance of your users -- there's a difference. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php install problem
David McDivitt escreveu: I hate to ask a simple question, but I have two issues installing PHP. I have XP SP 2 with IIS. When I ran the install php-5.2.3-win32-installer.msi, it said it could not access httpd.config and I would have to configure the web server manually. I could not find anything on the internet containing the error message. I get the same error when installing IIS API and IIS CGI. The other problem I have is when I attempt to display a page containing PHP, the browser displays an error. The error I was getting said PHP has encountered an Access Violation. Now it's changed and says No input file specified. Weird. If someone could shed light I'd appreciate it. Thanks - IMHO, the best, is to use the WAMP environment. Try: http://www.educar.pro.br/en/ -- zerof http://www.educar.pro.br/ Apache - PHP - MySQL - Boolean Logics - Project Management -- You must hear, always, one second opinion! In all cases. -- Let the people know if this info was useful for you! -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UTF-8 support
Naz Gassiep wrote: The functions trim() and explode() appear to be munging multibyte UTF-8 strings. I can't find multibyte safe versions of them in the manual, do they exist, or do I have to make my own? In what way are they munging the strings? I just tried with a bunch of UTF-8 characters pasted into a string, and it did exactly what I'd expect. jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Premature Ajax-ulation
One of my developers saw the following article; http://arstechnica.com/news.ars/post/20070802-security-experts-warn-deve lopers-about-the-risks-of-premature-ajax-ulation.html How are you securing Ajax? I know that for the most part we send data to a PHP script for processing, so all of the normal rules for sending that data apply (mysql_real_escape_string(), etc.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Premature Ajax-ulation
Jay Blanchard wrote: One of my developers saw the following article; http://arstechnica.com/news.ars/post/20070802-security-experts-warn-deve lopers-about-the-risks-of-premature-ajax-ulation.html How are you securing Ajax? I know that for the most part we send data to a PHP script for processing, so all of the normal rules for sending that data apply (mysql_real_escape_string(), etc.) Validation, validation, validation. The big danger with doing anything on the client-side is that it's all to easy to fall into blindly trusting what the client is giving you, even the smallest assumption can create a big hole in your app. Don't assume events will happen the way you expect them to. Don't assume users won't be able to make requests just because your logic *should not* allow it. In short, don't treat it any different to any other web application. There is no difference, you still need to do all the validation on every request whether it's AJAX or not. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php SHOW
On Fri, 2007-08-03 at 11:56 +0100, Hulf wrote: Is there a way to output my data and tables using a php version of SHOW? Doesn't have to be pretty HTML just output to screen Well, not knowing what show does, my best guess would be that you are looking for __toString() --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php SHOW
-Original Message- From: Hulf [mailto:[EMAIL PROTECTED] Sent: 03 August 2007 11:56 To: php-general@lists.php.net Subject: [PHP] php SHOW Is there a way to output my data and tables using a php version of SHOW? Doesn't have to be pretty HTML just output to screen Ta, R. Look up print_r() and var_dump() Edward -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Validating Email Conditional
hey... there are reasonable perl based solutions to the email address validation issue. if you're willing to call the perl function, you can let it do the heavy lifting. however, there's no way you're going to have a 5-10 line regex be able to accommodate all the email address nuances.. processing of email addresses should really be done by doing a good verification, and then doing the live email check by sending the confirmation... my $0.02 worth... peace -Original Message- From: Robin Vickery [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 12:59 AM To: PHP General List Cc: CK Subject: Re: [PHP] Validating Email Conditional On 02/08/07, CK [EMAIL PROTECTED] wrote: Hi Please see the notes below keeping in mind this RegEX is being used to validate emails for a newsletter signup form. It may not be possible, accommodating some of the formats you provided. If you have the Holy Grail of RegEx please share. Can you reply to the list please? It's exactly the kind of situation that's most annoying - when you try and sign up for a newsletter or register with a site and it refuses to let you because it reckons your email address is invalid, despite the fact you've been sending and receiving mail with it for years. The best advice for validating email addresses is don't do it with a regexp. Send an email to the address with a link in it for them to confirm their registration. On Aug 1, 2007, at 11:08 PM, Robin Vickery wrote: On 02/08/07, CK [EMAIL PROTECTED] wrote: Hi, Would you point out why? As I've tested a range of email address, and have not found one rejected that is formatted correctly. ok, here's a few perfectly valid email addresses off the top of my head. The first one's especially annoying as I use it a lot. The last one's not so common but can be useful if you've got broken dns. [EMAIL PROTECTED] (would you give a hand in accommodating this format?) Yeah, get rid of the regexp completely. Simple eh? [EMAIL PROTECTED] (should be invalid as the domain does not exist) Of course it doesn't - it's an example. that's why the example.museum domain is reserved - to use in examples like this. The point is your regexp won't let anyone with a perfectly valid .museum (or .travel) domain register with your newsletter. o'[EMAIL PROTECTED] (should be invalid as the domain does not exist) Of course it doesn't - it's an example. that's why the example.com domain is reserved - to use in examples like this. The point is that your regexp won't allow anyone with an apostrophe in their name: o'reilly, o'rourke, o'malley etc. [EMAIL PROTECTED] (would you give a hand in accommodating this format?) -robin -- 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] Downloading PHP 521
Exactly where does one go to download PHP 521, not 523, not 522 but 521??? Every link I clicked on at http://www.php.net/ took me to 523, which I don't want. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function - action
On Aug 3, 2007, at 9:39 AM, Ken Tozier wrote: On Aug 3, 2007, at 2:38 AM, Ralph Kutschera wrote: Hallo! I'm working on a project, where we distinguish between functions and actions in design, although in PHP both are implemented as functions. Is there a chance that PHP can use the word action as function? E.g.: public function doSomething() { } public action doSomethingElse() { ... } ... is actually the same but would help to see the design also in the code. You could define a generic action function function action($funcName, $funcArgs) { return $funcName($funcArgs); } Actually, this might be better as it makes no assumptions about the function's argument list. function action() { $func = func_get_arg(0); $expr = func_get_args(); $expr = array_slice($expr, 1); $expr = implode(', ', $expr); $expr = $func.'('.$expr.');'; return eval($expr); } You lose the ability to pass by reference but that might not be important for your script. and use it on any function you want to use as an action function function printColor($color) { echo 'color: '.$color.'br'; } function printArea($width, $height) { echo 'area: '.($width * $height).'br'; } action('printColor', 'blue'); action('printArea', 3, 5); You could then pass in any function that is visible to the action function. You lose some efficiency but get your action function Then again, you could also just prepend action functions with 'action_' TIA, Ralph -- 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] Downloading PHP 521
WyleySam wrote: Exactly where does one go to download PHP 521, not 523, not 522 but 521??? Every link I clicked on at http://www.php.net/ took me to 523, which I don't want. http://us3.php.net/get/php-5.2.1.tar.gz/from/this/mirror -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Downloading PHP 521
WyleySam wrote: Exactly where does one go to download PHP 521, not 523, not 522 but 521??? Every link I clicked on at http://www.php.net/ took me to 523, which I don't want. http://museum.php.net/php5/ -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Numbers, Numbers everywhere! Need some Dollar help.
On 8/3/07, tedd [EMAIL PROTECTED] wrote: At 12:57 AM +0200 8/3/07, M. Sokolewicz wrote: Now, as mentioned before: You have to decide for yourself if your application is the correct place to check for the stupidity of your users. Check for the ignorance of your users -- there's a difference. Cheers, tedd -- You need to check for both stupidity and ignorance; they are different and not mutually exclusive. But please, let's not turn this into another pirated books thread. That's the only discussion from this list that I've ever filtered out. David
Re: [PHP] Numbers, Numbers everywhere! Need some Dollar help.
Thanks for all of the suggestions. While I agree that I shouldn't have to write a check for stupid users, the supervisor of the employees that will be using this application is VERY insistent! I am going to try the Javascript route...too bad the javascript forums are not as helpful as all of you! On 8/3/07, David Giragosian [EMAIL PROTECTED] wrote: On 8/3/07, tedd [EMAIL PROTECTED] wrote: At 12:57 AM +0200 8/3/07, M. Sokolewicz wrote: Now, as mentioned before: You have to decide for yourself if your application is the correct place to check for the stupidity of your users. Check for the ignorance of your users -- there's a difference. Cheers, tedd -- You need to check for both stupidity and ignorance; they are different and not mutually exclusive. But please, let's not turn this into another pirated books thread. That's the only discussion from this list that I've ever filtered out. David
RE: [PHP] Setting group sticky bit on directory with chmod()
On 02 August 2007 17:45, Daniel Brown wrote: Well, you're pleasant today, Mike. H'mmm. I guess that was a little crabby. Sorry. All I can say is that it was practically the last thing I did before going home at the end of a particularly frustrating day Cheers! Mike - Mike Ford, Electronic Information Services Adviser, JG125, The Headingley Library, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 812 4730 Fax: +44 113 812 3211 On 8/2/07, Ford, Mike [EMAIL PROTECTED] wrote: On 02 August 2007 15:58, Daniel Brown wrote: On 8/2/07, Ben Ramsey [EMAIL PROTECTED] wrote: I'm trying to set a sticky bit on a directory with chmod(). The same octal value works from the command prompt, but it doesn't appear to work correctly with the PHP function. Anyone have an idea as to why? [SNIP] Drop the preceding 0 from the chmod() function parameters. The four-digit octal value is preferred, and the 0 is the first bit to show that there's no user- or group-specific execution (su-exec'ing, basically) or stickiness to the file/directory. However, three-digit values will work. In either case, five digits will not work. That's a ridiculous and downright wrong piece of advice. It may be correct for doing it directly in the shell, but in PHP you need the leading 0 to force the numbers to octal: 0755 is exactly the same as 00755 and 000755 (etc.), but different from plain 755. Right: chmod 0755 file.php chmod 1777 file.php chmod('file.php',0755); chmod('file.php',1777); That last statement is the same as: chmod('file.php', 03361) which I don't think will have the desired effect!! Will almost always work, but isn't entirely correct: Not even nearly correct: chmod 755 file.php chmod 644 file.php chmod('file.php',755); ... same as: chmod('file.php', 01363); chmod('file.php',644); ... same as: chmod('file.php', 01204); Will never (or at least, SHOULD never) work: On the contrary, the PHP versions of these are entirely correct -- you *need* the leading zeros to make the numeric literals be octal: chmod 00755 file.php chmod 01777 file.php chmod('file.php',00755); chmod('file.php',01777); Cheers! Mike - Mike Ford, Electronic Information Services Adviser, JG125, The Headingley Library, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 812 4730 Fax: +44 113 812 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Premature Ajax-ulation
Jay Blanchard wrote: One of my developers saw the following article; http://arstechnica.com/news.ars/post/20070802-security-experts-warn-deve lopers-about-the-risks-of-premature-ajax-ulation.html How are you securing Ajax? I know that for the most part we send data to a PHP script for processing, so all of the normal rules for sending that data apply (mysql_real_escape_string(), etc.) We secure AJAX the way we do anything that might take form input. We use intval() and floatval() on numeric fields to flat-out prevent text entry, we add slashes to strings where appropriate, check lengths and ranges, and do various other sanity checks. Other than being out of band and invisible to the user as a direct act, we don't see how AJAX is any different from normal form GET/POST work. I do agree with the article that some programmers put too much logic in the client side, but that's always been an issue, with or without AJAX. Remember the days when early shopping carts would store item prices on the client side, and use that data during checkout? You could edit your local data and knock $20 off an item. That sort of thing. You NEVER trust the client. Ever. You assume it simply cannot ever be completely secured. Period. Seeing something like this just shows me a developer that trusted the client, and it doesn't particularly surprise me when they get burned. Regards, Chad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] function - action
[snip] I'm working on a project, where we distinguish between functions and actions in design, although in PHP both are implemented as functions. Is there a chance that PHP can use the word action as function? E.g.: public function doSomething() { } public action doSomethingElse() { ... } ... is actually the same but would help to see the design also in the code. [/snip] Functions are pretty much actions in most programming languages but you could write a wrapper around functions and call that wrapper 'action'. It is just a matter of semantics. It would just be an additional layer. As for distinguishing between functions and actions in design I'd be curious as to how you measure the difference. How would this apply to OOP methods? (A method is essentially a function for a class, so I suppose it could be called an action.) function foo(){ /* do stuff */ } Do stuff is an action. All functions do stuff. So all functions are actions. Can there be a function that is not an action of some sort? As a sometimes robotics guy I might be able to make the distinction (again, only semantically) between the computation of something (a function) and computer driven mechanical output (walk, turn, raise arm, etc.)(an action). Really though these are one in the same. (BTW you happened to catch me awake at 3am working on server issues or I might be able to see this more clearly.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php SHOW
Hi, If I understood your problem correctly then, you can use ob_start and ob_end functions Warm Regards, Sanjeev http://www.sanchanworld.com/ http://webdirectory.sanchanworld.com -Original Message- From: Hulf [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 4:26 PM To: php-general@lists.php.net Subject: [PHP] php SHOW Is there a way to output my data and tables using a php version of SHOW? Doesn't have to be pretty HTML just output to screen Ta, R. -- 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] Premature Ajax-ulation
Stut wrote: Validation, validation, validation. The big danger with doing anything on the client-side is that it's all to easy to fall into blindly trusting what the client is giving you, even the smallest assumption can create a big hole in your app. Don't assume events will happen the way you expect them to. Don't assume users won't be able to make requests just because your logic *should not* allow it. In short, don't treat it any different to any other web application. There is no difference, you still need to do all the validation on every request whether it's AJAX or not. Beyond data validation, the thing that *really* bothers me about AJAX/JSON, etc is functions that can read or even modify data. Until recently, AJAX frameworks didn't do much verification on the source of the request, so If you happened to be logged to some private/sensitive site, a 3rd party site in another tab/window could call your AJAX functions and glean whatever data from the responses, or even modify data. (e.g. ajax_getUsers(), or ajax_launchAllNukesNowNowNow()!) I think all the major frameworks added protection against this, but home-brewed or out-of-date AJAX/JSON framework users beware! jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] output the schema
I reword my last post. I want to take the result and generate the field info to the screen e.g Well, if you're using MySQL you could use either DESC table; or SHOW CREATE But you can't really generate the schema from a result set. -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which PHP-Editor to use?
2007. 08. 2, csütörtök keltezéssel 18.12-kor Merlin ezt írta: Hi there, I have worked now for several years happily with homesite 4.5, but now it looks like I have to switch to another system as homesite will not run without admin rights on a XP machine. What editors do you use? Do you have any recomendations on a special one? I have looked into eclipse, but I would hear from your experience which one would you recommend me to switch to? it's in the archives, about a thousand times ;) I used jEdit, but switched to Easy Eclipse for PHP lately. for my needs that's the best I found so far. greets Zoltán Németh Thank you for any comment. Best regards, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function - action
On Aug 3, 2007, at 2:38 AM, Ralph Kutschera wrote: Hallo! I'm working on a project, where we distinguish between functions and actions in design, although in PHP both are implemented as functions. Is there a chance that PHP can use the word action as function? E.g.: public function doSomething() { } public action doSomethingElse() { ... } ... is actually the same but would help to see the design also in the code. You could define a generic action function function action($funcName, $funcArgs) { return $funcName($funcArgs); } and use it on any function you want to use as an action function function printColor($color) { echo 'color: '.$color.'br'; } function printArea($width, $height) { echo 'area: '.($width * $height).'br'; } action('printColor', 'blue'); action('printArea', 3, 5); You could then pass in any function that is visible to the action function. You lose some efficiency but get your action function Then again, you could also just prepend action functions with 'action_' TIA, Ralph -- 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] Downloading PHP 521
http://www.php.net/releases/ -- N/A -Original Message- From: WyleySam [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 10:47 AM To: php-general@lists.php.net Subject: [PHP] Downloading PHP 521 Exactly where does one go to download PHP 521, not 523, not 522 but 521??? Every link I clicked on at http://www.php.net/ took me to 523, which I don't want. -- 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] Re: php SHOW
That would be dependent on the database you are interfaced to, not your programming language. For MySQL 5.0 http://dev.mysql.com/doc/refman/5.0/en/charset-show.html Or 5.1 http://dev.mysql.com/doc/refman/5.1/en/charset-show.html Not all database systems support the SHOW command. Warren -Original Message- From: Hulf [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 4:06 AM To: php-general@lists.php.net Subject: [PHP] Re: php SHOW I mean get the schema. Hulf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there a way to output my data and tables using a php version of SHOW? Doesn't have to be pretty HTML just output to screen Ta, R. -- 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: function - action
Ralph Kutschera escreveu: Hallo! I'm working on a project, where we distinguish between functions and actions in design, although in PHP both are implemented as functions. Is there a chance that PHP can use the word action as function? E.g.: public function doSomething() { } public action doSomethingElse() { ... } ... is actually the same but would help to see the design also in the code. TIA, Ralph That's not implemented in PHP language. What you should do is use adequate naming conventions, use verbs and as far as possible, describe what the function does: public function execute_someaction() {} public function sanitize_somedata() {} public function is_validwhatever() {} Can you understand what each function does by their names? What should they return? How about in your application(s)... ~ DM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Premature Ajax-ulation
At 8:39 AM -0500 8/3/07, Jay Blanchard wrote: How are you securing Ajax? I know that for the most part we send data to a PHP script for processing, so all of the normal rules for sending that data apply (mysql_real_escape_string(), etc.) Jay: First, the subject title is LOL. Second, I don't know about others but every ajax post/get data received is treated like any other post/get data -- it's validated and scrubbed. Most ajax data provided in my scripts are there to trigger an event in a php script -- so it becomes even simperer to scrub it via a switch -- either it fits what I expect or the process/flow travels to a default, but the data is never used as-is. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [pcre] backreferences to all matches of a repeated subexpression
Jack Bates wrote: I'm trying to pull all the components out of strings structured like: word followed by any number of ( dot word or square bracketed string ) This is an example: foo.bar[ab.cd].baz From the above example, I want: array('foo', 'bar', 'ab.cd', 'baz'); A regular expression to match these strings, including parenthesis around the parts I want to pull out: preg_match('/(^\w+)(?:\.(\w+)|\[([^]]+)\])*/', $subject, $matches); However applied to the above example: $matches[1] = 'foo'; // First subexpression $matches[2] = 'baz'; // Last value of second subexpression $matches[3] = 'ab.cd'; // Last value of third subexpression I'm not sure how to get an array of all subexpression matches, in the order matches appear in the subject, instead of the order expressions appear in the pattern. I think I might be able to do something using the Perl (?{code}) construction, e.g. ...(?:\.(\w+)(?{$parts[] = \2})|\[([^]]+)(?{$parts[] = \3})\])*... but I haven't thought about it too much because PHP doesn't support this construction. Any ideas much appreciated. Thanks, Jack Perhaps this would be easier with preg_match_all() which allows you to do a global match. Then traverse the resulting array matches. The square brackets do make the problem a little tougher since you can get into recursion. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Premature Ajax-ulation
[snip] First, the subject title is LOL. [/snip] I know... I wish I had thought of it! [snip] Second, I don't know about others but every ajax post/get data received is treated like any other post/get data -- it's validated and scrubbed. Most ajax data provided in my scripts are there to trigger an event in a php script -- so it becomes even simperer to scrub it via a switch -- either it fits what I expect or the process/flow travels to a default, but the data is never used as-is. [/snip] All of my PHP/Ajax functions are in one file (per application) with a case for each one. I apply typical scrubbing to this too, so I never use stuff as is either. I guess I could take the step of using php to obscure the javascript code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OT- why is network solutions more than godaddy?
I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? Thanks!
Re: [PHP] OT- why is network solutions more than godaddy?
On Fri, 2007-08-03 at 14:22 -0400, blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? No, you own it. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
Stut wrote: blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? Network Solutions are expensive, GoDaddy are cheap. That's all there is to it. In my experience customer service from both can be pretty shoddy or excellent depending on the day of the week and the phase of the moon. My advice is that if it's between the two, go with GoDaddy - you won't get any less for your money than you would with NetSol. -Stut But you might get more then with NetSol. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? Network Solutions are expensive, GoDaddy are cheap. That's all there is to it. In my experience customer service from both can be pretty shoddy or excellent depending on the day of the week and the phase of the moon. My advice is that if it's between the two, go with GoDaddy - you won't get any less for your money than you would with NetSol. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
Robert Cummings wrote: On Fri, 2007-08-03 at 14:22 -0400, blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? No, you own it. But, don't make your final decision until you've read this: http://nodaddy.com Regards, Austin. signature.asc Description: OpenPGP digital signature
Re: [PHP] OT- why is network solutions more than godaddy?
I'm with GoDaddy since 1999 and have over 60 domains. Never had a problem with them. -afan Stut wrote: blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? Network Solutions are expensive, GoDaddy are cheap. That's all there is to it. In my experience customer service from both can be pretty shoddy or excellent depending on the day of the week and the phase of the moon. My advice is that if it's between the two, go with GoDaddy - you won't get any less for your money than you would with NetSol. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
On Fri, 2007-08-03 at 14:22 -0400, blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? Ave, I think I have at least 13 domains (personal + business) with GoDaddy, for over 4 years now. No problems whatsoever. And their domains do come with a boatload of stuff. This is something like getting an Intel Core 2 Duo E6420 Processor (Retail/Packaged) brand new from CompUSA for $339 and getting the same exact thing from Newegg.Com for $179. It¹s the exact same thing you can burn it when you get home, if you like! No You own it! ~~~ Rahul Sitaram Johari CEO, Twenty Four Seventy Nine Inc. W: http://www.rahulsjohari.com E: [EMAIL PROTECTED] ³I morti non sono piu soli ... The dead are no longer lonely²
Re: [PHP] OT- why is network solutions more than godaddy?
Interesting read - although the whole thing is trumpeted upon their policy We have the right to terminate a service at any time without any reason - Well apparently, Network Solutions and most Major Domain Name Service vendors have a similar policy - so I wouldn't be surprised to see a www.networkproblems.com website one day. :P On 8/3/07 3:12 PM, Austin Denyer [EMAIL PROTECTED] wrote: Robert Cummings wrote: On Fri, 2007-08-03 at 14:22 -0400, blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? No, you own it. But, don't make your final decision until you've read this: http://nodaddy.com Regards, Austin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OT- why is network solutions more than godaddy?
Does anyone know the relationship between goDaddy.com and WildWestDomains.com? :W -Original Message- From: Rahul Sitaram Johari [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 12:47 PM To: Austin Denyer; PHP Subject: Re: [PHP] OT- why is network solutions more than godaddy? Interesting read - although the whole thing is trumpeted upon their policy We have the right to terminate a service at any time without any reason - Well apparently, Network Solutions and most Major Domain Name Service vendors have a similar policy - so I wouldn't be surprised to see a www.networkproblems.com website one day. :P On 8/3/07 3:12 PM, Austin Denyer [EMAIL PROTECTED] wrote: Robert Cummings wrote: On Fri, 2007-08-03 at 14:22 -0400, blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? No, you own it. But, don't make your final decision until you've read this: http://nodaddy.com Regards, Austin. -- 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] OT- why is network solutions more than godaddy?
How about a middle-of-the-road solution? www.PairNIC.com The domain services of the very good webhost, Pair Networks. I've been with their hosting solutions since 1998, and with their domain registration services since whenever it opened (5 years ago, I spose). Not the cheapest, not the most expensive, but great support, and great value of services that comes along with the registration. Plus, its Pair! (No, I dont work for them, just a very happy customer). --Eric Warren Vail wrote: Does anyone know the relationship between goDaddy.com and WildWestDomains.com? :W -Original Message- From: Rahul Sitaram Johari [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 12:47 PM To: Austin Denyer; PHP Subject: Re: [PHP] OT- why is network solutions more than godaddy? Interesting read - although the whole thing is trumpeted upon their policy We have the right to terminate a service at any time without any reason - Well apparently, Network Solutions and most Major Domain Name Service vendors have a similar policy - so I wouldn't be surprised to see a www.networkproblems.com website one day. :P On 8/3/07 3:12 PM, Austin Denyer [EMAIL PROTECTED] wrote: Robert Cummings wrote: On Fri, 2007-08-03 at 14:22 -0400, blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? No, you own it. But, don't make your final decision until you've read this: http://nodaddy.com Regards, Austin. -- 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] OT- why is network solutions more than godaddy?
At 2:22 PM -0400 8/3/07, blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? Thanks! I have had good luck with iyd.com (http://www.itsyourdomain.com) for several years now -- some very good people there! I own over 60 domains as well and my cost is less than $9.00 each for everything. I was just informed this morning that iyd was purchased by Tucows, so I don't know how that will affect things. But, I've had good luck with Tucows in other things -- so I'm expecting no problems. In any event, I wouldn't go with either of the ones you mentioned. Back luck with both. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Premature Ajax-ulation
At 1:17 PM -0500 8/3/07, Jay Blanchard wrote: All of my PHP/Ajax functions are in one file (per application) with a case for each one. I apply typical scrubbing to this too, so I never use stuff as is either. I guess I could take the step of using php to obscure the javascript code. You really can't obscure the javascript code, but you can limit the code that can be seen by the user by sending commands back to the server and letting php do the work and then bringing the work product forward by displaying it via ajax. The only stuff the user see's (if they want) is the typical ajax routine. Everything else is tucked nicely away in php scripts. For example: http://www.webbytedd.com/b/ajax-pics/ Everything is created on the back-end and then brought forward via ajax. The only thing the user can ever see is: http://www.webbytedd.com/b/ajax-pics/a.js And, that's pretty common. It gets a bit more involved working with controls, like so: http://www.webbytedd.com/a/ajax-controls/ If the user tried, he user could see this: http://www.webbytedd.com/a/ajax-controls/ajax.js But, none of the deeper php stuff will ever be seen short of failure somewhere. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
I use and love http://www.namecheap.com/ 8.88$, plus whois guard. The control panel is great. Fast customer service. Also, I personally would avoid mixing host and registrar. Cheers, M -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
On 8/3/07, Micky Hulse [EMAIL PROTECTED] wrote: I use and love http://www.namecheap.com/ 8.88$, plus whois guard. The control panel is great. Fast customer service. Also, I personally would avoid mixing host and registrar. Cheers, M -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Yes, but at the core, Namecheap (http://www.namecheap.com/) is just like me (http://domains.pilotpig.net/) - a domain reseller. A bigger, richer, more well-known reseller, but still just a reseller. Their site looks fancy, mine well, I'm no designer, I'm a geek. I'll stick to what I know. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Hey, PHP-General list to give something back to everyone, you guys can have 50% off every month on hosting plans of $10/mo. or more (list price) at http://www.pilotpig.net/. Use the coupon code phpgeneralaug07 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
On 8/3/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-03 at 17:05 -0400, Daniel Brown wrote: Yes, but at the core, Namecheap (http://www.namecheap.com/) is just like me (http://domains.pilotpig.net/) - a domain reseller. A bigger, richer, more well-known reseller, but still just a reseller. Their site looks fancy, mine well, I'm no designer, I'm a geek. I'll stick to what I know. Your site is broken btw, it doesn't support Canadian Dollars you insensitive clod. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... Ha! Which one, the domains portion of it? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Hey, PHP-General list to give something back to everyone, you guys can have 50% off every month on hosting plans of $10/mo. or more (list price) at http://www.pilotpig.net/. Use the coupon code phpgeneralaug07 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
On Fri, 2007-08-03 at 17:05 -0400, Daniel Brown wrote: Yes, but at the core, Namecheap (http://www.namecheap.com/) is just like me (http://domains.pilotpig.net/) - a domain reseller. A bigger, richer, more well-known reseller, but still just a reseller. Their site looks fancy, mine well, I'm no designer, I'm a geek. I'll stick to what I know. Your site is broken btw, it doesn't support Canadian Dollars you insensitive clod. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
On Fri, 2007-08-03 at 17:05 -0400, Daniel Brown wrote: Yes, but at the core, Namecheap (http://www.namecheap.com/) is just like me (http://domains.pilotpig.net/) - a domain reseller. A bigger, richer, more well-known reseller, but still just a reseller. Their site looks fancy, mine well, I'm no designer, I'm a geek. I'll stick to what I know. Hmmm, I think yours looks nicer. But again, I'm a geek also and not a designer :) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
On 8/3/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-03 at 17:05 -0400, Daniel Brown wrote: Yes, but at the core, Namecheap (http://www.namecheap.com/) is just like me (http://domains.pilotpig.net/) - a domain reseller. A bigger, richer, more well-known reseller, but still just a reseller. Their site looks fancy, mine well, I'm no designer, I'm a geek. I'll stick to what I know. Hmmm, I think yours looks nicer. But again, I'm a geek also and not a designer :) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... Mine looks cheaper! Heh. I actually lose a penny for each domain I sell at that price, I think, but it's an attempt to gain attention for my newest hosting company. And by the way plug shame=no Check out the blurb in my signature! /plug -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Hey, PHP-General list to give something back to everyone, you guys can have 50% off every month on hosting plans of $10/mo. or more (list price) at http://www.pilotpig.net/. Use the coupon code phpgeneralaug07 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UTF-8 support
http://www.php.net/manual/en/ref.mbstring.php On 8/3/07, Naz Gassiep [EMAIL PROTECTED] wrote: The functions trim() and explode() appear to be munging multibyte UTF-8 strings. I can't find multibyte safe versions of them in the manual, do they exist, or do I have to make my own? - Naz. -- 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] OT- why is network solutions more than godaddy?
On Fri, 2007-08-03 at 17:13 -0400, Daniel Brown wrote: On 8/3/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-03 at 17:05 -0400, Daniel Brown wrote: Yes, but at the core, Namecheap (http://www.namecheap.com/) is just like me (http://domains.pilotpig.net/) - a domain reseller. A bigger, richer, more well-known reseller, but still just a reseller. Their site looks fancy, mine well, I'm no designer, I'm a geek. I'll stick to what I know. Your site is broken btw, it doesn't support Canadian Dollars you insensitive clod. Ha! Which one, the domains portion of it? When you go to Shopping Cart there's a currency select list. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
At 1:56 PM -0700 8/3/07, Micky Hulse wrote: Also, I personally would avoid mixing host and registrar. I've held the other view in keeping them separate -- I have lot's of host, but only one registrar that doesn't provide me hosting. I had host disappear overnight. It's one thing to put your site up again somewhere else, but it's another to have all your sites go down when a register fails, but I fortunately have never had that happen. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Output Buffering and zlib Compression Issue
When I run the following code (PHP 5.2.2, 5.2.3) via Apache (with an htaccess file), I get this error: Notice: ob_end_clean() [ref.outcontrol]: failed to delete buffer zlib output compression. in ... Can anyone explain what's going on? I'm assuming it isn't a bug and I've read the documentation. Did I miss something? htaccess file code: php_flag output_buffering Off php_flag zlib.output_compression On php_value zlib.output_compression_level -1 PHP Code: ?php error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); ob_start(); echo You shouldn't see this.; while (ob_get_level() 0) { ob_end_clean(); } ob_start(); echo You SHOULD see this.; ob_end_flush(); ? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
At 5:11 PM -0400 8/3/07, Robert Cummings wrote: On Fri, 2007-08-03 at 17:05 -0400, Daniel Brown wrote: Your site is broken btw, it doesn't support Canadian Dollars you insensitive clod. Ahhh, ya frostback. Ya can't blame a man a boot dat, eh? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
On Fri, 2007-08-03 at 19:05 -0400, tedd wrote: At 5:11 PM -0400 8/3/07, Robert Cummings wrote: On Fri, 2007-08-03 at 17:05 -0400, Daniel Brown wrote: Your site is broken btw, it doesn't support Canadian Dollars you insensitive clod. Ahhh, ya frostback. Ya can't blame a man a boot dat, eh? Don't make me set my pet polar bear upon you! He gets really angry when not within the confines of his igloo. :B Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Output Buffering and zlib Compression Issue
Hi! I'm not quite sure what you are trying to do ... Why do you use output buffering in your code, when you turn it off in the htaccess directive?? php_flag output_buffering Off The code worked for me. But I tested it without your htaccess settings ... Jan -Ursprüngliche Nachricht- Von: Chris [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 4. August 2007 01:18 An: php-general@lists.php.net Betreff: [PHP] Output Buffering and zlib Compression Issue When I run the following code (PHP 5.2.2, 5.2.3) via Apache (with an htaccess file), I get this error: Notice: ob_end_clean() [ref.outcontrol]: failed to delete buffer zlib output compression. in ... Can anyone explain what's going on? I'm assuming it isn't a bug and I've read the documentation. Did I miss something? htaccess file code: php_flag output_buffering Off php_flag zlib.output_compression On php_value zlib.output_compression_level -1 PHP Code: ?php error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); ob_start(); echo You shouldn't see this.; while (ob_get_level() 0) { ob_end_clean(); } ob_start(); echo You SHOULD see this.; ob_end_flush(); ? Chris -- 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: Output Buffering and zlib Compression Issue
I put set output_buffering off in the htaccess so i could have absolute control in my code. It doesn't matter what I was trying to do, actually. I created a very basic test case to illustrate the issue. And the problem won't happen if you don't bother using the htaccess code. Why would I have included it if it weren't necessary to illustrate my issue? Anyway, it is all irrelevant now as I found the solution in a pear package. Simply replace: while (ob_get_level() 0) { ob_end_clean(); } With: if (ob_get_level()) { while (@ob_end_clean()); } And the issue is solved. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Output Buffering and zlib Compression Issue
Right! With zlib compression ob_start() or similar seems to get called before the user script execution. I'm not quite sure why. Anyhow ob_get_level() returns 2 after the ob_start() is called for the first time in the script. You can avoid the error with while (ob_get_level() 1) { ob_end_clean(); } but it won't kill the buffer containing output before ob_start() is called. ob_end_clean(); ob_end_clean(); will reproduce your error, too. This leads to the assumption, that it is an issue of advancing the functions internal process pointer. Same reason why $data1 = mysql_fetch_assoc($resultid); $data2 = mysql_fetch_assoc($resultid); won't lead to the desired effect either, but While($data = mysql_fetch_assoc($resultid)){...} does, as does while (@ob_end_clean()); It seems only this way of accessing the buffers allows deleting the lowermost buffer created before Script execution. Jan -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Saturday, August 04, 2007 3:25 AM To: php-general@lists.php.net Subject: [PHP] Re: Output Buffering and zlib Compression Issue -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php