php-general Digest 1 Sep 2008 13:56:08 -0000 Issue 5657

2008-09-01 Thread php-general-digest-help
php-general Digest 1 Sep 2008 13:56:08 - Issue 5657 Topics (messages 279185 through 279216): [HS] Howto answer Was: [PHP] casting static property 279185 by: Lupus Michaelis Re: ASCII Captcha 279186 by: Ross McKay 279204 by: Nisse Engström 279206 by: Nisse

[PHP] Re: [PHP-DEV] T_PAAMAYIM_NEKUDOTAYIM

2008-09-01 Thread Maciek Sokolewicz
Jochem Maas wrote: redirecting to generals mailing list ... Diogo Neves schreef: php -r 'class B { private static function a() {} public function __callStatic($method, $parms) { echo $method, \n; } } $a = new B; $a::a();' Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in

[PHP] Re: skinning a cat (was: Individual bulk e-mails - performance question)

2008-09-01 Thread Per Jessen
Robert Cummings wrote: #!/bin/sh while true do yourscript sleep 300 done I accomplish the same with cron scripts by using locks with expiry. got an example? my cat skinning skills need to be improved, the cat won't like it but screw the cat, right? [snip code] I

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Jochem Maas
Per Jessen schreef: Robert Cummings wrote: #!/bin/sh while true do yourscript sleep 300 done I accomplish the same with cron scripts by using locks with expiry. got an example? my cat skinning skills need to be improved, the cat won't like it but screw the cat, right? [snip code] I

[PHP] Re: skinning a cat

2008-09-01 Thread Colin Guthrie
Jochem Maas wrote: either way, I've just learn't something new as far as shellscripting goes :-) apart from the xargs command ... that still does my head in (don't worry I'll look it up ... for the umpteenth time). find $lockfile -cmin +60 | xargs rm FWIW, it's nicer to do: $ find $lockfine

[PHP] newbie - how to receive/iterate posted arrays

2008-09-01 Thread Govinda
Hello early birds, I am going round and round the docs and list posts I saved on this topic... but I am still stumped. Kindly show me what I am missing. I want to simply send an array of vars via a post form to my receiving script. I've got simple inputs like this: input

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Per Jessen
Colin Guthrie wrote: Jochem Maas wrote: either way, I've just learn't something new as far as shellscripting goes :-) apart from the xargs command ... that still does my head in (don't worry I'll look it up ... for the umpteenth time). find $lockfile -cmin +60 | xargs rm FWIW, it's

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Per Jessen
Jochem Maas wrote: lockfile=/var/lock//file # clear out a lock older than 60mins find $lockfile -cmin +60 | xargs rm test ! -f $lockfile ( touch $lockfile run some php rm -f $lockfile ) wouldn't creating a dir be better here? (with regard to atomicity) I haven't thought it

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Jochem Maas
Colin Guthrie schreef: Jochem Maas wrote: either way, I've just learn't something new as far as shellscripting goes :-) apart from the xargs command ... that still does my head in (don't worry I'll look it up ... for the umpteenth time). find $lockfile -cmin +60 | xargs rm FWIW, it's nicer

Re: [PHP] newbie - how to receive/iterate posted arrays

2008-09-01 Thread Diogo Neves
Hi, On Mon, Sep 1, 2008 at 9:25 AM, Govinda [EMAIL PROTECTED] wrote: Hello early birds, I am going round and round the docs and list posts I saved on this topic... but I am still stumped. Kindly show me what I am missing. I want to simply send an array of vars via a post form to my

[PHP] uploading file outside WEB Root

2008-09-01 Thread Angelo Zanetti
Hi All, For security purposes I would like to upload a file outside the webroot. I have got this to work on my local dev machine but it doesn't seem to work on the live server. I have tried both the relative path and also the full path (from the $_SERVER[DOCUMENT_ROOT] variable). Now I can't

Re: [PHP] ASCII Captcha

2008-09-01 Thread Nisse Engström
On Fri, 29 Aug 2008 16:11:01 -0400, tedd wrote: http://webbytedd.com/aa/assorted-captcha/ Some of these are really cool. Assuming they are actually working, that is... Graphic CAPTCHA: Error! Reload the page! Audio CAPTCHA: -- There is nothing to

Re: [PHP] ASCII Captcha

2008-09-01 Thread Nisse Engström
On Mon, 1 Sep 2008 11:14:39 +0200, Nisse Engström wrote: On Fri, 29 Aug 2008 16:11:01 -0400, tedd wrote: http://webbytedd.com/aa/assorted-captcha/ Performance CAPTCHA: This one actually works. Well, sort of... And maybe your code should check for a circle rather

[PHP] Re: newbie - how to receive/iterate posted arrays

2008-09-01 Thread David Robley
Govinda wrote: Hello early birds, I am going round and round the docs and list posts I saved on this topic... but I am still stumped. Kindly show me what I am missing. I want to simply send an array of vars via a post form to my receiving script. I've got simple inputs like this:

[PHP] Re: newbie - how to receive/iterate posted arrays

2008-09-01 Thread Carlos Medina
Govinda schrieb: Hello early birds, I am going round and round the docs and list posts I saved on this topic... but I am still stumped. Kindly show me what I am missing. I want to simply send an array of vars via a post form to my receiving script. I've got simple inputs like this: input

[PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Kent Larsson
Hi, Is it possible to have shared memory in the form of shared global variables in PHP? Or any other form of shared memory? And if that is the case, is there any form of mutex functionality which may be used to assure syncronized access to this memory? My next question is related to the first

[PHP] Re: uploading file outside WEB Root

2008-09-01 Thread Carlos Medina
Angelo Zanetti schrieb: Hi All, For security purposes I would like to upload a file outside the webroot. I have got this to work on my local dev machine but it doesn't seem to work on the live server. I have tried both the relative path and also the full path (from the

Re: [PHP] Re: What's with the Rx symbol?

2008-09-01 Thread Robin Vickery
2008/8/30 Per Jessen [EMAIL PROTECTED]: tedd wrote: What some browser developers did was to NOT make the conversion from PUNYCODE to the correct code-points but rather show the PUNYCODE as-is, which was never the intent of the IDNS WG. This act defeated the entire process of allowing

[PHP] Job opening in Leiden, Netherlands: PHP/MySQL developer

2008-09-01 Thread Ivo F.A.C. Fokkema
Dear all, We have an immediate job opening available to work in our team of bio-informaticians on extending the LOVD software (www.LOVD.nl). Even if you're still a beginner with PHP you're welcome to respond. Affinity to biology is a big plus. LOVD (Leiden Open Variation Database) is webbased

Re: [PHP] Individual bulk e-mails - performance question (was skinning a cat) :-)

2008-09-01 Thread Merlin Morgenstern
Per Jessen schrieb: Jochem Maas wrote: lockfile=/var/lock//file # clear out a lock older than 60mins find $lockfile -cmin +60 | xargs rm test ! -f $lockfile ( touch $lockfile run some php rm -f $lockfile ) wouldn't creating a dir be better here? (with regard to atomicity) I haven't

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Jochem Maas
Per Jessen schreef: Jochem Maas wrote: lockfile=/var/lock//file # clear out a lock older than 60mins find $lockfile -cmin +60 | xargs rm test ! -f $lockfile ( touch $lockfile run some php rm -f $lockfile ) wouldn't creating a dir be better here? (with regard to atomicity) I haven't

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Per Jessen
Jochem Maas wrote: Per Jessen schreef: Jochem Maas wrote: lockfile=/var/lock//file # clear out a lock older than 60mins find $lockfile -cmin +60 | xargs rm test ! -f $lockfile ( touch $lockfile run some php rm -f $lockfile ) wouldn't creating a dir be better here? (with regard

[PHP] Re: how to write good code

2008-09-01 Thread Shiplu
Thanks Eric, Diogo, Ross and specially Christopher for this long article. I have started reading those articles. And I hope to collect those books too. -- Blog: http://talk.cmyweb.net/ Follow me: http://twitter.com/shiplu

Re: [PHP] newbie - how to receive/iterate posted arrays

2008-09-01 Thread Govinda
Thanks Diogo! , and other who replied! You nailed it (Of course! you would say.) I didn't reply sooner as we had a power out (just enough to get me to go to bed already ;-) -G On Sep 1, 2008, at 2:31 AM, Diogo Neves wrote: foreach($_POST['$tmbsToiterate'] as $value) {

Re: [PHP] how to write good code

2008-09-01 Thread Shelley
Hi Shiplu, For all that you mentioned, and if you want to get a quite good suggestion, I will highly recommend that you read through McConnell's Code Complete (2nd Edition). Specifically: Chapter 31: Layout and Style Chapter 32: Self-Documenting Code (Commenting Techniques) It won't disappoint

[PHP] Google Maps Distance Between UK Postcodes

2008-09-01 Thread Tom Chubb
Has anyone tried to work this out? All I'm trying to get is the rough distance in miles between two UK postcodes using Google Maps API for a basic auto quote script based on mileage travelled. I thought it would be easy but it seems that I need to convert each postcode to Lat/Long using Geocoding

[PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-01 Thread Colin Guthrie
Tom Chubb wrote: I thought it would be easy but it seems that I need to convert each postcode to Lat/Long using Geocoding and then work it out from there. That's the best way: then just do something like: Here's how I do it in SQL, but the principle is the same in PHP, so I'm sure you'll be

Re: [PHP] Google Maps Distance Between UK Postcodes

2008-09-01 Thread Richard Heyes
Has anyone tried to work this out? All I'm trying to get is the rough distance in miles between two UK postcodes using Google Maps API for a basic auto quote script based on mileage travelled. I thought it would be easy but it seems that I need to convert each postcode to Lat/Long using

Re: [PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-01 Thread Tom Chubb
On 01/09/2008, Colin Guthrie [EMAIL PROTECTED] wrote: Tom Chubb wrote: I thought it would be easy but it seems that I need to convert each postcode to Lat/Long using Geocoding and then work it out from there. That's the best way: then just do something like: Here's how I do it in SQL,

Re: [PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-01 Thread Michal Sokolowski
2008/9/1 Tom Chubb [EMAIL PROTECTED] On 01/09/2008, Colin Guthrie [EMAIL PROTECTED] wrote: Tom Chubb wrote: I thought it would be easy but it seems that I need to convert each postcode to Lat/Long using Geocoding and then work it out from there. That's the best way: then just

Re: [PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-01 Thread mike
This is what I have: $distance = number_format(ceil(69*rad2deg(acos(sin(deg2rad($ulat)) * sin(deg2rad($vlat)) + cos(deg2rad($ulat)) * cos(deg2rad($vlat)) * cos(deg2rad($ulong - $vlong)); where: $ulat = latitude of user #1 $ulong = longitude of user #1 $vlat = latitude of user #2 $vlong =

[PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-01 Thread Colin Guthrie
Tom Chubb wrote: That's all way above my head, but I think I'll be able to understand it after a strong coffee! I should point out that this is really just trig and is only an approximate distance as the crow flies. Not even sure if it takes the curvature of the earth into consideration, but

Re: [PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-01 Thread Tom Chubb
On 01/09/2008, Michal Sokolowski [EMAIL PROTECTED] wrote: 2008/9/1 Tom Chubb [EMAIL PROTECTED] On 01/09/2008, Colin Guthrie [EMAIL PROTECTED] wrote: Tom Chubb wrote: I thought it would be easy but it seems that I need to convert each postcode to Lat/Long using Geocoding and then

Re: [PHP] Re: skinning a cat (was: Individual bulk e-mails - performance question)

2008-09-01 Thread Robert Cummings
On Mon, 2008-09-01 at 09:44 +0200, Per Jessen wrote: Robert Cummings wrote: #!/bin/sh while true do yourscript sleep 300 done I accomplish the same with cron scripts by using locks with expiry. got an example? my cat skinning skills need to be improved, the

Re: [PHP] Individual bulk e-mails - performance question (was skinning a cat) :-)

2008-09-01 Thread Robert Cummings
On Mon, 2008-09-01 at 14:34 +0200, Merlin Morgenstern wrote: Per Jessen schrieb: Jochem Maas wrote: lockfile=/var/lock//file # clear out a lock older than 60mins find $lockfile -cmin +60 | xargs rm test ! -f $lockfile ( touch $lockfile run some php rm -f $lockfile )

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Robert Cummings
On Mon, 2008-09-01 at 14:51 +0200, Per Jessen wrote: Jochem Maas wrote: Per Jessen schreef: Jochem Maas wrote: lockfile=/var/lock//file # clear out a lock older than 60mins find $lockfile -cmin +60 | xargs rm test ! -f $lockfile ( touch $lockfile run some php rm -f

Re: [PHP] Re: how to write good code

2008-09-01 Thread Yeti
Ross McKay [EMAIL PROTECTED] wrote: Find out what bad is by reading this: http://thedailywtf.com/Series/CodeSOD.aspx Then, don't do it like that! What I enjoyed most on that page was this comment: One day, after a code review by one of our 'senior' developers this little beauty showed

Re: [PHP] Re: skinning a cat (was: Individual bulk e-mails - performance question)

2008-09-01 Thread Per Jessen
Robert Cummings wrote: I'm probably old fashioned, but to me all that stuff is way overkill. I also tend to think that synchronizing scripts is a job for the shell, not PHP. lockfile=/var/lock//file # clear out a lock older than 60mins find $lockfile -cmin +60 | xargs rm test ! -f

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Per Jessen
Robert Cummings wrote: The return value of creating the directory is either true for it having been made or false for it having not been made. Therein lies the atomicity. The OS will not return success if it was not made and will not return failure if it was made. Ah, interesting. Thanks.

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Per Jessen
Kent Larsson wrote: Hi, Is it possible to have shared memory in the form of shared global variables in PHP? Or any other form of shared memory? And if that is the case, is there any form of mutex functionality which may be used to assure syncronized access to this memory? My next

Re: [PHP] Re: skinning a cat (was: Individual bulk e-mails - performance question)

2008-09-01 Thread Robert Cummings
On Mon, 2008-09-01 at 20:22 +0200, Per Jessen wrote: Robert Cummings wrote: I'm probably old fashioned, but to me all that stuff is way overkill. I also tend to think that synchronizing scripts is a job for the shell, not PHP. lockfile=/var/lock//file # clear out a lock older

Re: [PHP] Re: What's with the Rx symbol?

2008-09-01 Thread Per Jessen
Robin Vickery wrote: Firefox holds a whitelist of toplevel domains that are allowed to display unicode (to see the list go to about:config and enter IDN.whitelist into the filter box). It does not allow .com domains to contain unicode for obvious phishing reasons, Very interesting, I had

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Kent Larsson
Hi, Thank you for your answer. I was hoping there were a solution. :-/ It would have been nice as PHP has a large install base and is a quite common element in cheap web hosting solutions. Has anyone else got any more comments or suggestions? In absence of shared memory and threads. What I

[PHP] Re: Job opening in Leiden, Netherlands: PHP/MySQL developer

2008-09-01 Thread Manuel Lemos
Hello, on 09/01/2008 09:15 AM Ivo F.A.C. Fokkema said the following: Dear all, We have an immediate job opening available to work in our team of bio-informaticians on extending the LOVD software (www.LOVD.nl). Even if you're still a beginner with PHP you're welcome to respond. Affinity to

[PHP] Re: how to write good code

2008-09-01 Thread Ross McKay
On Mon, 1 Sep 2008 08:50:45 -0700 (PDT), larry wrote: Write a lot of code, rewrite code you think is messy (we can always do better). The more you do the better you should get. Here is some inspiration on that: http://www.codinghorror.com/blog/archives/001160.html NB: the message of that blog

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Eric Butera
On Mon, Sep 1, 2008 at 5:45 PM, Kent Larsson [EMAIL PROTECTED] wrote: Hi, Thank you for your answer. I was hoping there were a solution. :-/ It would have been nice as PHP has a large install base and is a quite common element in cheap web hosting solutions. Has anyone else got any more

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Lupus Michaelis
Robert Cummings a écrit : Try running that on windows. No problem http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Al
Kent Larsson wrote: Hi, Is it possible to have shared memory in the form of shared global variables in PHP? Or any other form of shared memory? And if that is the case, is there any form of mutex functionality which may be used to assure syncronized access to this memory? My next question is

[PHP] newbie - PHP escaping trigger happy

2008-09-01 Thread Govinda
Just a quick Q, which I know has to be in the docs somewhere, but I haven't come across it yet- PHP automatically escaping single and double quotes... how to turn it off? I.e.- in a form text input, someone inputs love's influence grows and on the posted page I get: love\'s \influence\

Re: [PHP] newbie - PHP escaping trigger happy

2008-09-01 Thread Eric Butera
On Mon, Sep 1, 2008 at 10:21 PM, Govinda [EMAIL PROTECTED] wrote: Just a quick Q, which I know has to be in the docs somewhere, but I haven't come across it yet- PHP automatically escaping single and double quotes... how to turn it off? I.e.- in a form text input, someone inputs love's

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Micah Gersten
http://us2.php.net/apc Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Kent Larsson wrote: Hi, Is it possible to have shared memory in the form of shared global variables in PHP? Or any other form of shared memory? And if that is the case, is there any

[PHP] Mozilla user agent escapes detection

2008-09-01 Thread Dave M G
PHP List, I have a script, part of which is taken from a script I found on the 'net, which tries to detect the user agent of the browser accessing the site. One of the reasons I'm doing this is to find out if the browser is a desktop or mobile. Part of the code looks like this: $ua =

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Per Jessen
Kent Larsson wrote: In absence of shared memory and threads. What I really must have is some kind of mutex functionality. I will be manipulating files on disk and I don't want two instances to be able to touch the disk at the same time. Touch the disk or touch the file? I assume you meant

Re: [PHP] Re: skinning a cat

2008-09-01 Thread Per Jessen
Lupus Michaelis wrote: Robert Cummings a écrit : Try running that on windows. No problem http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx And of course, there's also Cygwin. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe,