Re: [PHP] A really wacky design decision

2009-10-04 Thread clancy_1
I am well aware of the === operator, but I had an uneasy feeling that there was still a trap. However when I tried it it worked, so I was going to thank you for your suggestion, though I find the concept of having separate 'sort of equal' and 'truly equal' operators decidedly distasteful, but

Re: [PHP] A really wacky design decision

2009-10-04 Thread clancy_1
On Sat, 03 Oct 2009 11:57:36 -0400, f...@thefsb.org (Tom Worster) wrote: On 10/3/09 7:21 AM, clanc...@cybec.com.au clanc...@cybec.com.au wrote: However there is one feature of PHP which, to my mind, is really bad design. How many of you can see anything wrong with the following procedure to

RE: [PHP] A really wacky design decision

2009-10-04 Thread Andrea Giammarchi
$a = 2260; $b = 226e1; $c = 2.26e3; $d = 2260.0; $a==$b==$c==$d, and $b===$c===$d $b , $c, and $d are the same indeed ... they represent the floating point 2260.0 in I think every language ... it's like saying that 1.0 is not 1. ... both floating point numbers,

RE: [PHP] A really wacky design decision

2009-10-04 Thread Andrea Giammarchi
All very messy! there is nothing messy, the logic is well defined and for a loose type language it's absolutely normal behavior. Regards _ Keep your friends updated—even when you’re

RE: [PHP] Self-Process php forms or not?

2009-10-04 Thread MEM
Thanks a lot. To all. For the moment, I'm with the redirect solution that others have pointed. But after seen tedd example and watch Manuel videos, I'm starting to understand how the hidden field solution work as well. Well... I'm *starting* to understand I've not fully understand it yet,

[PHP] class to generate Javascript Object ??

2009-10-04 Thread Michael A. Peters
I wrote a php class to generate flowplayer/html5 media code for my site: http://www.shastaherps.org/xml_MMmediaClass.phps The buildFlashvars() function in it is really ugly and will be a pain to update as I modify the class in the future. What it does is generate a JavaScript object string,

Re: [PHP] A really wacky design decision

2009-10-04 Thread Tom Worster
On 10/4/09 6:36 AM, clanc...@cybec.com.au clanc...@cybec.com.au wrote: i might think it ok for (2260 == '226E1') to be true since php would be doing type juggling in a logical left-to-right manner: we start with an integer 2260, next is the juggling comparison operator, then a string, so it

Re: [PHP] Self-Process php forms or not?

2009-10-04 Thread Tom Worster
On 10/4/09 9:25 AM, MEM tal...@gmail.com wrote: Thanks a lot. To all. For the moment, I'm with the redirect solution that others have pointed. But after seen tedd example and watch Manuel videos, I'm starting to understand how the hidden field solution work as well. Well... I'm *starting*

Re: [PHP] class to generate Javascript Object ??

2009-10-04 Thread Tom Worster
On 10/4/09 9:39 AM, Michael A. Peters mpet...@mac.com wrote: I wrote a php class to generate flowplayer/html5 media code for my site: http://www.shastaherps.org/xml_MMmediaClass.phps The buildFlashvars() function in it is really ugly and will be a pain to update as I modify the class in

RE: [PHP] class to generate Javascript Object ??

2009-10-04 Thread Andrea Giammarchi
I'm thinking (hoping) there is already a php class somewhere for generating JavaScript object strings that I can instead of my ugly easily breakable way of doing it. Anyone know of one? json_encode http://uk3.php.net/manual/en/function.json-encode.php Regards

RE: [PHP] Self-Process php forms or not?

2009-10-04 Thread MEM
i don't think so. if the user requests the page a_form.php then the server will normally execute the a_form.php script regardless whether the form was submitted or not. to display a blank form, the user probably requests a_form.php with the GET method and probably without any GET

RE: [PHP] Self-Process php forms or not?

2009-10-04 Thread tedd
At 3:39 PM +0100 10/4/09, MEM wrote: i don't think so. if the user requests the page a_form.php then the server will normally execute the a_form.php script regardless whether the form was submitted or not. to display a blank form, the user probably requests a_form.php with the GET

[PHP] a trivial little function (PostToHost)

2009-10-04 Thread tedd
Hi gang: The following 'trivial little' function I'm trying to get my head around: http://aspn.activestate.com/ASPN/Mail/Message/php-general/1259426 The article states: Either way, just generate your XML string and fire it at the remote machine. You will need to write code to handle the

Re: [PHP] Header problem

2009-10-04 Thread Kim Madsen
Andrea Giammarchi wrote on 2009-10-03 13:40: Do you want users download the file or the zip? They can choose between the two. do you send other headers before the download? Header must come first (before you output anything) or you get a parse error, so I'm not sure what you mean here? You

Re: [PHP] Header problem

2009-10-04 Thread Kim Madsen
Hi kranthi kranthi wrote on 2009-10-03 16:21: Thats a lot of headers to read.. At a first glance I can see that you did not specify a content-length header. this is a must and must be equal to the size of the file in bytes I've noticed that too, but it's impossiple to determine the length

Re: [PHP] Header problem

2009-10-04 Thread Ashley Sheridan
On Sun, 2009-10-04 at 18:10 +0200, Kim Madsen wrote: Hi kranthi kranthi wrote on 2009-10-03 16:21: Thats a lot of headers to read.. At a first glance I can see that you did not specify a content-length header. this is a must and must be equal to the size of the file in bytes

RE: [PHP] Header problem

2009-10-04 Thread Andrea Giammarchi
Header must come first (before you output anything) or you get a parse error I try to better explain ... HTTP works like this: you ask something, you receive something, html and texts are just one option. Your example page mess up html, zip, everything, because when you download a file

RE: [PHP] Header problem

2009-10-04 Thread Andrea Giammarchi
Afaik, the content length header is not necessary, but it will cause problems if it's set and it's wrong. correct, missed Content-Length means the classic download with useless progress bar and undefined estimation time, problematic for preloader as well in case of images, swf, generic

Re: [PHP] Header problem

2009-10-04 Thread Kim Madsen
Hello Andrea Andrea Giammarchi wrote on 2009-10-04 18:49: Header must come first (before you output anything) or you get a parse error I try to better explain ... HTTP works like this: you ask something, you receive something, html and texts are just one option. Got it so far Your

RE: [PHP] Header problem

2009-10-04 Thread Andrea Giammarchi
Unless I am missing something, your page has too many if and it always ends up with print something ... but there is no exit after the download, so the zip will have extra output included without a reason ... which is an error, imho, dunno how else explain if you can't see your print links at

Re: [PHP] Self-Process php forms or not?

2009-10-04 Thread Tom Worster
On 10/4/09 10:39 AM, MEM tal...@gmail.com wrote: i don't think so. if the user requests the page a_form.php then the server will normally execute the a_form.php script regardless whether the form was submitted or not. to display a blank form, the user probably requests a_form.php with the

Re: [PHP] class to generate Javascript Object ??

2009-10-04 Thread Michael A. Peters
Tom Worster wrote: On 10/4/09 9:39 AM, Michael A. Peters mpet...@mac.com wrote: I wrote a php class to generate flowplayer/html5 media code for my site: http://www.shastaherps.org/xml_MMmediaClass.phps The buildFlashvars() function in it is really ugly and will be a pain to update as I

Re: [PHP] Self-Process php forms or not?

2009-10-04 Thread Tom Worster
On 10/4/09 10:55 AM, tedd tedd.sperl...@gmail.com wrote: At 3:39 PM +0100 10/4/09, MEM wrote: i don't think so. if the user requests the page a_form.php then the server will normally execute the a_form.php script regardless whether the form was submitted or not. to display a blank

Re: [PHP] [SOLVED] class to generate Javascript Object ??

2009-10-04 Thread Michael A. Peters
Andrea Giammarchi wrote: I'm thinking (hoping) there is already a php class somewhere for generating JavaScript object strings that I can instead of my ugly easily breakable way of doing it. Anyone know of one? json_encode http://uk3.php.net/manual/en/function.json-encode.php

[PHP] strtotime strangeness

2009-10-04 Thread Floyd Resler
For some reason the strtotime is no longer returning the year portion. For example, strtotime(10/04/2009) will result in a date of -10-04. This started happening recently and I haven't done any updates other than the normal OS updates. I am running Mac OS X 10.5.8. Does anyone have

RE: [PHP] [SOLVED] class to generate Javascript Object ??

2009-10-04 Thread Andrea Giammarchi
Thank you, worked beautifully. just don't ignore this: PHP 5 = 5.2.0 if you are trying to create something portable, you should consider a Pear fallback ... if(!function_exists('json_encode')){ require_once 'JSON.phps'; // http://mike.teczno.com/JSON/JSON.phps function

RE: [PHP] strtotime strangeness

2009-10-04 Thread Andrea Giammarchi
Did the OS update changed the default locale settings or the default date format? From: fres...@adex-intl.com To: php-general@lists.php.net Date: Sun, 4 Oct 2009 14:05:05 -0400 Subject: [PHP] strtotime strangeness For some reason the strtotime is no longer returning the year portion.

Re: [PHP] Header problem

2009-10-04 Thread Tommy Pham
Original Message From: Kim Madsen php@emax.dk To: php-general@lists.php.net Sent: Sun, October 4, 2009 9:10:36 AM Subject: Re: [PHP] Header problem Hi kranthi kranthi wrote on 2009-10-03 16:21: Thats a lot of headers to read.. At a first glance I can see that you did

RE: [PHP] Self-Process php forms or not?

2009-10-04 Thread MEM
i agree that it does seem a bit as though Márcio is in such a hurry to make something work that the tasks of learning and understanding the fundamentals are being left aside. while that's maybe understandable, it's a bit frustrating when we're trying to explain the fundamentals. Thanks a

Re: [PHP] a trivial little function (PostToHost)

2009-10-04 Thread Kirk . Johnson
tedd tedd.sperl...@gmail.com wrote on 10/04/2009 08:51:13 AM: [PHP] a trivial little function (PostToHost) tedd to: php-general 10/04/2009 09:05 AM Hi gang: The following 'trivial little' function I'm trying to get my head around:

Re: [PHP] strtotime strangeness

2009-10-04 Thread Floyd Resler
I couldn't find anything in the php.ini file to account for this. I am running PHP 5.2.10. I've never actually updated it myself so the software updater updated it at some point. I did a little test and found out that date(:Y,$timestamp) returns . However, date(y, $timestamp)

Re: [PHP] [SOLVED] class to generate Javascript Object ??

2009-10-04 Thread Michael A. Peters
Andrea Giammarchi wrote: Thank you, worked beautifully. just don't ignore this: PHP 5 = 5.2.0 if you are trying to create something portable, you should consider a Pear fallback ... I make heavy use of DOMDocument so I need 5.2.x anyway. But thanks for the warning. -- PHP General

Re: [PHP] strtotime strangeness

2009-10-04 Thread Tommy Pham
- Original Message From: Floyd Resler fres...@adex-intl.com To: Andrea Giammarchi an_...@hotmail.com Cc: php-general@lists.php.net Sent: Sun, October 4, 2009 12:01:30 PM Subject: Re: [PHP] strtotime strangeness I couldn't find anything in the php.ini file to account for this. I

Re: [PHP] problem with mod_php

2009-10-04 Thread Tommy Pham
Original Message From: JC jcflo...@cablenet.com.pe To: php-general@lists.php.net Sent: Sat, October 3, 2009 12:22:21 PM Subject: [PHP] problem with mod_php I'm trying to install a webmail in a new server with the following items: Debian 2.6.26-2-amd64 horde 3.2.2 imp 4.2.4

Re: [PHP] strtotime strangeness

2009-10-04 Thread Floyd Resler
Yeah, the ;Y was a typo in my email. That's what happens while trying to type while watching my Colts play! Thanks! Floyd On Oct 4, 2009, at 3:06 PM, Tommy Pham wrote: - Original Message From: Floyd Resler fres...@adex-intl.com To: Andrea Giammarchi an_...@hotmail.com Cc:

Re: [PHP] strtotime strangeness

2009-10-04 Thread Eddie Drapkin
On Sun, Oct 4, 2009 at 3:22 PM, Floyd Resler fres...@adex-intl.com wrote: Yeah, the ;Y was a typo in my email.  That's what happens while trying to type while watching my Colts play! Thanks! Floyd Go Colts! At least you get to watch it, I have to follow along on sports sites! -- PHP

Re: [PHP] strtotime strangeness

2009-10-04 Thread Floyd Resler
Sorry to hear that! I live in Cincinnati so I normally don't get to watch the Colts play when they are on at the same time as the Bengals. But this week I did and, best of all, they won! On Oct 4, 2009, at 3:24 PM, Eddie Drapkin wrote: On Sun, Oct 4, 2009 at 3:22 PM, Floyd Resler