From michael.southwell at nyphp.com Tue May 1 11:33:48 2007 From: michael.southwell at nyphp.com (Michael Southwell) Date: Tue, 01 May 2007 11:33:48 -0400 Subject: [nycphp-talk] form spoofing Message-ID: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> I thought I was following best practices ( http://www.nyphp.org/phundamentals/spoofed_submission.php ) in creating a comment form for a restaurant client (There is no security issue here; the comments are emailed): I stored a random token in the session: session_start(); if ( ! isset( $_SESSION['secret'] ) ) $_SESSION['secret'] = uniqid( rand(), TRUE ); I hid that token in the form:
Upon submission, I checked for the token: if ( $_POST['secret'] !== $_SESSION['secret'] ) die( 'invalid form submission' ); But I still got obvious spoofed submissions, not very many of them, and all vapid and often nonsensical (a sample: "I consider that beside Your site there is future!"), but still maddening. So I added a five-minute timeout: if ( ! isset( $_SESSION['timeout'] ) ) { $timeout = time() + 5 * 60; $_SESSION['timeout'] = $timeout; } and checked for that as well: $now = time(); if ( $_POST['secret'] !== $_SESSION['secret'] || $now > $_SESSION['timeout'] ) die( 'invalid form submission' ); But this hasn't helped much; I still get a few of them, though I can't figure out how they can be generated. Any advice? Michael Southwell, Vice President for Education New York PHP http://www.nyphp.com/training - In-depth PHP Training Courses From rolan at omnistep.com Tue May 1 11:42:07 2007 From: rolan at omnistep.com (Rolan Yang) Date: Tue, 01 May 2007 11:42:07 -0400 Subject: [nycphp-talk] form spoofing In-Reply-To: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> References: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> Message-ID: <46375FCF.2060403@omnistep.com> Michael Southwell wrote: > I thought I was following best practices ( > http://www.nyphp.org/phundamentals/spoofed_submission.php ) in > creating a comment form for a restaurant client (There is no security > issue here; the comments are emailed): > snip > But this hasn't helped much; I still get a few of them, though I can't > figure out how they can be generated. Any advice? They are probably spam robots crawling the web, not spoofers. I manage a fairly large restaurant reservation site and we receive a lot of feedback spam from the web forms daily. I put a regex expression check for "http://" more than once in the content. If it exists, then I tag the subject of the email with "SPAM". My client still receives the feedback email, but at least they can sort most of the spam from the nonspam in their mail client. ~Rolan From rmarscher at beaffinitive.com Tue May 1 11:57:54 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 1 May 2007 11:57:54 -0400 Subject: [nycphp-talk] form spoofing In-Reply-To: <46375FCF.2060403@omnistep.com> References: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> <46375FCF.2060403@omnistep.com> Message-ID: <09090300-FDB6-41B6-8523-1F779501E34A@beaffinitive.com> > But this hasn't helped much; I still get a few of them, though I > can't figure out how they can be generated. Any advice? Yeah... you could add a spam/bayesian filter to your form processing or use a web service like Akismet to see if it may be spam. Another option would be to log the user-agent and ip address that was used so you can track down what the spider was using. You may get lucky and find that it's coming from a specific user-agent/ip and be able to easily throw away the form submissions from it (you don't want to block it outright because it might detect that it's being blocked and change its user-agent or something). Of course, if I was a spammer, I'd use a normal user-agent and spoof a different ip each time... in which case a spam filter is your only defense (I think). -Rob From lists at enobrev.com Tue May 1 12:19:34 2007 From: lists at enobrev.com (Mark Armendariz) Date: Tue, 1 May 2007 12:19:34 -0400 Subject: [nycphp-talk] form spoofing In-Reply-To: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> References: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> Message-ID: <033201c78c0c$83ff6ec0$6400a8c0@enobrev> A simple but effective method I used on a couple of my clients' sites was the hidden text field with an obvious name. The field name is usually "email" (actual email field is something like 'user_email') - and hidden via css, not an actual type="hidden". As long as it's submitted and empty, I can be somewhat sure the submission came from my form and probably wasn't filled by a bot. // the form

// the processor if (array_key_exists('email', $_POST) && strlen($_POST['email']) == 0) { // ok } else { // spoofed } Not necessarily hard to beat, but it killed all of the automated form posts my clients were receiving. Mark > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michael Southwell > Sent: Tuesday, May 01, 2007 11:34 AM > To: talk at lists.nyphp.org > Subject: [nycphp-talk] form spoofing > > I thought I was following best practices ( > http://www.nyphp.org/phundamentals/spoofed_submission.php ) > in creating a comment form for a restaurant client (There is > no security issue here; the comments are emailed): > > I stored a random token in the session: > > session_start(); > if ( ! isset( $_SESSION['secret'] ) ) $_SESSION['secret'] = > uniqid( rand(), TRUE ); > > I hid that token in the form: > >
value="" /> > > Upon submission, I checked for the token: > > if ( $_POST['secret'] !== $_SESSION['secret'] ) die( 'invalid > form submission' ); > > But I still got obvious spoofed submissions, not very many of > them, and all vapid and often nonsensical (a sample: "I > consider that beside Your site there is future!"), but still > maddening. So I added a five-minute timeout: > > if ( ! isset( $_SESSION['timeout'] ) ) { > $timeout = time() + 5 * 60; > $_SESSION['timeout'] = $timeout; > } > > and checked for that as well: > > $now = time(); > if ( $_POST['secret'] !== $_SESSION['secret'] || $now > > $_SESSION['timeout'] ) die( 'invalid form submission' ); > > But this hasn't helped much; I still get a few of them, > though I can't figure out how they can be generated. Any advice? > > > Michael Southwell, Vice President for Education > New York PHP > http://www.nyphp.com/training - In-depth PHP Training Courses > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From 1j0lkq002 at sneakemail.com Tue May 1 12:47:37 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 01 May 2007 09:47:37 -0700 Subject: [nycphp-talk] form spoofing In-Reply-To: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> References: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> Message-ID: <17459-04598@sneakemail.com> Hi Michael. Can you think of any good reason to accept a submission via a known open proxy? You can grab a maintained open proxy list and use it for a while Rolan-style... to tag potential spam as an experiment. Every market is different, but in the tech world I see no valid reason to accept connections from known open proxies (they are always spam). As a competitive SEO, I know of no easier way to automate web connections than via open proxies. Bot nets are still a problem and all the big boys use them so maybe get used to a little spam here and there as well. -=john Michael Southwell michael.southwell-at-nyphp.com |nyphp dev/internal group use| wrote: > I thought I was following best practices ( > http://www.nyphp.org/phundamentals/spoofed_submission.php ) in > creating a comment form for a restaurant client (There is no security > issue here; the comments are emailed): > > I stored a random token in the session: > > session_start(); > if ( ! isset( $_SESSION['secret'] ) ) $_SESSION['secret'] = uniqid( > rand(), TRUE ); > > I hid that token in the form: > > > > > Upon submission, I checked for the token: > > if ( $_POST['secret'] !== $_SESSION['secret'] ) die( 'invalid form > submission' ); > > But I still got obvious spoofed submissions, not very many of them, > and all vapid and often nonsensical (a sample: "I consider that beside > Your site there is future!"), but still maddening. So I added a > five-minute timeout: > > if ( ! isset( $_SESSION['timeout'] ) ) { > $timeout = time() + 5 * 60; > $_SESSION['timeout'] = $timeout; > } > > and checked for that as well: > > $now = time(); > if ( $_POST['secret'] !== $_SESSION['secret'] || $now > > $_SESSION['timeout'] ) die( 'invalid form submission' ); > > But this hasn't helped much; I still get a few of them, though I can't > figure out how they can be generated. Any advice? > > > Michael Southwell, Vice President for Education > New York PHP > http://www.nyphp.com/training - In-depth PHP Training Courses > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- ------------------------------------------------------------- Your web server traffic log file is the most important source of web business information available. Do you know where your logs are right now? Do you know who else has access to your log files? When they were last archived? Where those archives are? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From apg88zx at gmail.com Tue May 1 13:33:35 2007 From: apg88zx at gmail.com (Alvaro P.) Date: Tue, 01 May 2007 13:33:35 -0400 Subject: [nycphp-talk] form spoofing In-Reply-To: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> References: <6.2.3.4.2.20070501113111.028cb6c0@mail.optonline.net> Message-ID: <463779EF.50508@gmail.com> I had the same problem, I used a random session variable, but they still got through. I devised a way of avoiding several types of spam bots with some scripts I made. First of all, the form has no action="" when it is loaded, and therefore the simplest spam bots won't know where to send the information to. When the form is submitted, javascript validates it, if it is valid, it generates a random variable with a random number in it, they are related by a simple mathematical formula I made up. This variable is sent to a php script using the xmlhttpPost() function. The php script then checks to see if this variable matches it's criteria. Once it is checked, it generates the actual form processing script from a pre-made template and saves it with a random name. The name of the new form processor is then sent back to the actual form which then sets the action="" and finally submits the form. The neat thing about it is that I can set an 'expiration' date on the randomly named form processors, that way, if the spammer figures out the name of the file, he can only use it for 30 seconds after it is created. Old files are deleted when new ones are created. This is all pretty invisible to the end user, who now doesn't have to fill out annoying CAPTCHA fields, the only downside is that it requires javascript. The form processor can be any php script, it is read by the main script, and then re-saved with the random name and timeout added at the top. I have all the files if you want to try it out. Alvaro Michael Southwell wrote: > I thought I was following best practices ( > http://www.nyphp.org/phundamentals/spoofed_submission.php ) in > creating a comment form for a restaurant client (There is no security > issue here; the comments are emailed): > > I stored a random token in the session: > > session_start(); > if ( ! isset( $_SESSION['secret'] ) ) $_SESSION['secret'] = uniqid( > rand(), TRUE ); > > I hid that token in the form: > > > > > Upon submission, I checked for the token: > > if ( $_POST['secret'] !== $_SESSION['secret'] ) die( 'invalid form > submission' ); > > But I still got obvious spoofed submissions, not very many of them, > and all vapid and often nonsensical (a sample: "I consider that beside > Your site there is future!"), but still maddening. So I added a > five-minute timeout: > > if ( ! isset( $_SESSION['timeout'] ) ) { > $timeout = time() + 5 * 60; > $_SESSION['timeout'] = $timeout; > } > > and checked for that as well: > > $now = time(); > if ( $_POST['secret'] !== $_SESSION['secret'] || $now > > $_SESSION['timeout'] ) die( 'invalid form submission' ); > > But this hasn't helped much; I still get a few of them, though I can't > figure out how they can be generated. Any advice? > > > Michael Southwell, Vice President for Education > New York PHP > http://www.nyphp.com/training - In-depth PHP Training Courses > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From codebowl at gmail.com Wed May 2 13:52:46 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Wed, 2 May 2007 13:52:46 -0400 Subject: [nycphp-talk] Overriding Array's Message-ID: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com> Guys I have 2 arrays the structures will be similar, for instance here is a chopped down version Array ( [http_metas] => Array ( [content-type] => text/html; charset=utf-8 [content-language] => en-us ) [metas] => Array ( [PreventParsing] => true [robots] => noindex, nofollow [description] => Recruiting and HR news, information and community -- including articles, discussions, blogs, jobs, conferences, research, email publications and more. [copyright] => 2007 [keywords] => recruiting, staffing, HR, business ) [page] => Array ( [template] => mainTemplate [title] => ERE.net - Recruiting news, information and community [ssl] => ) ) The second array we have is the following Array ( [page] => Array ( [title] => Test Page ) ) We are looking to have the second array override the first array values. I am not sure if i am having a brain fart here or what. I have looked into array_walk, custom recursive function and array_merge_recursive. I cannot seem to get any of these methods to work. Here is the function that I have created public function override($default, $page) { foreach($page as $key => $val) { if(is_array($val)) return $this->override($default[$key], $page[$key]); else { if(isset($page[$key]) && $page[$key] !== "") $default[$key] = $val; } } return $default; } Any assistance would be appreciated. -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com From codebowl at gmail.com Wed May 2 14:49:45 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Wed, 2 May 2007 14:49:45 -0400 Subject: [nycphp-talk] Overriding Array's In-Reply-To: References: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com> Message-ID: <8d9a42800705021149y4bfde1feq39359ab430ddc403@mail.gmail.com> This will not work, hence if we have the following Array ( links => Array ( stylesheets => Array ( [0] => style.css, [1] => layout.css ) ) ) Array ( links => Array ( stylesheets => Array ( [0] => general.css ) ) ) we would want the end result to add the values to the array since it is numeric keys and not replace. -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com From codebowl at gmail.com Wed May 2 15:04:29 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Wed, 2 May 2007 15:04:29 -0400 Subject: [nycphp-talk] Overriding Array's In-Reply-To: References: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com> <8d9a42800705021146g327c197aofe1984d332b4e1f@mail.gmail.com> Message-ID: <8d9a42800705021204i76c40ad2h9348be153c4497b@mail.gmail.com> ok let me try to clarify myself. I somehow need to loop over all elements and see if any of them contain numeric indexes like the stylesheets does. If it does we need to add the new element from the secondary array to the first. If it get's to the bottom element (without finding a numeric key first) it will replace the value such as in $data['page']['title'] Is that clear? From jonbaer at jonbaer.com Wed May 2 17:39:04 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 2 May 2007 17:39:04 -0400 Subject: [nycphp-talk] Overriding Array's In-Reply-To: <8d9a42800705021204i76c40ad2h9348be153c4497b@mail.gmail.com> References: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com> <8d9a42800705021146g327c197aofe1984d332b4e1f@mail.gmail.com> <8d9a42800705021204i76c40ad2h9348be153c4497b@mail.gmail.com> Message-ID: <52572C4A-2139-4AA2-88E9-06C4049DBC54@jonbaer.com> Are you sure you need to even do the loop? Why not always array_unshift() the $links array ... array_unshift() prepends passed elements to the front of the array. Note that the list of elements is prepended as a whole, so that the prepended elements stay in the same order. All numerical array keys will be modified to start counting from zero while literal keys won't be touched. You get FIFO w/ the # index w/o doing the work. - Jon On May 2, 2007, at 3:04 PM, Joseph Crawford wrote: > ok let me try to clarify myself. > > I somehow need to loop over all elements and see if any of them > contain numeric indexes like the stylesheets does. If it does we need > to add the new element from the secondary array to the first. > > If it get's to the bottom element (without finding a numeric key > first) it will replace the value such as in $data['page']['title'] > > Is that clear? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ramons at gmx.net Wed May 2 20:55:38 2007 From: ramons at gmx.net (David Krings) Date: Wed, 02 May 2007 20:55:38 -0400 Subject: [nycphp-talk] next() for multidimensional arrays? Message-ID: <4639330A.8070801@gmx.net> Hi! Is there anything available like next() that will work on multidimensional arrays? I want to get a flat list of key and value of the current element of a multidimensional array. I played around with next() now for an excessive amount of time and it just doesn't seem to think in more than one dimension. I also cannot make it to without missing some portions of the multidimensional array. Here is what I really want to do: I copied the dirlist function from the php.net man page for scandir. The function really works well, but returns a multidimensional array with the folder names being the keys for the subarrays, whereas files have a numerical key. What I need is a one dimensional array that has this structure: path_to_folder_as_key => filename1 path_to_folder_as_key => filename2 path_to_folder_as_key => filename3 path_to_folder_as_key => filename4 .... I also spent quite some time with all the various array flattening routines, but due to my lack of skill I cannot get those to keep the keys in place or even combine them to a path. It is nice that something like scandir is finally available, but PHP is still not very helpful in that arena. Nah, it's not PHP, it's me being stupid. I also attempted recursion with a function myself, but that ended up in total chaos and desaster. It would be great if one of you smart people could beat me out of this .... again. Best regards, David From chehodgins at gmail.com Thu May 3 02:32:21 2007 From: chehodgins at gmail.com (Che Hodgins) Date: Thu, 3 May 2007 02:32:21 -0400 Subject: [nycphp-talk] next() for multidimensional arrays? In-Reply-To: <4639330A.8070801@gmx.net> References: <4639330A.8070801@gmx.net> Message-ID: Hi David, see below. On 5/2/07, David Krings wrote: > Hi! > > Is there anything available like next() that will work on > multidimensional arrays? > I want to get a flat list of key and value of the current element of a > multidimensional array. I played around with next() now for an excessive > amount of time and it just doesn't seem to think in more than one > dimension. I also cannot make it to without missing some portions of the > multidimensional array. > > Here is what I really want to do: > I copied the dirlist function from the php.net man page for scandir. The > function really works well, but returns a multidimensional array with > the folder names being the keys for the subarrays, whereas files have a > numerical key. What I need is a one dimensional array that has this > structure: > path_to_folder_as_key => filename1 > path_to_folder_as_key => filename2 > path_to_folder_as_key => filename3 > path_to_folder_as_key => filename4 > .... Since a folder will often contain more than 1 file, using the folder path as the array key is not a good idea. The key can only be associated to one value, so in your example the key path_to_folder_as_key would have the value filename4 only. A 2 dimensional array such as: $the_files['path_to_folder_as_key'][0] = filename1 $the_files['path_to_folder_as_key'][1] = filename2 $the_files['path_to_folder_as_key'][2] = filename3 .... Should do it. If you really want to keep a one dimensional array you could do the following: $the_files[0] = 'path_to_folder,filename1'; $the_files[1] = 'path_to_folder,filename2'; ... And then when going through the array: list($path, $file) = explode(',', $the_files[0]); Good luck, Che > > I also spent quite some time with all the various array flattening > routines, but due to my lack of skill I cannot get those to keep the > keys in place or even combine them to a path. It is nice that something > like scandir is finally available, but PHP is still not very helpful in > that arena. Nah, it's not PHP, it's me being stupid. I also attempted > recursion with a function myself, but that ended up in total chaos and > desaster. > > It would be great if one of you smart people could beat me out of this > .... again. > > Best regards, > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Che Hodgins www.chehodgins.com +1 514 312 3950 From jakob.buchgraber at googlemail.com Thu May 3 11:31:23 2007 From: jakob.buchgraber at googlemail.com (Jakob Buchgraber) Date: Thu, 03 May 2007 17:31:23 +0200 Subject: [nycphp-talk] Any alternatives to mbstring for PHP+UTF-8? Message-ID: <463A004B.5040303@gmail.com> Hey! I was wondering whether there are alternatives to mbstring for handling UTF-8 encoded data with PHP? I am asking, because I'd like to play around with as many "technologies" as possible before I actually start developing. I somehow also looked at the way Joomla! did it, but I don't really like their solution. So what do you use for building websites with UTF-8 + PHP? Thanks! Cheers, Jay From jakob.buchgraber at googlemail.com Thu May 3 11:41:11 2007 From: jakob.buchgraber at googlemail.com (Jakob Buchgraber) Date: Thu, 03 May 2007 17:41:11 +0200 Subject: [nycphp-talk] Casting string "false" to boolean In-Reply-To: <345845F9-44ED-4676-9B78-70720E883AE2@beaffinitive.com> References: <46349D06.7020807@gmail.com> <97E58DBF-E900-4084-AB69-55EC723348D7@sala.ca> <345845F9-44ED-4676-9B78-70720E883AE2@beaffinitive.com> Message-ID: <463A0297.1090001@gmail.com> Rob Marscher wrote: >> If you're getting input for a false value as "false" you should >> really use some kind of conditional statement. > > Yeah... like this: > > $string = 'false'; > $bool = ($string != 'false'); > var_dump($bool); > > > -Rob > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > Nice. Thanks! :) Cheers, Jay From jonbaer at jonbaer.com Thu May 3 11:57:31 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 3 May 2007 11:57:31 -0400 Subject: [nycphp-talk] Any alternatives to mbstring for PHP+UTF-8? In-Reply-To: <463A004B.5040303@gmail.com> References: <463A004B.5040303@gmail.com> Message-ID: <16F7E99D-1B22-44F9-A3B2-94E13FA62AE6@jonbaer.com> Iconv is way more flexible ... http://us.php.net/iconv Specifically the alternate ob handler ... http://us.php.net/manual/en/ function.ob-iconv-handler.php - Jon On May 3, 2007, at 11:31 AM, Jakob Buchgraber wrote: > Hey! > > I was wondering whether there are alternatives to mbstring for > handling UTF-8 encoded data with PHP? > I am asking, because I'd like to play around with as many > "technologies" as possible before I actually start developing. > I somehow also looked at the way Joomla! did it, but I don't really > like their solution. > > So what do you use for building websites with UTF-8 + PHP? > > Thanks! > > Cheers, > Jay > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jakob.buchgraber at googlemail.com Thu May 3 12:51:09 2007 From: jakob.buchgraber at googlemail.com (Jakob Buchgraber) Date: Thu, 03 May 2007 18:51:09 +0200 Subject: [nycphp-talk] Any alternatives to mbstring for PHP+UTF-8? In-Reply-To: <16F7E99D-1B22-44F9-A3B2-94E13FA62AE6@jonbaer.com> References: <463A004B.5040303@gmail.com> <16F7E99D-1B22-44F9-A3B2-94E13FA62AE6@jonbaer.com> Message-ID: <463A12FD.6070802@gmail.com> Jon Baer wrote: > Iconv is way more flexible ... > > http://us.php.net/iconv > > Specifically the alternate ob handler ... > http://us.php.net/manual/en/function.ob-iconv-handler.php > > - Jon Hey! Thanks a lot. Seems to be quite cool. Have you ever used it? How does it perform? And when I convert a UTF-8 string to some single-byte encoding, I can use the PHP provided functions for manipulating and validating the data, right? Cheers, Jay From jonbaer at jonbaer.com Thu May 3 13:36:40 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 3 May 2007 13:36:40 -0400 Subject: [nycphp-talk] Any alternatives to mbstring for PHP+UTF-8? In-Reply-To: <463A12FD.6070802@gmail.com> References: <463A004B.5040303@gmail.com> <16F7E99D-1B22-44F9-A3B2-94E13FA62AE6@jonbaer.com> <463A12FD.6070802@gmail.com> Message-ID: Yes ... ive used the mysql function listed on that page (which is normally where 1/2 problems exist anyways). Just make sure it is installed (depending on your PHP version) ... [PowerbookG4:~]$ php -m | grep iconv iconv Otherwise you might have to compile/install http://www.gnu.org/ software/libiconv/ and ./configure --enable-iconv before building php. - Jon On May 3, 2007, at 12:51 PM, Jakob Buchgraber wrote: > Jon Baer wrote: >> Iconv is way more flexible ... >> >> http://us.php.net/iconv >> >> Specifically the alternate ob handler ... http://us.php.net/manual/ >> en/function.ob-iconv-handler.php >> >> - Jon > Hey! > > Thanks a lot. > > Seems to be quite cool. Have you ever used it? How does it perform? > And when I convert a UTF-8 string to some single-byte encoding, I > can use the PHP provided functions for manipulating and validating > the data, right? > > Cheers, > Jay > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From vtbludgeon at gmail.com Thu May 3 14:31:03 2007 From: vtbludgeon at gmail.com (David Mintz) Date: Thu, 3 May 2007 14:31:03 -0400 Subject: [nycphp-talk] Ajax 101: what to return from a POST Message-ID: <721f1cc50705031131i8311600l7a2abbe2004631c1@mail.gmail.com> Let's say you are displaying a form populated with data from a db table for a user to edit, and you want to AJAXify(with Prototype). Your backend script does the validation. Suppose they POST it and validation fails, what do you do? I have experimented with converting a PHP array of error messages (fieldName => errorMessage, etc) into JSON and sending that back, then doing DOM scripting to stick the error messages into some DIVs. Kind of a lot of work, but it's efficient in the sense that you only send data that the front end needs. The other option is to redraw the whole form with the error messages in the DIVs and send back that chunk of HTML. Less efficient in that you are sending back a bunch of bytes that are the same as what was there in the first place, but more efficient in that you re-use more code, and do less client-side acrobatics, than if you return a JSON data structure. Am I being a byte-Nazi? Any thoughts? -- David Mintz http://davidmintz.org/ Just a spoonful of sugar helps the medicine go down In the most delightful way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim_lists at o2group.com Thu May 3 14:45:37 2007 From: tim_lists at o2group.com (Tim Lieberman) Date: Thu, 3 May 2007 12:45:37 -0600 Subject: [nycphp-talk] Ajax 101: what to return from a POST In-Reply-To: <721f1cc50705031131i8311600l7a2abbe2004631c1@mail.gmail.com> References: <721f1cc50705031131i8311600l7a2abbe2004631c1@mail.gmail.com> Message-ID: <2E398628-8F90-442D-9D75-09FD6B0515D6@o2group.com> If there are validation errors, send back a json-encoded false in the X-JSON header, and some error HTML to be injected into a DOM element in the body. If there are no errors, send back a json-encoded true in the X-JSON header, and do whatever else you need in the responseText. So your script does something like: new Ajax.Request('/some/service/url',{ onSuccess : function (transport,json){ if (json){ //everything is great. }else{ //ruh-roh $('ErrorTextDiv').update(transport.responseText); } }); On May 3, 2007, at 12:31 PM, David Mintz wrote: > Let's say you are displaying a form populated with data from a db > table for a user to edit, and you want to AJAXify(with Prototype). > Your backend script does the validation. Suppose they POST it and > validation fails, what do you do? > > I have experimented with converting a PHP array of error messages > (fieldName => errorMessage, etc) into JSON and sending that back, > then doing DOM scripting to stick the error messages into some > DIVs. Kind of a lot of work, but it's efficient in the sense that > you only send data that the front end needs. > > The other option is to redraw the whole form with the error > messages in the DIVs and send back that chunk of HTML. Less > efficient in that you are sending back a bunch of bytes that are > the same as what was there in the first place, but more efficient > in that you re-use more code, and do less client-side acrobatics, > than if you return a JSON data structure. > > Am I being a byte-Nazi? Any thoughts? > > > -- > David Mintz > http://davidmintz.org/ > > Just a spoonful of sugar helps the medicine go down > In the most delightful way. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtbludgeon at gmail.com Thu May 3 14:55:28 2007 From: vtbludgeon at gmail.com (David Mintz) Date: Thu, 3 May 2007 14:55:28 -0400 Subject: [nycphp-talk] Ajax 101: what to return from a POST In-Reply-To: <2E398628-8F90-442D-9D75-09FD6B0515D6@o2group.com> References: <721f1cc50705031131i8311600l7a2abbe2004631c1@mail.gmail.com> <2E398628-8F90-442D-9D75-09FD6B0515D6@o2group.com> Message-ID: <721f1cc50705031155x21b80298lbdb3816c67920a17@mail.gmail.com> Ah so, makes sense. The thing about the JSON header is nice. But I want to show the each message in a DIV adjacent to the corresponding form element. So sending one HTML fragment of error text wouldn't quite do it. On 5/3/07, Tim Lieberman wrote: > > If there are validation errors, send back a json-encoded false in the > X-JSON header, and some error HTML to be injected into a DOM element in the > body. > > If there are no errors, send back a json-encoded true in the X-JSON > header, and do whatever else you need in the responseText. [...] > -- David Mintz http://davidmintz.org/ Just a spoonful of sugar helps the medicine go down In the most delightful way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Thu May 3 15:10:14 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 3 May 2007 15:10:14 -0400 Subject: [nycphp-talk] Ajax 101: what to return from a POST In-Reply-To: <721f1cc50705031155x21b80298lbdb3816c67920a17@mail.gmail.com> References: <721f1cc50705031131i8311600l7a2abbe2004631c1@mail.gmail.com> <2E398628-8F90-442D-9D75-09FD6B0515D6@o2group.com> <721f1cc50705031155x21b80298lbdb3816c67920a17@mail.gmail.com> Message-ID: <5B035DFE-1BA6-4FBF-BE52-2FE86FC19187@jonbaer.com> Send back a 412 (precondition failed) error and evaluate the Run
Mark's method is similiar in that it builds on the existing DOM w/ JSON returned, but just showing you could easily control your divs server side. - Jon On May 3, 2007, at 3:48 PM, David Mintz wrote: > Yes, I got the part about the HTTP response code. > > I am trying to pose a question about what else to do if validation > fails, i.e., req.status == 412: send back the redrawn form w/ > errors and display it, or send back just the validation error > messages as a JSON object and work with that? > > On 5/3/07, Felix Shnir wrote: Jon means > that the response status should be 412... > > var req = this.getTransport (); > req.open('POST', uri, true); > req.onreadystatechange = function (aEvt) { > if (req.readyState == 4) { > if(req.status == 200) > var r = eval(req.responseText); > > if(req.status == 412) > alert("error has occured: " + req.responseText); > } > } > > Felix From ramons at gmx.net Thu May 3 21:19:30 2007 From: ramons at gmx.net (David Krings) Date: Thu, 03 May 2007 21:19:30 -0400 Subject: [nycphp-talk] next() for multidimensional arrays? In-Reply-To: References: <4639330A.8070801@gmx.net> Message-ID: <463A8A22.8000608@gmx.net> Che Hodgins wrote: > Hi David, see below. > > On 5/2/07, David Krings wrote: >> Hi! >> >> Is there anything available like next() that will work on >> multidimensional arrays? First of all, thanks for pointing out my brain fart with using the same key for different values. Second, what I tried to do is use again the hammer and consider everything a nail. I upload a ZIP (!!!) archive, extract it, throw the zip file away, and now break my neck to find out what the files and folders are! *slaphandonhead* This: $zip = zip_open($localzipfile); if ($zip) { while ($zip_entry = zip_read($zip)) { echo "Name: " . zip_entry_name($zip_entry) . "
"; echo "Actual Filesize: " . zip_entry_filesize($zip_entry) . "
"; echo "
"; } zip_close($zip); } does the trick. If the filesize is 0 then it is either just a folder entry or a file that I don't want anyway. So anything with a file size bigger than 0 will go into my array, with path and file name. What really threw me off is that zip_open() does not work with relative path/file names. Something like ./dir/zip file.zip returns an integer and not a resource handle! After translating the relative path into a direct path all things went smoothly. OK, I keep hammering away then. David From rmarscher at beaffinitive.com Thu May 3 21:37:15 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 3 May 2007 21:37:15 -0400 Subject: [nycphp-talk] Overriding Array's In-Reply-To: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com> References: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com> Message-ID: <3B461307-733A-466B-9C4D-51FFE15D0202@beaffinitive.com> On May 2, 2007, at 1:52 PM, Joseph Crawford wrote: > We are looking to have the second array override the first array > values. I cannot seem to get any of these methods to > work. I assume you've fixed this by now... but here's a recursive method that I think does what you want: // overrides non-numeric keys recursively public function override($default, $page) { foreach ($page as $key => $val) { if (isset($page[$key]) && $page[$key] !== "") { if (is_array($val)) { $default[$key] = $this->override($default[$key], $page[$key]); } else { if (is_numeric($key)) { $default[] = $val; } else { $default[$key] = $val; } } } } return $default; } Though, I wonder if it would be better to have these properties as class members... you may find that a bit more flexible... could even still have an override method to pass in an array... even offer it through the constructor... see below: /* note: php4 syntax, I don't use php5 enough daily to spit it off the top of my head * but I think if you search/replace var for public and add public in the class definition and * to the functions and make singleton a static method, that should be most of it */ class Config { // http-metas var $content-type = 'text/html; charset=utf-8'; var $content-language = 'en-us'; // metas var $PreventParsing = true; var $robots = 'noindex, nofollow'; var $description = 'Recruiting and HR news, information and ' . 'community -- including articles, discussions, blogs, jobs, . 'conferences, research, email publications and more.' var $copyright = '2007'; var $keywords = 'recruiting, staffing, HR, business'; // page var $template = 'mainTemplate'; var $title = 'ERE.net - Recruiting news, information and community'; var $ssl = 'false'; // links var $stylesheets = array('style.css', 'layout.css'); function Config($override = array()) { $this->__construct($override); } function __construct($override = array()) { $this->override($override); } function singleton($config = array()) { static $instance; if (!isset($instance)) { $instance = new Config($config); } return $instance; } function override($values = array()) { foreach($values as $key => $value) { if (is_array($this->$key)) { $this->$key[] = $value; } else { $this->$key = $value; } } } function getHttpMetas() { return array('content-type' => $this->content_type, 'content-language' => $this->content- language); } function getMetas() { return array('content-type' => $this->content_type, 'content-language' => $this->content- language); } function getPage() { return array('template' => $this->template, 'title' => $this->title, 'ssl' => $this->ssl); } function getLinks() { return array('stylesheets' => $this->stylesheets); } } From codebowl at gmail.com Thu May 3 22:57:12 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 3 May 2007 22:57:12 -0400 Subject: [nycphp-talk] Overriding Array's In-Reply-To: <3B461307-733A-466B-9C4D-51FFE15D0202@beaffinitive.com> References: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com> <3B461307-733A-466B-9C4D-51FFE15D0202@beaffinitive.com> Message-ID: <8d9a42800705031957j5483a2ebg9470f008884ab3d9@mail.gmail.com> Rob, Thanks for your code example however having them as class properties will not work. The main reason is that the default array is created by reading a YAML file. The array is populated by reading a section of a flat file and then it reads a section specific to the current page (if any) and overrides the defaults. Here is the code I have used to accomplish this. Thanks to every who responded. // parse through an array, $a is the original array and // $b is the new array to merge into it function override($a, $b) { // an array that will hold the new, properly // merged version of the two arrays $new = array(); // if we've encountered numbered keys, this // will be true $numbers = FALSE; // if $a is bigger than $b, lots of code repetition // beyond this point.. ugh. if(count($a) >= count($b)) { // override the arrays if necessary foreach($a as $key => $val) { // if we've found a number, stop the loop if(is_numeric($key)) // dunno why ctype_digit didn't work... { $numbers = TRUE; break; } // otherwise, override the key with a $b value // if it exists. else $new[$key] = isset($b[$key]) ? $b[$key] : $a[$key]; } } // otherwise.. else { // override the arrays if necessary foreach($b as $key => $val) { if(is_numeric($key)) { $numbers = TRUE; break; } // otherwise, override the key with an $a value // if it exists. else $new[$key] = isset($a[$key]) ? $a[$key] : $b[$key]; } } // merge the arrays if they are numbered keys if($numbers) $new = array_merge($a, $b); // loop through the new array and check for sub-arrays foreach($new as $key => $val) { // recursively go through if(is_array($new[$key]) && !$numbers) $new[$key] = $this->override((isset($a[$key]) ? $a[$key] : array()), (isset($b[$key]) ? $b[$key] : array())); } // return the new, merged array return $new; } -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com From dirn at dirnonline.com Thu May 3 23:04:03 2007 From: dirn at dirnonline.com (=?UTF-8?B?QW5keSBEaXJuYmVyZ2Vy?=) Date: Fri, 4 May 2007 03:04:03 +0000 Subject: [nycphp-talk] Overriding Array's In-Reply-To: <8d9a42800705031957j5483a2ebg9470f008884ab3d9@mail.gmail.com> References: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com><3B461307-733A-466B-9C4D-51FFE15D0202@beaffinitive.com> <8d9a42800705031957j5483a2ebg9470f008884ab3d9@mail.gmail.com> Message-ID: <1572933740-1178247845-cardhu_blackberry.rim.net-692104405-@bwe047-cell00.bisx.prod.on.blackberry> Like really sad. Sent via BlackBerry from Cingular Wireless -----Original Message----- From: "Joseph Crawford" Date: Thu, 3 May 2007 22:57:12 To:"NYPHP Talk" Subject: Re: [nycphp-talk] Overriding Array's Rob, Thanks for your code example however having them as class properties will not work. The main reason is that the default array is created by reading a YAML file. The array is populated by reading a section of a flat file and then it reads a section specific to the current page (if any) and overrides the defaults. Here is the code I have used to accomplish this. Thanks to every who responded. // parse through an array, $a is the original array and // $b is the new array to merge into it function override($a, $b) { // an array that will hold the new, properly // merged version of the two arrays $new = array(); // if we've encountered numbered keys, this // will be true $numbers = FALSE; // if $a is bigger than $b, lots of code repetition // beyond this point.. ugh. if(count($a) >= count($b)) { // override the arrays if necessary foreach($a as $key => $val) { // if we've found a number, stop the loop if(is_numeric($key)) // dunno why ctype_digit didn't work... { $numbers = TRUE; break; } // otherwise, override the key with a $b value // if it exists. else $new[$key] = isset($b[$key]) ? $b[$key] : $a[$key]; } } // otherwise.. else { // override the arrays if necessary foreach($b as $key => $val) { if(is_numeric($key)) { $numbers = TRUE; break; } // otherwise, override the key with an $a value // if it exists. else $new[$key] = isset($a[$key]) ? $a[$key] : $b[$key]; } } // merge the arrays if they are numbered keys if($numbers) $new = array_merge($a, $b); // loop through the new array and check for sub-arrays foreach($new as $key => $val) { // recursively go through if(is_array($new[$key]) && !$numbers) $new[$key] = $this->override((isset($a[$key]) ? $a[$key] : array()), (isset($b[$key]) ? $b[$key] : array())); } // return the new, merged array return $new; } -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From dirn at dirnonline.com Thu May 3 23:04:27 2007 From: dirn at dirnonline.com (=?UTF-8?B?QW5keSBEaXJuYmVyZ2Vy?=) Date: Fri, 4 May 2007 03:04:27 +0000 Subject: [nycphp-talk] Overriding Array's In-Reply-To: <8d9a42800705031957j5483a2ebg9470f008884ab3d9@mail.gmail.com> References: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com><3B461307-733A-466B-9C4D-51FFE15D0202@beaffinitive.com> <8d9a42800705031957j5483a2ebg9470f008884ab3d9@mail.gmail.com> Message-ID: <1443250847-1178247869-cardhu_blackberry.rim.net-897054150-@bwe038-cell00.bisx.prod.on.blackberry> Sorry about that email everyone. Sent via BlackBerry from Cingular Wireless -----Original Message----- From: "Joseph Crawford" Date: Thu, 3 May 2007 22:57:12 To:"NYPHP Talk" Subject: Re: [nycphp-talk] Overriding Array's Rob, Thanks for your code example however having them as class properties will not work. The main reason is that the default array is created by reading a YAML file. The array is populated by reading a section of a flat file and then it reads a section specific to the current page (if any) and overrides the defaults. Here is the code I have used to accomplish this. Thanks to every who responded. // parse through an array, $a is the original array and // $b is the new array to merge into it function override($a, $b) { // an array that will hold the new, properly // merged version of the two arrays $new = array(); // if we've encountered numbered keys, this // will be true $numbers = FALSE; // if $a is bigger than $b, lots of code repetition // beyond this point.. ugh. if(count($a) >= count($b)) { // override the arrays if necessary foreach($a as $key => $val) { // if we've found a number, stop the loop if(is_numeric($key)) // dunno why ctype_digit didn't work... { $numbers = TRUE; break; } // otherwise, override the key with a $b value // if it exists. else $new[$key] = isset($b[$key]) ? $b[$key] : $a[$key]; } } // otherwise.. else { // override the arrays if necessary foreach($b as $key => $val) { if(is_numeric($key)) { $numbers = TRUE; break; } // otherwise, override the key with an $a value // if it exists. else $new[$key] = isset($a[$key]) ? $a[$key] : $b[$key]; } } // merge the arrays if they are numbered keys if($numbers) $new = array_merge($a, $b); // loop through the new array and check for sub-arrays foreach($new as $key => $val) { // recursively go through if(is_array($new[$key]) && !$numbers) $new[$key] = $this->override((isset($a[$key]) ? $a[$key] : array()), (isset($b[$key]) ? $b[$key] : array())); } // return the new, merged array return $new; } -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From paul at devonianfarm.com Thu May 3 23:35:31 2007 From: paul at devonianfarm.com (Paul Houle) Date: Thu, 03 May 2007 23:35:31 -0400 Subject: [nycphp-talk] PHP Sessions, Expiration, and all that Message-ID: <463AAA03.7020105@devonianfarm.com> I've been making some modifications on an application that uses PHP sessions for authentication. Our client wants sessions to time out after six hours of inactivity, and I'm wondering if there's an easy way to do that by configuring PHP. session.cookie_lifetime sets the lifetime of the session cookie -- however, it appears that the cookie gets set once on session start, so this would cause the session to last six hours after it begins. It's not so clear to me exactly what session.gc_maxlifetime does, but with a default value of 1440 seconds, I'd think that my sessions would be expiring a lot more quickly than they are if that was setting a timeout. I can certainly hack the code to do something like $now=time(); if(isset($_SESSION["timestamp"])) { ... dump session if now-timestamp > limit ... } $_SESSION["timestamp"]=$now; but I'm wondering if there's a more natural way to do it. From codebowl at gmail.com Thu May 3 23:33:31 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 3 May 2007 23:33:31 -0400 Subject: [nycphp-talk] PHP Sessions, Expiration, and all that In-Reply-To: <463AAA03.7020105@devonianfarm.com> References: <463AAA03.7020105@devonianfarm.com> Message-ID: <8d9a42800705032033t1f1d48e4lf941397855195c82@mail.gmail.com> I would suggest creating a custom session handler and storing the sessions in the db, read up on this. http://www.php.net/manual/en/function.session-set-save-handler.php With a custom session handler you can set a timeout and have the sessions deleted from the database after 6 hours passes. A custom handler allows much better flexability over the built in sessions. -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com From codebowl at gmail.com Thu May 3 23:34:20 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 3 May 2007 23:34:20 -0400 Subject: [nycphp-talk] PHP Sessions, Expiration, and all that In-Reply-To: <8d9a42800705032033t1f1d48e4lf941397855195c82@mail.gmail.com> References: <463AAA03.7020105@devonianfarm.com> <8d9a42800705032033t1f1d48e4lf941397855195c82@mail.gmail.com> Message-ID: <8d9a42800705032034i4d966cfay96def05a4f4b6fb3@mail.gmail.com> You will want to look at the gc method for clearing the data. I am sure that you can set a lifetime in the php.ini as well but you should look into the custom session handler and see if the flexability meets your needs. -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com From rmarscher at beaffinitive.com Fri May 4 00:57:42 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 4 May 2007 00:57:42 -0400 Subject: [nycphp-talk] Overriding Array's In-Reply-To: <8d9a42800705031957j5483a2ebg9470f008884ab3d9@mail.gmail.com> References: <8d9a42800705021052l27113abcsa0e6137ee2ee24c8@mail.gmail.com> <3B461307-733A-466B-9C4D-51FFE15D0202@beaffinitive.com> <8d9a42800705031957j5483a2ebg9470f008884ab3d9@mail.gmail.com> Message-ID: <023F6F5D-2788-4DAD-9462-53578F604DC5@beaffinitive.com> On May 3, 2007, at 10:57 PM, Joseph Crawford wrote: > The main reason is that the default array is created > by reading a YAML file. Cool... I figured something like that was going on. Doesn't totally mean you can read the YAML file into class properties... but whatever works. The Zend_Config component of Zend Framework is an interesting read for something like this. I think the current version can read arrays, XML files, and regular ini files. No yaml yet :( http://framework.zend.com/manual/en/zend.config.adapters.ini.html From lists at zaunere.com Fri May 4 09:20:43 2007 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 4 May 2007 09:20:43 -0400 Subject: [nycphp-talk] FW: PHP statistics for April 2007 Message-ID: <025501c78e4f$04d00250$6b0aa8c0@MobileZ> The latest... > PHP adoption statistics for April 2007 are released. > > * 5.2 is about to be the 3rd most popular version > * PHP 5 is more often chosen on larger domains > * In April, web sites are bracing for the next versions > > As usual, lots of other details : PHP versions, Apache, country > details, etc. > Feel free to ask any other details, stats or context about the study. > > PHP stats evolution for April 2007 > > http://www.nexen.net/chiffres_cles/phpversion/16987-php_stats_evolution_for_ april_2007.php > PHP statistics for April 2007 > http://www.nexen.net/chiffres_cles/phpversion/16990-php_statistics_for_april _2007.php > > All nexen.net articles in English : > http://www.nexen.net/the_english_speaking_nexen.net.php > From shiflett at php.net Fri May 4 09:23:01 2007 From: shiflett at php.net (Chris Shiflett) Date: Fri, 04 May 2007 09:23:01 -0400 Subject: [nycphp-talk] PHP Sessions, Expiration, and all that In-Reply-To: <463AAA03.7020105@devonianfarm.com> References: <463AAA03.7020105@devonianfarm.com> Message-ID: <463B33B5.1040307@php.net> Hi Paul, > Our client wants sessions to time out after six hours of > inactivity, and I'm wondering if there's an easy way to do > that by configuring PHP. Yes, but keep in mind that session.gc_maxlifetime indicates a maximum, not a minimum. PHP isn't going to check on every request to see whether it should clean up stale sessions; there's some probability involved. However, you can change that, too. :-) > $now=time(); > if(isset($_SESSION["timestamp"])) { > ... dump session if now-timestamp > limit ... > } > $_SESSION["timestamp"]=$now; Seems like a fine way to do it to me. Chris -- Chris Shiflett http://shiflett.org/ From cliff at pinestream.com Fri May 4 10:08:47 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 04 May 2007 10:08:47 -0400 Subject: [nycphp-talk] PHP Sessions, Expiration, and all that In-Reply-To: <463B33B5.1040307@php.net> Message-ID: On 5/4/07 9:23 AM, "Chris Shiflett" wrote: > Hi Paul, > >> Our client wants sessions to time out after six hours of >> inactivity, and I'm wondering if there's an easy way to do >> that by configuring PHP. > > Yes, but keep in mind that session.gc_maxlifetime indicates a maximum, > not a minimum. PHP isn't going to check on every request to see whether > it should clean up stale sessions; there's some probability involved. > However, you can change that, too. :-) > >> $now=time(); >> if(isset($_SESSION["timestamp"])) { >> ... dump session if now-timestamp > limit ... >> } >> $_SESSION["timestamp"]=$now; > > Seems like a fine way to do it to me. > > Chris Why not kill the GC function and add a cron job instead? More predictable, less overhead. Cliff From dorgan at optonline.net Fri May 4 10:11:55 2007 From: dorgan at optonline.net (Donald J Organ IV) Date: Fri, 04 May 2007 10:11:55 -0400 Subject: [nycphp-talk] Mail Campaign Manager Message-ID: <463B3F2B.6010506@optonline.net> Does anyone know of a good open source Email Campaign Manager that will handle tracking stats of the emails sent out such as how many people click on which links as well as bounce backs and removals?? From randalrust at gmail.com Fri May 4 10:14:52 2007 From: randalrust at gmail.com (Randal Rust) Date: Fri, 4 May 2007 10:14:52 -0400 Subject: [nycphp-talk] Mail Campaign Manager In-Reply-To: <463B3F2B.6010506@optonline.net> References: <463B3F2B.6010506@optonline.net> Message-ID: On 5/4/07, Donald J Organ IV wrote: > Does anyone know of a good open source Email Campaign Manager It's an online service, but I'm pretty happy with what we've seen using CampaignMonitor.com. http://campaignmonitor.com/ -- Randal Rust R.Squared Communications www.r2communications.com From ferencz.attila at gmail.com Fri May 4 10:21:07 2007 From: ferencz.attila at gmail.com (Attila, Ferencz-Csibi) Date: Fri, 4 May 2007 15:21:07 +0100 Subject: [nycphp-talk] Mail Campaign Manager In-Reply-To: <463B3F2B.6010506@optonline.net> References: <463B3F2B.6010506@optonline.net> Message-ID: <894e56a90705040721m46bddc77nb1334b6a6fb24309@mail.gmail.com> On 5/4/07, Donald J Organ IV wrote: > Does anyone know of a good open source Email Campaign Manager that will > handle tracking stats of the emails sent out such as how many people > click on which links as well as bounce backs and removals?? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php Hi, We're useing this: http://www.openemm.org/ From jonbaer at jonbaer.com Fri May 4 10:26:34 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 4 May 2007 10:26:34 -0400 Subject: [nycphp-talk] Mail Campaign Manager In-Reply-To: <463B3F2B.6010506@optonline.net> References: <463B3F2B.6010506@optonline.net> Message-ID: Check out SwiftMailer + forums to see if someone has already built something similar, I remember a posting about something similar, it will log and you can do something like $failed_array = getFailedRecipients(); for scrubbing ... http://www.swiftmailer.org/ http://forums.devnetwork.net/viewforum.php?f=52 - Jon On May 4, 2007, at 10:11 AM, Donald J Organ IV wrote: > Does anyone know of a good open source Email Campaign Manager that > will handle tracking stats of the emails sent out such as how many > people click on which links as well as bounce backs and removals?? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jonbaer at jonbaer.com Fri May 4 10:36:02 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 4 May 2007 10:36:02 -0400 Subject: [nycphp-talk] Mail Campaign Manager In-Reply-To: References: <463B3F2B.6010506@optonline.net> Message-ID: Another: http://www.phplist.com/ Click Tracking tracks links and URLs. Statistics can be viewed by message, URL or subscriber. - Jon On May 4, 2007, at 10:26 AM, Jon Baer wrote: > Check out SwiftMailer + forums to see if someone has already built > something similar, I remember a posting about something similar, it > will log and you can do something like $failed_array = > getFailedRecipients(); for scrubbing ... > > http://www.swiftmailer.org/ > http://forums.devnetwork.net/viewforum.php?f=52 > > - Jon > > On May 4, 2007, at 10:11 AM, Donald J Organ IV wrote: > >> Does anyone know of a good open source Email Campaign Manager that >> will handle tracking stats of the emails sent out such as how many >> people click on which links as well as bounce backs and removals?? >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > From patrick.fee at baesystems.com Fri May 4 11:56:03 2007 From: patrick.fee at baesystems.com (Fee, Patrick J (US SSA)) Date: Fri, 4 May 2007 11:56:03 -0400 Subject: [nycphp-talk] Mail Campaign Manager References: <463B3F2B.6010506@optonline.net> Message-ID: <728813C3358BF04CB3A3DA2341D44A71058D3554@blums0007.na.baesystems.com> My issue with that would be that Corporate would have issue with it being controlled by an outside source ("an online service"). I think they would like to control it themselves using some COTS product. Patrick J. Fee Manager, Information Engineering Dept. Technology Solutions & Services Tel: (301) 231-1418 Cel: (240) 401-6820 Fax: (301) 231-2635 Patrick.Fee at BAESystems.com ------------------------------------------------------------------------ "Our deepest fear is not that we are inadequate. Our deepest fear is that we are powerful beyond measure. It is our light, not our darkness that most frightens us." --- Marianne Williamson -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Randal Rust Sent: Friday, May 04, 2007 10:15 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Mail Campaign Manager On 5/4/07, Donald J Organ IV wrote: > Does anyone know of a good open source Email Campaign Manager It's an online service, but I'm pretty happy with what we've seen using CampaignMonitor.com. http://campaignmonitor.com/ -- Randal Rust R.Squared Communications www.r2communications.com _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ramons at gmx.net Fri May 4 21:01:29 2007 From: ramons at gmx.net (David Krings) Date: Fri, 04 May 2007 21:01:29 -0400 Subject: [nycphp-talk] Conditional break? Message-ID: <463BD769.9010705@gmx.net> Hi! Try to make this short. I have an array with path/file names. I want to move each file unless it already exists at its destination. What I want to do is end the current go through the while loop, increase a counter that I use for the while condition, and then start at the top of the while loop again. I tried using break as such while ($counter < $max) { $error = move_file(); if (!$error) { echo "Failed!" $counter++; break; } else { do_some_stuff(); } $counter++; } The problem is that the whole thing stops as soon as it hits break, but I just want it to stop what it is doing now, increase $counter, and go back to the top and loop again. Obviously, break isn't the right thing to use. But what is? Hope this is a more intelligent question than the others I asked in the past days. Sorry for that. David From dirn at dirnonline.com Fri May 4 21:11:35 2007 From: dirn at dirnonline.com (=?UTF-8?B?QW5keSBEaXJuYmVyZ2Vy?=) Date: Sat, 5 May 2007 01:11:35 +0000 Subject: [nycphp-talk] Conditional break? In-Reply-To: <463BD769.9010705@gmx.net> References: <463BD769.9010705@gmx.net> Message-ID: <858226490-1178327496-cardhu_blackberry.rim.net-260289959-@bwe056-cell00.bisx.prod.on.blackberry> Try continue instead of break. Sent via BlackBerry from Cingular Wireless -----Original Message----- From: David Krings Date: Fri, 04 May 2007 21:01:29 To:NYPHP Talk Subject: [nycphp-talk] Conditional break? Hi! Try to make this short. I have an array with path/file names. I want to move each file unless it already exists at its destination. What I want to do is end the current go through the while loop, increase a counter that I use for the while condition, and then start at the top of the while loop again. I tried using break as such while ($counter < $max) { $error = move_file(); if (!$error) { echo "Failed!" $counter++; break; } else { do_some_stuff(); } $counter++; } The problem is that the whole thing stops as soon as it hits break, but I just want it to stop what it is doing now, increase $counter, and go back to the top and loop again. Obviously, break isn't the right thing to use. But what is? Hope this is a more intelligent question than the others I asked in the past days. Sorry for that. David _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ramons at gmx.net Fri May 4 21:17:46 2007 From: ramons at gmx.net (David Krings) Date: Fri, 04 May 2007 21:17:46 -0400 Subject: [nycphp-talk] Conditional break? In-Reply-To: <858226490-1178327496-cardhu_blackberry.rim.net-260289959-@bwe056-cell00.bisx.prod.on.blackberry> References: <463BD769.9010705@gmx.net> <858226490-1178327496-cardhu_blackberry.rim.net-260289959-@bwe056-cell00.bisx.prod.on.blackberry> Message-ID: <463BDB3A.1070608@gmx.net> Andy Dirnberger wrote: > Try continue instead of break. > That works! Thanks!! David From randalrust at gmail.com Mon May 7 09:54:12 2007 From: randalrust at gmail.com (Randal Rust) Date: Mon, 7 May 2007 09:54:12 -0400 Subject: [nycphp-talk] Overwriting files with copy() Message-ID: We have a new site that we just set up. We had everything set up on a test server and then moved to production over the weekend, when we ran into an odd issue. We have several areas where users can upload files (PDF, XLS, etc) into the system. The client found that they needed to update a few of the files after the move, and some were uploaded and overwrote the old file with no problems. Others failed for some reason. When we looked into it further, we found that files uploaded to this location were overwritten, as they should be: /root/uploads/2/files/ But files on this path were not getting overwritten. /root/uploads/2/files/documents We get a permission denied error from the copy() function. There are only three files in question, so it's not a huge deal, but I was suprised that this happened. All of the folder file attributes are set correctly, but the only way I can get the old file to update properly is to set the attributes of the actual file to '777.' -- Randal Rust R.Squared Communications www.r2communications.com From dorgan at optonline.net Mon May 7 10:10:42 2007 From: dorgan at optonline.net (Donald J Organ IV) Date: Mon, 07 May 2007 10:10:42 -0400 Subject: [nycphp-talk] PHP, Email & APPLEDOUBLE Message-ID: <463F3362.4020208@optonline.net> Has anyone has any experience with parsing emails with the subtype of APPLEDOUBLE?? Any advice on this would be greatly appreciated. From tboyden at supercoups.com Mon May 7 11:30:09 2007 From: tboyden at supercoups.com (Timothy Boyden) Date: Mon, 7 May 2007 11:30:09 -0400 Subject: [nycphp-talk] How to sort a multi-dimensional array by a given key? Message-ID: Hi All, I have a multi-dimensional array such as: $franchises['SCID1'] = SCNYC $franchises['SCID1']['BusinessName'] = SuperCoups of NY City $franchises['SCID1']['DistanceFromCustomer'] = 20 $franchises['SCID2'] = SCBUFF $franchises['SCID2']['BusinessName'] = SuperCoups of Buffalo $franchises['SCID2']['DistanceFromCustomer'] = 10 How can I sort this array so the businesses are sorted by the DistanceFromCustomer key? Thanks for the help in advance, Tim --------------------------- Timothy Boyden Network Administrator tboyden at supercoups.com SuperCoups(r) 350 Revolutionary Drive | E. Taunton, MA 02718 508-977-2034 | www.supercoups.com We Support Alex's Lemonade Stand Foundation, "Fighting Childhood Cancer One Cup At A Time" Donations Accepted at: www.firstgiving.com/SuperCoups --------------------------- Local Coupons. Super Savings.(r) -------------- next part -------------- An HTML attachment was scrubbed... URL: From strudeau at umich.edu Mon May 7 11:49:10 2007 From: strudeau at umich.edu (Scott Trudeau) Date: Mon, 7 May 2007 11:49:10 -0400 Subject: [nycphp-talk] How to sort a multi-dimensional array by a given key? In-Reply-To: References: Message-ID: <90174f6c0705070849i2c0a7790h2edbca3839044635@mail.gmail.com> I'm sure there's probably a better way to do this, but uasort() sorts an array using a callback provided callback function for item comparisons -- which you can use to compare the specific key you want to sort by. It seems like there should be a more generic way to do this by providing the name of the key on which you want to sort. $franchises['SCID1'] = SCNYC $franchises['SCID1']['BusinessName'] = SuperCoups of NY City $franchises['SCID1']['DistanceFromCustomer'] = 20 $franchises['SCID2'] = SCBUFF $franchises['SCID2']['BusinessName'] = SuperCoups of Buffalo $franchises['SCID2']['DistanceFromCustomer'] = 10 uasort($franchises, "cmp_distance"); function cmp_distance($a, $b) { if($a['DistanceFromCustomer'] == $b['DistanceFromCustomer']) return 0; return ($a['DistanceFromCustomer'] < $b['DistanceFromCustomer']) ? -1 : 1; } On 5/7/07, Timothy Boyden wrote: > > > Hi All, > > I have a multi-dimensional array such as: > > $franchises['SCID1'] = SCNYC > $franchises['SCID1']['BusinessName'] = SuperCoups of NY > City > $franchises['SCID1']['DistanceFromCustomer'] = 20 > > $franchises['SCID2'] = SCBUFF > $franchises['SCID2']['BusinessName'] = SuperCoups > of Buffalo > $franchises['SCID2']['DistanceFromCustomer'] = 10 > > How can I sort this array so the businesses are sorted by the > DistanceFromCustomer key? > > Thanks for the help in advance, > > Tim > > > --------------------------- > Timothy Boyden > > Network Administrator > > tboyden at supercoups.com > > > > SuperCoups(r) > > > > 350 Revolutionary Drive | E. Taunton, MA 02718 > > 508-977-2034 | www.supercoups.com > > > > We Support Alex's Lemonade Stand Foundation, > > "Fighting Childhood Cancer One Cup At A Time" > > Donations Accepted at: www.firstgiving.com/SuperCoups > > --------------------------- > > Local Coupons. Super Savings.(r) > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From dcech at phpwerx.net Mon May 7 11:51:24 2007 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 07 May 2007 11:51:24 -0400 Subject: [nycphp-talk] How to sort a multi-dimensional array by a given key? In-Reply-To: References: Message-ID: <463F4AFC.4090206@phpwerx.net> Timothy Boyden wrote: > Hi All, > > I have a multi-dimensional array such as: > > $franchises['SCID1'] = SCNYC > $franchises['SCID1']['BusinessName'] = SuperCoups of NY City > $franchises['SCID1']['DistanceFromCustomer'] = 20 > $franchises['SCID2'] = SCBUFF > $franchises['SCID2']['BusinessName'] = SuperCoups of Buffalo > $franchises['SCID2']['DistanceFromCustomer'] = 10 > > How can I sort this array so the businesses are sorted by the > DistanceFromCustomer key? Firstly, your array above looks somewhat suspect, you might want to use actual code for your example. That said, try the following: $franchises = array(); $franchises['SCID1'] = array(); $franchises['SCID1']['BusinessName'] = 'SuperCoups of NY City'; $franchises['SCID1']['DistanceFromCustomer'] = 20; $franchises['SCID2'] = array(); $franchises['SCID2']['BusinessName'] = 'SuperCoups of Buffalo'; $franchises['SCID2']['DistanceFromCustomer'] = 10; uasort($franchises,create_function('$a,$b','return strnatcmp($a["DistanceFromCustomer"],$b["DistanceFromCustomer"]);')); Dan From tboyden at supercoups.com Mon May 7 11:57:36 2007 From: tboyden at supercoups.com (Timothy Boyden) Date: Mon, 7 May 2007 11:57:36 -0400 Subject: [nycphp-talk] How to sort a multi-dimensional array by a given key? In-Reply-To: <90174f6c0705070849i2c0a7790h2edbca3839044635@mail.gmail.com> References: <90174f6c0705070849i2c0a7790h2edbca3839044635@mail.gmail.com> Message-ID: Scott, That worked great! Thanks, Tim -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Scott Trudeau Sent: Monday, May 07, 2007 11:49 AM To: NYPHP Talk Subject: Re: [nycphp-talk] How to sort a multi-dimensional array by a given key? I'm sure there's probably a better way to do this, but uasort() sorts an array using a callback provided callback function for item comparisons -- which you can use to compare the specific key you want to sort by. It seems like there should be a more generic way to do this by providing the name of the key on which you want to sort. $franchises['SCID1'] = SCNYC $franchises['SCID1']['BusinessName'] = SuperCoups of NY City $franchises['SCID1']['DistanceFromCustomer'] = 20 $franchises['SCID2'] = SCBUFF $franchises['SCID2']['BusinessName'] = SuperCoups of Buffalo $franchises['SCID2']['DistanceFromCustomer'] = 10 uasort($franchises, "cmp_distance"); function cmp_distance($a, $b) { if($a['DistanceFromCustomer'] == $b['DistanceFromCustomer']) return 0; return ($a['DistanceFromCustomer'] < $b['DistanceFromCustomer']) ? -1 : 1; } On 5/7/07, Timothy Boyden wrote: > > > Hi All, > > I have a multi-dimensional array such as: > > $franchises['SCID1'] = SCNYC > $franchises['SCID1']['BusinessName'] = SuperCoups of NY City > $franchises['SCID1']['DistanceFromCustomer'] = 20 > > $franchises['SCID2'] = SCBUFF > $franchises['SCID2']['BusinessName'] = SuperCoups of Buffalo > $franchises['SCID2']['DistanceFromCustomer'] = 10 > > How can I sort this array so the businesses are sorted by the > DistanceFromCustomer key? > > Thanks for the help in advance, > > Tim > > > --------------------------- > Timothy Boyden > > Network Administrator > > tboyden at supercoups.com > > > > SuperCoups(r) > > > > 350 Revolutionary Drive | E. Taunton, MA 02718 > > 508-977-2034 | www.supercoups.com > > > > We Support Alex's Lemonade Stand Foundation, > > "Fighting Childhood Cancer One Cup At A Time" > > Donations Accepted at: www.firstgiving.com/SuperCoups > > --------------------------- > > Local Coupons. Super Savings.(r) > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ashaw at polymerdb.org Mon May 7 11:58:21 2007 From: ashaw at polymerdb.org (Allen Shaw) Date: Mon, 07 May 2007 10:58:21 -0500 Subject: [nycphp-talk] How to sort a multi-dimensional array by a given key? In-Reply-To: References: Message-ID: <463F4C9D.6000600@polymerdb.org> Hi Tim, array_multisort() should do the trick. See the manual (http://php.net/array_multisort) for some examples ("Example 256. Sorting database results") much like what you're describing. Essentially, you'll have to loop through the array to create another array something like: $sortDistance['SCID1']=>20 $sortDistance['SCID2']=>10 and then call: array_multisort($franchises, $sortDistance); - Allen Timothy Boyden wrote: > Hi All, > > I have a multi-dimensional array such as: > > $franchises['SCID1'] = SCNYC > $franchises['SCID1']['BusinessName'] = SuperCoups of NY City > $franchises['SCID1']['DistanceFromCustomer'] = 20 > $franchises['SCID2'] = SCBUFF > $franchises['SCID2']['BusinessName'] = SuperCoups of Buffalo > $franchises['SCID2']['DistanceFromCustomer'] = 10 > > How can I sort this array so the businesses are sorted by the > DistanceFromCustomer key? > > Thanks for the help in advance, > > Tim > > --------------------------- > > > Timothy Boyden > > /Network Administrator/ > > tboyden at supercoups.com > > *SuperCoups^? * > > ** > > 350 Revolutionary Drive | E. Taunton, MA 02718 > > 508-977-2034 | www.supercoups.com > > > > We Support Alex's Lemonade Stand Foundation, > > ?Fighting Childhood Cancer One Cup At A Time? > > Donations Accepted at: www.firstgiving.com/SuperCoups > > > --------------------------- > > Local Coupons. Super Savings.^? > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Allen Shaw Polymer (http://polymerdb.org) slidePresenter (http://slides.sourceforge.net) From tboyden at supercoups.com Mon May 7 12:41:34 2007 From: tboyden at supercoups.com (Timothy Boyden) Date: Mon, 7 May 2007 12:41:34 -0400 Subject: [nycphp-talk] How to sort a multi-dimensional array by a given key? In-Reply-To: <463F4C9D.6000600@polymerdb.org> References: <463F4C9D.6000600@polymerdb.org> Message-ID: Scott's solution worked for me, but is there any performance/security benefit from Allen's suggestion? -Tim -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Allen Shaw Sent: Monday, May 07, 2007 11:58 AM To: NYPHP Talk Subject: Re: [nycphp-talk] How to sort a multi-dimensional array by a given key? Hi Tim, array_multisort() should do the trick. See the manual (http://php.net/array_multisort) for some examples ("Example 256. Sorting database results") much like what you're describing. Essentially, you'll have to loop through the array to create another array something like: $sortDistance['SCID1']=>20 $sortDistance['SCID2']=>10 and then call: array_multisort($franchises, $sortDistance); - Allen Timothy Boyden wrote: > Hi All, > > I have a multi-dimensional array such as: > > $franchises['SCID1'] = SCNYC > $franchises['SCID1']['BusinessName'] = SuperCoups of NY City > $franchises['SCID1']['DistanceFromCustomer'] = 20 > $franchises['SCID2'] = SCBUFF > $franchises['SCID2']['BusinessName'] = SuperCoups of Buffalo > $franchises['SCID2']['DistanceFromCustomer'] = 10 > > How can I sort this array so the businesses are sorted by the > DistanceFromCustomer key? > > Thanks for the help in advance, > > Tim > > --------------------------- > > > Timothy Boyden > > /Network Administrator/ > > tboyden at supercoups.com > > *SuperCoups^(r) * > > ** > > 350 Revolutionary Drive | E. Taunton, MA 02718 > > 508-977-2034 | www.supercoups.com > > > > We Support Alex's Lemonade Stand Foundation, > > "Fighting Childhood Cancer One Cup At A Time" > > Donations Accepted at: www.firstgiving.com/SuperCoups > > > --------------------------- > > Local Coupons. Super Savings.^(r) > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Allen Shaw Polymer (http://polymerdb.org) slidePresenter (http://slides.sourceforge.net) _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ashaw at polymerdb.org Mon May 7 12:49:01 2007 From: ashaw at polymerdb.org (Allen Shaw) Date: Mon, 07 May 2007 11:49:01 -0500 Subject: [nycphp-talk] How to sort a multi-dimensional array by a given key? In-Reply-To: References: <463F4C9D.6000600@polymerdb.org> Message-ID: <463F587D.4030003@polymerdb.org> Wish I could answer that for you, Tim. I've always done it this way and hadn't thought of uasort() before Scott and Dan mentioned it. Hopefully they'll be able to comment on it, because I'm curious, too. - Allen Timothy Boyden wrote: > Scott's solution worked for me, but is there any performance/security > benefit from Allen's suggestion? > > -Tim > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Allen Shaw > Sent: Monday, May 07, 2007 11:58 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] How to sort a multi-dimensional array by a > given key? > > Hi Tim, > > array_multisort() should do the trick. See the manual > (http://php.net/array_multisort) for some examples ("Example 256. > Sorting database results") much like what you're describing. > > Essentially, you'll have to loop through the array to create another > array something like: > $sortDistance['SCID1']=>20 > $sortDistance['SCID2']=>10 > and then call: > array_multisort($franchises, $sortDistance); > > > > - Allen > > > Timothy Boyden wrote: > >>Hi All, >> >>I have a multi-dimensional array such as: >> >>$franchises['SCID1'] = SCNYC >>$franchises['SCID1']['BusinessName'] = SuperCoups of NY City >>$franchises['SCID1']['DistanceFromCustomer'] = 20 >>$franchises['SCID2'] = SCBUFF >>$franchises['SCID2']['BusinessName'] = SuperCoups of Buffalo >>$franchises['SCID2']['DistanceFromCustomer'] = 10 >> >>How can I sort this array so the businesses are sorted by the >>DistanceFromCustomer key? >> >>Thanks for the help in advance, >> >>Tim >> >>--------------------------- >> >> >> Timothy Boyden >> >>/Network Administrator/ >> >>tboyden at supercoups.com >> >>*SuperCoups^(r) * >> >>** >> >>350 Revolutionary Drive | E. Taunton, MA 02718 >> >>508-977-2034 | www.supercoups.com >> >> >> >>We Support Alex's Lemonade Stand Foundation, >> >>"Fighting Childhood Cancer One Cup At A Time" >> >>Donations Accepted at: www.firstgiving.com/SuperCoups >> >> >>--------------------------- >> >>Local Coupons. Super Savings.^(r) >> >> >> >> >> > > ------------------------------------------------------------------------ > >>_______________________________________________ >>New York PHP Community Talk Mailing List >>http://lists.nyphp.org/mailman/listinfo/talk >> >>NYPHPCon 2006 Presentations Online >>http://www.nyphpcon.com >> >>Show Your Participation in New York PHP >>http://www.nyphp.org/show_participation.php > > > -- Allen Shaw Polymer (http://polymerdb.org) slidePresenter (http://slides.sourceforge.net) From strudeau at umich.edu Mon May 7 13:48:36 2007 From: strudeau at umich.edu (Scott Trudeau) Date: Mon, 7 May 2007 13:48:36 -0400 Subject: [nycphp-talk] How to sort a multi-dimensional array by a given key? In-Reply-To: <463F587D.4030003@polymerdb.org> References: <463F4C9D.6000600@polymerdb.org> <463F587D.4030003@polymerdb.org> Message-ID: <90174f6c0705071048s6996c008ua4fcb5983fc250ab@mail.gmail.com> Dan's solution is slightly more compact and a bit easier to generalize if you're doing different kinds of sorts, but it's the same basic idea. Scott On 5/7/07, Allen Shaw wrote: > Wish I could answer that for you, Tim. I've always done it this way and > hadn't thought of uasort() before Scott and Dan mentioned it. Hopefully > they'll be able to comment on it, because I'm curious, too. > > - Allen > > Timothy Boyden wrote: > > Scott's solution worked for me, but is there any performance/security > > benefit from Allen's suggestion? > > > > -Tim > > > > -----Original Message----- > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > > On Behalf Of Allen Shaw > > Sent: Monday, May 07, 2007 11:58 AM > > To: NYPHP Talk > > Subject: Re: [nycphp-talk] How to sort a multi-dimensional array by a > > given key? > > > > Hi Tim, > > > > array_multisort() should do the trick. See the manual > > (http://php.net/array_multisort) for some examples ("Example 256. > > Sorting database results") much like what you're describing. > > > > Essentially, you'll have to loop through the array to create another > > array something like: > > $sortDistance['SCID1']=>20 > > $sortDistance['SCID2']=>10 > > and then call: > > array_multisort($franchises, $sortDistance); > > > > > > > > - Allen > > > > > > Timothy Boyden wrote: > > > >>Hi All, > >> > >>I have a multi-dimensional array such as: > >> > >>$franchises['SCID1'] = SCNYC > >>$franchises['SCID1']['BusinessName'] = SuperCoups of NY City > >>$franchises['SCID1']['DistanceFromCustomer'] = 20 > >>$franchises['SCID2'] = SCBUFF > >>$franchises['SCID2']['BusinessName'] = SuperCoups of Buffalo > >>$franchises['SCID2']['DistanceFromCustomer'] = 10 > >> > >>How can I sort this array so the businesses are sorted by the > >>DistanceFromCustomer key? > >> > >>Thanks for the help in advance, > >> > >>Tim > >> > >>--------------------------- > >> > >> > >> Timothy Boyden > >> > >>/Network Administrator/ > >> > >>tboyden at supercoups.com > >> > >>*SuperCoups^(r) * > >> > >>** > >> > >>350 Revolutionary Drive | E. Taunton, MA 02718 > >> > >>508-977-2034 | www.supercoups.com > >> > >> > >> > >>We Support Alex's Lemonade Stand Foundation, > >> > >>"Fighting Childhood Cancer One Cup At A Time" > >> > >>Donations Accepted at: www.firstgiving.com/SuperCoups > >> > >> > >>--------------------------- > >> > >>Local Coupons. Super Savings.^(r) > >> > >> > >> > >> > >> > > > > ------------------------------------------------------------------------ > > > >>_______________________________________________ > >>New York PHP Community Talk Mailing List > >>http://lists.nyphp.org/mailman/listinfo/talk > >> > >>NYPHPCon 2006 Presentations Online > >>http://www.nyphpcon.com > >> > >>Show Your Participation in New York PHP > >>http://www.nyphp.org/show_participation.php > > > > > > > > > -- > Allen Shaw > Polymer (http://polymerdb.org) > slidePresenter (http://slides.sourceforge.net) > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From ken at secdat.com Tue May 8 07:35:18 2007 From: ken at secdat.com (Kenneth Downs) Date: Tue, 08 May 2007 07:35:18 -0400 Subject: [nycphp-talk] [ANNOUNCE] Andromeda adopts YAML for spec files Message-ID: <46406076.3070009@secdat.com> The latest version of Andromeda now makes use of the YAML format for our database specification files, replacing a home-grown solution used in the past. The database specification file is the heart of an Andromeda application, as it contains a complete description not just of table structures, but of security, constraints, and automations. Adopting YAML gives us the advantage of using a format that people are already familiar with (and growing more so), plus the advantage of using a freely-available parser, and of course not having to maintain our own parser any more. The tutorials and Introduction on the website have been updated to reflect the new format. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From dorgan at optonline.net Wed May 9 10:37:07 2007 From: dorgan at optonline.net (Donald J Organ IV) Date: Wed, 09 May 2007 10:37:07 -0400 Subject: [nycphp-talk] IMAP_FETCHSTRUCTURE Message-ID: <4641DC93.9060202@optonline.net> Has anyone that has done with with imap_fetchstructure run into the problem where in the parameters array the object containing the name/value pair the value is being truncated.... In this instance I am seeing some emails that the attachment filenames are being truncated to the first letter so in stead of being "file-name.txt" it shows up as "f" Any help would be appreciated. From chsnyder at gmail.com Wed May 9 16:50:31 2007 From: chsnyder at gmail.com (csnyder) Date: Wed, 9 May 2007 23:50:31 +0300 Subject: [nycphp-talk] IMAP_FETCHSTRUCTURE In-Reply-To: <4641DC93.9060202@optonline.net> References: <4641DC93.9060202@optonline.net> Message-ID: On 5/9/07, Donald J Organ IV wrote: > In this instance I am seeing some emails that the attachment filenames > are being truncated to the first letter so in stead of being > "file-name.txt" it shows up as "f" > Any chance that it's not an array sometimes, but a string? From dorgan at optonline.net Wed May 9 17:28:34 2007 From: dorgan at optonline.net (Donald J Organ IV) Date: Wed, 09 May 2007 17:28:34 -0400 Subject: [nycphp-talk] IMAP_FETCHSTRUCTURE In-Reply-To: References: <4641DC93.9060202@optonline.net> Message-ID: <46423D02.7000704@optonline.net> Note in this instance. And just so everyone on the list who is reading this here is part of the print_r() of what is returned from imap_fetchstructure: [1] => stdClass Object ( [type] => 3 [encoding] => 3 [ifsubtype] => 1 [subtype] => POSTSCRIPT [ifdescription] => 0 [ifid] => 0 [bytes] => 395650 [ifdisposition] => 1 [disposition] => attachment [ifdparameters] => 1 [dparameters] => Array ( [0] => stdClass Object ( [attribute] => filename [value] => P ) ) [ifparameters] => 1 [parameters] => Array ( [0] => stdClass Object ( [attribute] => name [value] => P ) ) ) csnyder wrote: > On 5/9/07, Donald J. Organ IV wrote: > >> In this instance I am seeing some emails that the attachment filenames >> are being truncated to the first letter so in stead of being >> "file-name.txt" it shows up as "f" >> > > Any chance that it's not an array sometimes, but a string? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From ken at secdat.com Thu May 10 10:25:19 2007 From: ken at secdat.com (Kenneth Downs) Date: Thu, 10 May 2007 10:25:19 -0400 Subject: [nycphp-talk] IMAP_FETCHSTRUCTURE In-Reply-To: <4641DC93.9060202@optonline.net> References: <4641DC93.9060202@optonline.net> Message-ID: <46432B4F.8030502@secdat.com> Donald J Organ IV wrote: > Has anyone that has done with with imap_fetchstructure run into the > problem where in the parameters array the object containing the > name/value pair the value is being truncated.... > > In this instance I am seeing some emails that the attachment filenames > are being truncated to the first letter so in stead of being > "file-name.txt" it shows up as "f" > > Any help would be appreciated. I did have some success about a year ago with various PEAR email packages. There is one really nifty one that parses an entire email into its complete nested tree of text and attachments, a really cool Right Thing kind of package. It saved me from having to learn too much about the internals of emails. Don't know if you've tried that or if its relevant, but here's hoping it helps. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From dorgan at optonline.net Thu May 10 10:33:46 2007 From: dorgan at optonline.net (Donald J Organ IV) Date: Thu, 10 May 2007 10:33:46 -0400 Subject: [nycphp-talk] IMAP_FETCHSTRUCTURE In-Reply-To: <46432B4F.8030502@secdat.com> References: <4641DC93.9060202@optonline.net> <46432B4F.8030502@secdat.com> Message-ID: <46432D4A.7050200@optonline.net> i don think the pear packages would have much success in this instance as well, because i believe they rely on the imap functions as well and this is the imap_fetchstructure function that i am having the issue with. Kenneth Downs wrote: > Donald J Organ IV wrote: >> Has anyone that has done with with imap_fetchstructure run into the >> problem where in the parameters array the object containing the >> name/value pair the value is being truncated.... >> >> In this instance I am seeing some emails that the attachment >> filenames are being truncated to the first letter so in stead of >> being "file-name.txt" it shows up as "f" >> >> Any help would be appreciated. > > I did have some success about a year ago with various PEAR email > packages. There is one really nifty one that parses an entire email > into its complete nested tree of text and attachments, a really cool > Right Thing kind of package. It saved me from having to learn too > much about the internals of emails. > > Don't know if you've tried that or if its relevant, but here's hoping > it helps. > > >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > From dcech at phpwerx.net Thu May 10 10:47:55 2007 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 10 May 2007 10:47:55 -0400 Subject: [nycphp-talk] IMAP_FETCHSTRUCTURE In-Reply-To: <46432D4A.7050200@optonline.net> References: <4641DC93.9060202@optonline.net> <46432B4F.8030502@secdat.com> <46432D4A.7050200@optonline.net> Message-ID: <4643309B.3020506@phpwerx.net> Donald J Organ IV wrote: > i don think the pear packages would have much success in this instance > as well, because i believe they rely on the imap functions as well and > this is the imap_fetchstructure function that i am having the issue with. I have been using the PEAR Mail_mimeDecode class for a number of years now. In general it does a very good job, and doesn't use any imap_* functions. Dan From dorgan at optonline.net Thu May 10 12:58:38 2007 From: dorgan at optonline.net (Donald J Organ IV) Date: Thu, 10 May 2007 12:58:38 -0400 Subject: [nycphp-talk] IMAP_FETCHSTRUCTURE In-Reply-To: <4643309B.3020506@phpwerx.net> References: <4641DC93.9060202@optonline.net> <46432B4F.8030502@secdat.com> <46432D4A.7050200@optonline.net> <4643309B.3020506@phpwerx.net> Message-ID: <46434F3E.7060008@optonline.net> An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Thu May 10 13:18:56 2007 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 10 May 2007 13:18:56 -0400 Subject: [nycphp-talk] IMAP_FETCHSTRUCTURE In-Reply-To: <46434F3E.7060008@optonline.net> References: <4641DC93.9060202@optonline.net> <46432B4F.8030502@secdat.com> <46432D4A.7050200@optonline.net> <4643309B.3020506@phpwerx.net> <46434F3E.7060008@optonline.net> Message-ID: <46435400.3040501@phpwerx.net> Donald J Organ IV wrote: > Dan Cech wrote: >> Donald J Organ IV wrote: >>> i don think the pear packages would have much success in this instance >>> as well, because i believe they rely on the imap functions as well and >>> this is the imap_fetchstructure function that i am having the issue with. >> >> I have been using the PEAR Mail_mimeDecode class for a number of years >> now. In general it does a very good job, and doesn't use any imap_* >> functions. >> > I assume this will give me a list of the attachments, and there attachmentid if > any?? Yes, if you look at the pear.php.net site there is some documentation available. http://pear.php.net/manual/en/package.mail.mail-mimedecode.decode.php You can easily work with each element in a multipart email. PS it is good netiquette to post your response below the text you are responding to, as well as trimming excess cruft from the mail. http://linux.sgms-centre.com/misc/netiquette.php#toppost Dan From support at dailytechnology.net Thu May 10 15:17:28 2007 From: support at dailytechnology.net (Brian Dailey) Date: Thu, 10 May 2007 15:17:28 -0400 Subject: [nycphp-talk] CakePHP wins "Web 2.0" award Message-ID: <46436FC8.5020402@dailytechnology.net> I use this on a (semi-)daily basis, so I'm glad to see the CakePHP devs getting some more attention. I can't wait until the stable 1.2 release! http://www.seomoz.org/web2.0#cat_51 "Cake is a rapid development framework for PHP whose primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility." CakePHP got high marks in usefulness, usability, interface/design, and quality. -- Thanks! - Brian Dailey Software Developer New York, NY www.dailytechnology.net -------------- next part -------------- A non-text attachment was scrubbed... Name: support.vcf Type: text/x-vcard Size: 250 bytes Desc: not available URL: From jonbaer at jonbaer.com Thu May 10 15:24:00 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 10 May 2007 15:24:00 -0400 Subject: [nycphp-talk] CakePHP wins "Web 2.0" award In-Reply-To: <46436FC8.5020402@dailytechnology.net> References: <46436FC8.5020402@dailytechnology.net> Message-ID: <70F4BE87-26EB-41A5-B160-7C28F40D54A0@jonbaer.com> Congrats to Nate 2.0 and the whole team ... On May 10, 2007, at 3:17 PM, Brian Dailey wrote: > I use this on a (semi-)daily basis, so I'm glad to see the CakePHP > devs getting some more attention. I can't wait until the stable 1.2 > release! > > http://www.seomoz.org/web2.0#cat_51 > > "Cake is a rapid development framework for PHP whose primary goal > is to provide a structured framework that enables PHP users at all > levels to rapidly develop robust web applications, without any loss > to flexibility." > > CakePHP got high marks in usefulness, usability, interface/design, > and quality. From ken at secdat.com Thu May 10 15:27:55 2007 From: ken at secdat.com (Kenneth Downs) Date: Thu, 10 May 2007 15:27:55 -0400 Subject: [nycphp-talk] CakePHP wins "Web 2.0" award In-Reply-To: <46436FC8.5020402@dailytechnology.net> References: <46436FC8.5020402@dailytechnology.net> Message-ID: <4643723B.8060000@secdat.com> Congratulations to the team, it is well deserved. Brian Dailey wrote: > I use this on a (semi-)daily basis, so I'm glad to see the CakePHP > devs getting some more attention. I can't wait until the stable 1.2 > release! > > http://www.seomoz.org/web2.0#cat_51 > > "Cake is a rapid development framework for PHP whose primary goal is > to provide a structured framework that enables PHP users at all levels > to rapidly develop robust web applications, without any loss to > flexibility." > > CakePHP got high marks in usefulness, usability, interface/design, and > quality. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From dorgan at optonline.net Thu May 10 16:41:59 2007 From: dorgan at optonline.net (Donald J Organ IV) Date: Thu, 10 May 2007 16:41:59 -0400 Subject: [nycphp-talk] IMAP_FETCHSTRUCTURE In-Reply-To: <46435400.3040501@phpwerx.net> References: <4641DC93.9060202@optonline.net> <46432B4F.8030502@secdat.com> <46432D4A.7050200@optonline.net> <4643309B.3020506@phpwerx.net> <46434F3E.7060008@optonline.net> <46435400.3040501@phpwerx.net> Message-ID: <46438397.30503@optonline.net> > Yes, if you look at the pear.php.net site there is some documentation > available. > > http://pear.php.net/manual/en/package.mail.mail-mimedecode.decode.php > > You can easily work with each element in a multipart email. > Would you be willing to provide an example I am a little lost on how to get the message from the imap inbox to pass it to the decode function. From cmerlo at ncc.edu Thu May 10 19:47:35 2007 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Thu, 10 May 2007 19:47:35 -0400 Subject: [nycphp-talk] OT - Java Constants and Switch statements Message-ID: <946586480705101647p67ecebc3v6ba99b3f2e69923d@mail.gmail.com> Friends: Sorry for the OT post, but I'm grading a student's Java project and trying to be fair. If you know lots of things about Java's compiler, especially 1.4 and 1.5, and how it handles the switch statement, please contact me off-list. Thanks. -c -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Thu May 10 20:35:59 2007 From: ramons at gmx.net (David Krings) Date: Thu, 10 May 2007 20:35:59 -0400 Subject: [nycphp-talk] Checking 'mime type' of local file Message-ID: <4643BA6F.3020807@gmx.net> Hi! When one gets a file via upload information about the file is in $_FILE and with that also the MIME type (although one cannot rely on that). Is there anything like this that works on local files as well? In particular, I want to figure out if a file is really an image file and not just some junk file that happens to have a .jpg, .tif, etc file extension. I thought about going by the exif header, but some image files don't have that, but are still valid, web supported image files. Am I pushing my luck here? David From jonbaer at jonbaer.com Thu May 10 21:02:49 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 10 May 2007 21:02:49 -0400 Subject: [nycphp-talk] Checking 'mime type' of local file In-Reply-To: <4643BA6F.3020807@gmx.net> References: <4643BA6F.3020807@gmx.net> Message-ID: What you're really looking for the is the 'magic' of the bin file. http://en.wikipedia.org/wiki/Magic_number_%28programming%29 There is a PECL extension for diving into libmagic ... http://pecl.php.net/package/Fileinfo - Jon On May 10, 2007, at 8:35 PM, David Krings wrote: > Hi! > > When one gets a file via upload information about the file is in > $_FILE and with that also the MIME type (although one cannot rely > on that). > > Is there anything like this that works on local files as well? In > particular, I want to figure out if a file is really an image file > and not just some junk file that happens to have a .jpg, .tif, etc > file extension. > I thought about going by the exif header, but some image files > don't have that, but are still valid, web supported image files. > > Am I pushing my luck here? > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From paul at devonianfarm.com Thu May 10 21:31:28 2007 From: paul at devonianfarm.com (Paul Houle) Date: Thu, 10 May 2007 21:31:28 -0400 Subject: [nycphp-talk] Any alternatives to mbstring for PHP+UTF-8? In-Reply-To: <463A004B.5040303@gmail.com> References: <463A004B.5040303@gmail.com> Message-ID: <4643C770.9010403@devonianfarm.com> Jakob Buchgraber wrote: > Hey! > > I was wondering whether there are alternatives to mbstring for > handling UTF-8 encoded data with PHP? > I am asking, because I'd like to play around with as many > "technologies" as possible before I actually start developing. > I somehow also looked at the way Joomla! did it, but I don't really > like their solution. > Sometimes you can process UTF-8 without doing anything special. For instance, if you want to pull some text out of a MySQL database and display it on a web page, you can pass the UTF-8 text through without using mbstring in PHP: the one thing you need to do is set the character encoding of the HTML document to UTF-8. A big strength of UTF-8 is that UTF-8 is compatible with US-ASCII; all US-ASCII characters are the same in UTF-8. This means that you can explode on ",", "\t", "\n" or a space just like you always do. Any regex on Unicode 'characters' can be translated to a regex that works on UTF-8 bytes. This may be awkwards sometimes, but it can be an efficient way to do many operations, including those that "get under the hood" of your language. Avoid unnecessary character conversions. If you can take UTF-8 in, process it as UTF-8, and output UTF-8, that's really the best. People who work with languages like Java, that do character conversions for you, often find they're not in control of their character conversions. Years ago I discovered that the contents of a postgres database were double-encoded... The bytes that made up the first UTF-8 encoding were treated as iso-latin-1 characters, and re-encoded in Unicode... If you're working with Unicode, you'll probably need to deal with problems like this from time to time. The main weakness of UTF-8 is that it's a variable-length encoding. That means it's hard to pick out the N'th character of a string. mbstring has a function that lets you do this, but be careful how you use it. Getting the N'th character of a UTF-8 string is an O(N) operation, and iterating over the whole string is O(N^2)... Ouch. Efficient algorithms for UTF-8 tend to work sequentially -- and quite a few of them can be translated to string algorithms over the bytes. There's no substitute for understanding how Unicode and UTF-8 and related representations work -- if you work with it enough, you'll see all kinds of malformed text and you'll need to be able to deal with it. From ramons at gmx.net Thu May 10 22:00:44 2007 From: ramons at gmx.net (David Krings) Date: Thu, 10 May 2007 22:00:44 -0400 Subject: [nycphp-talk] Checking 'mime type' of local file In-Reply-To: References: <4643BA6F.3020807@gmx.net> Message-ID: <4643CE4C.60804@gmx.net> Jon Baer wrote: > What you're really looking for the is the 'magic' of the bin file. > > http://en.wikipedia.org/wiki/Magic_number_%28programming%29 > > There is a PECL extension for diving into libmagic ... > > http://pecl.php.net/package/Fileinfo > > - Jon > Thank you very much! I give that a try. Amazing what you know... David From dorgan at optonline.net Fri May 11 10:59:59 2007 From: dorgan at optonline.net (Donald J Organ IV) Date: Fri, 11 May 2007 10:59:59 -0400 Subject: [nycphp-talk] JSON Message-ID: <464484EF.4080409@optonline.net> ANyone had any experiences with large datasets and JSON, seems the email interface i am writing is starting to choke with the data that is coming into it. Any help would be greatly appreciated. Thanks From jonbaer at jonbaer.com Fri May 11 11:15:56 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 11 May 2007 11:15:56 -0400 Subject: [nycphp-talk] JSON In-Reply-To: <464484EF.4080409@optonline.net> References: <464484EF.4080409@optonline.net> Message-ID: <45CBA213-B45B-4B6E-B9DF-663204A67C55@jonbaer.com> How large? Im using a YUI datatable w/ JSON @ 250k and no issues so far. I think anything over it Im going to have to page the data. The library does this automagically which is great, the very bad side is that its currently "beta" ... what library are you using? - Jon On May 11, 2007, at 10:59 AM, Donald J Organ IV wrote: > ANyone had any experiences with large datasets and JSON, seems the > email interface i am writing is starting to choke with the data > that is coming into it. > > Any help would be greatly appreciated. > > Thanks > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From dorgan at optonline.net Fri May 11 11:21:19 2007 From: dorgan at optonline.net (Donald J Organ IV) Date: Fri, 11 May 2007 11:21:19 -0400 Subject: [nycphp-talk] JSON In-Reply-To: <45CBA213-B45B-4B6E-B9DF-663204A67C55@jonbaer.com> References: <464484EF.4080409@optonline.net> <45CBA213-B45B-4B6E-B9DF-663204A67C55@jonbaer.com> Message-ID: <464489EF.2030401@optonline.net> What do you mean which library am I using....I am using php to convert a multidimensional array into JSON then using the eval statement in javascript on it. Jon Baer wrote: > How large? Im using a YUI datatable w/ JSON @ 250k and no issues so > far. I think anything over it Im going to have to page the data. The > library does this automagically which is great, the very bad side is > that its currently "beta" ... what library are you using? > > - Jon > > On May 11, 2007, at 10:59 AM, Donald J Organ IV wrote: > >> ANyone had any experiences with large datasets and JSON, seems the >> email interface i am writing is starting to choke with the data that >> is coming into it. >> >> Any help would be greatly appreciated. >> >> Thanks >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From chsnyder at gmail.com Fri May 11 11:39:33 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 11 May 2007 11:39:33 -0400 Subject: [nycphp-talk] Checking 'mime type' of local file In-Reply-To: References: <4643BA6F.3020807@gmx.net> Message-ID: On 5/10/07, Jon Baer wrote: > What you're really looking for the is the 'magic' of the bin file. > > http://en.wikipedia.org/wiki/Magic_number_%28programming%29 > > There is a PECL extension for diving into libmagic ... > > http://pecl.php.net/package/Fileinfo > In the past, I've made use of the unix file command for this. csnyder$ file -bi Desktop/DSC01060.jpg image/jpeg Command above uses -b for brief, and -i to get the mimetype of the file. -- Chris Snyder http://chxo.com/ From jonbaer at jonbaer.com Fri May 11 12:09:00 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 11 May 2007 12:09:00 -0400 Subject: [nycphp-talk] Checking 'mime type' of local file In-Reply-To: References: <4643BA6F.3020807@gmx.net> Message-ID: <9C786B11-2AE5-451E-A109-0BF04D24A43C@jonbaer.com> The interesting part is the magic db which file does use ... G5:~ jonbaer$ egrep "jpeg|png|gif" /usr/share/file/magic.mime 0 string GIF image/gif 0 beshort 0xffd8 image/jpeg 0 string \x89PNG image/png G5:/~ jonbaer$ Also it has been recently updated (if you want to update your mime_magic.magicfile directive) ... ftp://ftp.astron.com/pub/file/ - Jon On May 11, 2007, at 11:39 AM, csnyder wrote: > On 5/10/07, Jon Baer wrote: >> What you're really looking for the is the 'magic' of the bin file. >> >> http://en.wikipedia.org/wiki/Magic_number_%28programming%29 >> >> There is a PECL extension for diving into libmagic ... >> >> http://pecl.php.net/package/Fileinfo >> > > In the past, I've made use of the unix file command for this. > > csnyder$ file -bi Desktop/DSC01060.jpg > image/jpeg > > Command above uses -b for brief, and -i to get the mimetype of the > file. > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From codebowl at gmail.com Fri May 11 13:56:42 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 11 May 2007 13:56:42 -0400 Subject: [nycphp-talk] Database Design Patterns Message-ID: <8d9a42800705111056j7c479dd4y750f33df9ff166d2@mail.gmail.com> Guys, We are using CodeIgniter for our framework that will run our sites, however the database implementation that they offer is based on the Active Record pattern. I have been running into issues that are making me think this is not the pattern for us to use. I have been going through the php|arch guide to php design patterns and I believe that we would be better off with the Data Mapper Pattern. All of these patterns bring up a concern with me though. They are stating that each class should be related to one table. We have things setup like this. Tables Content JobPostings Articles Reviews etc. Each of the tables have an entry in the Content table since they all share Content in common. Currently we have the Active Record pattern and our models extend a base Content model. So for example our job postings would be like this http://jobs.ere.net/job/3431/ It will call the JobPostings model with the $this->jobs->load(3431); which will load the job info, which then in turn calls parent:load(3431); which will load the content for that particular job. I could do this in one join query and there are other times where it would make more sense such as when grabbing multiple locations for a JobPosting, etc. My question is how can you join tables and still stick to the patterns that I am reading about? Does joining tables completely bypass the reason for using these patterns? I am not asking how to do a join, i know how to do that ;) I just would like some insight on the best practice when it comes to using these patterns. Any insight would be greatly appreciated. -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com From jonbaer at jonbaer.com Fri May 11 14:31:39 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 11 May 2007 14:31:39 -0400 Subject: [nycphp-talk] JSON In-Reply-To: <464489EF.2030401@optonline.net> References: <464484EF.4080409@optonline.net> <45CBA213-B45B-4B6E-B9DF-663204A67C55@jonbaer.com> <464489EF.2030401@optonline.net> Message-ID: <955D5FC1-D939-4722-8FBC-7D4E849FA7B4@jonbaer.com> Ahh I thought you were maybe fiddling w/ the data via a framework, anyway how much JSON data are you loading? I wish there was a page containing an updated version of this benchmark: http://www.jamesward.org/wordpress/2007/04/30/ajax-and-flex-data- loading-benchmarks/ 5000+ rows. - Jon On May 11, 2007, at 11:21 AM, Donald J Organ IV wrote: > What do you mean which library am I using....I am using php to > convert a multidimensional array into JSON then using the eval > statement in javascript on it. From jonbaer at jonbaer.com Fri May 11 14:45:23 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 11 May 2007 14:45:23 -0400 Subject: [nycphp-talk] Database Design Patterns In-Reply-To: <8d9a42800705111056j7c479dd4y750f33df9ff166d2@mail.gmail.com> References: <8d9a42800705111056j7c479dd4y750f33df9ff166d2@mail.gmail.com> Message-ID: The key you are missing is the idea of a "hasMany", "hasOne", "hasAndBelongsToMany", "belongsTo", and the other conventions. With that many of the joins are automagically created for you and you generally dont need to worry about your bindings are they will happen unless you tell them not to. I think its about more to using ActiveRecord than just that record itself, its about how the row is encapsulating other logic which saves you time and work from figuring out. I just browsed through the CI docs @ http://www.codeigniter.com/ user_guide/database/active_record.html and (no offense) have to say that I really can't see what you get out of it, even the chaining part ... $this->db->select('title')->from('mytable')->where('id', $id)->limit (10, 20); (ehh looks like straight SQL to me ;-) So it looks like you would have to join and do all the work vs. say Cake where you would stick w/ a convention and have it all wrapped up for you. (BTW, anyone correct me if Im wrong since I too am trying to explore what the pros/cons of other frameworks are). - Jon On May 11, 2007, at 1:56 PM, Joseph Crawford wrote: > Guys, > > We are using CodeIgniter for our framework that will run our sites, > however the database implementation that they offer is based on the > Active Record pattern. I have been running into issues that are > making me think this is not the pattern for us to use. > > I have been going through the php|arch guide to php design patterns > and I believe that we would be better off with the Data Mapper > Pattern. > > All of these patterns bring up a concern with me though. They are > stating that each class should be related to one table. We have > things setup like this. > > Tables > Content > JobPostings > Articles > Reviews > > etc. Each of the tables have an entry in the Content table since they > all share Content in common. Currently we have the Active Record > pattern and our models extend a base Content model. > > So for example our job postings would be like this > > http://jobs.ere.net/job/3431/ > > It will call the JobPostings model with the $this->jobs->load(3431); > which will load the job info, which then in turn calls > parent:load(3431); which will load the content for that particular > job. I could do this in one join query and there are other times > where it would make more sense such as when grabbing multiple > locations for a JobPosting, etc. > > My question is how can you join tables and still stick to the patterns > that I am reading about? Does joining tables completely bypass the > reason for using these patterns? > > I am not asking how to do a join, i know how to do that ;) I just > would like some insight on the best practice when it comes to using > these patterns. > > Any insight would be greatly appreciated. > > -- > Joseph Crawford Jr. > Zend Certified Engineer > Codebowl Solutions, Inc. > http://www.codebowl.com/ > Blog: http://www.josephcrawford.com/ > 1-802-671-2021 > codebowl at gmail.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From codebowl at gmail.com Fri May 11 15:11:54 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 11 May 2007 15:11:54 -0400 Subject: [nycphp-talk] Database Design Patterns In-Reply-To: References: <8d9a42800705111056j7c479dd4y750f33df9ff166d2@mail.gmail.com> Message-ID: <8d9a42800705111211v231e0877qd97f78c70ccce28d@mail.gmail.com> Jon, I was aware that the CI active record pattern is not the best implementation and if we were to go with a true active record i would roll my own and integrate it into CI in one way or another. I am just not sure what the benefits are for this as I read documentation i do not see how the joins are done for you as you put it. -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com From jonbaer at jonbaer.com Fri May 11 15:43:18 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 11 May 2007 15:43:18 -0400 Subject: [nycphp-talk] Database Design Patterns In-Reply-To: <8d9a42800705111211v231e0877qd97f78c70ccce28d@mail.gmail.com> References: <8d9a42800705111056j7c479dd4y750f33df9ff166d2@mail.gmail.com> <8d9a42800705111211v231e0877qd97f78c70ccce28d@mail.gmail.com> Message-ID: <7F125A4D-591B-419B-B500-5B4E99EE97E8@jonbaer.com> Im biased and was talking specifically re: CakePHP AR HBTM implementation ... http://manual.cakephp.org/chapter/models Your simple join would be as simple as: class A extends AppModel { $var hasMany = array("B"); } class B extends AppModel { $var belongsTo = array("A"); } $a = $this->A->findById($id); $a['B']['field']; (provided you have a b_id in table A) This would be the core idea you would have to wrap a CI library around from what I can tell. But like I said Id too would be interested to know if the facility already exists in CI. - Jon On May 11, 2007, at 3:11 PM, Joseph Crawford wrote: > Jon, > > I was aware that the CI active record pattern is not the best > implementation and if we were to go with a true active record i would > roll my own and integrate it into CI in one way or another. > > I am just not sure what the benefits are for this as I read > documentation i do not see how the joins are done for you as you put > it. From codebowl at gmail.com Fri May 11 16:56:42 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 11 May 2007 16:56:42 -0400 Subject: [nycphp-talk] Database Design Patterns In-Reply-To: <7F125A4D-591B-419B-B500-5B4E99EE97E8@jonbaer.com> References: <8d9a42800705111056j7c479dd4y750f33df9ff166d2@mail.gmail.com> <8d9a42800705111211v231e0877qd97f78c70ccce28d@mail.gmail.com> <7F125A4D-591B-419B-B500-5B4E99EE97E8@jonbaer.com> Message-ID: <8d9a42800705111356r65810cb1w4a6580217c50df9@mail.gmail.com> Jon, AFAIK CI does not have this ability, that's the issue with CI is that it is maintained by 1 person and not a community project. -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken at secdat.com Mon May 14 09:40:10 2007 From: ken at secdat.com (Kenneth Downs) Date: Mon, 14 May 2007 09:40:10 -0400 Subject: [nycphp-talk] [ANNOUNCE] Andromeda Database Reference now online Message-ID: <464866BA.5010004@secdat.com> The Andromeda main site now includes a complete reference to our database description format, listing all of the options available to build a database. These include the obvious columns, table, and indexes, as well as Andromeda extensions like automations, and our cascading security assignments. http://www.andromeda-project.org/pages/cms/Database+Reference. This is equivalent to a function reference or API reference. It details all of the options available when writing out a database specification. The publishing of the reference, following up the Introductions and Tutorials, finishes up the first pass of documentation about the database abilities of Andromeda. Focus will now shift to making equivalently simple data-driven zero code interfaces that are aware of the data dictionary and make use of it. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From jakob.buchgraber at googlemail.com Mon May 14 13:24:34 2007 From: jakob.buchgraber at googlemail.com (Jakob Buchgraber) Date: Mon, 14 May 2007 19:24:34 +0200 Subject: [nycphp-talk] Test HTTP Headers with PHPUnit Message-ID: <46489B52.30709@gmail.com> Hey! I was wondering whether it is possible to test with PHPUnit if a HTTP header was sent. It is definitely possible with PHP if run by a webserver. e.g. However I am running my Unit Tests via PHP CLI, so HTTP Headers aren't sent and therefore headers_list () returns an empty array. So is there anyway to test if the header function was called with a specific value from PHP CLI? PS: I'm currently testing with Exceptions, so if HttpResponse::trigger404 () throws an Exception the header couldn't be sent otherwise it was sent, but I don't really like this solution. Cheers, Jay From support at dailytechnology.net Tue May 15 10:45:19 2007 From: support at dailytechnology.net (Brian Dailey) Date: Tue, 15 May 2007 10:45:19 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... Message-ID: <4649C77F.4050009@dailytechnology.net> I have several large forms that I am putting together. I'm aiming to keep them flexible and make it fit within the database object schema that I have used so far in this particular program. In the past with a large form I've seen some developers resort to tables with a multitude of columns... I thought that this was a kludgy solution and I'd like to avoid it if possible. Another way I've seen it handled is to have a header table and a detail table that works something like this: table: documents (id, date, etc) table: documentdetails (documentid, fieldname, fieldvalue) All of the form values were stored in a fieldname=fieldvalue format inside the table. This worked nicely until you attempted to run reports on it - you couldn't easily combine data since it all existed in different table rows. So, I humbly come before thee, o PHP gurus, and ask you, how would you advise approaching this? Are there other ways to handle huge forms? I have seen people serialize arrays and store them in a column, but I can't see that working well when creating reports. I've googled and read around as much as I can on this one, but what I need is some advice from some more experienced developers. Opinions? -- Thanks! - Brian Dailey Software Developer New York, NY www.dailytechnology.net -------------- next part -------------- A non-text attachment was scrubbed... Name: support.vcf Type: text/x-vcard Size: 264 bytes Desc: not available URL: From jonbaer at jonbaer.com Tue May 15 11:38:18 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 15 May 2007 11:38:18 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <4649C77F.4050009@dailytechnology.net> References: <4649C77F.4050009@dailytechnology.net> Message-ID: <6CDB87B1-0D3D-4DC4-9AFB-C7B7EF1E9F34@jonbaer.com> So here has been my latest approach (or idea) ... Since *normally* your main objective is to reach a result page (view) of data, (either from a report or just a general link compiled from criteria), I normally include @ least one column of YAML-based data (a misc field of sorts). Obviously this is based on what your doing but its a general idea. Then from that data and any other indexed columns on your schema build an index using Zend Framework / Ferret / Lucene and interface the YAML w/ that data. I normally take this approach when Ive labelled a situation "client can't figure out what data he really wants yet". I think you have to think outside the box and have knowledge or querying the index ... http://framework.zend.com/manual/en/zend.search.query-api.html But once you apply behaviors to objects (and ultimately forms) like "this object is searchable via x, y, and z" it makes managing it easier. My opinion on the idea of microsearching your data and being flexible. - Jon On May 15, 2007, at 10:45 AM, Brian Dailey wrote: > > I have several large forms that I am putting together. I'm aiming > to keep them flexible and make it fit within the database object > schema that I have used so far in this particular program. > > In the past with a large form I've seen some developers resort to > tables with a multitude of columns... I thought that this was a > kludgy solution and I'd like to avoid it if possible. Another way > I've seen it handled is to have a header table and a detail table > that works something like this: > > table: documents (id, date, etc) > table: documentdetails (documentid, fieldname, fieldvalue) > > All of the form values were stored in a fieldname=fieldvalue format > inside the table. This worked nicely until you attempted to run > reports on it - you couldn't easily combine data since it all > existed in different table rows. > > So, I humbly come before thee, o PHP gurus, and ask you, how would > you advise approaching this? Are there other ways to handle huge > forms? I have seen people serialize arrays and store them in a > column, but I can't see that working well when creating reports. > > I've googled and read around as much as I can on this one, but what > I need is some advice from some more experienced developers. Opinions? > > -- > > Thanks! > - Brian Dailey > Software Developer > New York, NY > www.dailytechnology.net > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From support at dailytechnology.net Tue May 15 12:12:03 2007 From: support at dailytechnology.net (Brian Dailey) Date: Tue, 15 May 2007 12:12:03 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <6CDB87B1-0D3D-4DC4-9AFB-C7B7EF1E9F34@jonbaer.com> References: <4649C77F.4050009@dailytechnology.net> <6CDB87B1-0D3D-4DC4-9AFB-C7B7EF1E9F34@jonbaer.com> Message-ID: <4649DBD3.90801@dailytechnology.net> I wonder what kind of a speed hit you would take in using this technique. I've always thought that indexing a huge column would be a bad idea. Still, I supposed you could store the "reportable" information in a seperate column and filter out the extra stuff that, while appearing in the report, isn't necessarily needed for searches. I'm not using any PHP framework for this particular application (woe is me), so I can't use Zends tools necessarily, but I will look more into their approach and see if I can garner any useful techniques from it. Thanks for your input! - Brian Jon Baer wrote: > So here has been my latest approach (or idea) ... > > Since *normally* your main objective is to reach a result page (view) of > data, (either from a report or just a general link compiled from > criteria), I normally include @ least one column of YAML-based data (a > misc field of sorts). Obviously this is based on what your doing but > its a general idea. > > Then from that data and any other indexed columns on your schema build > an index using Zend Framework / Ferret / Lucene and interface the YAML > w/ that data. > > I normally take this approach when Ive labelled a situation "client > can't figure out what data he really wants yet". > > I think you have to think outside the box and have knowledge or querying > the index ... > http://framework.zend.com/manual/en/zend.search.query-api.html > > But once you apply behaviors to objects (and ultimately forms) like > "this object is searchable via x, y, and z" it makes managing it easier. > > My opinion on the idea of microsearching your data and being flexible. > > - Jon > > On May 15, 2007, at 10:45 AM, Brian Dailey wrote: > >> >> I have several large forms that I am putting together. I'm aiming to >> keep them flexible and make it fit within the database object schema >> that I have used so far in this particular program. >> >> In the past with a large form I've seen some developers resort to >> tables with a multitude of columns... I thought that this was a kludgy >> solution and I'd like to avoid it if possible. Another way I've seen >> it handled is to have a header table and a detail table that works >> something like this: >> >> table: documents (id, date, etc) >> table: documentdetails (documentid, fieldname, fieldvalue) >> >> All of the form values were stored in a fieldname=fieldvalue format >> inside the table. This worked nicely until you attempted to run >> reports on it - you couldn't easily combine data since it all existed >> in different table rows. >> >> So, I humbly come before thee, o PHP gurus, and ask you, how would you >> advise approaching this? Are there other ways to handle huge forms? I >> have seen people serialize arrays and store them in a column, but I >> can't see that working well when creating reports. >> >> I've googled and read around as much as I can on this one, but what I >> need is some advice from some more experienced developers. Opinions? >> >> -- >> >> Thanks! >> - Brian Dailey >> Software Developer >> New York, NY >> www.dailytechnology.net >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > -- Thanks! - Brian Dailey Software Developer New York, NY www.dailytechnology.net -------------- next part -------------- A non-text attachment was scrubbed... Name: support.vcf Type: text/x-vcard Size: 264 bytes Desc: not available URL: From lists at enobrev.com Tue May 15 13:31:13 2007 From: lists at enobrev.com (Mark Armendariz) Date: Tue, 15 May 2007 13:31:13 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <4649C77F.4050009@dailytechnology.net> References: <4649C77F.4050009@dailytechnology.net> Message-ID: <001401c79716$d6d868d0$6400a8c0@enobrev> > -----Original Message----- > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Brian Dailey > Sent: Tuesday, May 15, 2007 10:45 AM > Another way I've seen it handled is to have a > header table and a detail table that works something like this: > > table: documents (id, date, etc) > table: documentdetails (documentid, fieldname, fieldvalue) > > All of the form values were stored in a fieldname=fieldvalue > format inside the table. This worked nicely until you > attempted to run reports on it - you couldn't easily combine > data since it all existed in different table rows. Reports aren't too difficult. It depends on how in-depth your reports get. Essentially you end up joining the data table for every field. I haven't done this in quite some time, but here's the idea of how you run reports when using field-value tables (tested in mysql 4.0.23) CREATE TABLE data ( data_id TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data_user VARCHAR(100) ) CREATE TABLE data_fields ( field_id MEDIUMINT(6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data_id TINYINT(3) UNSIGNED NOT NULL, field_name VARCHAR(20), field_data VARCHAR(100) ) INSERT INTO data (data_user) VALUES ('mark at example.com'); INSERT INTO data (data_user) VALUES ('brian at example.com'); INSERT INTO data (data_user) VALUES ('steve at example.com'); INSERT INTO data_fields (data_id, field_name, field_data) VALUES (1, 'name', 'Mark'); INSERT INTO data_fields (data_id, field_name, field_data) VALUES (1, 'city', 'Brooklyn'); INSERT INTO data_fields (data_id, field_name, field_data) VALUES (1, 'state', 'NY'); INSERT INTO data_fields (data_id, field_name, field_data) VALUES (2, 'name', 'Brian'); INSERT INTO data_fields (data_id, field_name, field_data) VALUES (2, 'city', 'New York'); INSERT INTO data_fields (data_id, field_name, field_data) VALUES (2, 'state', 'NY'); INSERT INTO data_fields (data_id, field_name, field_data) VALUES (3, 'name', 'Steve'); INSERT INTO data_fields (data_id, field_name, field_data) VALUES (3, 'city', 'Jersey City'); INSERT INTO data_fields (data_id, field_name, field_data) VALUES (3, 'state', 'NJ'); // All data with Name, City and State SELECT d.data_id, d.data_user, fName.field_data AS Name, fCity.field_data AS City, fState.field_data AS State FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND fName.field_name = 'name' LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND fCity.field_name = 'city' LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND fState.field_name = 'state'; // output +---------+-------------------+-------+-------------+-------+ | data_id | data_user | Name | City | State | +---------+-------------------+-------+-------------+-------+ | 1 | mark at example.com | Mark | Brooklyn | NY | | 2 | brian at example.com | Brian | New York | NY | | 3 | steve at example.com | Steve | Jersey City | NJ | +---------+-------------------+-------+-------------+-------+ // data with Name, City, State in NY SELECT d.data_id, d.data_user, fName.field_data AS Name, fCity.field_data AS City, fState.field_data AS State FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND fName.field_name = 'name' LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND fCity.field_name = 'city' LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND fState.field_name = 'state'; HAVING(State = 'NY'); // output +---------+-------------------+-------+----------+-------+ | data_id | data_user | Name | City | State | +---------+-------------------+-------+----------+-------+ | 1 | mark at example.com | Mark | Brooklyn | NY | | 2 | brian at example.com | Brian | New York | NY | +---------+-------------------+-------+----------+-------+ // data with Name, City, State in Brooklyn SELECT d.data_id, d.data_user, fName.field_data AS Name, fCity.field_data AS City, fState.field_data AS State FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND fName.field_name = 'name' LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND fCity.field_name = 'city' LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND fState.field_name = 'state'; HAVING(City = 'Brooklyn'); // output +---------+------------------+------+----------+-------+ | data_id | data_user | Name | City | State | +---------+------------------+------+----------+-------+ | 1 | mark at example.com | Mark | Brooklyn | NY | +---------+------------------+------+----------+-------+ // using WHERE instead of HAVING SELECT d.data_id, d.data_user, fName.field_data AS Name, fCity.field_data AS City, fState.field_data AS State FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND fName.field_name = 'name' LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND fCity.field_name = 'city' LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND fState.field_name = 'state'; WHERE fCity.field_data = 'Brooklyn' AND fState.field_data = 'NY'; // output +---------+------------------+------+----------+-------+ | data_id | data_user | Name | City | State | +---------+------------------+------+----------+-------+ | 1 | mark at example.com | Mark | Brooklyn | NY | +---------+------------------+------+----------+-------+ // EXPLAIN output of the last statement ('having' is a bit less efficient) +--------+--------+---------------+------------+---------+---------------+-- ----+-------------+ | table | type | possible_keys | key | key_len | ref | rows | Extra | +--------+--------+---------------+------------+---------+---------------+-- ----+-------------+ | fCity | ref | field_name | field_name | 120 | const,const | 1 | Using where | | d | eq_ref | PRIMARY | PRIMARY | 1 | fCity.data_id | 1 | | | fName | ref | field_name | field_name | 20 | const | 2 | Using where | | fState | ref | field_name | field_name | 120 | const,const | 2 | Using where | +--------+--------+---------------+------------+---------+---------------+-- ----+-------------+ Hope that helps. Good luck!! Mark Armendariz From chsnyder at gmail.com Tue May 15 14:01:07 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 15 May 2007 14:01:07 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <6CDB87B1-0D3D-4DC4-9AFB-C7B7EF1E9F34@jonbaer.com> References: <4649C77F.4050009@dailytechnology.net> <6CDB87B1-0D3D-4DC4-9AFB-C7B7EF1E9F34@jonbaer.com> Message-ID: On 5/15/07, Jon Baer wrote: > I normally include @ least one column of YAML-based data > (a misc field of sorts). At first I thought this would work with a MySQL FULLTEXT index, but of course it won't because the field names would be in more than 50% of the records and would therefore be considered stopwords. Nifty as this is, then, it only works if all querying is handled by your application or an application using a platform that includes its own sufficiently reliable search index. Clients who want/need to create their own SQL queries are out of luck, or forced to use LIKE expressions. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Tue May 15 14:06:13 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 15 May 2007 14:06:13 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <001401c79716$d6d868d0$6400a8c0@enobrev> References: <4649C77F.4050009@dailytechnology.net> <001401c79716$d6d868d0$6400a8c0@enobrev> Message-ID: On 5/15/07, Mark Armendariz wrote: > CREATE TABLE data_fields ( > field_id MEDIUMINT(6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, > data_id TINYINT(3) UNSIGNED NOT NULL, > field_name VARCHAR(20), > field_data VARCHAR(100) > ) Did you ever worry about record integrity problems? What if a data record is missing some field values? Or has more than one value stored for some field name? I was glad to see Brian asking about this topic, because it's been sitting in the back of my head for a while now. -- Chris Snyder http://chxo.com/ From support at dailytechnology.net Tue May 15 14:10:27 2007 From: support at dailytechnology.net (Brian Dailey) Date: Tue, 15 May 2007 14:10:27 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <001401c79716$d6d868d0$6400a8c0@enobrev> References: <4649C77F.4050009@dailytechnology.net> <001401c79716$d6d868d0$6400a8c0@enobrev> Message-ID: <4649F793.2070200@dailytechnology.net> This looks like what I'll ultimately be doing. I played around with some SQL queries and what I ended up with was similar to this - joining the table for each data value that I wanted to look up (and since I expect a matching data value, I don't even have to LEFT JOIN everything, which speeds it up significantly). Thanks for all of your help and suggestions! Mark Armendariz wrote: > > -----Original Message----- >> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Brian Dailey >> Sent: Tuesday, May 15, 2007 10:45 AM >> Another way I've seen it handled is to have a >> header table and a detail table that works something like this: >> >> table: documents (id, date, etc) >> table: documentdetails (documentid, fieldname, fieldvalue) >> >> All of the form values were stored in a fieldname=fieldvalue >> format inside the table. This worked nicely until you >> attempted to run reports on it - you couldn't easily combine >> data since it all existed in different table rows. > > Reports aren't too difficult. It depends on how in-depth your reports get. > Essentially you end up joining the data table for every field. I haven't > done this in quite some time, but here's the idea of how you run reports > when using field-value tables (tested in mysql 4.0.23) > > CREATE TABLE data ( > data_id TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, > data_user VARCHAR(100) > ) > > CREATE TABLE data_fields ( > field_id MEDIUMINT(6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, > data_id TINYINT(3) UNSIGNED NOT NULL, > field_name VARCHAR(20), > field_data VARCHAR(100) > ) > > > INSERT INTO data (data_user) VALUES ('mark at example.com'); > INSERT INTO data (data_user) VALUES ('brian at example.com'); > INSERT INTO data (data_user) VALUES ('steve at example.com'); > > INSERT INTO data_fields (data_id, field_name, field_data) VALUES (1, 'name', > 'Mark'); > INSERT INTO data_fields (data_id, field_name, field_data) VALUES (1, 'city', > 'Brooklyn'); > INSERT INTO data_fields (data_id, field_name, field_data) VALUES (1, > 'state', 'NY'); > > INSERT INTO data_fields (data_id, field_name, field_data) VALUES (2, 'name', > 'Brian'); > INSERT INTO data_fields (data_id, field_name, field_data) VALUES (2, 'city', > 'New York'); > INSERT INTO data_fields (data_id, field_name, field_data) VALUES (2, > 'state', 'NY'); > > INSERT INTO data_fields (data_id, field_name, field_data) VALUES (3, 'name', > 'Steve'); > INSERT INTO data_fields (data_id, field_name, field_data) VALUES (3, 'city', > 'Jersey City'); > INSERT INTO data_fields (data_id, field_name, field_data) VALUES (3, > 'state', 'NJ'); > > // All data with Name, City and State > SELECT d.data_id, > d.data_user, > fName.field_data AS Name, > fCity.field_data AS City, > fState.field_data AS State > FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND > fName.field_name = 'name' > LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND > fCity.field_name = 'city' > LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND > fState.field_name = 'state'; > > // output > +---------+-------------------+-------+-------------+-------+ > | data_id | data_user | Name | City | State | > +---------+-------------------+-------+-------------+-------+ > | 1 | mark at example.com | Mark | Brooklyn | NY | > | 2 | brian at example.com | Brian | New York | NY | > | 3 | steve at example.com | Steve | Jersey City | NJ | > +---------+-------------------+-------+-------------+-------+ > > // data with Name, City, State in NY > SELECT d.data_id, > d.data_user, > fName.field_data AS Name, > fCity.field_data AS City, > fState.field_data AS State > FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND > fName.field_name = 'name' > LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND > fCity.field_name = 'city' > LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND > fState.field_name = 'state'; > HAVING(State = 'NY'); > > // output > +---------+-------------------+-------+----------+-------+ > | data_id | data_user | Name | City | State | > +---------+-------------------+-------+----------+-------+ > | 1 | mark at example.com | Mark | Brooklyn | NY | > | 2 | brian at example.com | Brian | New York | NY | > +---------+-------------------+-------+----------+-------+ > > // data with Name, City, State in Brooklyn > SELECT d.data_id, > d.data_user, > fName.field_data AS Name, > fCity.field_data AS City, > fState.field_data AS State > FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND > fName.field_name = 'name' > LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND > fCity.field_name = 'city' > LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND > fState.field_name = 'state'; > HAVING(City = 'Brooklyn'); > > // output > +---------+------------------+------+----------+-------+ > | data_id | data_user | Name | City | State | > +---------+------------------+------+----------+-------+ > | 1 | mark at example.com | Mark | Brooklyn | NY | > +---------+------------------+------+----------+-------+ > > // using WHERE instead of HAVING > SELECT d.data_id, > d.data_user, > fName.field_data AS Name, > fCity.field_data AS City, > fState.field_data AS State > FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND > fName.field_name = 'name' > LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND > fCity.field_name = 'city' > LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND > fState.field_name = 'state'; > WHERE fCity.field_data = 'Brooklyn' > AND fState.field_data = 'NY'; > > // output > +---------+------------------+------+----------+-------+ > | data_id | data_user | Name | City | State | > +---------+------------------+------+----------+-------+ > | 1 | mark at example.com | Mark | Brooklyn | NY | > +---------+------------------+------+----------+-------+ > > // EXPLAIN output of the last statement ('having' is a bit less efficient) > +--------+--------+---------------+------------+---------+---------------+-- > ----+-------------+ > | table | type | possible_keys | key | key_len | ref | > rows | Extra | > +--------+--------+---------------+------------+---------+---------------+-- > ----+-------------+ > | fCity | ref | field_name | field_name | 120 | const,const | > 1 | Using where | > | d | eq_ref | PRIMARY | PRIMARY | 1 | fCity.data_id | > 1 | | > | fName | ref | field_name | field_name | 20 | const | > 2 | Using where | > | fState | ref | field_name | field_name | 120 | const,const | > 2 | Using where | > +--------+--------+---------------+------------+---------+---------------+-- > ----+-------------+ > > > > Hope that helps. > > Good luck!! > > Mark Armendariz > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > -- Thanks! - Brian Dailey Software Developer New York, NY www.dailytechnology.net -------------- next part -------------- A non-text attachment was scrubbed... Name: support.vcf Type: text/x-vcard Size: 264 bytes Desc: not available URL: From lists at enobrev.com Tue May 15 14:50:35 2007 From: lists at enobrev.com (Mark Armendariz) Date: Tue, 15 May 2007 14:50:35 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: References: <4649C77F.4050009@dailytechnology.net><001401c79716$d6d868d0$6400a8c0@enobrev> Message-ID: <001e01c79721$ec7d2d50$6400a8c0@enobrev> > What if a data record is missing some field values? Or has > more than one value stored for some field name? Interesting points... For missing data, you can make the field nullable... // set field_data to NULLABLE ALTER TABLE data_fields CHANGE field_data field_data VARCHAR( 100 ) NULL DEFAULT NULL; // remove Steve's state DELETE FROM data_fields WHERE data_id = 3 AND field_data = 'NJ'; // using People without States SELECT d.data_id, d.data_user, fName.field_data AS Name, fCity.field_data AS City, fState.field_data AS State FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND fName.field_name = 'name' LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND fCity.field_name = 'city' LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND fState.field_name = 'state' WHERE ISNULL(fState.field_data) = 1; // output +---------+-------------------+-------+-------------+-------+ | data_id | data_user | Name | City | State | +---------+-------------------+-------+-------------+-------+ | 3 | steve at example.com | Steve | Jersey City | NULL | +---------+-------------------+-------+-------------+-------+ // as for people with multi data per field, you end up with something like this: SELECT d.data_id, d.data_user, fName.field_data AS Name, fCity.field_data AS City, fState.field_data AS State FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND fName.field_name = 'name' LEFT JOIN data_fields fCity ON d.data_id = fCity.data_id AND fCity.field_name = 'city' LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND fState.field_name = 'state'; +---------+-------------------+-------+-------------+-------+ | data_id | data_user | Name | City | State | +---------+-------------------+-------+-------------+-------+ | 1 | mark at example.com | Mark | Brooklyn | NY | | 2 | brian at example.com | Brian | New York | NY | | 3 | steve at example.com | Steve | Jersey City | NJ | | 3 | steve at example.com | Steve | Jersey City | NY | +---------+-------------------+-------+-------------+-------+ // Which might not be pretty, but could be ok, depending on your needs... SELECT fState.field_data AS State FROM data d LEFT JOIN data_fields fName ON d.data_id = fName.data_id AND fName.field_name = 'name' LEFT JOIN data_fields fState ON d.data_id = fState.data_id AND fState.field_name = 'state' WHERE fName.field_data = 'Steve'; // all of steve's states +-------+ | State | +-------+ | NJ | | NY | +-------+ // Or Set a Unique Index on the parent field and field_name for one record per field per user ALTER TABLE data_fields ADD UNIQUE data_field (data_id, field_name); // now try inserting INSERT INTO data_fields (data_id, field_name, field_data) VALUES (3, 'state', 'NJ'); // works once because we just removed it INSERT INTO data_fields (data_id, field_name, field_data) VALUES (3, 'state', 'NJ'); ERROR 1062 (00000): Duplicate entry '3-state' for key 2 Mark From ramons at gmx.net Tue May 15 15:11:22 2007 From: ramons at gmx.net (David Krings) Date: Tue, 15 May 2007 15:11:22 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <4649F793.2070200@dailytechnology.net> References: <4649C77F.4050009@dailytechnology.net> <001401c79716$d6d868d0$6400a8c0@enobrev> <4649F793.2070200@dailytechnology.net> Message-ID: <464A05DA.7030608@gmx.net> Brian Dailey wrote: > This looks like what I'll ultimately be doing. I played around with some > SQL queries and what I ended up with was similar to this - joining the > table for each data value that I wanted to look up (and since I expect a > matching data value, I don't even have to LEFT JOIN everything, which > speeds it up significantly). > > Thanks for all of your help and suggestions! > Here is another one...some time ago I had to run a report that crossed a few tables and should do sorting and all kinds of other neat stuff. Since my SQL knowledge is limited, I created a temporary table and worked off that. That ended up being fairly easy and I could run any other subsequent SQL against that table. I have no idea what the speed / performance impact is as the app was not used by that many clients at the same time as that this issue would have surfaced. David From jonbaer at jonbaer.com Tue May 15 16:01:44 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 15 May 2007 16:01:44 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: References: <4649C77F.4050009@dailytechnology.net> <6CDB87B1-0D3D-4DC4-9AFB-C7B7EF1E9F34@jonbaer.com> Message-ID: <105A3BAD-C7E0-4F35-8785-8CFD622E1B76@jonbaer.com> Im not sure this does justice w/o any demo but Id never plan on doing a search like that ... the idea was that one field w/ key:value pairs would be split and put into a searchable index via Zend_Search ... http://framework.zend.com/manual/en/zend.search.html The query (or report) from the index search into the db is trivial since the pk keys are exchangeable. This is really a 2 layer approach not using MySQL for FT indexing. Any other option gives you way more IR functions than MySQL does. Although it would be fair to point out that it is pluggable: ( ) But still pretty new. - Jon On May 15, 2007, at 2:01 PM, csnyder wrote: > On 5/15/07, Jon Baer wrote: >> I normally include @ least one column of YAML-based data >> (a misc field of sorts). > > At first I thought this would work with a MySQL FULLTEXT index, but of > course it won't because the field names would be in more than 50% of > the records and would therefore be considered stopwords. > > Nifty as this is, then, it only works if all querying is handled by > your application or an application using a platform that includes its > own sufficiently reliable search index. Clients who want/need to > create their own SQL queries are out of luck, or forced to use LIKE > expressions. > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From chsnyder at gmail.com Tue May 15 18:17:02 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 15 May 2007 18:17:02 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <105A3BAD-C7E0-4F35-8785-8CFD622E1B76@jonbaer.com> References: <4649C77F.4050009@dailytechnology.net> <6CDB87B1-0D3D-4DC4-9AFB-C7B7EF1E9F34@jonbaer.com> <105A3BAD-C7E0-4F35-8785-8CFD622E1B76@jonbaer.com> Message-ID: On 5/15/07, Jon Baer wrote: > This is really a 2 layer approach not using MySQL for FT indexing. > Any other option gives you > way more IR functions than MySQL does. Although it would be fair to > point out that it is pluggable: ( 5.1/en/plugin-full-text-plugins.html> ) But still pretty new. I'm all for the 2 layer approach -- at that point it doesn't really matter how you store the data in the db. YAML seems especially friendly, but it could be RDF, some other flavor of XML, or even a serialized PHP object. As a developer you get a tremendous amount of flexibility at a negative cost, because you don't have to write any complex SQL, ever, once you take care of CRUD. It scares the beejeesus out of anyone with a background in databases, though. The people I work with think I'm completely off my nut for storing data this way. They're asking me to use custom tables for even the simplest business objects, despite the fact that the model changes constantly. I'd love to find a technique that we could all embrace. If Ken Downs is reading this thread, I hope next Tuesday's talk will touch on this topic... -- Chris Snyder http://chxo.com/ From rolan at omnistep.com Tue May 15 18:51:49 2007 From: rolan at omnistep.com (Rolan Yang) Date: Tue, 15 May 2007 18:51:49 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <4649F793.2070200@dailytechnology.net> References: <4649C77F.4050009@dailytechnology.net> <001401c79716$d6d868d0$6400a8c0@enobrev> <4649F793.2070200@dailytechnology.net> Message-ID: <464A3985.7050803@omnistep.com> Brian Dailey wrote: > This looks like what I'll ultimately be doing. I played around with > some SQL queries and what I ended up with was similar to this - > joining the table for each data value that I wanted to look up (and > since I expect a matching data value, I don't even have to LEFT JOIN > everything, which speeds it up significantly). > > Thanks for all of your help and suggestions! > You may eventually reach a point where your data volume becomes monstrous and the queries start to take an unacceptably long time to run, or consume too much CPU, or maybe even lock up the tables from being written to. At that point (or before) you may want to consider setting up a second mysql machine as as replicated slave - dedicated for generating reports. Once you have that you can create triggers or run periodic batch processes to index your data in more optimized tables so the reports can be generated on the fly or at least more quickly. ~Rolan From support at dailytechnology.net Tue May 15 22:41:34 2007 From: support at dailytechnology.net (Brian Dailey) Date: Tue, 15 May 2007 22:41:34 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <464A3985.7050803@omnistep.com> References: <4649C77F.4050009@dailytechnology.net> <001401c79716$d6d868d0$6400a8c0@enobrev> <4649F793.2070200@dailytechnology.net> <464A3985.7050803@omnistep.com> Message-ID: <464A6F5E.9070108@dailytechnology.net> I'm already looking at 100,000+ records, and I am somewhat nervous as to how it will perform as the load begins to get a little bit higher. I suppose I will have to do a little tweaking to make it work properly, but it seems like this approach would lend itself a little more to indexing rather than using the 2 layer approach. Which leads me to my next question - Chris, in your 2 layer approach how do you handle indexing? If you have a fairly sizable chunk of YAML/XML/etc data, how do you handle searching it? Rolan Yang wrote: > Brian Dailey wrote: >> This looks like what I'll ultimately be doing. I played around with >> some SQL queries and what I ended up with was similar to this - >> joining the table for each data value that I wanted to look up (and >> since I expect a matching data value, I don't even have to LEFT JOIN >> everything, which speeds it up significantly). >> >> Thanks for all of your help and suggestions! >> > > You may eventually reach a point where your data volume becomes > monstrous and the queries start to take an unacceptably long time to > run, or consume too much CPU, or maybe even lock up the tables from > being written to. At that point (or before) you may want to consider > setting up a second mysql machine as as replicated slave - dedicated for > generating reports. Once you have that you can create triggers or run > periodic batch processes to index your data in more optimized tables so > the reports can be generated on the fly or at least more quickly. > > ~Rolan > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > -- Thanks! - Brian Dailey Software Developer New York, NY www.dailytechnology.net -------------- next part -------------- A non-text attachment was scrubbed... Name: support.vcf Type: text/x-vcard Size: 264 bytes Desc: not available URL: From sukritd at sevenacross.com Tue May 15 23:33:10 2007 From: sukritd at sevenacross.com (Sukrit D) Date: Wed, 16 May 2007 09:03:10 +0530 Subject: [nycphp-talk] [OT] unsuscribing Message-ID: <443AE01A-0726-47BF-A6D8-852118690224@sevenacross.com> Can someone please help me unsubscribe from this mailing list. I went to http://lists.nyphp.org/mailman/listinfo/talk and tried unsubscribing. but that didn't work. SD. From ken at secdat.com Wed May 16 07:35:49 2007 From: ken at secdat.com (Kenneth Downs) Date: Wed, 16 May 2007 07:35:49 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: References: <4649C77F.4050009@dailytechnology.net> <6CDB87B1-0D3D-4DC4-9AFB-C7B7EF1E9F34@jonbaer.com> <105A3BAD-C7E0-4F35-8785-8CFD622E1B76@jonbaer.com> Message-ID: <464AEC95.6070401@secdat.com> csnyder wrote: > On 5/15/07, Jon Baer wrote: >> This is really a 2 layer approach not using MySQL for FT indexing. >> Any other option gives you >> way more IR functions than MySQL does. Although it would be fair to >> point out that it is pluggable: ( > 5.1/en/plugin-full-text-plugins.html> ) But still pretty new. > > I'm all for the 2 layer approach -- at that point it doesn't really > matter how you store the data in the db. YAML seems especially > friendly, but it could be RDF, some other flavor of XML, or even a > serialized PHP object. As a developer you get a tremendous amount of > flexibility at a negative cost, because you don't have to write any > complex SQL, ever, once you take care of CRUD. > > It scares the beejeesus out of anyone with a background in databases, > though. The people I work with think I'm completely off my nut for > storing data this way. They're asking me to use custom tables for even > the simplest business objects, despite the fact that the model changes > constantly. I'd love to find a technique that we could all embrace. > > If Ken Downs is reading this thread, I hope next Tuesday's talk will > touch on this topic... I've been following but I don't know enough about the underlying problem to comment beyond general rules. The approach under discussion is known as Entity-Attribute-Value and, yes, it is considered a major mistake when used in a SQL database because SQL is all about using rows and tables, and you can't do any of that anymore. You've left yourself with no reasonable query language. What used to be "select name,city from mytable" now requires a join (or left join) at very least. The trouble only gets worse. Since everything you are doing with a relational database requires SQL, and since SQL has no tables to query, simple concepts like JOINS become insane, performance drops, and as you said the database people start calling you names and will refuse to help. Expect a sort of "it's your funeral" attitude. Here is an unusually non-bitter presentation on wikipedia: http://en.wikipedia.org/wiki/Entity-Attribute-Value_model The real underlying problems usually come down one or more of: 1) Unknown structure 2) Known structure, but seen as "too complex" 3) Structure *appears* to change often 4) Confusion between structured data and text data 5) Desire for "flexibility" in structure 6) Weak tools for creating/updating structures For #1, we can probably agree if that if the structure is not yet known, nobody should be coding. Go back to the users for more interviews. For #2, the standard reply is that EAV is not going to solve the underlying problem, its going to make it worse. Complex structures will require complex queries, which are impossible using EAV in a SQL database. This is probably a sticky situation where somebody needs to go ask the paymaster for more money and time. For #3, I underscore "appears" to change. While structures do change, the appearance of rapid change can often be traced to other factors. A skilled table designer can listen to the apparently random noise generated by the users and discern patterns that the users are unaware of. They will often think in details, we are supposed to be thinking systematically. For #4, what I mean is that you may have things like product descriptions for an electronic catalog, where many different product categories contain zillions of little details. A great example of this is mwave. EAV looks good when confronting the bewildering prospect of making a table for this stuff. But it often turns out that all items have real attributes that must be in the database, not the least of which are price and weight, but a lot of the rest of it is descriptive, and can go into a text field (it can be html, or wiki text as well). For #5, This is usually a symptom that the programmer does not yet know if his problem is 1,2,3,4 or 6. He is having problems matching code to table structure, and wants to solve that problem with "flexibility", some way of lessening the pain of trying to keep these two coordinated. It may be that he needs a better tool to do so (see #6), or he may be confronting #3 and #4 and not realizing that he needs to nail down the structure more. For #6, in Ken's humble opinion the absence of strong tools is the number one problem for those who handle tables every day. It is quite simply a royal PITA to build tables, modify them, and then track changes and get them into production. If you get into stored procedures and triggers the problems with basic chores of version control, debugging and so forth only get worse. This basic chore was the first thing I coded in Andromeda, it's something that's crying out to be done. The absence of these tools drives people to avoid structure changes and is the number one reason people find themselves trying to write code that will somehow not depend on the table structure. My own answer was to write Andromeda so that it would be easy to match my code to the tables. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From support at dailytechnology.net Wed May 16 07:41:11 2007 From: support at dailytechnology.net (Brian Dailey) Date: Wed, 16 May 2007 07:41:11 -0400 Subject: [nycphp-talk] May NYPHP - Anyone available to record? Message-ID: <464AEDD7.5090109@dailytechnology.net> All - I'm not going to make it to this month's presentation, but I'd very much like to hear what Kenneth Down has to say. Does anyone have the ability to record it using an mp3 player so we can get a copy of the presentation on the web? -- Thanks! - Brian Dailey Software Developer New York, NY www.dailytechnology.net -------------- next part -------------- A non-text attachment was scrubbed... Name: support.vcf Type: text/x-vcard Size: 264 bytes Desc: not available URL: From patrick at hexane.org Wed May 16 08:22:43 2007 From: patrick at hexane.org (Patrick May) Date: Wed, 16 May 2007 08:22:43 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <4649C77F.4050009@dailytechnology.net> References: <4649C77F.4050009@dailytechnology.net> Message-ID: <2C61D3B8-A750-44A8-8C96-0B538497BFED@hexane.org> Hello, On May 15, 2007, at 10:45 AM, Brian Dailey wrote: > I have several large forms that I am putting together. I'm aiming > to keep them flexible and make it fit within the database object > schema that I have used so far in this particular program. > > In the past with a large form I've seen some developers resort to > tables with a multitude of columns... I thought that this was a > kludgy solution and I'd like to avoid it if possible. Another way > I've seen it handled is to have a header table and a detail table > that works something like this: > > table: documents (id, date, etc) > table: documentdetails (documentid, fieldname, fieldvalue) > > All of the form values were stored in a fieldname=fieldvalue format > inside the table. This worked nicely until you attempted to run > reports on it - you couldn't easily combine data since it all > existed in different table rows. > > So, I humbly come before thee, o PHP gurus, and ask you, how would > you advise approaching this? Are there other ways to handle huge > forms? I have seen people serialize arrays and store them in a > column, but I can't see that working well when creating reports. > > I've googled and read around as much as I can on this one, but what > I need is some advice from some more experienced developers. Opinions? My question is -- when the forms change, who makes the change? You, or a user via a tool? If you are making the change, then I would go with the flat table and make your code flexible. It's nice to have a straightforward and flat table. You can get your code pretty tight. This is can be most problem anyways -- If you have a giant form, you can spend forever fiddling with the html. But if a user is the one making the change, then I would go with one of the aforementioned solutions -- store everything in yaml, or entity attribute value. I prefer EAV. Cheers, Patrick From lists at enobrev.com Wed May 16 08:32:09 2007 From: lists at enobrev.com (Mark Armendariz) Date: Wed, 16 May 2007 08:32:09 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <2C61D3B8-A750-44A8-8C96-0B538497BFED@hexane.org> References: <4649C77F.4050009@dailytechnology.net> <2C61D3B8-A750-44A8-8C96-0B538497BFED@hexane.org> Message-ID: <000601c797b6$397d6630$0202fea9@enobrev> > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Patrick May > My question is -- when the forms change, who makes the > change? You, or a user via a tool? Though I'd offered a solution for EAV, I haven't gone that route in quite some time (usually only for dynamic surveying tools where the forms / fields are updated by the client daily or weekly). Otherwise I generally agree with Ken. Unless absolutely necessary, EAV is quite messy and can get painfully inefficient (in coding and query times) if not watched closely. I've been offering clients a tool up to update the CRUD tables / fields. It helps that the queries throughout my framework are dynamic and automatically include any new / updated fields in all cached and live queries. Mark From chsnyder at gmail.com Wed May 16 10:34:44 2007 From: chsnyder at gmail.com (csnyder) Date: Wed, 16 May 2007 10:34:44 -0400 Subject: [nycphp-talk] Flexible Forms & How to store them... In-Reply-To: <464A6F5E.9070108@dailytechnology.net> References: <4649C77F.4050009@dailytechnology.net> <001401c79716$d6d868d0$6400a8c0@enobrev> <4649F793.2070200@dailytechnology.net> <464A3985.7050803@omnistep.com> <464A6F5E.9070108@dailytechnology.net> Message-ID: On 5/15/07, Brian Dailey wrote: > Which leads me to my next question - Chris, in your 2 layer approach how > do you handle indexing? If you have a fairly sizable chunk of > YAML/XML/etc data, how do you handle searching it? Well, I haven't had to. I've been working in content and event management, and using tags to give objects searchable properties when they fall outside of indexed fields. It's amazing what you can fudge with semantic categorization, but it's definitely a fudge. You can't SUM() tags. In fact, SUM() might be a great example of the problem here. I can see how Lucene would quickly return all the orders with quantity:2, but what kind of crunching is involved in finding the total quantity across all orders? -- Chris Snyder http://chxo.com/ From jonbaer at jonbaer.com Thu May 17 13:05:34 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 17 May 2007 13:05:34 -0400 Subject: [nycphp-talk] PHP Marketing Message-ID: Looks like it needs to kick into overdrive ... http://aatw.tumblr.com/post/2036104 http://aatw.tumblr.com/post/2036194 I even saw a "$this->sucks" t-shirt the other day. What is up with that? ;-) From anieshjoseph at gmail.com Thu May 17 16:16:22 2007 From: anieshjoseph at gmail.com (Aniesh joseph) Date: Fri, 18 May 2007 01:46:22 +0530 Subject: [nycphp-talk] Support Ticket Sytem Message-ID: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> Hello, I want to build a Support Ticket Sytem. I need to register for tickets through mail.Two task is : 1. Whenever I recieved a mail from the clients, I have to register for a ticket. 2. Read the contents of the mail. I am working on LAMP. How can accomplish the two tasks in a PHP-MYSQL? Can someone help me ? Regards Aniesh Joseph -------------- next part -------------- An HTML attachment was scrubbed... URL: From mba2000 at ioplex.com Thu May 17 16:35:53 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Thu, 17 May 2007 16:35:53 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> Message-ID: <20070517163553.c611a54d.mba2000@ioplex.com> There are a LOT of support ticket systems around. You might want to checkout freshmeat.net. Unfortunately it seems like no particular one ever never suits your needs (which explains why there are so many). The support ticket system I always wanted was one that just used IMAP for everything where the "tickets" where really just emails. So when someone searched tickets it really just used IMAP to talk to the local IMAP server. Also there would be a mail processing script to identify or insert a ticket number in the subject line. Etc. Never found such a thing. Mike On Fri, 18 May 2007 01:46:22 +0530 "Aniesh joseph" wrote: > Hello, > > > I want to build a Support Ticket Sytem. I need to register for tickets > through mail.Two task is : > > 1. Whenever I recieved a mail from the clients, I have to register for a > ticket. > > 2. Read the contents of the mail. > > I am working on LAMP. How can accomplish the two tasks in a PHP-MYSQL? Can > someone help me ? > > > > Regards > Aniesh Joseph > -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From lists at enobrev.com Thu May 17 16:51:33 2007 From: lists at enobrev.com (Mark Armendariz) Date: Thu, 17 May 2007 16:51:33 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> Message-ID: <003401c798c5$27644350$6600a8c0@enobrev> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Aniesh joseph 1. Whenever I recieved a mail from the clients, I have to register for a ticket. 2. Read the contents of the mail. I am working on LAMP. How can accomplish the two tasks in a PHP-MYSQL? Can someone help me ? Look around for a pop3 php library. Write a CLI script that uses the pop3 lib to log into your ticket email account. Use cron to run the script every few minutes and download the messages. Compare the messages with your ticket database and add it to a previous ticket or add the new ticket #. I'd written a fairly robust one years ago for a client, but it's hard to answer such a general question with much detail. Mark From jonbaer at jonbaer.com Thu May 17 18:10:46 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 17 May 2007 18:10:46 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <20070517163553.c611a54d.mba2000@ioplex.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> Message-ID: Im sure either TRAC http://trac.edgewall.org/ or TRAC-HACKS www.trac- hacks.org has it. This is a great (and what seems like) defacto ticketing system, I use it all the time and rarely ever work w/o it. I install it for free @ client sites just so I can stay sane on a project. But I can see it being used as a general ticket system w/ ease (however Python skills required). A PHP version anywhere? - Jon On May 17, 2007, at 4:35 PM, Michael B Allen wrote: > There are a LOT of support ticket systems around. You might want to > checkout freshmeat.net. Unfortunately it seems like no particular one > ever never suits your needs (which explains why there are so many). > > The support ticket system I always wanted was one that just used IMAP > for everything where the "tickets" where really just emails. So when > someone searched tickets it really just used IMAP to talk to the local > IMAP server. Also there would be a mail processing script to identify > or insert a ticket number in the subject line. Etc. Never found such > a thing. > > Mike > > On Fri, 18 May 2007 01:46:22 +0530 > "Aniesh joseph" wrote: > >> Hello, >> >> >> I want to build a Support Ticket Sytem. I need to register for >> tickets >> through mail.Two task is : >> >> 1. Whenever I recieved a mail from the clients, I have to register >> for a >> ticket. >> >> 2. Read the contents of the mail. >> >> I am working on LAMP. How can accomplish the two tasks in a PHP- >> MYSQL? Can >> someone help me ? >> >> >> >> Regards >> Aniesh Joseph >> > > > -- > Michael B Allen > PHP Active Directory Kerberos SSO > http://www.ioplex.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jonbaer at jonbaer.com Thu May 17 18:15:20 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 17 May 2007 18:15:20 -0400 Subject: [nycphp-talk] jQPie - jQuery <-> PHP Message-ID: Came across this today, interesting lightweight lib ... http://projects.cyberlot.net/trac/jqpie/ -snip- The idea of jQPie is to provide a lightweight PHP interface to jQuery. The lightweight interface allows multiple ways to interact. What makes jQPie unique? * Lightweight * Supports XML, HTML and JSON Handlers * API is simple, while the handlers engine is PHP based the javascript library is usable by any language * Includes a powerful autocomplete plugin, plans to provide other plugins for use and as examples -snip- From joshmccormack at travelersdiary.com Thu May 17 18:19:57 2007 From: joshmccormack at travelersdiary.com (Josh McCormack) Date: Thu, 17 May 2007 17:19:57 -0500 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> Message-ID: Mantis is a PHP issue tracker that's pretty good. Josh On 5/17/07, Jon Baer wrote: > > Im sure either TRAC http://trac.edgewall.org/ or TRAC-HACKS www.trac- > hacks.org has it. > > This is a great (and what seems like) defacto ticketing system, I use > it all the time and rarely ever work w/o it. I install it for free @ > client sites just so I can stay sane on a project. But I can see it > being used as a general ticket system w/ ease (however Python skills > required). A PHP version anywhere? > > - Jon > > On May 17, 2007, at 4:35 PM, Michael B Allen wrote: > > > There are a LOT of support ticket systems around. You might want to > > checkout freshmeat.net. Unfortunately it seems like no particular one > > ever never suits your needs (which explains why there are so many). > > > > The support ticket system I always wanted was one that just used IMAP > > for everything where the "tickets" where really just emails. So when > > someone searched tickets it really just used IMAP to talk to the local > > IMAP server. Also there would be a mail processing script to identify > > or insert a ticket number in the subject line. Etc. Never found such > > a thing. > > > > Mike > > > > On Fri, 18 May 2007 01:46:22 +0530 > > "Aniesh joseph" wrote: > > > >> Hello, > >> > >> > >> I want to build a Support Ticket Sytem. I need to register for > >> tickets > >> through mail.Two task is : > >> > >> 1. Whenever I recieved a mail from the clients, I have to register > >> for a > >> ticket. > >> > >> 2. Read the contents of the mail. > >> > >> I am working on LAMP. How can accomplish the two tasks in a PHP- > >> MYSQL? Can > >> someone help me ? > >> > >> > >> > >> Regards > >> Aniesh Joseph > >> > > > > > > -- > > Michael B Allen > > PHP Active Directory Kerberos SSO > > http://www.ioplex.com/ > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Josh McCormack Owner, InteractiveQA Web testing & development http://www.interactiveqa.com 917.620.4902 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mba2000 at ioplex.com Thu May 17 18:26:18 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Thu, 17 May 2007 18:26:18 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> Message-ID: <20070517182618.a1947144.mba2000@ioplex.com> On Thu, 17 May 2007 18:10:46 -0400 Jon Baer wrote: > http://trac.edgewall.org/ Just looked at it and clearly it's nothing like I described. Mike From Consult at CovenantEDesign.com Thu May 17 18:28:52 2007 From: Consult at CovenantEDesign.com (CED) Date: Thu, 17 May 2007 18:28:52 -0400 Subject: [nycphp-talk] Support Ticket Sytem References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com><20070517163553.c611a54d.mba2000@ioplex.com> Message-ID: <006801c798d2$bfe15c00$07d6f4a7@ced> Eventum. Period. =D Edward JS Prevost II Me at EdwardPrevost.info www.EdwardPrevost.info ----- Original Message ----- From: Josh McCormack To: NYPHP Talk Sent: Thursday, May 17, 2007 6:19 PM Subject: Re: [nycphp-talk] Support Ticket Sytem Mantis is a PHP issue tracker that's pretty good. Josh On 5/17/07, Jon Baer wrote: Im sure either TRAC http://trac.edgewall.org/ or TRAC-HACKS www.trac - hacks.org has it. This is a great (and what seems like) defacto ticketing system, I use it all the time and rarely ever work w/o it. I install it for free @ client sites just so I can stay sane on a project. But I can see it being used as a general ticket system w/ ease (however Python skills required). A PHP version anywhere? - Jon On May 17, 2007, at 4:35 PM, Michael B Allen wrote: > There are a LOT of support ticket systems around. You might want to > checkout freshmeat.net. Unfortunately it seems like no particular one > ever never suits your needs (which explains why there are so many). > > The support ticket system I always wanted was one that just used IMAP > for everything where the "tickets" where really just emails. So when > someone searched tickets it really just used IMAP to talk to the local > IMAP server. Also there would be a mail processing script to identify > or insert a ticket number in the subject line. Etc. Never found such > a thing. > > Mike > > On Fri, 18 May 2007 01:46:22 +0530 > "Aniesh joseph" < anieshjoseph at gmail.com> wrote: > >> Hello, >> >> >> I want to build a Support Ticket Sytem. I need to register for >> tickets >> through mail.Two task is : >> >> 1. Whenever I recieved a mail from the clients, I have to register >> for a >> ticket. >> >> 2. Read the contents of the mail. >> >> I am working on LAMP. How can accomplish the two tasks in a PHP- >> MYSQL? Can >> someone help me ? >> >> >> >> Regards >> Aniesh Joseph >> > > > -- > Michael B Allen > PHP Active Directory Kerberos SSO > http://www.ioplex.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -- Josh McCormack Owner, InteractiveQA Web testing & development http://www.interactiveqa.com 917.620.4902 ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Thu May 17 18:34:30 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyline)) Date: Thu, 17 May 2007 18:34:30 -0400 Subject: [nycphp-talk] Support Ticket Sytem References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com><20070517163553.c611a54d.mba2000@ioplex.com> <006801c798d2$bfe15c00$07d6f4a7@ced> Message-ID: <01ad01c798d3$89fc8e60$6b01a8c0@gamebox> Hello, I've also been looking for something: Eventum looks really great at first glance. - Ben ----- Original Message ----- From: CED To: NYPHP Talk Sent: Thursday, May 17, 2007 6:28 PM Subject: Re: [nycphp-talk] Support Ticket Sytem Eventum. Period. =D Edward JS Prevost II Me at EdwardPrevost.info www.EdwardPrevost.info ----- Original Message ----- From: Josh McCormack To: NYPHP Talk Sent: Thursday, May 17, 2007 6:19 PM Subject: Re: [nycphp-talk] Support Ticket Sytem Mantis is a PHP issue tracker that's pretty good. Josh On 5/17/07, Jon Baer wrote: Im sure either TRAC http://trac.edgewall.org/ or TRAC-HACKS www.trac - hacks.org has it. This is a great (and what seems like) defacto ticketing system, I use it all the time and rarely ever work w/o it. I install it for free @ client sites just so I can stay sane on a project. But I can see it being used as a general ticket system w/ ease (however Python skills required). A PHP version anywhere? - Jon On May 17, 2007, at 4:35 PM, Michael B Allen wrote: > There are a LOT of support ticket systems around. You might want to > checkout freshmeat.net. Unfortunately it seems like no particular one > ever never suits your needs (which explains why there are so many). > > The support ticket system I always wanted was one that just used IMAP > for everything where the "tickets" where really just emails. So when > someone searched tickets it really just used IMAP to talk to the local > IMAP server. Also there would be a mail processing script to identify > or insert a ticket number in the subject line. Etc. Never found such > a thing. > > Mike > > On Fri, 18 May 2007 01:46:22 +0530 > "Aniesh joseph" < anieshjoseph at gmail.com> wrote: > >> Hello, >> >> >> I want to build a Support Ticket Sytem. I need to register for >> tickets >> through mail.Two task is : >> >> 1. Whenever I recieved a mail from the clients, I have to register >> for a >> ticket. >> >> 2. Read the contents of the mail. >> >> I am working on LAMP. How can accomplish the two tasks in a PHP- >> MYSQL? Can >> someone help me ? >> >> >> >> Regards >> Aniesh Joseph >> > > > -- > Michael B Allen > PHP Active Directory Kerberos SSO > http://www.ioplex.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -- Josh McCormack Owner, InteractiveQA Web testing & development http://www.interactiveqa.com 917.620.4902 ---------------------------------------------------------------------------- _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From anieshjoseph at gmail.com Thu May 17 18:33:18 2007 From: anieshjoseph at gmail.com (Aniesh joseph) Date: Fri, 18 May 2007 04:03:18 +0530 Subject: [nycphp-talk] Re:Support Ticket Sytem Message-ID: <1b3d2fde0705171533o59fb5f33x5be0fd42fc618847@mail.gmail.com> Hello I tried to forward mail to php script page by setting from cpanel. But cpanel wonot allow to forward mail to script page. Could someone suggest other method ? Regards Aniesh -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Thu May 17 18:35:20 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 17 May 2007 18:35:20 -0400 Subject: [nycphp-talk] Input whitelist validation warning Message-ID: I just discovered a hole in a white list validation technique I bored from a PHP security book ? no, not Chris? book. Beware in_array($_POST/GET[?input?], $whitelist) Type matters. All input is string type and PHP will try to force type matching. So the input string ?securityhole? will match the int number 0. FYI, Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck at horde.org Thu May 17 18:37:32 2007 From: chuck at horde.org (Chuck Hagenbuch) Date: Thu, 17 May 2007 18:37:32 -0400 Subject: [nycphp-talk] Input whitelist validation warning In-Reply-To: References: Message-ID: <20070517183732.3eyx0vk3esggcsos@technest.org> Quoting Cliff Hirsch : > I just discovered a hole in a white list validation technique I bored from a > PHP security book ? no, not Chris? book. > > Beware in_array($_POST/GET[?input?], $whitelist) > > Type matters. All input is string type and PHP will try to force type > matching. > > So the input string ?securityhole? will match the int number 0. This is the kind of thing that the third argument to in-array is for - forces strict type checking: http://us2.php.net/in-array -chuck From Consult at CovenantEDesign.com Thu May 17 18:38:05 2007 From: Consult at CovenantEDesign.com (CED) Date: Thu, 17 May 2007 18:38:05 -0400 Subject: [nycphp-talk] Support Ticket Sytem References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com><20070517163553.c611a54d.mba2000@ioplex.com><006801c798d2$bfe15c00$07d6f4a7@ced> <01ad01c798d3$89fc8e60$6b01a8c0@gamebox> Message-ID: <012801c798d4$0b5691e0$07d6f4a7@ced> I've been using and customizing eventum for some time, I dinf it by far the easiest to use 'out of the box' and easiest to 'hack'. Edward JS Prevost II Me at EdwardPrevost.info www.EdwardPrevost.info ----- Original Message ----- From: Ben Sgro (ProjectSkyline) To: NYPHP Talk Sent: Thursday, May 17, 2007 6:34 PM Subject: Re: [nycphp-talk] Support Ticket Sytem Hello, I've also been looking for something: Eventum looks really great at first glance. - Ben ----- Original Message ----- From: CED To: NYPHP Talk Sent: Thursday, May 17, 2007 6:28 PM Subject: Re: [nycphp-talk] Support Ticket Sytem Eventum. Period. =D Edward JS Prevost II Me at EdwardPrevost.info www.EdwardPrevost.info ----- Original Message ----- From: Josh McCormack To: NYPHP Talk Sent: Thursday, May 17, 2007 6:19 PM Subject: Re: [nycphp-talk] Support Ticket Sytem Mantis is a PHP issue tracker that's pretty good. Josh On 5/17/07, Jon Baer wrote: Im sure either TRAC http://trac.edgewall.org/ or TRAC-HACKS www.trac - hacks.org has it. This is a great (and what seems like) defacto ticketing system, I use it all the time and rarely ever work w/o it. I install it for free @ client sites just so I can stay sane on a project. But I can see it being used as a general ticket system w/ ease (however Python skills required). A PHP version anywhere? - Jon On May 17, 2007, at 4:35 PM, Michael B Allen wrote: > There are a LOT of support ticket systems around. You might want to > checkout freshmeat.net. Unfortunately it seems like no particular one > ever never suits your needs (which explains why there are so many). > > The support ticket system I always wanted was one that just used IMAP > for everything where the "tickets" where really just emails. So when > someone searched tickets it really just used IMAP to talk to the local > IMAP server. Also there would be a mail processing script to identify > or insert a ticket number in the subject line. Etc. Never found such > a thing. > > Mike > > On Fri, 18 May 2007 01:46:22 +0530 > "Aniesh joseph" < anieshjoseph at gmail.com> wrote: > >> Hello, >> >> >> I want to build a Support Ticket Sytem. I need to register for >> tickets >> through mail.Two task is : >> >> 1. Whenever I recieved a mail from the clients, I have to register >> for a >> ticket. >> >> 2. Read the contents of the mail. >> >> I am working on LAMP. How can accomplish the two tasks in a PHP- >> MYSQL? Can >> someone help me ? >> >> >> >> Regards >> Aniesh Joseph >> > > > -- > Michael B Allen > PHP Active Directory Kerberos SSO > http://www.ioplex.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -- Josh McCormack Owner, InteractiveQA Web testing & development http://www.interactiveqa.com 917.620.4902 -------------------------------------------------------------------------- _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php ---------------------------------------------------------------------------- _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Thu May 17 18:38:02 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 17 May 2007 18:38:02 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <20070517182618.a1947144.mba2000@ioplex.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <20070517182618.a1947144.mba2000@ioplex.com> Message-ID: <2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> The system is called SARA, its a plugin for TRAC ... https://subtrac.sara.nl/oss/email2trac You were asking about email <-> email ticketing no? - Jon On May 17, 2007, at 6:26 PM, Michael B Allen wrote: > On Thu, 17 May 2007 18:10:46 -0400 > Jon Baer wrote: > >> http://trac.edgewall.org/ > > Just looked at it and clearly it's nothing like I described. > > Mike From ben at projectskyline.com Thu May 17 18:42:16 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyline)) Date: Thu, 17 May 2007 18:42:16 -0400 Subject: [nycphp-talk] Re:Support Ticket Sytem References: <1b3d2fde0705171533o59fb5f33x5be0fd42fc618847@mail.gmail.com> Message-ID: <01c001c798d4$9fbc3970$6b01a8c0@gamebox> Hello, You could have your script check the email account every X minutes. You can do that by having it loop (while 1) { ... } attempt to fetch the mail using the phpmailer class, then sleep(60 /* seconds);. Repeat. http://phpmailer.sourceforge.net/ Else, you can have cron (*nix only) execute the file/script at specified intervals. http://en.wikipedia.org/wiki/Crontab - Ben ----- Original Message ----- From: Aniesh joseph To: talk at lists.nyphp.org Sent: Thursday, May 17, 2007 6:33 PM Subject: [nycphp-talk] Re:Support Ticket Sytem Hello I tried to forward mail to php script page by setting from cpanel. But cpanel wonot allow to forward mail to script page. Could someone suggest other method ? Regards Aniesh ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From mba2000 at ioplex.com Thu May 17 18:56:50 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Thu, 17 May 2007 18:56:50 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <20070517182618.a1947144.mba2000@ioplex.com> <2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> Message-ID: <20070517185650.0f56fa74.mba2000@ioplex.com> On Thu, 17 May 2007 18:38:02 -0400 Jon Baer wrote: > The system is called SARA, its a plugin for TRAC ... > > https://subtrac.sara.nl/oss/email2trac > > You were asking about email <-> email ticketing no? Hi Jon, Nope. That just converts between emails and trac tickets. Let me explain further what I'm interested in. What I want is very simple actually. I will no doubt write it myself eventually but I would be delighted if someone "stole" my idea (provided I could use it too). There would be two ways to submit a ticket. The first method is to simply send an email to the support mailbox. The incoming mail component of this thing would look at the subject of the message and determine if it has a ticket number already. If not, it generates and insert a ticket number. For example, if the subject of a message was 'big-time error', the incoming mail component would transform this to '[TPF0844812] big-time error'. It might also send an automated reply to the sender with the ticket number in the subject with instructions that they should include that number in any subsequent dialog about the problem. There would also be a web interface that used PHP's IMAP interface to allow support personnel to search on a ticket number. User's who were logged in could also search tickets that contained the user's email address. Finally, the other way to submit a ticket would be through a simple web screen that any visitor could use (of course they could not specify the recipient - it would be hard coded to the support mailbox). The nice thing about this system is that it can be managed entirely via SquirrelMail. Using SquirrelMail you can search the subject line. You can change ticket numbers if someone submits additional messages with a new ticket number. Depending on how you generate the ticket numbers you wouldn't even need a database. It's just two php scripts - one for processsing incoming mail and another for searching / submitting tickets. Mike > On May 17, 2007, at 6:26 PM, Michael B Allen wrote: > > > On Thu, 17 May 2007 18:10:46 -0400 > > Jon Baer wrote: > > > >> http://trac.edgewall.org/ > > > > Just looked at it and clearly it's nothing like I described. From mba2000 at ioplex.com Thu May 17 19:02:33 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Thu, 17 May 2007 19:02:33 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <20070517185650.0f56fa74.mba2000@ioplex.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <20070517182618.a1947144.mba2000@ioplex.com> <2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> <20070517185650.0f56fa74.mba2000@ioplex.com> Message-ID: <20070517190233.df64f56c.mba2000@ioplex.com> Oh, and it can't have any XML, AJAX, Web 2.0 or fuzz like that. I don't want to win awards, I just want to get s**t done. Mike On Thu, 17 May 2007 18:56:50 -0400 Michael B Allen wrote: > On Thu, 17 May 2007 18:38:02 -0400 > Jon Baer wrote: > > > The system is called SARA, its a plugin for TRAC ... > > > > https://subtrac.sara.nl/oss/email2trac > > > > You were asking about email <-> email ticketing no? > > Hi Jon, > > Nope. That just converts between emails and trac tickets. > > Let me explain further what I'm interested in. What I want is very > simple actually. I will no doubt write it myself eventually but I would > be delighted if someone "stole" my idea (provided I could use it too). > > There would be two ways to submit a ticket. The first method is to simply > send an email to the support mailbox. The incoming mail component of > this thing would look at the subject of the message and determine if it > has a ticket number already. If not, it generates and insert a ticket > number. For example, if the subject of a message was 'big-time error', > the incoming mail component would transform this to '[TPF0844812] > big-time error'. It might also send an automated reply to the sender > with the ticket number in the subject with instructions that they should > include that number in any subsequent dialog about the problem. > > There would also be a web interface that used PHP's IMAP interface to > allow support personnel to search on a ticket number. User's who were > logged in could also search tickets that contained the user's email > address. > > Finally, the other way to submit a ticket would be through a simple web > screen that any visitor could use (of course they could not specify the > recipient - it would be hard coded to the support mailbox). > > The nice thing about this system is that it can be managed entirely via > SquirrelMail. Using SquirrelMail you can search the subject line. You > can change ticket numbers if someone submits additional messages with > a new ticket number. > > Depending on how you generate the ticket numbers you wouldn't even need > a database. It's just two php scripts - one for processsing incoming > mail and another for searching / submitting tickets. > > Mike > > > On May 17, 2007, at 6:26 PM, Michael B Allen wrote: > > > > > On Thu, 17 May 2007 18:10:46 -0400 > > > Jon Baer wrote: > > > > > >> http://trac.edgewall.org/ > > > > > > Just looked at it and clearly it's nothing like I described. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From Consult at CovenantEDesign.com Thu May 17 19:14:58 2007 From: Consult at CovenantEDesign.com (CED) Date: Thu, 17 May 2007 19:14:58 -0400 Subject: [nycphp-talk] Support Ticket Sytem References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com><20070517163553.c611a54d.mba2000@ioplex.com><20070517182618.a1947144.mba2000@ioplex.com><2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> <20070517185650.0f56fa74.mba2000@ioplex.com> Message-ID: <017e01c798d9$307ad530$07d6f4a7@ced> E-V-E-N-T-U-M =D > > Hi Jon, > > Nope. That just converts between emails and trac tickets. > > Let me explain further what I'm interested in. What I want is very > simple actually. I will no doubt write it myself eventually but I would > be delighted if someone "stole" my idea (provided I could use it too). > > There would be two ways to submit a ticket. The first method is to simply > send an email to the support mailbox. The incoming mail component of > this thing would look at the subject of the message and determine if it > has a ticket number already. If not, it generates and insert a ticket > number. For example, if the subject of a message was 'big-time error', > the incoming mail component would transform this to '[TPF0844812] > big-time error'. It might also send an automated reply to the sender > with the ticket number in the subject with instructions that they should > include that number in any subsequent dialog about the problem. > > There would also be a web interface that used PHP's IMAP interface to > allow support personnel to search on a ticket number. User's who were > logged in could also search tickets that contained the user's email > address. > > Finally, the other way to submit a ticket would be through a simple web > screen that any visitor could use (of course they could not specify the > recipient - it would be hard coded to the support mailbox). > > The nice thing about this system is that it can be managed entirely via > SquirrelMail. Using SquirrelMail you can search the subject line. You > can change ticket numbers if someone submits additional messages with > a new ticket number. > > Depending on how you generate the ticket numbers you wouldn't even need > a database. It's just two php scripts - one for processsing incoming > mail and another for searching / submitting tickets. > > Mike > From mba2000 at ioplex.com Thu May 17 19:26:08 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Thu, 17 May 2007 19:26:08 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <017e01c798d9$307ad530$07d6f4a7@ced> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <20070517182618.a1947144.mba2000@ioplex.com> <2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> <20070517185650.0f56fa74.mba2000@ioplex.com> <017e01c798d9$307ad530$07d6f4a7@ced> Message-ID: <20070517192608.7fd23fda.mba2000@ioplex.com> Hi CED, That does look like it's worth a look but it still doesn't look like the "IMAP server is the ticket database" paradigm I'm talking about. One of the main benefits of what I'm talking about is that you don't have to use the application itself - you can just use your regular email. Correct me if I'm wrong but this looks like you would have to actually log into eventum to initiate or processes a ticket at some point in it's lifetime. No? Mike On Thu, 17 May 2007 19:14:58 -0400 "CED" wrote: > E-V-E-N-T-U-M > > =D > > > > > > > > Hi Jon, > > > > Nope. That just converts between emails and trac tickets. > > > > Let me explain further what I'm interested in. What I want is very > > simple actually. I will no doubt write it myself eventually but I would > > be delighted if someone "stole" my idea (provided I could use it too). > > > > There would be two ways to submit a ticket. The first method is to simply > > send an email to the support mailbox. The incoming mail component of > > this thing would look at the subject of the message and determine if it > > has a ticket number already. If not, it generates and insert a ticket > > number. For example, if the subject of a message was 'big-time error', > > the incoming mail component would transform this to '[TPF0844812] > > big-time error'. It might also send an automated reply to the sender > > with the ticket number in the subject with instructions that they should > > include that number in any subsequent dialog about the problem. > > > > There would also be a web interface that used PHP's IMAP interface to > > allow support personnel to search on a ticket number. User's who were > > logged in could also search tickets that contained the user's email > > address. > > > > Finally, the other way to submit a ticket would be through a simple web > > screen that any visitor could use (of course they could not specify the > > recipient - it would be hard coded to the support mailbox). > > > > The nice thing about this system is that it can be managed entirely via > > SquirrelMail. Using SquirrelMail you can search the subject line. You > > can change ticket numbers if someone submits additional messages with > > a new ticket number. > > > > Depending on how you generate the ticket numbers you wouldn't even need > > a database. It's just two php scripts - one for processsing incoming > > mail and another for searching / submitting tickets. > > > > Mike > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From michael.southwell at nyphp.com Thu May 17 20:39:03 2007 From: michael.southwell at nyphp.com (Michael Southwell) Date: Thu, 17 May 2007 20:39:03 -0400 Subject: [nycphp-talk] Input whitelist validation warning In-Reply-To: References: Message-ID: <6.2.3.4.2.20070517203747.028edbc0@pop.nyphp.com> An HTML attachment was scrubbed... URL: From cliff at pinestream.com Thu May 17 20:45:52 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 17 May 2007 20:45:52 -0400 Subject: [nycphp-talk] Input whitelist validation warning In-Reply-To: <6.2.3.4.2.20070517203747.028edbc0@pop.nyphp.com> Message-ID: You are right ? I forgot about Chris Snyder?s excellent book. On 5/17/07 8:39 PM, "Michael Southwell" wrote: > At 06:35 PM 5/17/2007, you wrote: >> I just discovered a hole in a white list validation technique I bored from a >> PHP security book ? no, not Chris? book. > > uhh, there are actually two PHP security books written by someone named Chris. > I can say that this is not Pro PHP Security by Chris Snyder ;-). > >> Beware in_array($_POST/GET[?input?], $whitelist) >> >> Type matters. All input is string type and PHP will try to force type >> matching. >> >> So the input string ?securityhole? will match the int number 0. >> >> FYI, >> Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From rolan at omnistep.com Fri May 18 01:09:06 2007 From: rolan at omnistep.com (Rolan Yang) Date: Fri, 18 May 2007 01:09:06 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <20070517163553.c611a54d.mba2000@ioplex.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> Message-ID: <464D34F2.8090607@omnistep.com> Michael B Allen wrote: > There are a LOT of support ticket systems around. You might want to > checkout freshmeat.net. Unfortunately it seems like no particular one > ever never suits your needs (which explains why there are so many). > > The support ticket system I always wanted was one that just used IMAP > for everything where the "tickets" where really just emails. So when > someone searched tickets it really just used IMAP to talk to the local > IMAP server. Also there would be a mail processing script to identify > or insert a ticket number in the subject line. Etc. Never found such > a thing. > > Mike > That does sound like a pretty simple solution, and simple elegance is usually quite hard to achieve! What you're asking is not very difficult at all. I would suggest configuring a procmail or maildrop (or whatever scripting mail delivery agent you use) to feed the message to a php (I'm only saying php because this is the php list, but a perl or bash script would be much leaner) script which checks and rewrites the subject line. I can see it being done with about 20 lines of code. If you plan to use a consecutive numbering system for the tickets, I would also suggest appending a stored hash code to the end of it. Without that, pranksters could change their ticket numbers or create other ticket numbers injecting garbage in with your legitimate tickets. This brings up another interesting question. What are you going to do about the incoming flood of tickets selling Viagra, weight loss miracles, and stock market tips? :) ~Rolan From mba2000 at ioplex.com Fri May 18 02:45:04 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Fri, 18 May 2007 02:45:04 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <464D34F2.8090607@omnistep.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <464D34F2.8090607@omnistep.com> Message-ID: <20070518024504.05346e80.mba2000@ioplex.com> On Fri, 18 May 2007 01:09:06 -0400 Rolan Yang wrote: > Michael B Allen wrote: > > The support ticket system I always wanted was one that just used IMAP > > for everything where the "tickets" where really just emails. > This brings up another interesting question. What are you going to do > about the incoming flood of tickets selling Viagra, weight loss > miracles, and stock market tips? :) That's no problem. There's a bunch of things you can do. The procmailrc or the input script could simply pass on anything that doesn't have at least one of a list of keywords (e.g. the product name). You would still get the message in the inbox but it wouldn't trigger the ticket routines. You might get a few false negatives but you're almost guaranteed to eliminate the spams. You can also whitelist senders you replied to. Mike -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From Consult at CovenantEDesign.com Fri May 18 07:19:47 2007 From: Consult at CovenantEDesign.com (CED) Date: Fri, 18 May 2007 07:19:47 -0400 Subject: [nycphp-talk] Support Ticket Sytem References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com><20070517163553.c611a54d.mba2000@ioplex.com> <464D34F2.8090607@omnistep.com> Message-ID: <005501c7993e$71d9a6e0$07d6f4a7@ced> Rolan, Thats a good idea too for a homegrown. -Ed ----- Original Message ----- From: "Rolan Yang" To: "NYPHP Talk" Sent: Friday, May 18, 2007 1:09 AM Subject: Re: [nycphp-talk] Support Ticket Sytem > Michael B Allen wrote: > > There are a LOT of support ticket systems around. You might want to > > checkout freshmeat.net. Unfortunately it seems like no particular one > > ever never suits your needs (which explains why there are so many). > > > > The support ticket system I always wanted was one that just used IMAP > > for everything where the "tickets" where really just emails. So when > > someone searched tickets it really just used IMAP to talk to the local > > IMAP server. Also there would be a mail processing script to identify > > or insert a ticket number in the subject line. Etc. Never found such > > a thing. > > > > Mike > > > > That does sound like a pretty simple solution, and simple elegance is > usually quite hard to achieve! > What you're asking is not very difficult at all. I would suggest > configuring a procmail or maildrop (or whatever scripting mail delivery > agent you use) to feed the message to a php (I'm only saying php because > this is the php list, but a perl or bash script would be much leaner) > script which checks and rewrites the subject line. I can see it being > done with about 20 lines of code. > > If you plan to use a consecutive numbering system for the tickets, I > would also suggest appending a stored hash code to the end of it. > Without that, pranksters could change their ticket numbers or create > other ticket numbers injecting garbage in with your legitimate tickets. > This brings up another interesting question. What are you going to do > about the incoming flood of tickets selling Viagra, weight loss > miracles, and stock market tips? :) > > ~Rolan > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From shadab_w at yahoo.co.in Fri May 18 08:11:40 2007 From: shadab_w at yahoo.co.in (Shadab Wadiwala) Date: Fri, 18 May 2007 13:11:40 +0100 (BST) Subject: [nycphp-talk] Difference between isset() and empty() . Message-ID: <173393.46504.qm@web8713.mail.in.yahoo.com> Hi !! I want to know what's the difference between the functions ---- isset() and empty() I referred the function reference on php.net, but still couldn't the exact answer to my query. Shadab .I. Wadiwala My homepage:-- http://shadabworld.110mb.com --------------------------------- Here?s a new way to find what you're looking for - Yahoo! Answers -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Fri May 18 08:22:12 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 18 May 2007 08:22:12 -0400 Subject: [nycphp-talk] Difference between isset() and empty() . In-Reply-To: <173393.46504.qm@web8713.mail.in.yahoo.com> Message-ID: See: http://www.php.net/manual/en/types.comparisons.php On 5/18/07 8:11 AM, "Shadab Wadiwala" wrote: > Hi !! > > I want to know what's the difference between the functions ---- > isset() and empty() > > I referred the function reference on php.net, but still couldn't the > exact answer to my query. > > > Shadab .I. Wadiwala > > My homepage:-- http://shadabworld.110mb.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri May 18 08:44:17 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 18 May 2007 08:44:17 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <20070517192608.7fd23fda.mba2000@ioplex.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <20070517182618.a1947144.mba2000@ioplex.com> <2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> <20070517185650.0f56fa74.mba2000@ioplex.com> <017e01c798d9$307ad530$07d6f4a7@ced> <20070517192608.7fd23fda.mba2000@ioplex.com> Message-ID: On 5/17/07, Michael B Allen wrote: > Hi CED, > > That does look like it's worth a look but it still doesn't look like the > "IMAP server is the ticket database" paradigm I'm talking about. One of > the main benefits of what I'm talking about is that you don't have to use > the application itself - you can just use your regular email. Correct > me if I'm wrong but this looks like you would have to actually log > into eventum to initiate or processes a ticket at some point in it's > lifetime. No? > > Mike Mike, build it this weekend, then sell it to Aniesh. ;-) You're totally right that it's not rocket science. It's much simpler than any open source project you're likely to run across, because why would someone bother "open sourcing" something so simple? (tongue firmly in cheek there) Aniesh, use IMAP. PHP's support is easy to get, once you figure out the right way to connect to your choice of server. You can create folders and move messages around on the server in order to enable workflows (seen, active, on hold, finished, cancelled). As Mike points out, whatever web front end you build can be extremely simple, because you can always perform complex admin stuff on the backend using an email client. Remember that in order to stay sane you absolutely MUST put a top-notch spam filter in front of this thing. -- Chris Snyder http://chxo.com/ From ben at projectskyline.com Fri May 18 09:51:47 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyline)) Date: Fri, 18 May 2007 09:51:47 -0400 Subject: [nycphp-talk] File upload choices Message-ID: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> Hello All, I'm working on a client spec now and I need to find the best way to allow a user to upload multiple files at the same time. What solutions are people happy with? I'm open to using any method to get this done {flash, js, whatever..}. I'd really like it to take place without refreshing the entire page. I'm using JS functions with *ajax* to keep the wizard-like part of the application very clean and fun to use. Thanks! Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons -------------- next part -------------- An HTML attachment was scrubbed... URL: From apg88zx at gmail.com Fri May 18 09:51:41 2007 From: apg88zx at gmail.com (Alvaro P.) Date: Fri, 18 May 2007 09:51:41 -0400 Subject: [nycphp-talk] File upload choices In-Reply-To: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> References: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> Message-ID: <464DAF6D.4030502@gmail.com> If you use GMail, check how they do their multiple file uploads, I believe they keep adding upload fields with the use of javascript. Alvaro Ben Sgro (ProjectSkyline) wrote: > Hello All, > > I'm working on a client spec now and I need to find the best way to allow > a user to upload multiple files at the same time. > > What solutions are people happy with? I'm open to using any method to get > this done {flash, js, whatever..}. I'd really like it to take place > without refreshing > the entire page. I'm using JS functions with *ajax* to keep the > wizard-like > part of the application very clean and fun to use. > > Thanks! > > Ben Sgro, Chief Engineer > ProjectSkyLine - Defining New Horizons > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jonbaer at jonbaer.com Fri May 18 09:57:46 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 18 May 2007 09:57:46 -0400 Subject: [nycphp-talk] File upload choices In-Reply-To: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> References: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> Message-ID: SWFUpload works pretty well ... http://swfupload.mammon.se/ - Jon On May 18, 2007, at 9:51 AM, Ben Sgro ((ProjectSkyline)) wrote: > Hello All, > > I'm working on a client spec now and I need to find the best way to > allow > a user to upload multiple files at the same time. > > What solutions are people happy with? I'm open to using any method > to get > this done {flash, js, whatever..}. I'd really like it to take place > without refreshing > the entire page. I'm using JS functions with *ajax* to keep the > wizard-like > part of the application very clean and fun to use. > > Thanks! > > Ben Sgro, Chief Engineer > ProjectSkyLine - Defining New Horizons > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ben at projectskyline.com Fri May 18 10:02:24 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyline)) Date: Fri, 18 May 2007 10:02:24 -0400 Subject: [nycphp-talk] File upload choices References: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> Message-ID: <002901c79955$2a52ae40$6b01a8c0@gamebox> Hello, 1st glance - very cool. Thanks. - Ben ----- Original Message ----- From: "Jon Baer" To: "NYPHP Talk" Sent: Friday, May 18, 2007 9:57 AM Subject: Re: [nycphp-talk] File upload choices > SWFUpload works pretty well ... > > http://swfupload.mammon.se/ > > - Jon > > On May 18, 2007, at 9:51 AM, Ben Sgro ((ProjectSkyline)) wrote: > >> Hello All, >> >> I'm working on a client spec now and I need to find the best way to >> allow >> a user to upload multiple files at the same time. >> >> What solutions are people happy with? I'm open to using any method >> to get >> this done {flash, js, whatever..}. I'd really like it to take place >> without refreshing >> the entire page. I'm using JS functions with *ajax* to keep the >> wizard-like >> part of the application very clean and fun to use. >> >> Thanks! >> >> Ben Sgro, Chief Engineer >> ProjectSkyLine - Defining New Horizons >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ramons at gmx.net Fri May 18 10:05:32 2007 From: ramons at gmx.net (David Krings) Date: Fri, 18 May 2007 10:05:32 -0400 Subject: [nycphp-talk] Difference between isset() and empty() . In-Reply-To: <173393.46504.qm@web8713.mail.in.yahoo.com> References: <173393.46504.qm@web8713.mail.in.yahoo.com> Message-ID: <464DB2AC.1000901@gmx.net> Shadab Wadiwala wrote: > Hi !! > > I want to know what's the difference between the functions ---- > isset() and empty() > > I referred the function reference on php.net, but still couldn't > the exact answer to my query. > > isset() checks if a key exists in a server array such as $_SESSION or $_POST regardless of the value, which can be NULL or an empty string. I never used empty(), but just by the name of it that function checks if the value of a given variable or array key is considered "nothing" for the respective variable type. I always check if something is set in $_SESSION or $_POST (I rarely use get) and then go with that value. In case it is not set I either set a known good default value or I set a value that is guaranteed to generate an obvious error (means a runtime error, crash, or such). David From ramons at gmx.net Fri May 18 10:17:17 2007 From: ramons at gmx.net (David Krings) Date: Fri, 18 May 2007 10:17:17 -0400 Subject: [nycphp-talk] File upload choices In-Reply-To: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> References: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> Message-ID: <464DB56D.9080209@gmx.net> Ben Sgro (ProjectSkyline) wrote: > Hello All, > > I'm working on a client spec now and I need to find the best way to allow > a user to upload multiple files at the same time. > > What solutions are people happy with? I'm open to using any method to get > this done {flash, js, whatever..}. I'd really like it to take place > without refreshing > the entire page. I'm using JS functions with *ajax* to keep the wizard-like > part of the application very clean and fun to use. > > Thanks! > I just came across this and went the ZIP file route. User creates a ZIP archive with any number of files or folders and then uploads that archive. I was impressed how easy it was to unzip and get the archive contents (after I was told that I have more than a hammer and that not everything is a nail). I also like the performance, although I haven't crash tested it yet with a huge archive. The disadvantages are somewhat obvious, the user needs to perform an extra step, the upload time can be quite lengthy (script time out, although that is easy to address), and the file size can be big (several MB, but that is also somewhat easy to address). It also requires a user that is capable of using a ZIP tool and locating the resulting file. The advantage is clearly that it doesn't require any JS, AJAX, Flash or whatever else, but works with a plain simple HTML browse box. Also, since the archive has a directory you know exactly which files and folders you get and where they are located after unpacking. That saved me from getting complicated and parsing through a bunch of unknown territory. You can also check the contents first and decide if there is anything in the archive that is useful for the purpose without handling the individual file. Hmmm, I should add this to my project.... In any case, this solution doesn't require fancy tools, the code needed is a few dozen lines, and all components involved are for free and exist on many systems. For what I want and can do this is the best solution. David From ntang at communityconnect.com Fri May 18 10:18:20 2007 From: ntang at communityconnect.com (Nicholas Tang) Date: Fri, 18 May 2007 10:18:20 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <20070518024504.05346e80.mba2000@ioplex.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com><20070517163553.c611a54d.mba2000@ioplex.com><464D34F2.8090607@omnistep.com> <20070518024504.05346e80.mba2000@ioplex.com> Message-ID: This is a really interesting concept. How would you deal with a.) priorities, b.) due dates, c.) simultaneous multiple users, and finally d.) performance? (The reason I ask about the last point is because we currently have ~200 non-closed (open, new, stalled, etc.) tickets, some of which have threads 20+ replies long. Even with an average of 2 replies per ticket, that's still 600 emails, which would have to be read in, parsed, and processed every time a user does anything. Admittedly for just updating tickets I'd assume it's ok if there's a delay, but when you're trying to read through a ticket's history or do some queue management, it sounds pretty ugly.) Nicholas > -----Original Message----- > That's no problem. There's a bunch of things you can do. The > procmailrc or the input script could simply pass on anything > that doesn't have at least one of a list of keywords (e.g. > the product name). You would still get the message in the > inbox but it wouldn't trigger the ticket routines. You might > get a few false negatives but you're almost guaranteed to > eliminate the spams. You can also whitelist senders you replied to. > > Mike From dcech at phpwerx.net Fri May 18 10:20:05 2007 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 18 May 2007 10:20:05 -0400 Subject: [nycphp-talk] Difference between isset() and empty() . In-Reply-To: <173393.46504.qm@web8713.mail.in.yahoo.com> References: <173393.46504.qm@web8713.mail.in.yahoo.com> Message-ID: <464DB615.4050007@phpwerx.net> Shadab Wadiwala wrote: > Hi !! > > I want to know what's the difference between the functions ---- > isset() and empty() > > I referred the function reference on php.net, but still couldn't the exact answer to my query. Try this page: http://www.php.net/manual/en/types.comparisons.php Dan From ben at projectskyline.com Fri May 18 10:24:33 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyline)) Date: Fri, 18 May 2007 10:24:33 -0400 Subject: [nycphp-talk] File upload choices References: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> <464DB56D.9080209@gmx.net> Message-ID: <003b01c79958$42544820$6b01a8c0@gamebox> Hello, David, great points. The stuff im building utilizes an activeX component to read into .STL (cad/cam) files and actually display a picture of what the part looks like. That code was written by someone else and Im just piggy backing off the modules ability to draw a 3D image of the .STL file. The zip is a good idea, its something to ask my client about. Right now, the need is to allow users to upload multiple files and then display a picture of what each part looks like. Zip is a good. Thanks for the thoughts. - Ben ----- Original Message ----- From: "David Krings" To: "NYPHP Talk" Sent: Friday, May 18, 2007 10:17 AM Subject: Re: [nycphp-talk] File upload choices > Ben Sgro (ProjectSkyline) wrote: >> Hello All, >> I'm working on a client spec now and I need to find the best way to >> allow >> a user to upload multiple files at the same time. >> What solutions are people happy with? I'm open to using any method to >> get >> this done {flash, js, whatever..}. I'd really like it to take place >> without refreshing >> the entire page. I'm using JS functions with *ajax* to keep the >> wizard-like >> part of the application very clean and fun to use. >> Thanks! >> > I just came across this and went the ZIP file route. User creates a ZIP > archive with any number of files or folders and then uploads that archive. > I was impressed how easy it was to unzip and get the archive contents > (after I was told that I have more than a hammer and that not everything > is a nail). I also like the performance, although I haven't crash tested > it yet with a huge archive. > The disadvantages are somewhat obvious, the user needs to perform an extra > step, the upload time can be quite lengthy (script time out, although that > is easy to address), and the file size can be big (several MB, but that is > also somewhat easy to address). It also requires a user that is capable of > using a ZIP tool and locating the resulting file. > The advantage is clearly that it doesn't require any JS, AJAX, Flash or > whatever else, but works with a plain simple HTML browse box. Also, since > the archive has a directory you know exactly which files and folders you > get and where they are located after unpacking. That saved me from getting > complicated and parsing through a bunch of unknown territory. You can also > check the contents first and decide if there is anything in the archive > that is useful for the purpose without handling the individual file. Hmmm, > I should add this to my project.... In any case, this solution doesn't > require fancy tools, the code needed is a few dozen lines, and all > components involved are for free and exist on many systems. For what I > want and can do this is the best solution. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From vtbludgeon at gmail.com Fri May 18 10:31:53 2007 From: vtbludgeon at gmail.com (David Mintz) Date: Fri, 18 May 2007 10:31:53 -0400 Subject: [nycphp-talk] Difference between isset() and empty() . In-Reply-To: <464DB2AC.1000901@gmx.net> References: <173393.46504.qm@web8713.mail.in.yahoo.com> <464DB2AC.1000901@gmx.net> Message-ID: <721f1cc50705180731r52d25561n2224574643d99530@mail.gmail.com> Yes but you certainly can check ANY variable with isset(), not just superglobal arrays. In addition to the technical differences between empty() and isset(), I would add that empty() is quite convenient and under-utilized. Consider if (isset($_GET['q'] && $_GET['q']) { ........ } versus if (!empty($_GET[) { ....... } empty() also has a cooler, more Zen-like name. On 5/18/07, David Krings wrote: > > > > isset() checks if a key exists in a server array such as $_SESSION or > $_POST regardless of the value, which can be NULL or an empty string. I > never used empty(), but just by the name of it that function checks if > the value of a given variable or array key is considered "nothing" for > the respective variable type. -- David Mintz http://davidmintz.org/ Just a spoonful of sugar helps the medicine go down In a most delightful way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Fri May 18 10:41:53 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 18 May 2007 10:41:53 -0400 Subject: [nycphp-talk] Difference between isset() and empty() . In-Reply-To: <464DB2AC.1000901@gmx.net> References: <173393.46504.qm@web8713.mail.in.yahoo.com> <464DB2AC.1000901@gmx.net> Message-ID: Example of options, note the empty() when using 0/1: http://localhost/ bool(false) bool(true) bool(false) http://localhost/?var bool(true) bool(true) bool(true) http://localhost/?var=0 bool(true) bool(true) bool(true) http://localhost/?var=1 bool(true) bool(false) bool(true) - Jon On May 18, 2007, at 10:05 AM, David Krings wrote: > Shadab Wadiwala wrote: >> Hi !! >> I want to know what's the difference between the functions >> ---- >> isset() and empty() >> I referred the function reference on php.net, but still >> couldn't the exact answer to my query. > isset() checks if a key exists in a server array such as $_SESSION > or $_POST regardless of the value, which can be NULL or an empty > string. I never used empty(), but just by the name of it that > function checks if the value of a given variable or array key is > considered "nothing" for the respective variable type. > I always check if something is set in $_SESSION or $_POST (I rarely > use get) and then go with that value. In case it is not set I > either set a known good default value or I set a value that is > guaranteed to generate an obvious error (means a runtime error, > crash, or such). > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ajai at bitblit.net Fri May 18 11:01:58 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 18 May 2007 11:01:58 -0400 (EDT) Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> Message-ID: On Fri, 18 May 2007, Aniesh joseph wrote: > I want to build a Support Ticket Sytem. I need to register for tickets > through mail.Two task is : > > 1. Whenever I recieved a mail from the clients, I have to register for a > ticket. > > 2. Read the contents of the mail. > > I am working on LAMP. How can accomplish the two tasks in a PHP-MYSQL? Can > someone help me ? OTRS (otrs.org) -- Aj. From ajai at bitblit.net Fri May 18 11:06:23 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 18 May 2007 11:06:23 -0400 (EDT) Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: Message-ID: On Thu, 17 May 2007, Jon Baer wrote: > Im sure either TRAC http://trac.edgewall.org/ or TRAC-HACKS www.trac- > hacks.org has it. > > This is a great (and what seems like) defacto ticketing system, I use > it all the time and rarely ever work w/o it. I install it for free @ > client sites just so I can stay sane on a project. But I can see it > being used as a general ticket system w/ ease Trac is great for working on a project but it is not a serious general-purpose ticketing system. For that, you need to look at more hardcore stuff like RT or OTRS (both of which work with email OOTB). -- Aj. From elizabeth at linuxbox.com Fri May 18 11:23:06 2007 From: elizabeth at linuxbox.com (elizabeth) Date: Fri, 18 May 2007 11:23:06 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: References: Message-ID: <464DC4DA.2020507@linuxbox.com> Take a look at dP-helpdesk http://linuxbox.com/tiki/tiki-index.php?page=dotProject+Packages Ajai Khattri wrote: > On Fri, 18 May 2007, Aniesh joseph wrote: > > >> I want to build a Support Ticket Sytem. I need to register for tickets >> through mail.Two task is : >> >> 1. Whenever I recieved a mail from the clients, I have to register for a >> ticket. >> >> 2. Read the contents of the mail. >> >> I am working on LAMP. How can accomplish the two tasks in a PHP-MYSQL? Can >> someone help me ? >> > > OTRS > (otrs.org) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mba2000 at ioplex.com Fri May 18 11:33:09 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Fri, 18 May 2007 11:33:09 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <464D34F2.8090607@omnistep.com> <20070518024504.05346e80.mba2000@ioplex.com> Message-ID: <20070518113309.ff7bb9ae.mba2000@ioplex.com> On Fri, 18 May 2007 10:18:20 -0400 "Nicholas Tang" wrote: > This is a really interesting concept. How would you deal with a.) > priorities, b.) due dates, c.) simultaneous multiple users, and finally > d.) performance? > > (The reason I ask about the last point is because we currently have ~200 > non-closed (open, new, stalled, etc.) tickets, some of which have > threads 20+ replies long. Even with an average of 2 replies per ticket, > that's still 600 emails, which would have to be read in, parsed, and > processed every time a user does anything. Admittedly for just updating > tickets I'd assume it's ok if there's a delay, but when you're trying to > read through a ticket's history or do some queue management, it sounds > pretty ugly.) Hi Nicholas, If you want a really sophisticated tracker then this solution would not be for you. You could do some of these thing though. You would need an actual database but considering you need to consistently generate new ticket numbers, you probably need one anyway. Then you could hang all sorts of ticket metadata off of that. That information would not be accessible through email however. There would have to be a separate web screen for that. I'm sure there are a lot of people doing support entirely through email right now (we are). So this is a nice gentle step up without changing the procedures too much. Support personnel can continue to just do everything with emails (but with an occasional ticket number fixup) while devs can give interesting things a priority so that it shows up in some colorful web table with priority, status, SquirrelMail links, etc. Than maybe later on when they want something more sophisticated they upgrade to Eventum or Trac. Mike -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From mba2000 at ioplex.com Fri May 18 11:37:39 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Fri, 18 May 2007 11:37:39 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <20070517182618.a1947144.mba2000@ioplex.com> <2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> <20070517185650.0f56fa74.mba2000@ioplex.com> <017e01c798d9$307ad530$07d6f4a7@ced> <20070517192608.7fd23fda.mba2000@ioplex.com> Message-ID: <20070518113739.abf68494.mba2000@ioplex.com> On Fri, 18 May 2007 08:44:17 -0400 csnyder wrote: > On 5/17/07, Michael B Allen wrote: > > Hi CED, > > > > That does look like it's worth a look but it still doesn't look like the > > "IMAP server is the ticket database" paradigm I'm talking about. One of > > the main benefits of what I'm talking about is that you don't have to use > > the application itself - you can just use your regular email. Correct > > me if I'm wrong but this looks like you would have to actually log > > into eventum to initiate or processes a ticket at some point in it's > > lifetime. No? > > > > Mike > > > Mike, build it this weekend, then sell it to Aniesh. ;-) Ok, I'm gonna do it! But not this weekend. And not next weekend. But maybe in June. Almost definitely this year at least. Probably. :-> Mike -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From rolan at omnistep.com Fri May 18 11:40:41 2007 From: rolan at omnistep.com (Rolan Yang) Date: Fri, 18 May 2007 11:40:41 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <20070518113739.abf68494.mba2000@ioplex.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <20070517182618.a1947144.mba2000@ioplex.com> <2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> <20070517185650.0f56fa74.mba2000@ioplex.com> <017e01c798d9$307ad530$07d6f4a7@ced> <20070517192608.7fd23fda.mba2000@ioplex.com> <20070518113739.abf68494.mba2000@ioplex.com> Message-ID: <464DC8F9.3070900@omnistep.com> Michael B Allen wrote: > On Fri, 18 May 2007 08:44:17 -0400 > csnyder wrote: > >> Mike, build it this weekend, then sell it to Aniesh. ;-) >> > > Ok, I'm gonna do it! > > But not this weekend. And not next weekend. But maybe in June. Almost > definitely this year at least. Probably. > > :-> > > Maybe if you added the task to your ticket system... ~Rolan From mba2000 at ioplex.com Fri May 18 12:07:32 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Fri, 18 May 2007 12:07:32 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <464DC8F9.3070900@omnistep.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <20070517182618.a1947144.mba2000@ioplex.com> <2B461CAA-FE73-46FC-9EF3-E56CA67B554F@jonbaer.com> <20070517185650.0f56fa74.mba2000@ioplex.com> <017e01c798d9$307ad530$07d6f4a7@ced> <20070517192608.7fd23fda.mba2000@ioplex.com> <20070518113739.abf68494.mba2000@ioplex.com> <464DC8F9.3070900@omnistep.com> Message-ID: <20070518120732.6e7082fd.mba2000@ioplex.com> On Fri, 18 May 2007 11:40:41 -0400 Rolan Yang wrote: > Michael B Allen wrote: > > On Fri, 18 May 2007 08:44:17 -0400 > > csnyder wrote: > > > >> Mike, build it this weekend, then sell it to Aniesh. ;-) > >> > > > > Ok, I'm gonna do it! > > > > But not this weekend. And not next weekend. But maybe in June. Almost > > definitely this year at least. Probably. > > > > :-> > > > > > > Maybe if you added the task to your ticket system... I already did: $ vi ~/todo :r!date oWrite "IMAP server is the ticket database" support ticket system with ... -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From jonbaer at jonbaer.com Fri May 18 12:12:06 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 18 May 2007 12:12:06 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: References: Message-ID: <59EF09E7-B2FA-4611-A9E3-625C525DE3B6@jonbaer.com> Hmmm ... Developer needs source control, ticketing, bug tracking and billing system all in one :-) Thanks for the otrs.org link, haven't seen it before ... - Jon On May 18, 2007, at 11:06 AM, Ajai Khattri wrote: > On Thu, 17 May 2007, Jon Baer wrote: > >> Im sure either TRAC http://trac.edgewall.org/ or TRAC-HACKS www.trac- >> hacks.org has it. >> >> This is a great (and what seems like) defacto ticketing system, I use >> it all the time and rarely ever work w/o it. I install it for free @ >> client sites just so I can stay sane on a project. But I can see it >> being used as a general ticket system w/ ease > > Trac is great for working on a project but it is not a serious > general-purpose ticketing system. For that, you need to look at more > hardcore stuff like RT or OTRS (both of which work with email OOTB). From ken at secdat.com Fri May 18 13:17:56 2007 From: ken at secdat.com (Kenneth Downs) Date: Fri, 18 May 2007 13:17:56 -0400 Subject: [nycphp-talk] Outline of Tuesday's talk Message-ID: <464DDFC4.1080004@secdat.com> Yesterday I finalized my outline for the Database talk coming up this Tuesday. I'll post the slides once I have them ready. 1. Pre-relational, eg. COBOL, implementing your own database 2. Arguments over hierarchical, network, and later relational models 3. Relational Revolution, using mathematics to prove a route to a goal: 3a. Edjard Dykstra's contribution 3b. EF Codd, first order logic 3c. EF Codd and relational algebra, sets 3d. EF Codd, self-containment, DDL, DML and system catalogs 3e. Tangent: Why code generation is so easy with databases 3f. Tangent, Ken's Law: People work well with tabular data 3g. Review of a data model as compared to file formats (XML is a file format) 3h. Conclusion: db theorists love relational because it is grounded in mathematics, compare objection orientation and procedure programming 4. Shocker: SQL is not relational 4a. Bags not sets 4b. World banking has not collapsed, non-relational must be somehow ok 4c. Dataphor to the rescue 5. Database Design Techniques, normalization, constraints, security, (automation if you use Andromeda hint hint) 5a. first normal form 5b. second normal form 5c. third normal form 5d. The Primary Key 5e. The foreign key 5f. Constraints 5g. Security 5h. Automation (Only in Andromeda AFAIK), or manually with: 5i. Triggers 5j. Other stuff: stored procedures, indexes 6. Common Flamewars 6a. E-A-V, recently discussed here 6b. ORM, database people don't like it. Don't try to turn an apples-bananas situation in apples-apples or bananas-bananas, use each tier as intended. 6c. Biz rules in application code or db server code? Will the true encapsulation please stand up? 7. Conclusion: TGIFridays, Wings or Stuffed Skins? -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From anieshjoseph at gmail.com Fri May 18 13:55:49 2007 From: anieshjoseph at gmail.com (Aniesh joseph) Date: Fri, 18 May 2007 23:25:49 +0530 Subject: [nycphp-talk] Email Piping Message-ID: <1b3d2fde0705181055w2a79d2bja51dca75fbb58329@mail.gmail.com> Hello, Our hosting server does not support email piping. How can I get mail content to php script ? Regards Aniesh Joseph -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthony at adcl.biz Fri May 18 13:59:27 2007 From: anthony at adcl.biz (Anthony) Date: Fri, 18 May 2007 12:59:27 -0500 Subject: [nycphp-talk] Email Piping References: <1b3d2fde0705181055w2a79d2bja51dca75fbb58329@mail.gmail.com> Message-ID: <001901c79976$473b0770$6501a8c0@ADCL1> You could interact with the mail server directly either using one of the POP3/SMTP classes out there or via raw sockets. Anthony ----- Original Message ----- From: Aniesh joseph To: talk at lists.nyphp.org Sent: Friday, May 18, 2007 12:55 PM Subject: [nycphp-talk] Email Piping Hello, Our hosting server does not support email piping. How can I get mail content to php script ? Regards Aniesh Joseph ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri May 18 16:19:32 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 18 May 2007 16:19:32 -0400 Subject: [nycphp-talk] Input whitelist validation warning In-Reply-To: References: Message-ID: On 5/17/07, Cliff Hirsch wrote: > > I just discovered a hole in a white list validation technique I bored from > a PHP security book ? no, not Chris' book. > > Beware in_array($_POST/GET['input'], $whitelist) > > Type matters. All input is string type and PHP will try to force type > matching. > > So the input string 'securityhole' will match the int number 0. > Hmmm, but it might as well be our book, because I don't immediately see the problem... $whitelist = array( 'foo', 'bar', 'baz' ); if ( !in_array( $_POST['input'], $whitelist ) ) { exit( "Denied, you cad!" ); } What is the condition under which that is exploited? -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Fri May 18 16:25:59 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 18 May 2007 16:25:59 -0400 Subject: [nycphp-talk] File upload choices In-Reply-To: References: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> Message-ID: On 5/18/07, Jon Baer wrote: > SWFUpload works pretty well ... > > http://swfupload.mammon.se/ > > - Jon > Seconded. You need to move the uploaded files into more permanent storage with each backgroup request made by SWFUpload, because PHP will delete the uploaded files if you don't move them. Store the file's locations in the user's session. Then when the containing form is submitted, you can check for any stored files in $_SESSION and process them all together at once along with the rest of the form data. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Fri May 18 16:26:34 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 18 May 2007 16:26:34 -0400 Subject: [nycphp-talk] File upload choices In-Reply-To: References: <001201c79953$ae3b5dd0$6b01a8c0@gamebox> Message-ID: On 5/18/07, csnyder wrote: > backgroup ... special way of spelling background. From cliff at pinestream.com Fri May 18 16:32:06 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 18 May 2007 16:32:06 -0400 Subject: [nycphp-talk] Input whitelist validation warning In-Reply-To: Message-ID: On 5/18/07 4:19 PM, "csnyder" wrote: > On 5/17/07, Cliff Hirsch wrote: > > I just discovered > a hole in a white list validation technique I bored from > a PHP security book > ? no, not Chris' book. > > Beware in_array($_POST/GET['input'], > $whitelist) > > Type matters. All input is string type and PHP will try to > force type > matching. > > So the input string 'securityhole' will match the > int number 0. > Hmmm, but it might as well be our book, because I don't > immediately see the problem... $whitelist = array( 'foo', 'bar', 'baz' ); if > ( !in_array( $_POST['input'], $whitelist ) ) { exit( "Denied, you cad!" > ); } What is the condition under which that is exploited? -- Chris Snyder http://chxo.com/ REFUND!!! The book goes back! Here?s the condition that caught me: $whitelist = (0,1); in_array($_POST[?input?], $whitelist); Since the values in the whitelist are ints, not strings, in_array attempts type conversion. In this example, any string that converts to 0 will match. At this point, since I had a match, I pass the bad input into the depths of the code.... I should have used: $whitelist = (?0?, ?1?); For input validation, any value in the whitelist should be a string. As a quick safety bandaid, I changed my code to only return values from the whitelist, not the source input. Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri May 18 16:39:47 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 18 May 2007 16:39:47 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: <20070518113309.ff7bb9ae.mba2000@ioplex.com> References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <464D34F2.8090607@omnistep.com> <20070518024504.05346e80.mba2000@ioplex.com> <20070518113309.ff7bb9ae.mba2000@ioplex.com> Message-ID: On Fri, 18 May 2007 10:18:20 -0400 > "Nicholas Tang" wrote: > > > This is a really interesting concept. How would you deal with a.) > > priorities, b.) due dates, c.) simultaneous multiple users, and finally > > d.) performance? > On 5/18/07, Michael B Allen wrote: > > You could do some of these thing though. You would need an actual database > but considering you need to consistently generate new ticket numbers, you > probably need one anyway. Then you could hang all sorts of ticket metadata > off of that. That information would not be accessible through email > however. There would have to be a separate web screen for that. Each email message has a unique message id. Most modern mail clients will show you threaded conversations by id, so it wouldn't exactly be difficult to carry on conversations about tickets using just the IMAP database. Priority is obvious as well, but due date not so much. Simultaneous users could be an issue if you scale past 3-5. I always cringe a bit when I realize I have email clients open to the same account at work, home, and in two web browsers at once. But I've never seen them do anything unexpected. As for performance, how many messages are in your inbox right now? Apple's Mail.app can search a mailbox with a few thousand messages in real time, something no web frontend can do. I'm not saying it's not crazy, but it is fun to think about. Until someone selects all the tickets and hits 'delete'... :-( -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Fri May 18 16:46:39 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 18 May 2007 16:46:39 -0400 Subject: [nycphp-talk] Input whitelist validation warning In-Reply-To: References: Message-ID: On 5/18/07, Cliff Hirsch wrote: > REFUND!!! The book goes back! Damn, no points for honesty in this town. > Here's the condition that caught me: > > $whitelist = (0,1); > > in_array($_POST['input'], $whitelist); Oh yeah, that'll get ya. Same as if ( $_POST['input'] == TRUE )... lots of funny stories about that one. I guess the rule of thumb is that you should always be validating against strings, since that's what you get in the request. Then if you specifically need the value to be bool, int, or float, cast it as such post-validation. Thanks for illustrating! -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Fri May 18 16:50:26 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 18 May 2007 16:50:26 -0400 Subject: [nycphp-talk] Email Piping In-Reply-To: <1b3d2fde0705181055w2a79d2bja51dca75fbb58329@mail.gmail.com> References: <1b3d2fde0705181055w2a79d2bja51dca75fbb58329@mail.gmail.com> Message-ID: On 5/18/07, Aniesh joseph wrote: > Hello, > > Our hosting server does not support email piping. How can I get mail content > to php script ? > > Regards > Aniesh Joseph Pick up the messages from a mailbox in a timely fashion. Then you can do things like batch-processing and graceful failure / retry. -- Chris Snyder http://chxo.com/ From cliff at pinestream.com Fri May 18 16:55:58 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 18 May 2007 16:55:58 -0400 Subject: [nycphp-talk] Input whitelist validation warning In-Reply-To: Message-ID: On 5/18/07 4:46 PM, "csnyder" wrote: > On 5/18/07, Cliff Hirsch wrote: > >> REFUND!!! The book goes back! > > Damn, no points for honesty in this town. > > >> Here's the condition that caught me: >> >> $whitelist = (0,1); >> >> in_array($_POST['input'], $whitelist); > > > Oh yeah, that'll get ya. Same as if ( $_POST['input'] == TRUE )... > lots of funny stories about that one. > > I guess the rule of thumb is that you should always be validating > against strings, since that's what you get in the request. Then if you > specifically need the value to be bool, int, or float, cast it as such > post-validation. > > Thanks for illustrating! Best regards, Cliff Hirsch, President ______________________________ Pinestream Communications, Inc. Publisher of Semiconductor Times & Telecom Trends 52 Pine Street, Weston, MA 02493 USA Tel: 781.647.8800, Fax: 781.647.8825 http://www.pinestream.com From cliff at pinestream.com Fri May 18 16:58:05 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 18 May 2007 16:58:05 -0400 Subject: [nycphp-talk] Input whitelist validation warning In-Reply-To: Message-ID: On 5/18/07 4:46 PM, "csnyder" wrote: > On 5/18/07, Cliff Hirsch wrote: > >> REFUND!!! The book goes back! > > Damn, no points for honesty in this town. Yeah, but your town has 4.2M women and only 3.8M men. http://www.nytimes.com/2007/05/17/fashion/17Dating.html?ex=1180152000&en=384 e1ad410bfa16f&ei=5070&emc=eta1 From mba2000 at ioplex.com Fri May 18 17:18:38 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Fri, 18 May 2007 17:18:38 -0400 Subject: [nycphp-talk] Support Ticket Sytem In-Reply-To: References: <1b3d2fde0705171316w7e1bbc17n544226920545fddc@mail.gmail.com> <20070517163553.c611a54d.mba2000@ioplex.com> <464D34F2.8090607@omnistep.com> <20070518024504.05346e80.mba2000@ioplex.com> <20070518113309.ff7bb9ae.mba2000@ioplex.com> Message-ID: <20070518171838.3aec61d8.mba2000@ioplex.com> On Fri, 18 May 2007 16:39:47 -0400 csnyder wrote: > On Fri, 18 May 2007 10:18:20 -0400 > > "Nicholas Tang" wrote: > > > > > This is a really interesting concept. How would you deal with a.) > > > priorities, b.) due dates, c.) simultaneous multiple users, and finally > > > d.) performance? > > > > On 5/18/07, Michael B Allen wrote: > > > > You could do some of these thing though. You would need an actual database > > but considering you need to consistently generate new ticket numbers, you > > probably need one anyway. Then you could hang all sorts of ticket metadata > > off of that. That information would not be accessible through email > > however. There would have to be a separate web screen for that. > > Each email message has a unique message id. Most modern mail clients > will show you threaded conversations by id, so it wouldn't exactly be > difficult to carry on conversations about tickets using just the IMAP > database. Priority is obvious as well, but due date not so much. > > Simultaneous users could be an issue if you scale past 3-5. I always > cringe a bit when I realize I have email clients open to the same > account at work, home, and in two web browsers at once. But I've never > seen them do anything unexpected. > > As for performance, how many messages are in your inbox right now? > Apple's Mail.app can search a mailbox with a few thousand messages in > real time, something no web frontend can do. Actually SquirrelMail is pretty good at this. I just searched my Spam folder with 1600 messages in it for the word 'incredible' in the Subject+Body and got 17 results in less than 5 seconds. I don't know if it's issuing a server side search command but SquirrelMail and IMAP are on the same host. But if you're just searhing for a ticket number you could also limit the search to the Subject line. And closed tickets could be moved to a 'Closed' folder so the search might also be limited by folder. Overall I'm not really clear as to why you think performance would be a problem. There would be nothing happening that you wouldn't do with a regular mail client and AFAIK IMAP servers are supposed to be able to handle a large number of users. > I'm not saying it's not crazy, but it is fun to think about. Until > someone selects all the tickets and hits 'delete'... :-( True but I suspect someone could do the same on any ticket system. Clearly an "IMAP server as the ticket database" ticket system would not be ideal for everyone. But I think it would be ideal for me since 90% of the time I would just want to handle tickets as email. Mike -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From selyah1 at yahoo.com Fri May 18 19:35:20 2007 From: selyah1 at yahoo.com (selyah) Date: Fri, 18 May 2007 16:35:20 -0700 (PDT) Subject: [nycphp-talk] Difference between isset() and empty() . In-Reply-To: <173393.46504.qm@web8713.mail.in.yahoo.com> Message-ID: <843777.71789.qm@web30806.mail.mud.yahoo.com> isset() checks to see if a button was pressed (usually the submit button), and as a result a "TRUE" flag will be "on". The empty() function means , like it says, if a space is empty, with out a value.........hope that helps Shadab Wadiwala wrote: Hi !! I want to know what's the difference between the functions ---- isset() and empty() I referred the function reference on php.net, but still couldn't the exact answer to my query. Shadab .I. Wadiwala My homepage:-- http://shadabworld.110mb.com --------------------------------- Here?s a new way to find what you're looking for - Yahoo! Answers _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Sat May 19 09:05:34 2007 From: ramons at gmx.net (David Krings) Date: Sat, 19 May 2007 09:05:34 -0400 Subject: [nycphp-talk] Connecting to MS SharePoint Message-ID: <464EF61E.2080006@gmx.net> Hi! Does anyone know how to or did before connect with an MS SharePoint system? I was asked to create some forms using InfoPath, but that app is fine for some stand-alone or barely interacting forms. I need way more dynamic forms than what I could click together in InfoPath. I don't say it is impossible, but using PHP strikes me to be quicker. The goal is to post resulting documentation (Word documents) to SharePoint for as much automation as possible. Is there an easy way or do I need to poke around in the MSSQL database? Any hints are greatly appreciated. David From ramons at gmx.net Sat May 19 09:41:17 2007 From: ramons at gmx.net (David Krings) Date: Sat, 19 May 2007 09:41:17 -0400 Subject: [nycphp-talk] Connecting to MS SharePoint In-Reply-To: <464EF61E.2080006@gmx.net> References: <464EF61E.2080006@gmx.net> Message-ID: <464EFE7D.8080305@gmx.net> Hi! I forgot.... if there is a suitable SharePoint replacement based on PHP/MySQL, that would work as well. David From randalrust at gmail.com Sat May 19 11:16:37 2007 From: randalrust at gmail.com (Randal Rust) Date: Sat, 19 May 2007 11:16:37 -0400 Subject: [nycphp-talk] Connecting to MS SharePoint In-Reply-To: <464EFE7D.8080305@gmx.net> References: <464EF61E.2080006@gmx.net> <464EFE7D.8080305@gmx.net> Message-ID: On 5/19/07, David Krings wrote: > I forgot.... if there is a suitable SharePoint replacement based on > PHP/MySQL, that would work as well. David, I haven't looked at this enough yet [1], but I wanted to share it with you. I am actualy looking into the same thing. We have a client that is interested in SharePoint, but there are some members of their team that are very concerned about vendor lock and any solution provided by MS. [1] http://www.springcm.com/v2/index.php?method=lp&sub=sharepoint01&track=CPC-GOO-070501-03.002.004_CATSHPT_ConShptHelp -- Randal Rust R.Squared Communications www.r2communications.com From ramons at gmx.net Sat May 19 11:48:37 2007 From: ramons at gmx.net (David Krings) Date: Sat, 19 May 2007 11:48:37 -0400 Subject: [nycphp-talk] Connecting to MS SharePoint In-Reply-To: References: <464EF61E.2080006@gmx.net> <464EFE7D.8080305@gmx.net> Message-ID: <464F1C55.6010306@gmx.net> Randal Rust wrote: > On 5/19/07, David Krings wrote: > >> I forgot.... if there is a suitable SharePoint replacement based on >> PHP/MySQL, that would work as well. > > David, I haven't looked at this enough yet [1], but I wanted to share > it with you. I am actualy looking into the same thing. We have a > client that is interested in SharePoint, but there are some members of > their team that are very concerned about vendor lock and any solution > provided by MS. > > [1] > http://www.springcm.com/v2/index.php?method=lp&sub=sharepoint01&track=CPC-GOO-070501-03.002.004_CATSHPT_ConShptHelp > > Thanks for the pointer, but this is a paid service. I am looking for something that I can host myself and expand/customize as desired. We currently use MS SharePoint in a pilot project and people like it. I may convince management to change to a cost neutral solution if that provides for more flexibility. Having this cost point attached to it makes this a no go right away. I was looking at the SharePoint theme for Drupal, but also looked briefly at Joomla as a framework and yet have to figure out if PHPNuke may be a framework for creating something better suited. I need to really get some convincing points as our IT is one of these shops that have MS-only blinkers on blindly following whatever MS claims is the best (typically that technology, that they lambasted a few years ago). David From cliff at pinestream.com Sat May 19 16:46:21 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Sat, 19 May 2007 16:46:21 -0400 Subject: [nycphp-talk] Config file format and admin suggestions Message-ID: My config files are currently a bunch of define statements. I?m going to change the format as I rewrite the admin back-end and am looking for suggestions ? anything from database storge to yaml files. I?m leaning towards PEAR Config to get me going. It appears to be fairly flexible, but it doesn?t support yaml or a DB-based container. I?m also curious about how people go about setting available white list values, default values, etc. without hardcoding them. Ideas? Suggestions? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From dell at sala.ca Sat May 19 18:42:34 2007 From: dell at sala.ca (Dell Sala) Date: Sat, 19 May 2007 18:42:34 -0400 Subject: [nycphp-talk] Config file format and admin suggestions In-Reply-To: References: Message-ID: On May 19, 2007, at 4:46 PM, Cliff Hirsch wrote: > My config files are currently a bunch of define statements. I?m > going to change the format as I rewrite the admin back-end and am > looking for suggestions ini files aren't bad. nice built-in php support with parse_ini_file() > I?m also curious about how people go about setting available white > list values, default values, etc. without hardcoding them. For validating and accessing the values I wrap the loaded config data in a class. I don't see how you can avoid hardcoding the default values or validation rules, except maybe storing those things in another config file. -- Dell From anieshjoseph at gmail.com Sat May 19 20:36:34 2007 From: anieshjoseph at gmail.com (Aniesh joseph) Date: Sun, 20 May 2007 06:06:34 +0530 Subject: [nycphp-talk] Download mail attachment automatically Message-ID: <1b3d2fde0705191736i4dad5878h65110f03c7516b23@mail.gmail.com> Hello, I need to read the mailbox using php script. I find that it is possible by IMAP functions. Using IMAP functions I can read header and body of the mail. But I cannot download attachment. I am planning to use cron to check the mailbox and if new mail, then download the attachment automatically and save the attachment details at MySql Table. But I do not know how to accomplish this. I need to download it without any user interaction. Could you please help me ? Regards Aniesh Joseph PHP Developer India -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Mon May 21 08:41:06 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 21 May 2007 08:41:06 -0400 Subject: [nycphp-talk] Config file format and admin suggestions In-Reply-To: Message-ID: On 5/19/07 6:42 PM, "Dell Sala" wrote: > On May 19, 2007, at 4:46 PM, Cliff Hirsch wrote: >> My config files are currently a bunch of define statements. I?m >> going to change the format as I rewrite the admin back-end and am >> looking for suggestions > > ini files aren't bad. nice built-in php support with parse_ini_file() > >> I?m also curious about how people go about setting available white >> list values, default values, etc. without hardcoding them. > > For validating and accessing the values I wrap the loaded config data > in a class. I don't see how you can avoid hardcoding the default > values or validation rules, except maybe storing those things in > another config file. > > -- Dell Ini files are growing on me. Seems easy enough, although extra parsing seems wasteful versus just using defines or array variables, especially with APC. Cycles count. I don't want to lose my comments when I write to the file -- hopefully PEAR conf will handle this. Cliff From ken at secdat.com Mon May 21 08:50:48 2007 From: ken at secdat.com (Kenneth Downs) Date: Mon, 21 May 2007 08:50:48 -0400 Subject: [nycphp-talk] Config file format and admin suggestions In-Reply-To: References: Message-ID: <465195A8.2030503@secdat.com> Cliff Hirsch wrote: > My config files are currently a bunch of define statements. I'm going > to change the format as I rewrite the admin back-end and am looking > for suggestions --- anything from database storge to yaml files. Probably the first thing you want to do is break them out. Database is good for things that users (including admins) can change. If it will not be changed by the user, only by the programmer, it is by definition code and should be managed with the rest of the code, not in the database. That being said, I've just gotten into YAML myself for that stuff, and like it a lot. I tend to think of it as associative arrays with less typing. Gives you complete freedom on structure. The other possibility I have not seen mentioned yet is to type the configs directly into associative arrays. This is a bit of a pain, but it does solve all of the parsing problems. > > I'm leaning towards PEAR Config to get me going. It appears to be > fairly flexible, but it doesn't support yaml or a DB-based container. > I'm also curious about how people go about setting available white > list values, default values, etc. without hardcoding them. > > Ideas? Suggestions? > > Cliff > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtbludgeon at gmail.com Mon May 21 10:24:56 2007 From: vtbludgeon at gmail.com (David Mintz) Date: Mon, 21 May 2007 10:24:56 -0400 Subject: [nycphp-talk] Input whitelist validation warning In-Reply-To: References: Message-ID: <721f1cc50705210724u19ef7f3ai391c063f574aa399@mail.gmail.com> Ladies, don't you see that all the hottest men are in front of their monitors reading talk at nyphp,org? On 5/18/07, Cliff Hirsch wrote: > > > Yeah, but your town has 4.2M women and only 3.8M men. > > http://www.nytimes.com/2007/05/17/fashion/17Dating.html?ex=1180152000&en=384 > e1ad410bfa16f&ei=5070&emc=eta1 > > -- David Mintz http://davidmintz.org/ Just a spoonful of sugar helps the medicine go down In a most delightful way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anieshjoseph at gmail.com Mon May 21 17:13:28 2007 From: anieshjoseph at gmail.com (Aniesh joseph) Date: Tue, 22 May 2007 02:43:28 +0530 Subject: [nycphp-talk] powerpoint to html convertion Message-ID: <1b3d2fde0705211413tbcb36b0r23d826f358205a1f@mail.gmail.com> Hello Do you know how to convert POWERPOINT to HTML using PHP script ? Regards Aniesh Joseph -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Tue May 22 10:54:59 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 22 May 2007 10:54:59 -0400 Subject: [nycphp-talk] Amazing application acceleration solution Message-ID: <20070522145037.M9616@pinestream.com> This will make you drool if you are frustrated by the spend my time on new features versus spend my time on performance optimization dilemma. http://www.strangeloopnetworks.com/ Of course, it's only available for asp.net. I had a briefing with the company yesterday. The concept is way cool. A drop-in inline appliance that automatically accelerates an application 10x without any coding changes. Yeah, sounds like smoke and mirrors or just caching. But its way more than that. Very cool -- wish they had something like this for php/mysql. Cliff From chsnyder at gmail.com Tue May 22 11:03:21 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 22 May 2007 11:03:21 -0400 Subject: [nycphp-talk] Amazing application acceleration solution In-Reply-To: <20070522145037.M9616@pinestream.com> References: <20070522145037.M9616@pinestream.com> Message-ID: On 5/22/07, Cliff Hirsch wrote: > sounds like smoke and mirrors or just caching. But its way more than that. Caching is more effective than smoke or mirrors. But okay, what is it? Caching + load balancing? Gzip compression? Philosopher's stone on-a-chip? -- Chris Snyder http://chxo.com/ From jeff.knight at gmail.com Tue May 22 11:06:12 2007 From: jeff.knight at gmail.com (Jeff Knight) Date: Tue, 22 May 2007 10:06:12 -0500 Subject: [nycphp-talk] Amazing application acceleration solution In-Reply-To: References: <20070522145037.M9616@pinestream.com> Message-ID: <2ca9ba910705220806v248c5f6ar1066b19d1b4df110@mail.gmail.com> If it is asp.net, my guess is Kool-aid On 5/22/07, csnyder wrote: > On 5/22/07, Cliff Hirsch wrote: > > > sounds like smoke and mirrors or just caching. But its way more than that. > > Caching is more effective than smoke or mirrors. But okay, what is it? > Caching + load balancing? > Gzip compression? > Philosopher's stone on-a-chip? > > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From cliff at pinestream.com Tue May 22 11:11:45 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 22 May 2007 11:11:45 -0400 Subject: [nycphp-talk] Amazing application acceleration solution In-Reply-To: References: <20070522145037.M9616@pinestream.com> Message-ID: <20070522150711.M17014@pinestream.com> On Tue, 22 May 2007 11:03:21 -0400, csnyder wrote > On 5/22/07, Cliff Hirsch wrote: > > > sounds like smoke and mirrors or just caching. But its way more than that. > > Caching is more effective than smoke or mirrors. But okay, what is > it? Caching + load balancing? Gzip compression? Philosopher's stone > on-a-chip? > Yes, yes, yes It does a whole bunch of things. There is an agent of the asp.net server, so the appliance can collect a lot of data and set a bunch of things. Apparently, asp.net includes this monster (like 100Kish) viewset hidden variable in each page -- sort of a piggish client-side session. The appliance can strip that out, since its not necessary. Most asp.net pages are not browse cached either. The appliance can change this dynamically and intelligently. It can compress where necessary, serve static content, even figure out what database queries can be cached and tell the asp.net server to do so since asp.net is tightly integrated with sqlserver. asp.net assume a dumb programmer, which creates a lot of bloat. The appliance can intelligently strip a lot of this out. From chsnyder at gmail.com Tue May 22 11:51:02 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 22 May 2007 11:51:02 -0400 Subject: [nycphp-talk] Amazing application acceleration solution In-Reply-To: <20070522150711.M17014@pinestream.com> References: <20070522145037.M9616@pinestream.com> <20070522150711.M17014@pinestream.com> Message-ID: On 5/22/07, Cliff Hirsch wrote: > asp.net assume a dumb programmer, which creates a lot of bloat. The appliance > can intelligently strip a lot of this out. ... so even a robot can write better code than an asp dev? Okay, it's probably true of the average php or rails app as well. Certainly an itelligent proxy does wonders for scalability and security. -- Chris Snyder http://chxo.com/ From ramons at gmx.net Tue May 22 12:50:22 2007 From: ramons at gmx.net (David Krings) Date: Tue, 22 May 2007 12:50:22 -0400 Subject: [nycphp-talk] Amazing application acceleration solution In-Reply-To: <20070522150711.M17014@pinestream.com> References: <20070522145037.M9616@pinestream.com> <20070522150711.M17014@pinestream.com> Message-ID: <46531F4E.3040406@gmx.net> Cliff Hirsch wrote: > Most asp.net pages are not browse cached either. The appliance can change this > dynamically and intelligently. It can compress where necessary, serve static > content, even figure out what database queries can be cached and tell the > asp.net server to do so since asp.net is tightly integrated with sqlserver. That is why MS planned or still plans to can IIS and integrate it into MSSQL. A database engine as a web server....scary. > asp.net assume a dumb programmer, which creates a lot of bloat. The appliance > can intelligently strip a lot of this out. That's why we use PHP and have control on how bloated things get. David From shadab_w at yahoo.co.in Tue May 22 12:50:36 2007 From: shadab_w at yahoo.co.in (Shadab Wadiwala) Date: Tue, 22 May 2007 17:50:36 +0100 (BST) Subject: [nycphp-talk] Some feedback about CakePHP ........... Message-ID: <979249.15159.qm@web8703.mail.in.yahoo.com> Hi !! I am trying my hands upon cakePHP these days. I wanted to get some feedback about it . I mean what is it's learning curve, where to find its tutorials ( website links which provide free tutorials on cakePHP) etc.... Shadab .I. Wadiwala My homepage:-- http://shadabworld.110mb.com --------------------------------- Office firewalls, cyber cafes, college labs, don't allow you to download CHAT? Here's a solution! -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1j0lkq002 at sneakemail.com Tue May 22 14:49:22 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 22 May 2007 11:49:22 -0700 Subject: [nycphp-talk] Amazing application acceleration solution In-Reply-To: <20070522150711.M17014@pinestream.com> References: <20070522145037.M9616@pinestream.com> <20070522150711.M17014@pinestream.com> Message-ID: <17864-85322@sneakemail.com> Cliff Hirsch cliff-at-pinestream.com |nyphp dev/internal group use| wrote: > Apparently,asp.net includes this monster (like 100Kish) viewset hidden > variable in each > >page -- sort of a piggish client-side session. The appliance can strip that >out, since its not necessary. > > that is hilarious. From thenov at gmail.com Wed May 23 22:46:36 2007 From: thenov at gmail.com (Michael Novak) Date: Wed, 23 May 2007 22:46:36 -0400 Subject: [nycphp-talk] shell exec Message-ID: Hi, I am trying to run a foundation tool on os x through the shell exec script. It is not working though. I have successfully run other command line functions and it worked. I then copy and pasted the command call in the php script into the terminal thinking there could be a typo but it worked in the terminal. Is there something I am missing? Thanks, Mike From ajai at bitblit.net Thu May 24 10:41:12 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 24 May 2007 10:41:12 -0400 (EDT) Subject: [nycphp-talk] shell exec In-Reply-To: Message-ID: On Wed, 23 May 2007, Michael Novak wrote: > I am trying to run a foundation tool on os x through the shell > exec script. It is not working though. I have successfully run other > command line functions and it worked. I then copy and pasted the > command call in the php script into the terminal thinking there could > be a typo but it worked in the terminal. > > Is there something I am missing? You may recall, that PHP scripts run under the same username as the user running the Apache server. So, any scripts you run from a PHP script will run as that user and not as you. Therefore it could be permissions or some other issue that does not allow the script to run. You could look through your web server error logs and see if any messages are logged there. -- Aj. From thenov at gmail.com Thu May 24 10:44:55 2007 From: thenov at gmail.com (Michael Novak) Date: Thu, 24 May 2007 10:44:55 -0400 Subject: [nycphp-talk] shell exec In-Reply-To: References: Message-ID: It could be permissions even though I can run other commands through the same script? On 5/24/07, Ajai Khattri wrote: > On Wed, 23 May 2007, Michael Novak wrote: > > > I am trying to run a foundation tool on os x through the shell > > exec script. It is not working though. I have successfully run other > > command line functions and it worked. I then copy and pasted the > > command call in the php script into the terminal thinking there could > > be a typo but it worked in the terminal. > > > > Is there something I am missing? > > You may recall, that PHP scripts run under the same username as the user > running the Apache server. So, any scripts you run from a PHP script will > run as that user and not as you. > > Therefore it could be permissions or some other issue that does not allow > the script to run. You could look through your web server error logs and > see if any messages are logged there. > > > > -- > Aj. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From dirn at dirnonline.com Thu May 24 10:54:15 2007 From: dirn at dirnonline.com (Andy Dirnberger) Date: Thu, 24 May 2007 10:54:15 -0400 Subject: [nycphp-talk] shell exec In-Reply-To: References: Message-ID: <000001c79e13$67574bd0$3605e370$@com> You need to check the execute permissions on the utility you are trying to run. The Apache user may have execute permission on the other utilities you are using and just not the one in question. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michael Novak Sent: Thursday, May 24, 2007 10:45 AM To: NYPHP Talk Subject: Re: [nycphp-talk] shell exec It could be permissions even though I can run other commands through the same script? On 5/24/07, Ajai Khattri wrote: > On Wed, 23 May 2007, Michael Novak wrote: > > > I am trying to run a foundation tool on os x through the shell > > exec script. It is not working though. I have successfully run other > > command line functions and it worked. I then copy and pasted the > > command call in the php script into the terminal thinking there could > > be a typo but it worked in the terminal. > > > > Is there something I am missing? > > You may recall, that PHP scripts run under the same username as the user > running the Apache server. So, any scripts you run from a PHP script will > run as that user and not as you. > > Therefore it could be permissions or some other issue that does not allow > the script to run. You could look through your web server error logs and > see if any messages are logged there. > > > > -- > Aj. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From thenov at gmail.com Thu May 24 11:09:23 2007 From: thenov at gmail.com (Michael Novak) Date: Thu, 24 May 2007 11:09:23 -0400 Subject: [nycphp-talk] shell exec In-Reply-To: <000001c79e13$67574bd0$3605e370$@com> References: <000001c79e13$67574bd0$3605e370$@com> Message-ID: thanks, where would those permissions live? -mike On 5/24/07, Andy Dirnberger wrote: > You need to check the execute permissions on the utility you are trying to > run. The Apache user may have execute permission on the other utilities you > are using and just not the one in question. > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of Michael Novak > Sent: Thursday, May 24, 2007 10:45 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] shell exec > > It could be permissions even though I can run other commands through > the same script? > > On 5/24/07, Ajai Khattri wrote: > > On Wed, 23 May 2007, Michael Novak wrote: > > > > > I am trying to run a foundation tool on os x through the shell > > > exec script. It is not working though. I have successfully run other > > > command line functions and it worked. I then copy and pasted the > > > command call in the php script into the terminal thinking there could > > > be a typo but it worked in the terminal. > > > > > > Is there something I am missing? > > > > You may recall, that PHP scripts run under the same username as the user > > running the Apache server. So, any scripts you run from a PHP script will > > run as that user and not as you. > > > > Therefore it could be permissions or some other issue that does not allow > > the script to run. You could look through your web server error logs and > > see if any messages are logged there. > > > > > > > > -- > > Aj. > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From dirn at dirnonline.com Thu May 24 11:34:15 2007 From: dirn at dirnonline.com (Andy Dirnberger) Date: Thu, 24 May 2007 11:34:15 -0400 Subject: [nycphp-talk] shell exec In-Reply-To: References: <000001c79e13$67574bd0$3605e370$@com> Message-ID: <000101c79e19$03238920$096a9b60$@com> The permissions live on the file (command) itself. In a *nix environment I use some variation of "ls -l /path/to/file" to check the permissions. In Windows I would right-click on the file and go to Properties->Security. I'm not sure the best way to do it in OSX, but I'm sure you can figure that out. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michael Novak Sent: Thursday, May 24, 2007 11:09 AM To: NYPHP Talk Subject: Re: [nycphp-talk] shell exec thanks, where would those permissions live? -mike On 5/24/07, Andy Dirnberger wrote: > You need to check the execute permissions on the utility you are trying to > run. The Apache user may have execute permission on the other utilities you > are using and just not the one in question. > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of Michael Novak > Sent: Thursday, May 24, 2007 10:45 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] shell exec > > It could be permissions even though I can run other commands through > the same script? > > On 5/24/07, Ajai Khattri wrote: > > On Wed, 23 May 2007, Michael Novak wrote: > > > > > I am trying to run a foundation tool on os x through the shell > > > exec script. It is not working though. I have successfully run other > > > command line functions and it worked. I then copy and pasted the > > > command call in the php script into the terminal thinking there could > > > be a typo but it worked in the terminal. > > > > > > Is there something I am missing? > > > > You may recall, that PHP scripts run under the same username as the user > > running the Apache server. So, any scripts you run from a PHP script will > > run as that user and not as you. > > > > Therefore it could be permissions or some other issue that does not allow > > the script to run. You could look through your web server error logs and > > see if any messages are logged there. > > > > > > > > -- > > Aj. > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From thenov at gmail.com Thu May 24 11:37:48 2007 From: thenov at gmail.com (Michael Novak) Date: Thu, 24 May 2007 11:37:48 -0400 Subject: [nycphp-talk] shell exec In-Reply-To: <000101c79e19$03238920$096a9b60$@com> References: <000001c79e13$67574bd0$3605e370$@com> <000101c79e19$03238920$096a9b60$@com> Message-ID: thanks.... i appreciate the help! On 5/24/07, Andy Dirnberger wrote: > > The permissions live on the file (command) itself. In a *nix environment > I > use some variation of "ls -l /path/to/file" to check the permissions. In > Windows I would right-click on the file and go to > Properties->Security. I'm > not sure the best way to do it in OSX, but I'm sure you can figure that > out. > > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On > Behalf Of Michael Novak > Sent: Thursday, May 24, 2007 11:09 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] shell exec > > thanks, where would those permissions live? > > -mike > > On 5/24/07, Andy Dirnberger wrote: > > You need to check the execute permissions on the utility you are trying > to > > run. The Apache user may have execute permission on the other utilities > you > > are using and just not the one in question. > > > > -----Original Message----- > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On > > Behalf Of Michael Novak > > Sent: Thursday, May 24, 2007 10:45 AM > > To: NYPHP Talk > > Subject: Re: [nycphp-talk] shell exec > > > > It could be permissions even though I can run other commands through > > the same script? > > > > On 5/24/07, Ajai Khattri wrote: > > > On Wed, 23 May 2007, Michael Novak wrote: > > > > > > > I am trying to run a foundation tool on os x through the shell > > > > exec script. It is not working though. I have successfully run > other > > > > command line functions and it worked. I then copy and pasted the > > > > command call in the php script into the terminal thinking there > could > > > > be a typo but it worked in the terminal. > > > > > > > > Is there something I am missing? > > > > > > You may recall, that PHP scripts run under the same username as the > user > > > running the Apache server. So, any scripts you run from a PHP script > will > > > run as that user and not as you. > > > > > > Therefore it could be permissions or some other issue that does not > allow > > > the script to run. You could look through your web server error logs > and > > > see if any messages are logged there. > > > > > > > > > > > > -- > > > Aj. > > > > > > _______________________________________________ > > > New York PHP Community Talk Mailing List > > > http://lists.nyphp.org/mailman/listinfo/talk > > > > > > NYPHPCon 2006 Presentations Online > > > http://www.nyphpcon.com > > > > > > Show Your Participation in New York PHP > > > http://www.nyphp.org/show_participation.php > > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtbludgeon at gmail.com Thu May 24 13:23:14 2007 From: vtbludgeon at gmail.com (David Mintz) Date: Thu, 24 May 2007 13:23:14 -0400 Subject: [nycphp-talk] building an event manager Message-ID: <721f1cc50705241023w59c3f390x2752da7754f05073@mail.gmail.com> Ladies and Gentlemen: I'm thinking about rolling an event manager and looking at the PEAR Calendar module. Anybody have any experience with it? I notice that it's in beta and the last release was November 2005, which makes me wonder if it has a future. Moving right along: how did you NYPHP dawgz put together NYPHP's calendar? Totally home-grown, or does it rely on any handy libs a person might be able to use? Many thanks, -- David Mintz http://davidmintz.org/ Just a spoonful of sugar helps the medicine go down In a most delightful way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Thu May 24 20:19:55 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 24 May 2007 20:19:55 -0400 Subject: [nycphp-talk] PHP Marketing In-Reply-To: References: Message-ID: Sounds like RoR fanboys in action. I just got my first chance to check this list in the last week and those links aren't active anymore... Know an alternate way to get to them? Other than having to type dollar signs all the time, I think php is great :) I like other languages too... some are much prettier... but every time I think I'll start a little project using something else... I can't think of a really good reason to spend the extra time it would take to do something I know I can do in php almost off the top of my head. What about you, Jon? If you were to start a new project, are there reasons you would choose ruby (or python or java or something) over php? Obviously if a project already exists in another language, that's a good reason to keep using it. Later, Rob On May 17, 2007, at 1:05 PM, Jon Baer wrote: > Looks like it needs to kick into overdrive ... > > http://aatw.tumblr.com/post/2036104 > http://aatw.tumblr.com/post/2036194 > > I even saw a "$this->sucks" t-shirt the other day. What is up with > that? > > ;-) > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jonbaer at jonbaer.com Thu May 24 21:24:41 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 24 May 2007 21:24:41 -0400 Subject: [nycphp-talk] PHP Marketing In-Reply-To: References: Message-ID: <1B044E1C-D070-4A81-BDC1-5B5D6767E410@jonbaer.com> You can pick them up @ http://www.railsenvy.com I think it really depends on the job @ hand, an app running under new JRuby and a JVM under EC2 cluster is pretty impressive, but that's just me. I guess whatever language runs the looping functions getPaid (),payBills() fastest usually wins out these days. - Jon On May 24, 2007, at 8:19 PM, Rob Marscher wrote: > Sounds like RoR fanboys in action. I just got my first chance to > check this list in the last week and those links aren't active > anymore... Know an alternate way to get to them? > > Other than having to type dollar signs all the time, I think php is > great :) I like other languages too... some are much prettier... > but every time I think I'll start a little project using something > else... I can't think of a really good reason to spend the extra > time it would take to do something I know I can do in php almost > off the top of my head. > > What about you, Jon? If you were to start a new project, are there > reasons you would choose ruby (or python or java or something) over > php? Obviously if a project already exists in another language, > that's a good reason to keep using it. > > Later, > Rob > > On May 17, 2007, at 1:05 PM, Jon Baer wrote: > >> Looks like it needs to kick into overdrive ... >> >> http://aatw.tumblr.com/post/2036104 >> http://aatw.tumblr.com/post/2036194 >> >> I even saw a "$this->sucks" t-shirt the other day. What is up >> with that? >> >> ;-) >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ajai at bitblit.net Thu May 24 22:54:59 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 24 May 2007 22:54:59 -0400 (EDT) Subject: [nycphp-talk] shell exec In-Reply-To: Message-ID: On Thu, 24 May 2007, Michael Novak wrote: > thanks, where would those permissions live? What sort of permissions? It kind of depends on what the script is trying to do right? Is it opening files? Or is it running system commands? Or is it trying to open a network connection? Or listen on a port? Or what? You should know what your script is trying to do and look in the appropriate place. -- Aj. From thenov at gmail.com Thu May 24 23:46:32 2007 From: thenov at gmail.com (Michael Novak) Date: Thu, 24 May 2007 23:46:32 -0400 Subject: [nycphp-talk] shell exec In-Reply-To: References: Message-ID: I was able to figure it out. I had to make that command available to all users using the unix user groups... it allowed me to brush up on the good old unix commands! Thanks for all your help! -Mike On 5/24/07, Ajai Khattri wrote: > > On Thu, 24 May 2007, Michael Novak wrote: > > > thanks, where would those permissions live? > > What sort of permissions? It kind of depends on what the script is trying > to do right? Is it opening files? Or is it running system commands? Or is > it trying to open a network connection? Or listen on a port? Or what? > > You should know what your script is trying to do and look in the > appropriate place. > > > > -- > Aj. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken at secdat.com Fri May 25 07:45:17 2007 From: ken at secdat.com (Kenneth Downs) Date: Fri, 25 May 2007 07:45:17 -0400 Subject: [nycphp-talk] PHP Marketing In-Reply-To: <1B044E1C-D070-4A81-BDC1-5B5D6767E410@jonbaer.com> References: <1B044E1C-D070-4A81-BDC1-5B5D6767E410@jonbaer.com> Message-ID: <4656CC4D.3000102@secdat.com> It seems the real joke is comparing two languages, which appear to be equally expressive. Jon Baer wrote: > You can pick them up @ http://www.railsenvy.com > > I think it really depends on the job @ hand, an app running under new > JRuby and a JVM under EC2 cluster is pretty impressive, but that's > just me. I guess whatever language runs the looping functions > getPaid(),payBills() fastest usually wins out these days. > > - Jon > > On May 24, 2007, at 8:19 PM, Rob Marscher wrote: > >> Sounds like RoR fanboys in action. I just got my first chance to >> check this list in the last week and those links aren't active >> anymore... Know an alternate way to get to them? >> >> Other than having to type dollar signs all the time, I think php is >> great :) I like other languages too... some are much prettier... but >> every time I think I'll start a little project using something >> else... I can't think of a really good reason to spend the extra time >> it would take to do something I know I can do in php almost off the >> top of my head. >> >> What about you, Jon? If you were to start a new project, are there >> reasons you would choose ruby (or python or java or something) over >> php? Obviously if a project already exists in another language, >> that's a good reason to keep using it. >> >> Later, >> Rob >> >> On May 17, 2007, at 1:05 PM, Jon Baer wrote: >> >>> Looks like it needs to kick into overdrive ... >>> >>> http://aatw.tumblr.com/post/2036104 >>> http://aatw.tumblr.com/post/2036194 >>> >>> I even saw a "$this->sucks" t-shirt the other day. What is up with >>> that? >>> >>> ;-) >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From ramons at gmx.net Fri May 25 10:04:13 2007 From: ramons at gmx.net (David Krings) Date: Fri, 25 May 2007 10:04:13 -0400 Subject: [nycphp-talk] IDE recommendations Message-ID: <4656ECDD.7030803@gmx.net> Hi! Since years I am using Luckasoft's EnginSite PHP Editor as IDE. It works well and has many features that more expensive IDEs offer. There is one major drawback to this IDE: the implementation of the debugger (PHP dbg) is....well....goofy. If I want to debug a series of scripts I have to automatically set a breakpoint at the beginning of each script. So when I start at login and want to debug something 6 script files down, I have to stop and continue six times before I get to the real breakpoint where I want to look at things. That is so utterly annoying and Luckasoft is kinda unresponsive to this issue that I set out to look for another IDE. I really like EnginSite PHP, but when adding a bunch of echos for debugging is faster than using a debugger, something's not right. I looked so far at Zend, but don't get the GUI. It seems to be overly complicated. I then tried some of these Eclipse based hodgepodges, but they lack a lot of features if I ever can get them to run. And I tried NuSphere PHPEd. I like it a lot and consider the Pro version, but I and my wallet can't get over the sticker shock of 299$. I'm not saying the app isn't worth that, but for a hobbyist with a budget of about 0$ that is a bit pricey. So, the question of the day is: Which other IDEs do you recommend that I look at? Any pointers are welcome. David From jonbaer at jonbaer.com Fri May 25 10:23:31 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 25 May 2007 10:23:31 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <4656ECDD.7030803@gmx.net> References: <4656ECDD.7030803@gmx.net> Message-ID: Not sure what OS but ... It may or may not work for you, but going the reverse route of lightweight editors and FirePHP is a good free simple route. Originally I felt the same that the more tools in an IDE the better and was excited about the idea of a DB query tool in the IDE but things really slow down after that. A new OS X editor for PHP that is pretty nice is Coda. No Windows clone yet. Linkage http://www.firephp.org/Reference/Documentation/Introduction.htm http://www.panic.com/coda/ Other lightweights for Win ... http://www.e-texteditor.com http://intype.info It would be nice to see a "How I Work" section on nyphp.org for IDE recommendations. I feel the topic comes up alot w/ good pros and cons. - Jon On May 25, 2007, at 10:04 AM, David Krings wrote: > Hi! > > Since years I am using Luckasoft's EnginSite PHP Editor as IDE. It > works well and has many features that more expensive IDEs offer. > There is one major drawback to this IDE: the implementation of the > debugger (PHP dbg) is....well....goofy. If I want to debug a series > of scripts I have to automatically set a breakpoint at the > beginning of each script. So when I start at login and want to > debug something 6 script files down, I have to stop and continue > six times before I get to the real breakpoint where I want to look > at things. That is so utterly annoying and Luckasoft is kinda > unresponsive to this issue that I set out to look for another IDE. > I really like EnginSite PHP, but when adding a bunch of echos for > debugging is faster than using a debugger, something's not right. > > I looked so far at Zend, but don't get the GUI. It seems to be > overly complicated. I then tried some of these Eclipse based > hodgepodges, but they lack a lot of features if I ever can get them > to run. And I tried NuSphere PHPEd. I like it a lot and consider > the Pro version, but I and my wallet can't get over the sticker > shock of 299$. I'm not saying the app isn't worth that, but for a > hobbyist with a budget of about 0$ that is a bit pricey. > > So, the question of the day is: Which other IDEs do you recommend > that I look at? > > Any pointers are welcome. > > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From lists at enobrev.com Fri May 25 11:50:52 2007 From: lists at enobrev.com (Mark Armendariz) Date: Fri, 25 May 2007 11:50:52 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <4656ECDD.7030803@gmx.net> References: <4656ECDD.7030803@gmx.net> Message-ID: <002401c79ee4$79cb57d0$6400a8c0@enobrev> > -----Original Message----- > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Krings > Subject: [nycphp-talk] IDE recommendations > I looked so far at Zend, but don't get the GUI. It seems to > be overly complicated. I then tried some of these Eclipse > based hodgepodges, but they lack a lot of features if I ever > can get them to run. And I tried NuSphere PHPEd. I like it a > lot and consider the Pro version, but I and my wallet can't > get over the sticker shock of 299$. I'm not saying the app > isn't worth that, but for a hobbyist with a budget of about > 0$ that is a bit pricey. Have you tried Zend's Eclipse IDE? I know there's another one out there which I tried a while ago - unhappily. Been using PDT for about 6 months now. Still a ways to go until 1.0, but I'm a fan. Especially with the SVN and Mylar plugins since I use Trac. The debugger is pretty good (proper breakpoints - including conditional breakpoints - in the ide), though a bit slow at times. http://www.eclipse.org/pdt/index.php At least you can see their progress in bugzilla, much unlike the zend ide. Oh, and it's open source, which is always fun. Still hoping to dive into vi/m some day (beyond the basics). Seems so damned powerful if you've the time to beat the learning curve. Mark From ramons at gmx.net Fri May 25 11:57:33 2007 From: ramons at gmx.net (David Krings) Date: Fri, 25 May 2007 11:57:33 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: References: <4656ECDD.7030803@gmx.net> Message-ID: <4657076D.9000600@gmx.net> Jon Baer wrote: > Not sure what OS but ... It may or may not work for you, but going the > reverse route of lightweight editors and FirePHP is a good free simple > route. Originally I felt the same that the more tools in an IDE the > better and was excited about the idea of a DB query tool in the IDE but > things really slow down after that. I currently do the development on Windope, but I plan to redistribute the usage of my PCs in such a way as that I can reduce the number of Windope boxes in favour of (K)Ubuntu. I don't mind either platform, but for right now I'd tend towards Windope just to keep the fear of the unknown out of the equation. While I like Luckasoft's MySQL client a lot, I don't need to have it integrated into the IDE and do all kinds of stuff. My SQL skills cover the basic insert, update, select, and delete queries, so I don't need a DB client that is so much smarter than I am. Also, I find that the free MySQL tools aren't bad, but a bit clumsy and sometimes a bit broken. But I do want some project management, a debugger, and a link between code word and PHP manual (such as F1 help in Enginsite). Can I do without all that, sure, but then I'd use notepad and write perfect code...ehem. > A new OS X editor for PHP that is pretty nice is Coda. No Windows clone > yet. > > Linkage > http://www.firephp.org/Reference/Documentation/Introduction.htm > http://www.panic.com/coda/ > > Other lightweights for Win ... > http://www.e-texteditor.com > http://intype.info I took FirePHP for a spin and it works, it for sure gives a nice overview what is happening on the page, but for me it is like riding a bike without training wheels - and yes, I still need those. > It would be nice to see a "How I Work" section on nyphp.org for IDE > recommendations. I feel the topic comes up alot w/ good pros and cons. > > - Jon I can wrap up my evaluations / findings in a document. I need to edit it once written as I tend to be very wordy....seems to be a German thing that doesn't go well with Americans, see http://www.atlantic-times.com/archive_detail.php?recordID=143 David From lists at enobrev.com Fri May 25 11:58:23 2007 From: lists at enobrev.com (Mark Armendariz) Date: Fri, 25 May 2007 11:58:23 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: References: <4656ECDD.7030803@gmx.net> Message-ID: <002a01c79ee5$86885710$6400a8c0@enobrev> > > It would be nice to see a "How I Work" section on nyphp.org > for IDE recommendations. I feel the topic comes up alot w/ > good pros and cons. > > - Jon Absolutely agree. Dev Server Setups (local and remote), Source Control, Upload / Build Strategies, Bug Tracking, IDEs, Configurations, etc. Could be damned useful to compare and contrast methods. Mark From agfische at email.smith.edu Fri May 25 12:04:01 2007 From: agfische at email.smith.edu (Aaron Fischer) Date: Fri, 25 May 2007 12:04:01 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <002a01c79ee5$86885710$6400a8c0@enobrev> References: <4656ECDD.7030803@gmx.net> <002a01c79ee5$86885710$6400a8c0@enobrev> Message-ID: <9CAA97A4-6277-4C9E-828E-EDF810A12C69@email.smith.edu> +1 That would be a great resource. Probably be good to standardize to require version numbers, date of user post, etc. since features vary from version to version. -Aaron On May 25, 2007, at 11:58 AM, Mark Armendariz wrote: >> >> It would be nice to see a "How I Work" section on nyphp.org >> for IDE recommendations. I feel the topic comes up alot w/ >> good pros and cons. >> >> - Jon > > Absolutely agree. Dev Server Setups (local and remote), Source > Control, > Upload / Build Strategies, Bug Tracking, IDEs, Configurations, > etc. Could > be damned useful to compare and contrast methods. > > Mark From lists at enobrev.com Fri May 25 12:17:12 2007 From: lists at enobrev.com (Mark Armendariz) Date: Fri, 25 May 2007 12:17:12 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <4657076D.9000600@gmx.net> References: <4656ECDD.7030803@gmx.net> <4657076D.9000600@gmx.net> Message-ID: <002c01c79ee8$27387080$6400a8c0@enobrev> > > I currently do the development on Windope, but I plan to > redistribute the usage of my PCs in such a way as that I can > reduce the number of Windope boxes in favour of (K)Ubuntu. Have win32 on my desktop and Ubuntu on my laptop which is why I went after eclipse, which works pretty much the same cross platform (with some minor inconsitencies, but nothing memorable thus far) > But I do want some project management Eclipse Mylar > , a debugger Eclipse PDT >, and a link > between code word and PHP manual Eclipse PDT: Mouseover for a description or Shift+F2 for the manual (browser tab in the ide) Sorry, don't mean to over-sell, but if more people use it I'm hoping it will make it to 1.0 a little faster. Mark From jonbaer at jonbaer.com Fri May 25 12:55:08 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 25 May 2007 12:55:08 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <002a01c79ee5$86885710$6400a8c0@enobrev> References: <4656ECDD.7030803@gmx.net> <002a01c79ee5$86885710$6400a8c0@enobrev> Message-ID: <23722CA0-7D76-4B9D-81DC-B703A828C3B1@jonbaer.com> You nailed it. In the past 4 gigs Ive worked @, each had a different deployment strategy, each w/ good techniques and a few wtf? The situation always comes up w/ how to properly work independently w/ o a) changing policy and b) with multiple developers and same codebase. I have to say that Capistrano 2.0 is something to possibly look @ (even if you don't know Ruby) as it does work extremely well w/ a PHP app. http://www.capify.org http://www.simplisticcomplexity.com/2006/8/16/automated-php- deployment-with-capistrano http://presentations.jamisbuck.org/railsconf2007/ Im still unsure what a PHP equivalent would be, Phing maybe? - Jon On May 25, 2007, at 11:58 AM, Mark Armendariz wrote: >> >> It would be nice to see a "How I Work" section on nyphp.org >> for IDE recommendations. I feel the topic comes up alot w/ >> good pros and cons. >> >> - Jon > > Absolutely agree. Dev Server Setups (local and remote), Source > Control, > Upload / Build Strategies, Bug Tracking, IDEs, Configurations, > etc. Could > be damned useful to compare and contrast methods. > > Mark > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From lists at enobrev.com Fri May 25 13:10:01 2007 From: lists at enobrev.com (Mark Armendariz) Date: Fri, 25 May 2007 13:10:01 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <23722CA0-7D76-4B9D-81DC-B703A828C3B1@jonbaer.com> References: <4656ECDD.7030803@gmx.net><002a01c79ee5$86885710$6400a8c0@enobrev> <23722CA0-7D76-4B9D-81DC-B703A828C3B1@jonbaer.com> Message-ID: <003c01c79eef$88b78790$6400a8c0@enobrev> > -----Original Message----- > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jon Baer > The situation always comes up w/ how to properly work > independently w/ o a) changing policy and b) with multiple > developers and same codebase. Also how people collaborate with designers (communications, templates, etc), which comprises the majority of my clients. From ramons at gmx.net Fri May 25 14:10:11 2007 From: ramons at gmx.net (David Krings) Date: Fri, 25 May 2007 14:10:11 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <002c01c79ee8$27387080$6400a8c0@enobrev> References: <4656ECDD.7030803@gmx.net> <4657076D.9000600@gmx.net> <002c01c79ee8$27387080$6400a8c0@enobrev> Message-ID: <46572683.7050906@gmx.net> Mark Armendariz wrote: >> But I do want some project management > Eclipse Mylar >> , a debugger > Eclipse PDT >> , and a link >> between code word and PHP manual > Eclipse PDT: Mouseover for a description or Shift+F2 for the manual (browser > tab in the ide) > > Sorry, don't mean to over-sell, but if more people use it I'm hoping it will > make it to 1.0 a little faster. > > Mark Nah, I think the Eclipse thingie is really slick and I gave PDT a spin as well. Of course, I cannot do an in depth analysis in half an hour, but since I know what I'm used to, what I want, and what I am looking for in an IDE, I get a good first impression. Unfortunately, PDT is similar to the other PHP solutions bolted onto Eclipse. It seems never to work out for me, for example, I couldn't get the debugger to work and after reading some docu and googling around I already got annoyed. So much for an "out of the box" solution. I did hear back from Mr. Lucka at Luckasoft and he explained what their motivation and plans are. The difference supposedly is between the free and commercial version of dbg and Luckasoft doesn't sell enough licenses to warrant the investment into the commercial version. Mr. Lucka wrote that after three years of selling EnginSite PHP they recovered about 1/3 of their development expenses. I didn't want to go down the path and discuss with him why that most likely happened that way. Luckasoft makes money selling software for product packaging, a PHP IDE is a side product that they apparently work on in slow times. Mr. Lucka was so nice to point out PHPEdit from WaterProof (www.waterproof.fr). It is reasonably priced (80$) and seems to not require the annoying start/stop of the debugger at script start. I put it through a quick test and I really like it. This is for sure one candidate that offers the features I want at a price I am willing to pay. I will compare it against NuSphere PHPEd Pro which strikes me a bit overpriced for what it can do. I'll report back. David From greg.rundlett at gmail.com Fri May 25 22:09:34 2007 From: greg.rundlett at gmail.com (Greg Rundlett) Date: Fri, 25 May 2007 22:09:34 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <46572683.7050906@gmx.net> References: <4656ECDD.7030803@gmx.net> <4657076D.9000600@gmx.net> <002c01c79ee8$27387080$6400a8c0@enobrev> <46572683.7050906@gmx.net> Message-ID: <5e2aaca40705251909w5772dc59k517ddfd42c568f4e@mail.gmail.com> For open source on Linux, Quanta is an excellent PHP IDE http://quanta.kdewebdev.org/ Comes with integrated debugging, structure parsing/browsing, project management, network transparency through fish:// and even svn integration, plus all the possibilities in the world to customize it with custom actions, toolbars and local (integrated) documentation. Example of customization: I created an action (button on a toolbar) to convert phpMyAdmin schema export (SQL) into mediawiki+geshi markup (e.g. ==tablename==SQL ) so that I can do a history-diffed, annotated schema in the wiki For as long as I've done the web, people invariably ask: What IDE do you use? What is your toolchain like? The idea of capturing this information into an organized discussion of methodology and tools is I think key to promoting webmastery and apprenticeship. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting annoying in email? From patrick at hexane.org Fri May 25 23:01:37 2007 From: patrick at hexane.org (Patrick May) Date: Fri, 25 May 2007 23:01:37 -0400 Subject: [nycphp-talk] PHP Marketing In-Reply-To: <1B044E1C-D070-4A81-BDC1-5B5D6767E410@jonbaer.com> References: <1B044E1C-D070-4A81-BDC1-5B5D6767E410@jonbaer.com> Message-ID: http://www.cafepress.com/apperrorrails On May 24, 2007, at 9:24 PM, Jon Baer wrote: > You can pick them up @ http://www.railsenvy.com > > I think it really depends on the job @ hand, an app running under > new JRuby and a JVM under EC2 cluster is pretty impressive, but > that's just me. I guess whatever language runs the looping > functions getPaid(),payBills() fastest usually wins out these days. > > - Jon > > On May 24, 2007, at 8:19 PM, Rob Marscher wrote: > >> Sounds like RoR fanboys in action. I just got my first chance to >> check this list in the last week and those links aren't active >> anymore... Know an alternate way to get to them? >> >> Other than having to type dollar signs all the time, I think php >> is great :) I like other languages too... some are much >> prettier... but every time I think I'll start a little project >> using something else... I can't think of a really good reason to >> spend the extra time it would take to do something I know I can do >> in php almost off the top of my head. >> >> What about you, Jon? If you were to start a new project, are >> there reasons you would choose ruby (or python or java or >> something) over php? Obviously if a project already exists in >> another language, that's a good reason to keep using it. >> >> Later, >> Rob >> >> On May 17, 2007, at 1:05 PM, Jon Baer wrote: >> >>> Looks like it needs to kick into overdrive ... >>> >>> http://aatw.tumblr.com/post/2036104 >>> http://aatw.tumblr.com/post/2036194 >>> >>> I even saw a "$this->sucks" t-shirt the other day. What is up >>> with that? >>> >>> ;-) >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ramons at gmx.net Sat May 26 07:30:49 2007 From: ramons at gmx.net (David Krings) Date: Sat, 26 May 2007 07:30:49 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <46572683.7050906@gmx.net> References: <4656ECDD.7030803@gmx.net> <4657076D.9000600@gmx.net> <002c01c79ee8$27387080$6400a8c0@enobrev> <46572683.7050906@gmx.net> Message-ID: <46581A69.9090908@gmx.net> David Krings wrote: > I did hear back from Mr. Lucka at Luckasoft and he explained what their > motivation and plans are. The difference supposedly is between the free > and commercial version of dbg and Luckasoft doesn't sell enough licenses > to warrant the investment into the commercial version. Mr. Lucka wrote > that after three years of selling EnginSite PHP they recovered about 1/3 > of their development expenses. I didn't want to go down the path and > discuss with him why that most likely happened that way. Luckasoft makes > money selling software for product packaging, a PHP IDE is a side > product that they apparently work on in slow times. Mr. Lucka was so > nice to point out PHPEdit from WaterProof (www.waterproof.fr). It is > reasonably priced (80$) and seems to not require the annoying start/stop > of the debugger at script start. I put it through a quick test and I > really like it. This is for sure one candidate that offers the features > I want at a price I am willing to pay. I will compare it against > NuSphere PHPEd Pro which strikes me a bit overpriced for what it can do. > > I'll report back. OK, here is my report back. Generally, NuSphere, WaterProof, and Luckasoft have about the same feature set. The big difference is the debugger implementation. Luckasoft uses the free dbg, WaterProof uses XDebug, and NuSphere the commerical dbg. XDebug doesn't require stopping at the start of every script, but blows up after hitting a rather harmless header("location:.... redirect. I use those all over the place to send the client to different places after the user made a decision as to what he/she wants to do. The only one debugger that doesn't have to run in hiccup mode and doesn't get confused by a redirect is the commercial dbg....exclusively for NuSphere. :( That may explain the price tag. WaterProof's PHPEd also comes with a personal license. One can write to WaterProof and explain why one needs a PHP IDE for free and depending on their good will one gets a personal license for free. Nice move! So, the conclusion so far is, unless I can come up with the 300$ for NuSphere there isn't any reason to change IDEs...at least not on Windows. Really disappointing and not because I want a pro IDE for free or on the cheap. If I'd have the bucks I'd buy NuSphere in a heartbeat, but you know, they don't pay much for a tech writer.Next try is to bug the dbg people. Gee, this rapidly inhales! David From ramons at gmx.net Sat May 26 20:20:14 2007 From: ramons at gmx.net (David Krings) Date: Sat, 26 May 2007 20:20:14 -0400 Subject: [nycphp-talk] IDE recommendations In-Reply-To: <46581A69.9090908@gmx.net> References: <4656ECDD.7030803@gmx.net> <4657076D.9000600@gmx.net> <002c01c79ee8$27387080$6400a8c0@enobrev> <46572683.7050906@gmx.net> <46581A69.9090908@gmx.net> Message-ID: <4658CEBE.70908@gmx.net> David Krings wrote: > So, the conclusion so far is, unless I can come up with the 300$ for > NuSphere there isn't any reason to change IDEs...at least not on > Windows. Really disappointing and not because I want a pro IDE for free > or on the cheap. If I'd have the bucks I'd buy NuSphere in a heartbeat, > but you know, they don't pay much for a tech writer.Next try is to bug > the dbg people. Turns out the dbg people are NuSphere as it seems. Anyhow, after digging around on the NuSphere website I came across the sales page that lists quite different prices. They currently have a promo that ends tomorrow and anyone evaluating their apps gets a 10% coupon. I then looked deeper into the various things that differs in Standard vs. Pro version. I took the advice to heart that less is often more and went with the standard version that clocks in at 53$ after promo and coupon. That is a fair price for a quite nice environment. I worked with it this afternoon and really like it, especially the debugger that works "VisualStudioish". One nice thing is also that if the script generates a PHP error it instantly stops the script at the offending line and turns into debug mode. That's sweet! The only beef I had so far with it is the quite crippled PHP version that comes with it. I replaced it with the one from the Luckasoft IDE and only had to change the dbg dll entry to match the file name and version. I save you all the ooohs and aaahs and write it up nicely with a comparison between the IDEs I tried and tested with my opinion. Thanks for all your pointers and hints. Although I didn't go with anything that got proposed, I tried most of it and it helped me a great deal to separate the lights from the darks and go with something that really suits my needs and wallet. David From ramons at gmx.net Sat May 26 20:23:27 2007 From: ramons at gmx.net (David Krings) Date: Sat, 26 May 2007 20:23:27 -0400 Subject: [nycphp-talk] $_SERVER Message-ID: <4658CF7F.7040102@gmx.net> Hi! Every web server generates a different $_SERVER array in PHP. I got burnt by it once. I used several keys/values that are present in the Luckasoft EnginServer, but not in Apache. I am sure that IIS again has a different $_SERVER and the whole picture may look different on Linux or Mac OS. The question of the day is: Which keys/values are guaranteed to be present in $_SERVER on all/most of the modern servers? David From jonbaer at jonbaer.com Sun May 27 11:51:56 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Sun, 27 May 2007 11:51:56 -0400 Subject: [nycphp-talk] $_SERVER In-Reply-To: <4658CF7F.7040102@gmx.net> References: <4658CF7F.7040102@gmx.net> Message-ID: <686E14DF-74DF-4CF4-9136-1A7A50733374@jonbaer.com> From what I recall this depends on what's thrown into it @ the SAPI handler level which you can view via source ... http://lxr.php.net/source/php-src/sapi/ http://lxr.php.net/source/php-src/sapi/apache2handler/sapi_apache2.c http://lxr.php.net/source/php-src/sapi/isapi/php5isapi.c - Jon On May 26, 2007, at 8:23 PM, David Krings wrote: > Hi! > > Every web server generates a different $_SERVER array in PHP. I got > burnt by it once. I used several keys/values that are present in > the Luckasoft EnginServer, but not in Apache. I am sure that IIS > again has a different $_SERVER and the whole picture may look > different on Linux or Mac OS. > > The question of the day is: Which keys/values are guaranteed to be > present in $_SERVER on all/most of the modern servers? > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From nate at cakephp.org Sun May 27 12:15:15 2007 From: nate at cakephp.org (Nate Abele) Date: Sun, 27 May 2007 12:15:15 -0400 Subject: [nycphp-talk] $_SERVER In-Reply-To: <20070527155434.EBC6410A8070@cakephp.org> References: <20070527155434.EBC6410A8070@cakephp.org> Message-ID: <85303B62-5A15-46E6-A8E3-708F4E33C67C@cakephp.org> > Date: Sat, 26 May 2007 20:23:27 -0400 > From: David Krings > Subject: [nycphp-talk] $_SERVER > To: NYPHP Talk > > Hi! > > Every web server generates a different $_SERVER array in PHP. I got > burnt by it once. I used several keys/values that are present in the > Luckasoft EnginServer, but not in Apache. I am sure that IIS again > has a > different $_SERVER and the whole picture may look different on > Linux or > Mac OS. > > The question of the day is: Which keys/values are guaranteed to be > present in $_SERVER on all/most of the modern servers? > > David Hi David, This may or may not be helpful for your specific situation, but I wrote a $_SERVER compatibility layer into Cake in the form of an env () function, which you can check out here: https://trac.cakephp.org/browser/branches/1.2.x.x/cake/basics.php#L978 It's not super-comprehensive, but it covers the basics, and uses fallback accessors if the $_SERVER variable is disabled entirely (I know Yahoo! does this, as there are some advantages in reduced overhead). - Nate From ramons at gmx.net Sun May 27 13:30:45 2007 From: ramons at gmx.net (David Krings) Date: Sun, 27 May 2007 13:30:45 -0400 Subject: [nycphp-talk] $_SERVER In-Reply-To: <686E14DF-74DF-4CF4-9136-1A7A50733374@jonbaer.com> References: <4658CF7F.7040102@gmx.net> <686E14DF-74DF-4CF4-9136-1A7A50733374@jonbaer.com> Message-ID: <4659C045.5060306@gmx.net> Jon Baer wrote: > From what I recall this depends on what's thrown into it @ the SAPI > handler level which you can view via source ... > > http://lxr.php.net/source/php-src/sapi/ > http://lxr.php.net/source/php-src/sapi/apache2handler/sapi_apache2.c > http://lxr.php.net/source/php-src/sapi/isapi/php5isapi.c Thanks, but are you sure about that being a PHP dependent thing? As mentioned earlier I walked into the trap with EnginSrv, which is fairly similar to IIS. I used the exact same PHP binaries on EnginSrv as well as Apache and $_SERVER was different. And in NuSphere I replaced their stripped down stock PHP version with the one from Luckasoft (which comes straight from php.net) and $_SERVER is different in each instance using the internal server and different again when using Apache. It seems to be server app dependent and PHP just packages up anything it can get into a nice array. Or is that what you wanted to point out? I'm not that versed in reading C code. :( David From ramons at gmx.net Sun May 27 13:41:08 2007 From: ramons at gmx.net (David Krings) Date: Sun, 27 May 2007 13:41:08 -0400 Subject: [nycphp-talk] $_SERVER In-Reply-To: <85303B62-5A15-46E6-A8E3-708F4E33C67C@cakephp.org> References: <20070527155434.EBC6410A8070@cakephp.org> <85303B62-5A15-46E6-A8E3-708F4E33C67C@cakephp.org> Message-ID: <4659C2B4.4090407@gmx.net> Nate Abele wrote: > Hi David, > > This may or may not be helpful for your specific situation, but I wrote > a $_SERVER compatibility layer into Cake in the form of an env() > function, which you can check out here: > > https://trac.cakephp.org/browser/branches/1.2.x.x/cake/basics.php#L978 > > It's not super-comprehensive, but it covers the basics, and uses > fallback accessors if the $_SERVER variable is disabled entirely (I know > Yahoo! does this, as there are some advantages in reduced overhead). Thank you! This is sweet! Right now I use my script in a 'controlled' environment as I am the only one who uses it. I do plan on releasing it to the public at some point, especially after adding the modularized internationalization and the context sensitive help portion that is intended to work with MadCap Flare's WebHelp. I need to make sure that it likely works on various servers and not only on a specific XAMPP version on the first Monday in March if the Friday before was full moon and the tide in San Diego is right. I doubt it will be a big problem, after all there are as many PHP based image galleries as lines in Cake's basic.php. I will need to investigate which keys/values I end up using in $_SERVER. Gee, we manage to standardize toilet seats, why not environment variables? David From mba2000 at ioplex.com Sun May 27 17:55:47 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Sun, 27 May 2007 17:55:47 -0400 Subject: [nycphp-talk] How not to save HTML entities to the DB when using htmlentities()? Message-ID: <20070527175547.614a3a34.mba2000@ioplex.com> Hi List, I don't do a lot of websites so pardon me if this is a stupid question. I am using htmlentities($text, ENT_COMPAT, 'UTF-8'); to escape text from the db to be displayed in form fields. This works fine but when the text is saved in the database the entities are saved with it. For example, if the text in the db is 'Mike & Ike', the form field looks like: This is displayed correctly but when I submit this to the server it is saved to the database as 'Mike & Ike'. The next time it is output in HTML I get: which is, of course, NOT displayed correctly. How can I protect my pages from script injection and display content in form fields correctly? Mike -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From rolan at omnistep.com Sun May 27 18:07:17 2007 From: rolan at omnistep.com (Rolan Yang) Date: Sun, 27 May 2007 18:07:17 -0400 Subject: [nycphp-talk] How not to save HTML entities to the DB when using htmlentities()? In-Reply-To: <20070527175547.614a3a34.mba2000@ioplex.com> References: <20070527175547.614a3a34.mba2000@ioplex.com> Message-ID: <465A0115.5010406@omnistep.com> Maybe you're looking for something like: mysql_query("insert into mytable (`tablekey`,`rowvalue`) values (NULL,'".mysql_real_escape_string(html_entity_decode($datafrompage))."'"); You shouldn't have to do the html_entity_decode though. I think you're double converting it somewhere. ~Rolan Michael B Allen wrote: > Hi List, > > I don't do a lot of websites so pardon me if this is a stupid question. > > I am using htmlentities($text, ENT_COMPAT, 'UTF-8'); to escape text from > the db to be displayed in form fields. This works fine but when the text > is saved in the database the entities are saved with it. > > For example, if the text in the db is 'Mike & Ike', the form field looks like: > > > > This is displayed correctly but when I submit this to the server it is > saved to the database as 'Mike & Ike'. The next time it is output > in HTML I get: > > > > which is, of course, NOT displayed correctly. > > How can I protect my pages from script injection and display content in > form fields correctly? > > Mike > > From shiflett at php.net Sun May 27 18:14:15 2007 From: shiflett at php.net (Chris Shiflett) Date: Sun, 27 May 2007 18:14:15 -0400 Subject: [nycphp-talk] How not to save HTML entities to the DB when using htmlentities()? In-Reply-To: <20070527175547.614a3a34.mba2000@ioplex.com> References: <20070527175547.614a3a34.mba2000@ioplex.com> Message-ID: <465A02B7.8030708@php.net> Michael B Allen wrote: > I am using htmlentities($text, ENT_COMPAT, 'UTF-8'); to escape text > from the db to be displayed in form fields. This works fine but when > the text is saved in the database the entities are saved with it. > > For example, if the text in the db is 'Mike & Ike', the form field > looks like: > > > > This is displayed correctly but when I submit this to the server it > is saved to the database as 'Mike & Ike'. This is only true if you escape it again. Since there is no abomination like magic_quotes_gpc for HTML escaping, it means you're doing this double escaping yourself, so the problem should be easy to track down. Hope that helps. Chris -- Chris Shiflett http://shiflett.org/ From michael.southwell at nyphp.com Sun May 27 19:27:26 2007 From: michael.southwell at nyphp.com (Michael Southwell) Date: Sun, 27 May 2007 19:27:26 -0400 Subject: [nycphp-talk] .htaccess redirect with $_GET Message-ID: <6.2.3.4.2.20070527192145.028cf060@mail.optonline.net> I have been unable to confirm in the Apache docs or elsewhere what experience shows, that something in .htaccess like this: RedirectMatch permanent somefile.htm http://example.com/anotherfile.php?variable=something will not work. There is of course a certain logic to its not working. Can somebody definitively either confirm or deny this? Michael Southwell, Vice President for Education New York PHP http://www.nyphp.com/training - In-depth PHP Training Courses From mba2000 at ioplex.com Sun May 27 20:49:18 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Sun, 27 May 2007 20:49:18 -0400 Subject: [nycphp-talk] How not to save HTML entities to the DB when using htmlentities()? In-Reply-To: <465A02B7.8030708@php.net> References: <20070527175547.614a3a34.mba2000@ioplex.com> <465A02B7.8030708@php.net> Message-ID: <20070527204918.caf4da87.mba2000@ioplex.com> On Sun, 27 May 2007 18:14:15 -0400 Chris Shiflett wrote: > Michael B Allen wrote: > > I am using htmlentities($text, ENT_COMPAT, 'UTF-8'); to escape text > > from the db to be displayed in form fields. This works fine but when > > the text is saved in the database the entities are saved with it. > > > > For example, if the text in the db is 'Mike & Ike', the form field > > looks like: > > > > > > > > This is displayed correctly but when I submit this to the server it > > is saved to the database as 'Mike & Ike'. > > This is only true if you escape it again. > > Since there is no abomination like magic_quotes_gpc for HTML escaping, > it means you're doing this double escaping yourself, so the problem > should be easy to track down. > > Hope that helps. Indeed. I was escaping again in my form field formatting code. Thanks, Mike -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From nyphp at dynamicink.com Sun May 27 21:56:38 2007 From: nyphp at dynamicink.com (Dynamic Ink) Date: Sun, 27 May 2007 21:56:38 -0400 Subject: [nycphp-talk] Modifying an XML tag name OR cloning an entire node including childnodes Message-ID: <002a01c7a0cb$71e97900$0401a8c0@e6300> I need to modify an XML tag name and am having quite a few setbacks trying to do it with DOM. Basically I am trying to turn something like this:
Hello Joe, nice to meet you
into this:

Hello Joe, nice to meet you

I could not figure out any way to change the readonly nodeName property, but I was able to make a new node, insert before the old node and then remove the old node. The problem is that I am populating the value of the new node with the $oldNode->nodeValue property which apparently only includes text, not child nodes, so I end up with:

Hello Joe, nice to meet you

Anyone have any ideas how to get the entire node value including any subnodes that may appear within? Or better yet, how can I just modify an XML tag name and avoid this hassle altogether? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Sun May 27 23:27:40 2007 From: ramons at gmx.net (David Krings) Date: Sun, 27 May 2007 23:27:40 -0400 Subject: [nycphp-talk] Modifying an XML tag name OR cloning an entire node including childnodes In-Reply-To: <002a01c7a0cb$71e97900$0401a8c0@e6300> References: <002a01c7a0cb$71e97900$0401a8c0@e6300> Message-ID: <465A4C2C.2080504@gmx.net> Dynamic Ink wrote: > Basically I am trying to turn something like this: >
Hello Joe, nice to meet you
> into this: >

Hello Joe, nice to meet you

In my naivity I'd propose doing a simple find and replace. After all, XML is nothing else than a string or a text file, so replacing the
with

and the

with

is almost trivial. You can do that line by line or for any size portion or even across one or more files. If it is really only about replacing all instances of one tag with another tag then throwing all this complicated stuff at it strikes me as a bit of overkill. Chances are that I am missing something here. David From jonbaer at jonbaer.com Sun May 27 23:30:26 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Sun, 27 May 2007 23:30:26 -0400 Subject: [nycphp-talk] $_SERVER In-Reply-To: <4659C045.5060306@gmx.net> References: <4658CF7F.7040102@gmx.net> <686E14DF-74DF-4CF4-9136-1A7A50733374@jonbaer.com> <4659C045.5060306@gmx.net> Message-ID: Well I remembered it from a PHP internals talk I saw once and the same question was asked about how $_* variables are pushed up from the server layer. Although Nate's solution is definitely what you want. It makes sense though as you work up the stack to have common variables to depend on even if they need to be set in the environment. - Jon On May 27, 2007, at 1:30 PM, David Krings wrote: > Jon Baer wrote: >> From what I recall this depends on what's thrown into it @ the >> SAPI handler level which you can view via source ... >> http://lxr.php.net/source/php-src/sapi/ >> http://lxr.php.net/source/php-src/sapi/apache2handler/sapi_apache2.c >> http://lxr.php.net/source/php-src/sapi/isapi/php5isapi.c > > Thanks, but are you sure about that being a PHP dependent thing? As > mentioned earlier I walked into the trap with EnginSrv, which is > fairly similar to IIS. I used the exact same PHP binaries on > EnginSrv as well as Apache and $_SERVER was different. > And in NuSphere I replaced their stripped down stock PHP version > with the one from Luckasoft (which comes straight from php.net) and > $_SERVER is different in each instance using the internal server > and different again when using Apache. > It seems to be server app dependent and PHP just packages up > anything it can get into a nice array. Or is that what you wanted > to point out? I'm not that versed in reading C code. :( > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jonbaer at jonbaer.com Sun May 27 23:43:00 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Sun, 27 May 2007 23:43:00 -0400 Subject: [nycphp-talk] Modifying an XML tag name OR cloning an entire node including childnodes In-Reply-To: <002a01c7a0cb$71e97900$0401a8c0@e6300> References: <002a01c7a0cb$71e97900$0401a8c0@e6300> Message-ID: Is it something you can do client side? http://docs.jquery.com/DOM/Manipulation#remove.28_expr_.29 SimpleXML will remove HTML but I think if you wrap w/ CDATA and use that instead of text might work? - Jon On May 27, 2007, at 9:56 PM, Dynamic Ink wrote: > I need to modify an XML tag name and am having quite a few setbacks > trying to do it with DOM. > > Basically I am trying to turn something like this: > >
Hello Joe, nice to meet you
> > into this: > >

Hello Joe, nice to meet you

> > I could not figure out any way to change the readonly nodeName > property, but I was able to make a new node, insert before the old > node and then remove the old node. The problem is that I am > populating the value of the new node with the $oldNode->nodeValue > property which apparently only includes text, not child nodes, so I > end up with: > >

Hello Joe, nice to meet you

> > Anyone have any ideas how to get the entire node value including > any subnodes that may appear within? Or better yet, how can I just > modify an XML tag name and avoid this hassle altogether? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From mba2000 at ioplex.com Mon May 28 00:20:01 2007 From: mba2000 at ioplex.com (Michael B Allen) Date: Mon, 28 May 2007 00:20:01 -0400 Subject: [nycphp-talk] Array Reference Strangeness Message-ID: <20070528002001.79ed2354.mba2000@ioplex.com> Hey, I'm having trouble with array references. Consider the following code: #!/usr/bin/php -q I want to be able to update elements in $arr after it has been added to $top. However, the assignment appears to make a copy (adding elements to $arr are not in the $arr added to $top). So I thought perhaps I need to assign $arr to $top by reference with '&'. However this yields strange behavior. Even though I feel like I'm creating a new $arr with each iteration of the loop, the reference has not changed in $top. Elements are updated in $arr within $top but it seems there is only one $arr. The output shows that the keys and values added are all the same: $ ./test.php Array ( [0] => Array ( [0] => a2 [key2] => val2 ) [1] => Array ( [0] => a2 [key2] => val2 ) [2] => Array ( [0] => a2 [key2] => val2 ) ) The behavior I want would yield: Array ( [0] => Array ( [0] => a0 [key0] => val0 ) [1] => Array ( [0] => a1 [key1] => val1 ) [2] => Array ( [0] => a2 [key2] => val2 What's the problem? Mike -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From nyphp at n0p.net Mon May 28 08:55:39 2007 From: nyphp at n0p.net (Flavio daCosta) Date: Mon, 28 May 2007 08:55:39 -0400 Subject: [nycphp-talk] Array Reference Strangeness In-Reply-To: <20070528002001.79ed2354.mba2000@ioplex.com> References: <20070528002001.79ed2354.mba2000@ioplex.com> Message-ID: <465AD14B.7020708@n0p.net> Remember from the php manual: References in php are not like C pointers. (they are symbol table aliases) On 05/28/2007 12:20 AM, Michael B Allen wrote: > for ($i = 0; $i < 3; $i++) { > $arr = array("a$i"); > $top[] = &$arr; > $arr["key$i"] = "val$i"; > } So what that is saying is that $arr and $top[n] are both pointing to the same symbol table (or zval), so each iteration of your loop, you never /create/ a new zval, in the first line, you (re)assign new data in the zval which $arr points to. The second line keep pushing another reference to the same zval. I usually do all my work to $arr first and then push a *copy* onto top, however, in order to get the effect of what you wanted "I want to be able to update elements in $arr after it has been added to $top", you could do something like assign the value into $top first, and then grab a reference to that value. References: <20070528002001.79ed2354.mba2000@ioplex.com> <465AD14B.7020708@n0p.net> Message-ID: <20070528104304.7891c4b9.mba2000@ioplex.com> On Mon, 28 May 2007 08:55:39 -0400 Flavio daCosta wrote: > Remember from the php manual: References in php are not like C pointers. > (they are symbol table aliases) > > On 05/28/2007 12:20 AM, Michael B Allen wrote: > > > for ($i = 0; $i < 3; $i++) { unset($arr); > > $arr = array("a$i"); > > $top[] = &$arr; > > $arr["key$i"] = "val$i"; > > } > > > So what that is saying is that $arr and $top[n] are both pointing to the > same symbol table (or zval), so each iteration of your loop, you never > /create/ a new zval, in the first line, you (re)assign new data in the > zval which $arr points to. The second line keep pushing another > reference to the same zval. > > I usually do all my work to $arr first and then push a *copy* onto top, > however, in order to get the effect of what you wanted "I want to be > able to update elements in $arr after it has been added to $top", you > could do something like assign the value into $top first, and then grab > a reference to that value. Hi Flavio, Actually one way that I found that seems to work fine is to simply unset($arr) at the top of the loop. Thanks, Mike PS: Flavio is a cool name. I envision you as a cross between Flavor Flav and Fabio (Yhea-boyieeee, I can't believe it's not butter.). Am I right? :-> -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/ From nyphp at n0p.net Mon May 28 12:00:55 2007 From: nyphp at n0p.net (Flavio daCosta) Date: Mon, 28 May 2007 12:00:55 -0400 Subject: [nycphp-talk] OT: Array Reference Strangeness In-Reply-To: <20070528104304.7891c4b9.mba2000@ioplex.com> References: <20070528002001.79ed2354.mba2000@ioplex.com> <465AD14B.7020708@n0p.net> <20070528104304.7891c4b9.mba2000@ioplex.com> Message-ID: <465AFCB7.3070406@n0p.net> On 05/28/2007 10:43 AM, Michael B Allen wrote: > PS: Flavio is a cool name. I envision you as a cross between Flavor Flav > and Fabio (Yhea-boyieeee, I can't believe it's not butter.). Am I right? Ha, rol. No clock necklaces or romance novel covers in my history, just a pointy hair php developer ;-P From nyphp at dynamicink.com Mon May 28 14:04:14 2007 From: nyphp at dynamicink.com (Dynamic Ink) Date: Mon, 28 May 2007 14:04:14 -0400 Subject: [nycphp-talk] Modifying an XML tag name OR cloning an entire nodeincluding childnodes References: <002a01c7a0cb$71e97900$0401a8c0@e6300> <465A4C2C.2080504@gmx.net> Message-ID: <001e01c7a152$9bf91110$0401a8c0@e6300> I can do it easily with regex, but the solution needs to be XML and in PHP 5, so either DOM or SimpleXML. I need to be able to control other aspects of the nodes that get modified so using regex will end up yielding a series of hacks. Also, I do not have control over the original XML content, so making fields CDATA does not appear to be an option. From shaijudavis at gmail.com Mon May 28 14:08:22 2007 From: shaijudavis at gmail.com (shaiju davis) Date: Mon, 28 May 2007 23:38:22 +0530 Subject: [nycphp-talk] Warning: Unknown(): Your script possibly Message-ID: <30ce306c0705281108y34f70ed0l4c6b889a3c3a0084@mail.gmail.com> Hi, I'm Shaiju Davis a PHP Programmer. When I submit a page I get the following warning. Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register*globals is enabled. You can disable this functionality and this warning by setting session.bug*compat*42 or session.bug*compat_warn to off, respectively. in Unknown on line 0 I'm using PHP Version 4.4.6. If you have any solution to this please update me. Thanks & Regards Shaiju Davis -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiflett at php.net Mon May 28 14:11:30 2007 From: shiflett at php.net (Chris Shiflett) Date: Mon, 28 May 2007 14:11:30 -0400 Subject: [nycphp-talk] Warning: Unknown(): Your script possibly In-Reply-To: <30ce306c0705281108y34f70ed0l4c6b889a3c3a0084@mail.gmail.com> References: <30ce306c0705281108y34f70ed0l4c6b889a3c3a0084@mail.gmail.com> Message-ID: <465B1B52.8050001@php.net> Shaiju Davis wrote: > Warning: Unknown(): Your script possibly relies on a session > side-effect which existed until PHP 4.2.3. Please be advised > that the session extension does not consider global variables > as a source of data, unless register/globals is enabled. You > can disable this functionality and this warning by setting > session.bug/compat/42 or session.bug/compat_warn to off, > respectively. Just use session_start() and the $_SESSION superglobal, then you won't see this warning. Chris -- Chris Shiflett http://shiflett.org/ From shaijudavis at gmail.com Mon May 28 14:25:58 2007 From: shaijudavis at gmail.com (shaiju davis) Date: Mon, 28 May 2007 23:55:58 +0530 Subject: [nycphp-talk] Warning: Unknown(): Your script possibly In-Reply-To: <465B1B52.8050001@php.net> References: <30ce306c0705281108y34f70ed0l4c6b889a3c3a0084@mail.gmail.com> <465B1B52.8050001@php.net> Message-ID: <30ce306c0705281125l391a24adme8b69a5af2089917@mail.gmail.com> Hi Chris, I'm using session_start() and $_SESSION an the register globals off. Then also I get this warning Thanks & Regards Shaiju Davis -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiflett at php.net Mon May 28 14:30:49 2007 From: shiflett at php.net (Chris Shiflett) Date: Mon, 28 May 2007 14:30:49 -0400 Subject: [nycphp-talk] Warning: Unknown(): Your script possibly In-Reply-To: <30ce306c0705281125l391a24adme8b69a5af2089917@mail.gmail.com> References: <30ce306c0705281108y34f70ed0l4c6b889a3c3a0084@mail.gmail.com> <465B1B52.8050001@php.net> <30ce306c0705281125l391a24adme8b69a5af2089917@mail.gmail.com> Message-ID: <465B1FD9.7050209@php.net> Shaiju Davis wrote: > I'm using session_start() and $_SESSION an the register > globals off. Then also I get this warning. Can you show us a small example that demonstrates this problem? Based on the information you've given us, my only guess is that you've got a naming collision that would have behaved differently in an earlier version of PHP, and the warning is meant to inform you of this. Chris -- Chris Shiflett http://shiflett.org/ From shaijudavis at gmail.com Mon May 28 15:10:38 2007 From: shaijudavis at gmail.com (shaiju davis) Date: Tue, 29 May 2007 00:40:38 +0530 Subject: [nycphp-talk] Warning: Unknown(): Your script possibly In-Reply-To: <465B1FD9.7050209@php.net> References: <30ce306c0705281108y34f70ed0l4c6b889a3c3a0084@mail.gmail.com> <465B1B52.8050001@php.net> <30ce306c0705281125l391a24adme8b69a5af2089917@mail.gmail.com> <465B1FD9.7050209@php.net> Message-ID: <30ce306c0705281210v39e294e5je76518d0aecf4dfd@mail.gmail.com> Hi Chris, It happens while I edit a page with the server information. It contains almost 20 fields to submit. sample code session_start(); // Starts the session if(isset($_SESSION['authen']) && $_SESSION['authen']=="Ddlj2N3Ko0J32kHm3Gyi") // Check if the user logged in { if($_SESSION['Pending Servers_status']==1) //Check whether the page is enabled { if($_SESSION['pending_access']==1) // Check user access rights { form-data }} Thanks & Regards Shaiju Davis -------------- next part -------------- An HTML attachment was scrubbed... URL: From selyah1 at yahoo.com Mon May 28 16:56:57 2007 From: selyah1 at yahoo.com (selyah) Date: Mon, 28 May 2007 13:56:57 -0700 (PDT) Subject: [nycphp-talk] random image selection In-Reply-To: <465B1FD9.7050209@php.net> Message-ID: <275562.15148.qm@web30801.mail.mud.yahoo.com> is there a simple way of selecting random images to be displayed from a library of images. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From Consult at CovenantEDesign.com Mon May 28 17:16:41 2007 From: Consult at CovenantEDesign.com (CED) Date: Mon, 28 May 2007 17:16:41 -0400 Subject: [nycphp-talk] random image selection References: <275562.15148.qm@web30801.mail.mud.yahoo.com> Message-ID: <006001c7a16d$7cc2d900$6401a8c0@ced> $i = rand( 0, count(imagesArray)); $imagesArray[$i]; ----- Original Message ----- From: selyah To: NYPHP Talk Sent: Monday, May 28, 2007 4:56 PM Subject: [nycphp-talk] random image selection is there a simple way of selecting random images to be displayed from a library of images. Thanks ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From Consult at CovenantEDesign.com Mon May 28 17:18:59 2007 From: Consult at CovenantEDesign.com (CED) Date: Mon, 28 May 2007 17:18:59 -0400 Subject: [nycphp-talk] random image selection References: <275562.15148.qm@web30801.mail.mud.yahoo.com> Message-ID: <007501c7a16d$cf2082b0$6401a8c0@ced> OR foreach(glob("imageDirectory/*.gif") as $item){ $sort[] = end(explode('/',$item)); } $i = rand(0, count($sort); echo $sort[$i]; HTH, Ed Edward JS Prevost II Me at EdwardPrevost.info www.EdwardPrevost.info ----- Original Message ----- From: selyah To: NYPHP Talk Sent: Monday, May 28, 2007 4:56 PM Subject: [nycphp-talk] random image selection is there a simple way of selecting random images to be displayed from a library of images. Thanks ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Mon May 28 22:11:28 2007 From: ramons at gmx.net (David Krings) Date: Mon, 28 May 2007 22:11:28 -0400 Subject: [nycphp-talk] Displaying time and date of the client Message-ID: <465B8BD0.7020405@gmx.net> Hi! After a year on the to do list I finally finished the portion for my script that generates a date and time display - of the client time. It requires that the client accepts a cookie, executes ECMAScript (fka JavaScript), and that the client computer time zone is set correctly. The client doesn't need to have the correct time, but the server should. It should compensate correctly for DST and will also work with the 'half' time zones such as the one for New Foundland. I don't know how you all feel about unsolicited code postings, so I won't do this right now and ask instead if anyone is interested in this. I find it to be quite clever, although the core piece being the client side script is from a good soul from the ECLUG list. Unfortunately, I do not have the original post anymore, so I cannot nail it down to a person. I asked about it over a year ago, if not longer. A few system crashes and mail clients later....I guess you know these stories. David From tim_lists at o2group.com Mon May 28 23:23:21 2007 From: tim_lists at o2group.com (Tim Lieberman) Date: Mon, 28 May 2007 21:23:21 -0600 Subject: [nycphp-talk] Displaying time and date of the client In-Reply-To: <465B8BD0.7020405@gmx.net> References: <465B8BD0.7020405@gmx.net> Message-ID: <465B9CA9.1030508@o2group.com> I'd love to see this. -Tim David Krings wrote: > Hi! > > After a year on the to do list I finally finished the portion for my > script that generates a date and time display - of the client time. > It requires that the client accepts a cookie, executes ECMAScript (fka > JavaScript), and that the client computer time zone is set correctly. > The client doesn't need to have the correct time, but the server > should. It should compensate correctly for DST and will also work with > the 'half' time zones such as the one for New Foundland. > > I don't know how you all feel about unsolicited code postings, so I > won't do this right now and ask instead if anyone is interested in > this. I find it to be quite clever, although the core piece being the > client side script is from a good soul from the ECLUG list. > Unfortunately, I do not have the original post anymore, so I cannot > nail it down to a person. I asked about it over a year ago, if not > longer. A few system crashes and mail clients later....I guess you > know these stories. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From nate at cakephp.org Tue May 29 11:01:47 2007 From: nate at cakephp.org (Nate Abele) Date: Tue, 29 May 2007 11:01:47 -0400 Subject: [nycphp-talk] $_SERVER In-Reply-To: <20070528032528.1159410A806D@cakephp.org> References: <20070528032528.1159410A806D@cakephp.org> Message-ID: <1A710F73-22CE-42FF-8646-235DCE1CDA6A@cakephp.org> > Date: Sun, 27 May 2007 23:30:26 -0400 > From: Jon Baer > Subject: Re: [nycphp-talk] $_SERVER > To: NYPHP Talk > > Well I remembered it from a PHP internals talk I saw once and the > same question was asked about how $_* variables are pushed up from > the server layer. Although Nate's solution is definitely what you > want. It makes sense though as you work up the stack to have common > variables to depend on even if they need to be set in the environment. > > - Jon > > On May 27, 2007, at 1:30 PM, David Krings wrote: > >> Jon Baer wrote: >>> From what I recall this depends on what's thrown into it @ the >>> SAPI handler level which you can view via source ... >>> http://lxr.php.net/source/php-src/sapi/ >>> http://lxr.php.net/source/php-src/sapi/apache2handler/sapi_apache2.c >>> http://lxr.php.net/source/php-src/sapi/isapi/php5isapi.c >> >> Thanks, but are you sure about that being a PHP dependent thing? As >> mentioned earlier I walked into the trap with EnginSrv, which is >> fairly similar to IIS. I used the exact same PHP binaries on >> EnginSrv as well as Apache and $_SERVER was different. >> And in NuSphere I replaced their stripped down stock PHP version >> with the one from Luckasoft (which comes straight from php.net) and >> $_SERVER is different in each instance using the internal server >> and different again when using Apache. >> It seems to be server app dependent and PHP just packages up >> anything it can get into a nice array. Or is that what you wanted >> to point out? I'm not that versed in reading C code. :( >> >> David Jon, Thanks for posting those links, btw. They'll be of help in emulating other environment variables. - Nate From ramons at gmx.net Tue May 29 20:11:26 2007 From: ramons at gmx.net (David Krings) Date: Tue, 29 May 2007 20:11:26 -0400 Subject: [nycphp-talk] Displaying time and date of the client In-Reply-To: References: <465B8BD0.7020405@gmx.net> Message-ID: <465CC12E.3050905@gmx.net> Hi! Here is the script that shows the time of the client system. I added quite a bit of commentary to it, so it should be obvious what it does. I wrapped it into a function, but that is not really necessary. As mentioned earlier the core piece is the JavaScript, which I did not create, but some smart person on the ECLUG mailing list. The rest may be trivial to you, but I think it is darn smart and I'm proud of it. :) Have fun and show your clients that you are ticking right. David -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: showclienttime.php URL: