[PHP] Suggestion needed: Internet store script
Hi everyone, I'm making a website for a small company. The site itself is quite easy to accomplish, but there are two problems: i18n and the store. So I would like to have your suggestions about the store. Here are the requirements: 1. Basic functionality (possibility to purchase without authorization, maybe no basket). 2. Accessibility and usability by visually impaired persons, for the admin part included (that means, no complicated flash content and such features). 3. I18n capabilities (unicode of course). We need it to be in English, Russian, and Swedish since it's a Swedish company. 4. It should be freeware (or, if it's really impossible, not expensive). 5. It should be Php+MySql. Thanks! -- With best regards from Ukraine, Andre Skype: Francophile Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] suggestion required
Hey all, I have one flex+PHP application. Main purpose of the site is to sell T-shirts online. Flex is used for generating different designs on available tshirt. Something similar to Cafepress dot com. I want to generate 300 DPI tshirt image from flex and send it to PHP side for processing. Now the question is Flex doen't support direct image generation. So flex send's a Bytearray for 300 dpi image which is quite Bigger.some time it crashes the browser while processing..because of heavy data.. And can not store in any of MySQL datatype. Also storing in a txt file is too much time taking process.. Any Suggestion or help to come out fron this issue.. Regards Pravin
[PHP] Suggestion on .htaccess
This is a .htaccess for a MU blog the index file is kept at : public_html/ And main blog is kept at: public_html/blog It is causing severe cache issue. SuperCache plugin is not working. The blog is running out of memory most of times and consuming huge CPU. Any suggestions? # BEGIN WPSuperCache IfModule mod_rewrite.c RewriteEngine On RewriteBase /blog/ AddDefaultCharset UTF-8 RewriteRule ^(.*) /blog/wp-content/cache/%{HTTP_HOST}/blog/$1/index.html.gz [L] RewriteCond %{REQUEST_URI} !^.*[^/]$ RewriteCond %{REQUEST_URI} !^.*//.*$ RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$ RewriteCond %{HTTP:Accept-Encoding} gzip RewriteCond %{DOCUMENT_ROOT}/blog/wp-content/cache/%{HTTP_HOST}/blog/$1/index.html.gz -f /IfModule # END WPSuperCache #uploaded files RewriteRule ^(.*/)?files/$ index.php [L] RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L] RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* # add a trailing slash to /wp-admin RewriteCond %{REQUEST_URI} ^.*/wp-admin$ RewriteRule ^(.+)$ $1/ [R=301,L] RewriteRule . - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule .* /blog/index.php [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d IfModule mod_security.c Files async-upload.php SecFilterEngine Off SecFilterScanPOST Off /Files /IfModule
Re: [PHP] Suggestion re: PHP Brain Teasers
Steve Edberg wrote: At 7:37 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 16:27 -0700, Steve Edberg wrote: Proposal - Perhaps we could separate Brain Teasers, Obfuscated PHP challenges, and what-have-you to a separate mailing list, say php-fun (php-phun? PHPhun?)? Maybe you could also include 'use of eval()' in that list, since I think 97.004% of the time using eval() inevitably leads to obfuscation. And one should eschew obfuscation. We could... but why bother?! Minimizing the circumlocution and periphrasis that is characteristic of an exhaustively obfuscated style is conducive to a maximally productive ISO-9000/six-sigma enterprise infrastructure that is architected towards the rightsized core competencies of an n-tier profit maximization strategy. Errr, wait, I think I just wandered into the 'PHP as a strategic BUSINESS language' thread... That almost made more sense when ROTed :-) Cheers -- David Robley It's a bloody lion, said Tom categorically. Today is Boomtime, the 41st day of Confusion in the YOLD 3173. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion re: PHP Brain Teasers
Steve Edberg wrote: At 7:37 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 16:27 -0700, Steve Edberg wrote: Proposal - Perhaps we could separate Brain Teasers, Obfuscated PHP challenges, and what-have-you to a separate mailing list, say php-fun (php-phun? PHPhun?)? Maybe you could also include 'use of eval()' in that list, since I think 97.004% of the time using eval() inevitably leads to obfuscation. And one should eschew obfuscation. We could... but why bother?! Minimizing the circumlocution and periphrasis that is characteristic of an exhaustively obfuscated style is conducive to a maximally productive ISO-9000/six-sigma enterprise infrastructure that is architected towards the rightsized core competencies of an n-tier profit maximization strategy. that's the shortest essay I've read on the subject of 'what is wrong with the world', brilliant :-P -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Suggestion re: PHP Brain Teasers
Proposal - Perhaps we could separate Brain Teasers, Obfuscated PHP challenges, and what-have-you to a separate mailing list, say php-fun (php-phun? PHPhun?)? Maybe you could also include 'use of eval()' in that list, since I think 97.004% of the time using eval() inevitably leads to obfuscation. And one should eschew obfuscation. - steve, eschewing away... -- +--- my people are the people of the dessert, ---+ | Steve Edberghttp://pgfsun.ucdavis.edu/ | | UC Davis Genome Center[EMAIL PROTECTED] | | Bioinformatics programming/database/sysadmin (530)754-9127 | + said t e lawrence, picking up his fork + -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion re: PHP Brain Teasers
On Thu, 2007-07-05 at 16:27 -0700, Steve Edberg wrote: Proposal - Perhaps we could separate Brain Teasers, Obfuscated PHP challenges, and what-have-you to a separate mailing list, say php-fun (php-phun? PHPhun?)? Maybe you could also include 'use of eval()' in that list, since I think 97.004% of the time using eval() inevitably leads to obfuscation. And one should eschew obfuscation. We could... but why bother?! Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion re: PHP Brain Teasers
At 7:37 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 16:27 -0700, Steve Edberg wrote: Proposal - Perhaps we could separate Brain Teasers, Obfuscated PHP challenges, and what-have-you to a separate mailing list, say php-fun (php-phun? PHPhun?)? Maybe you could also include 'use of eval()' in that list, since I think 97.004% of the time using eval() inevitably leads to obfuscation. And one should eschew obfuscation. We could... but why bother?! Minimizing the circumlocution and periphrasis that is characteristic of an exhaustively obfuscated style is conducive to a maximally productive ISO-9000/six-sigma enterprise infrastructure that is architected towards the rightsized core competencies of an n-tier profit maximization strategy. Errr, wait, I think I just wandered into the 'PHP as a strategic BUSINESS language' thread... - s -- +--- my people are the people of the dessert, ---+ | Steve Edberghttp://pgfsun.ucdavis.edu/ | | UC Davis Genome Center[EMAIL PROTECTED] | | Bioinformatics programming/database/sysadmin (530)754-9127 | + said t e lawrence, picking up his fork + -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion for IN()
Your first scenario can been done in a similar fashion to how you are used to doing it in SQL: if ( in_array($a, array(1,4,20,...) ) {} Your second scenario doesn't seem like there is much of a problem because it will always be short (can only have 2 comparisons). -Shawn Jay Blanchard wrote: [snip] I'm sure I'll be flamed for this, but it seems to me that there should be a shortcut way to write: If ($a == 1 || $a == 4 || $a == 20 || ...) {} To something more like what SQL has... If ( $a IN(1,4,20,...) ) {} And same with the very helpful SQL BETWEEN 'function'. Instead of If ($a 1 $a 20) {} Why not If ($a BETWEEN (1,20)) {} [/snip] You could write a function and share it with the rest of us! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion for IN()
Jay Blanchard wrote: You could write a function and share it with the rest of us! function between ($var, $min, $max) { return ($var $min $var $max) ? TRUE : FALSE; } function in () { if (func_num_args() 2) trigger_error('You must provide at least one argument for in()', E_USER_WARNING); $haystack = func_get_args(); $needle = array_shift($haystack); return in_array($needle, $haystack) ? TRUE : FALSE; } if (in('foo', 'bar', 'foobar', 'foo')) //... TRUE if (in('foo', 'bar', 'foobar', 'baz')) //... FALSE if (between(15, 10, 20)) //... TRUE I'm not sure if you want = and = instead in between(), but you can just change it yourself. Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion for IN()
Daniel Schierbeck wrote: return ($var $min $var $max) ? TRUE : FALSE; (...) return in_array($needle, $haystack) ? TRUE : FALSE; You can return booleans without comparing them to true/false: return $var $min $var $max; return in_array($needle, $haystack); Christophe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion for IN()
Christophe Chisogne wrote: Daniel Schierbeck wrote: return ($var $min $var $max) ? TRUE : FALSE; (...) return in_array($needle, $haystack) ? TRUE : FALSE; You can return booleans without comparing them to true/false: return $var $min $var $max; return in_array($needle, $haystack); Christophe Thanks, nicely spotted there. Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Suggestion for IN()
On 01 October 2004 14:05, Daniel Schierbeck wrote: Jay Blanchard wrote: You could write a function and share it with the rest of us! function between ($var, $min, $max) { return ($var $min $var $max) ? TRUE : FALSE; } Don't make PHP do more work than it needs to: return ($var $min $var $max) is quite sufficient. function in () { if (func_num_args() 2) trigger_error('You must provide at least one argument for in()', E_USER_WARNING); $haystack = func_get_args(); $needle = array_shift($haystack); return in_array($needle, $haystack) ? TRUE : FALSE; } return in_array($needle, $haystack) Also, you may find array_splice($haystack, 0, 1) more efficient, since array_shift() renumbers all the keys. ($needle = $haystack[0]; unset $haystack[0]; would be another possibility.) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Suggestion for IN()
I'm sure I'll be flamed for this, but it seems to me that there should be a shortcut way to write: If ($a == 1 || $a == 4 || $a == 20 || ...) {} To something more like what SQL has... If ( $a IN(1,4,20,...) ) {} And same with the very helpful SQL BETWEEN 'function'. Instead of If ($a 1 $a 20) {} Why not If ($a BETWEEN (1,20)) {} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Suggestion for IN()
[snip] I'm sure I'll be flamed for this, but it seems to me that there should be a shortcut way to write: If ($a == 1 || $a == 4 || $a == 20 || ...) {} To something more like what SQL has... If ( $a IN(1,4,20,...) ) {} And same with the very helpful SQL BETWEEN 'function'. Instead of If ($a 1 $a 20) {} Why not If ($a BETWEEN (1,20)) {} [/snip] You could write a function and share it with the rest of us! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion for IN()
you could try in_array() if (in_array(1,2,3,4,5), 6) On Thu, 2004-09-30 at 22:10, Daevid Vincent wrote: I'm sure I'll be flamed for this, but it seems to me that there should be a shortcut way to write: If ($a == 1 || $a == 4 || $a == 20 || ...) {} To something more like what SQL has... If ( $a IN(1,4,20,...) ) {} And same with the very helpful SQL BETWEEN 'function'. Instead of If ($a 1 $a 20) {} Why not If ($a BETWEEN (1,20)) {} -- http://cosminb.blogspot.com/ c3f7bc9d7683857572da3d1fa3d31af17bde4ebbc5c0f0dc2b7f6f
Re: [PHP] Suggestion for IN()
On Friday 01 October 2004 03:10, Daevid Vincent wrote: I'm sure I'll be flamed for this, but it seems to me that there should be a shortcut way to write: If ($a == 1 || $a == 4 || $a == 20 || ...) {} To something more like what SQL has... If ( $a IN(1,4,20,...) ) {} in_array() or make your own IN() function. And same with the very helpful SQL BETWEEN 'function'. Instead of If ($a 1 $a 20) {} Why not If ($a BETWEEN (1,20)) {} Ditto, make your own BETWEEN() function. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Please don't put a strain on our friendship by asking me to do something for you. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion for IN()
...sorry, that should have been if (in_array(array(1,2,3,4), 6)) On Thu, 2004-09-30 at 22:10, Daevid Vincent wrote: I'm sure I'll be flamed for this, but it seems to me that there should be a shortcut way to write: If ($a == 1 || $a == 4 || $a == 20 || ...) {} To something more like what SQL has... If ( $a IN(1,4,20,...) ) {} And same with the very helpful SQL BETWEEN 'function'. Instead of If ($a 1 $a 20) {} Why not If ($a BETWEEN (1,20)) {} -- c3f7bc9d7683857572da3d1fa3d31af17bde4ebbc5c0f0dc2b7f6f
Re: [PHP] Suggestion for IN()
On Thu, 2004-09-30 at 15:50, Cosmin wrote: you could try in_array() if (in_array(1,2,3,4,5), 6) Just for farts and giggles... possibly better speed with such a basic datatype: if( strpos( ' 1 2 3 4 5 6 7 ', $a ) !== false ) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion on executing external programs from within php
Hi Stuart, I have finally had a chance to test your suggestion and I am still getting a browser timeout ? The 1st program runs to completion even though the broswer times out. So it doesn't execute the second program :-( I have also tried `/usr/local/bin/process_file file1 ` exec('/usr/local/bin/process_file file1 ') Any ideas?? John Stuart wrote: John Clegg wrote: I would like to be able to execute 2 system calls simultaneously. I am not interested in the output and I would like to do the equivalent of a fork as these programs take a long time. system('/usr/local/bin/process_file file1'); system('/usr/local/bin/process_file file2'); system('/usr/local/bin/process_file file1 '); system('/usr/local/bin/process_file file2 '); Should work in theory. Haven't test it though. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion on executing external programs from within php
John Clegg wrote: I have finally had a chance to test your suggestion and I am still getting a browser timeout ? The 1st program runs to completion even though the broswer times out. So it doesn't execute the second program :-( I have also tried `/usr/local/bin/process_file file1 ` exec('/usr/local/bin/process_file file1 ') Any ideas?? Yup. Having checked the system function in the manual (http://php.net/system), it says this... Note: If you start a program using this function and want to leave it running in the background, you have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends. So try this... system('/usr/local/bin/process_file file1 /dev/null '); system('/usr/local/bin/process_file file2 /dev/null '); -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Suggestion on executing external programs from within php
Hi I would like to be able to execute 2 system calls simultaneously. I am not interested in the output and I would like to do the equivalent of a fork as these programs take a long time. eg system('/usr/local/bin/process_file file1'); system('/usr/local/bin/process_file file2'); Any suggestions on what to use??? Cheers John Clegg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion on executing external programs from within php
John Clegg wrote: I would like to be able to execute 2 system calls simultaneously. I am not interested in the output and I would like to do the equivalent of a fork as these programs take a long time. system('/usr/local/bin/process_file file1'); system('/usr/local/bin/process_file file2'); system('/usr/local/bin/process_file file1 '); system('/usr/local/bin/process_file file2 '); Should work in theory. Haven't test it though. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suggestion: recursive calls
Yep, but then I expect a timeout error because my script is running more than say 20 seconds... Ronald Marco Schuler [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Hi Am Don, 2003-09-04 um 12.40 schrieb Ronald van Raaphorst: I normally program in clarion (www.softvelocity.com) and an infinite recursive call will cause a heap overflow... As I only got a This page cannot be displayed page, an error must have occurred, but it's not displayed... A computer cannot decide when a recursion is to deep. Imagine traversing a realy big tree. There a recursion can get realy deep. I don't know about the internals of php. But as it is an interpreter language, I would say that all variables or even the parsing tree are located on the heap. So this heap will probably be quite big! Thus, to produce a heap overflow will take a rather long time. (Correct me if I am wrong with my tought) A workaround could be that you have a counter (static variable!) in your recursion procedure or methode respectively. You increment this counter on every entry into the procedure and compare it to a limit that _you_ specifiy. -- Cheers! Marco At first I thought I had lost contact with the site, but then, after a lot of tracing, I found the source of the error. Ronald Marek Kilimajer [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I don't think it is even possible, if the recursive calls don't seem infinite to inteligent human being, how should a stupid computer program find out. Ronald van Raaphorst wrote: Hi all, Not a real bug, but a suggestion: It would be nice if inifite recursive calls would somehow give an error. I spend quite some time to find the error in my php script. Ronald -- 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] suggestion: recursive calls
yeah, but my unix server is located at my providers place, and I can't get a core dump. Ronald Robert Cummings [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I've accidentally had infinite recursion at times. Under Linux if configured, you can get a core dump which can be loaded in GDB to see the stack. I usually know Its infinite recursion when GDB shows a backtrack in the 10s of thousands. Cheers, Rob. On Thu, 2003-09-04 at 06:04, Ronald van Raaphorst wrote: Hi all, Not a real bug, but a suggestion: It would be nice if inifite recursive calls would somehow give an error. I spend quite some time to find the error in my php script. Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .-. | Worlds of Carnage - http://www.wocmud.org | :-: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul.| `-' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] suggestion: recursive calls
Hi all, Not a real bug, but a suggestion: It would be nice if inifite recursive calls would somehow give an error. I spend quite some time to find the error in my php script. Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suggestion: recursive calls
I don't think it is even possible, if the recursive calls don't seem infinite to inteligent human being, how should a stupid computer program find out. Ronald van Raaphorst wrote: Hi all, Not a real bug, but a suggestion: It would be nice if inifite recursive calls would somehow give an error. I spend quite some time to find the error in my php script. Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suggestion: recursive calls
I normally program in clarion (www.softvelocity.com) and an infinite recursive call will cause a heap overflow... As I only got a This page cannot be displayed page, an error must have occurred, but it's not displayed... At first I thought I had lost contact with the site, but then, after a lot of tracing, I found the source of the error. Ronald Marek Kilimajer [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I don't think it is even possible, if the recursive calls don't seem infinite to inteligent human being, how should a stupid computer program find out. Ronald van Raaphorst wrote: Hi all, Not a real bug, but a suggestion: It would be nice if inifite recursive calls would somehow give an error. I spend quite some time to find the error in my php script. Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suggestion: recursive calls
Hi Am Don, 2003-09-04 um 12.40 schrieb Ronald van Raaphorst: I normally program in clarion (www.softvelocity.com) and an infinite recursive call will cause a heap overflow... As I only got a This page cannot be displayed page, an error must have occurred, but it's not displayed... A computer cannot decide when a recursion is to deep. Imagine traversing a realy big tree. There a recursion can get realy deep. I don't know about the internals of php. But as it is an interpreter language, I would say that all variables or even the parsing tree are located on the heap. So this heap will probably be quite big! Thus, to produce a heap overflow will take a rather long time. (Correct me if I am wrong with my tought) A workaround could be that you have a counter (static variable!) in your recursion procedure or methode respectively. You increment this counter on every entry into the procedure and compare it to a limit that _you_ specifiy. -- Cheers! Marco At first I thought I had lost contact with the site, but then, after a lot of tracing, I found the source of the error. Ronald Marek Kilimajer [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I don't think it is even possible, if the recursive calls don't seem infinite to inteligent human being, how should a stupid computer program find out. Ronald van Raaphorst wrote: Hi all, Not a real bug, but a suggestion: It would be nice if inifite recursive calls would somehow give an error. I spend quite some time to find the error in my php script. Ronald -- 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] suggestion: recursive calls
I was just testing PHP with this code: ?php function blah($varible) { if ($varible 860) exit(); echo $varible . 'br'; flush(); blah($varible + 1); } blah(1); ? This would show 1 to 860, however if I tried any number greater than 860, ie 861 then the page would give the This page cannot be displayed page like you were saying. Normally apps in C, etc would throw a stack overflow error when you recursed too high... I'm guessing PHP doesn't implement this as a normal stack, and is crashing out because we have hit the memory limit. The reason I say that is because 860 seems a very odd number to set the stack size to. I'm also guessing that it wouldn't be too hard for the PHP Dev team to place a limit on the recursion depth, or maybe it is a bit too hard and thats why they didn't bother :)... Andrew - Original Message - From: Ronald van Raaphorst [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 11:40 AM Subject: Re: [PHP] suggestion: recursive calls I normally program in clarion (www.softvelocity.com) and an infinite recursive call will cause a heap overflow... As I only got a This page cannot be displayed page, an error must have occurred, but it's not displayed... At first I thought I had lost contact with the site, but then, after a lot of tracing, I found the source of the error. Ronald Marek Kilimajer [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I don't think it is even possible, if the recursive calls don't seem infinite to inteligent human being, how should a stupid computer program find out. Ronald van Raaphorst wrote: Hi all, Not a real bug, but a suggestion: It would be nice if inifite recursive calls would somehow give an error. I spend quite some time to find the error in my php script. Ronald -- 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] suggestion: recursive calls
I wouldn't want to see a limit placed on recursion depth, IMHO it is the responsibility of the programmer to limit recursion not the language itself otherwise the language is limiting the programmer. Another possiblity is hitting the execution time limit, sounds like you are using IE with friendly errors turned on, I prefer turning them off. Jason Andrew Brampton wrote: I was just testing PHP with this code: ?php function blah($varible) { if ($varible 860) exit(); echo $varible . 'br'; flush(); blah($varible + 1); } blah(1); ? This would show 1 to 860, however if I tried any number greater than 860, ie 861 then the page would give the This page cannot be displayed page like you were saying. Normally apps in C, etc would throw a stack overflow error when you recursed too high... I'm guessing PHP doesn't implement this as a normal stack, and is crashing out because we have hit the memory limit. The reason I say that is because 860 seems a very odd number to set the stack size to. I'm also guessing that it wouldn't be too hard for the PHP Dev team to place a limit on the recursion depth, or maybe it is a bit too hard and thats why they didn't bother :)... Andrew - Original Message - From: Ronald van Raaphorst [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 11:40 AM Subject: Re: [PHP] suggestion: recursive calls I normally program in clarion (www.softvelocity.com) and an infinite recursive call will cause a heap overflow... As I only got a This page cannot be displayed page, an error must have occurred, but it's not displayed... At first I thought I had lost contact with the site, but then, after a lot of tracing, I found the source of the error. Ronald Marek Kilimajer [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I don't think it is even possible, if the recursive calls don't seem infinite to inteligent human being, how should a stupid computer program find out. Ronald van Raaphorst wrote: Hi all, Not a real bug, but a suggestion: It would be nice if inifite recursive calls would somehow give an error. I spend quite some time to find the error in my php script. Ronald -- 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] suggestion: recursive calls
I've accidentally had infinite recursion at times. Under Linux if configured, you can get a core dump which can be loaded in GDB to see the stack. I usually know Its infinite recursion when GDB shows a backtrack in the 10s of thousands. Cheers, Rob. On Thu, 2003-09-04 at 06:04, Ronald van Raaphorst wrote: Hi all, Not a real bug, but a suggestion: It would be nice if inifite recursive calls would somehow give an error. I spend quite some time to find the error in my php script. Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .-. | Worlds of Carnage - http://www.wocmud.org | :-: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul.| `-' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] suggestion on php-editor?
Louie Miranda mailto:[EMAIL PROTECTED] on Friday, August 08, 2003 12:24 AM said: I currently used Dev-PHP IDE. But i was wondering if you guys have any other suggestions? HTML-Kit: http://www.chami.com/html-kit/ c. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] suggestion on php-editor?
I use Jedit (www.jedit.org). It's an excellent program for many different programming languages. Robbert van Andel -Original Message- From: Adrian [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 12:27 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] suggestion on php-editor? the tswebeditor ist not bad: http://194.112.147.2/tswebeditor/index/index/en -- Adrian mailto:[EMAIL PROTECTED] www: http://www.planetcoding.net www: http://www.webskyline.de -- 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] suggestion on php-editor?
I currently used Dev-PHP IDE. But i was wondering if you guys have any other suggestions? -- Thank you, Louie Miranda ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suggestion on php-editor?
the tswebeditor ist not bad: http://194.112.147.2/tswebeditor/index/index/en -- Adrian mailto:[EMAIL PROTECTED] www: http://www.planetcoding.net www: http://www.webskyline.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: SPAM: [PHP] suggestion on php-editor?
On Friday, August 8, 2003, at 05:24 PM, Louie Miranda wrote: I currently used Dev-PHP IDE. But i was wondering if you guys have any other suggestions? Search the archives... this would have to be in the top 5 topics repeated on this list, so you'll find 10's or 100's of suggestions :) http://marc.theaimsgroup.com/?l=php-generalw=2r=1s=php+editorq=t Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion of webpage about search engines
C'mon! You built this site - don't lie and say you 'found' it! Quoting l [EMAIL PROTECTED]: I found one small site (designed in php of course:)) what care about registration on search engines and search engine optimalization here: http://submit.prolidi.net/en/ I found some of the information very helpful, so I send it to you. L. -- 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] Suggestion of webpage about search engines
Liar Liar, This is your site..I recognize the english/spelling mistakes. -Ryan - Original Message - From: l [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 30, 2003 2:24 PM Subject: [PHP] Suggestion of webpage about search engines I found one small site (designed in php of course:)) what care about registration on search engines and search engine optimalization here: http://submit.prolidi.net/en/ I found some of the information very helpful, so I send it to you. L. -- 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] Suggestion of webpage about search engines
I found one small site (designed in php of course:)) what care about registration on search engines and search engine optimalization here: http://submit.prolidi.net/en/ I found some of the information very helpful, so I send it to you. L. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Suggestion: Adding fmt like linebreak algorithm
Hi there, I've been searching for a PHP implementation of the GNU textformatting tool fmt (http://www.gnu.org/software/textutils/textutils.html) which provides an almost optimal linebreak for your text. I'm not skilled in enough in C programming to implement such a feature for PHP but I'd really appreciate having this algorithm available in a simple PHP function. My question is, if there's anyone who is interested in implementing this for PHP, so that we can see it in one of the next releases? I think, the function would be very useful to do some pretty reformatting of text when for example sending mail or in general doing text formatted output. Thanks for your replies in advance, Dominik -- 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]
Re: [PHP] Suggestion: Adding fmt like linebreak algorithm
You may use these two and not have to bother what version of PHP your script runs on. Note that you may have to edit wordwrap if you need to chop exceedingly long words (this code allows long lines in this case). Please let me know if you use/optimize this. HTH Bogdan -- // Function to determine if the current version of PHP is // at least the one specified as a string in the parameter. // This is needed because string comparison isn't always accurate: // 4.0.24.0.12 as strings, although that's not true when // speaking of comparing versions. // Usage example: // if (!isphpver(4.0.2)) // { // [do something] // } // Bogdan Stancescu [EMAIL PROTECTED], November 2001 function isphpver($minver) { $itis=2; // That is, undecided $minimum=explode(.,$minver); $current=explode(.,phpversion()); for ($i=0;(($isizeof($current)) ($isizeof($minimum)));$i++) { if ($current[$i]$minimum[$i]) { $itis=true; // In this case, we have a winner break; } if ($current[$i]$minimum[$i]) // { $itis=false; // In this case, we have a loser break; } } if ($itis==2) // This would only happen if all the common version // components are identical. But there are may be // differences: // Example 1: comparing 4.0.1 with 4.0 would be //identical for now, but the condition //is satisfied; // Example 2: comparing 4.0 with 4.0.1 - identical //for now, but the condition is NOT //satisfied { if (sizeof($current)=sizeof($minimum)) { $itis=true; } else { // Ok, only one more chance: if for example the user // specified 4.0.0 and phpversion returned 4.0. for ($i=sizeof($current)-1;$isizeof($minimum);$i++) // { if ($minimum[$i]) { $itis=false; } } if ($itis==2) { $itis=true; } } } return($itis); } // Bogdan Stancescu [EMAIL PROTECTED], November 2001 if (!isphpver(4.0.2)) { // Word-wrap $string at $width chars // Already available in PHP 4.0.2 and later function wordwrap($string,$width=75) { // So, this is how we're going to go about wrapping the incoming // text: // We first break the text into natural lines: $tm_str=explode(\n,$string); for ($i=0;$isizeOf($tm_str);$i++) { // Then we move each line into a temporary string we'll start // chopping until we finish it. $temp_str=$tm_str[$i]; $line_st=; while ($temp_str) { // Now let's see if the incoming string (or what's left of it) // isn't already shorter than the desired length. if (($line_len=strlen($temp_str))$width) { // If it isn't, we'll just chop a piece of the ideal width // for starters. $wrapped_st=substr($temp_str,0,$width); // We'll start looking for a space in order to break the // line there. // (searching backwards!) if ($wrapping_len=strrpos($wrapped_st, )) { // If there is one (it usually is) then we'll retrieve its // position and use it $line_len=$wrapping_len; } else { // Otherwise (i.e. a LOOONG word) then we'll just have to // look where it ends and use that. $line_len=strpos($temp_str, ); } } // Now that we have the proper line ending we'll chop the // temporary string and add the chopped // part to the final (wrapped) string, along with a line // break. // Obviously, we'll do that in // reversed order than described here. $line_st.=substr($temp_str,0,$line_len).\n; $temp_str=substr($temp_str,$line_len); // Making sure we don't leave spaces at the beginning of the // next line if (substr($temp_str,0,1)== ) { $temp_str=substr($temp_str,1); } } // while // We need this for incoming empty lines: if (!strlen($line_st)) { $final_st.=\n; } else { $final_st.=$line_st; } } // for return($final_st); } // function } // if phpver -- Dominik Roettsches wrote: Hi there, I've been searching for a PHP implementation of the GNU textformatting tool fmt (http://www.gnu.org/software/textutils/textutils.html) which provides an almost optimal linebreak for your text. I'm not skilled in enough in C programming to implement