From danielc at analysisandsolutions.com Sun Feb 1 19:07:19 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sun, 1 Feb 2004 19:07:19 -0500 Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem Message-ID: <20040202000719.GB18625@panix.com> Hi Folks: I just uploaded the latest release of PEAR DB, 1.6.0RC3. Can someone who's more familliar with PHP 5 than I please help fix the following problem? The DB_common::getAssoc() method works fine in PHP 4 but is producing really weird results under PHP 5. If you're wondering, PHP 5 is a windows snapshot from today. Attached are three files: 1) getassoc.out.diff is a side-by-side diff of the tests run under PHP 4 and PHP 5. See the "ABOUT TO BE RETURNED" section at the bottom for the diff. 2) common.php.getassoc.diff is a unified diff for patching the current DB/common.php file to provide the debugging info. 3) getassoc.phpt is a test file. Thanks so much, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 -------------- next part -------------- Index: common.php =================================================================== RCS file: /repository/pear/DB/DB/common.php,v retrieving revision 1.75 diff -u -r1.75 common.php --- common.php 31 Jan 2004 01:09:35 -0000 1.75 +++ common.php 1 Feb 2004 23:51:47 -0000 @@ -1361,11 +1361,19 @@ while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $arr = get_object_vars($row); $key = current($arr); +print "\n--------------\narr...\n"; +print_r($arr); +print "\nkey = $key\n"; +print "\nrow...\n"; +print_r($row); if ($group) { $results[$key][] = $row; } else { $results[$key] = $row; +print "\nresults[$key]...\n"; +print_r($results[$key]); } +print "--------------\n"; } } else { while (is_array($row = $res->fetchRow(DB_FETCHMODE_ORDERED))) { @@ -1398,6 +1406,9 @@ $res->free(); +echo "\n\$result ABOUT TO BE RETURNED...\n"; +print_r($results); + return $results; } -------------- next part -------------- 4.3.5RC2-dev | 5.0.0RC1-dev testing getAssoc with false force, array params, DB_FETCHMODE testing getAssoc with false force, array params, DB_FETCHMODE -------------- -------------- arr... arr... Array Array ( ( [a] => 42 [a] => 42 [b] => bing [b] => bing [c] => This is a test [c] => This is a test ) ) key = 42 key = 42 row... row... stdClass Object stdClass Object ( ( [a] => 42 [a] => 42 [b] => bing [b] => bing [c] => This is a test [c] => This is a test ) ) results[42]... results[42]... stdClass Object stdClass Object ( ( [a] => 42 [a] => 42 [b] => bing [b] => bing [c] => This is a test [c] => This is a test ) ) -------------- -------------- -------------- -------------- arr... arr... Array Array ( ( [a] => 42 [a] => 42 [b] => three [b] => three [c] => Three [c] => Three ) ) key = 42 key = 42 row... row... stdClass Object stdClass Object ( ( [a] => 42 [a] => 42 [b] => three [b] => three [c] => Three [c] => Three ) ) results[42]... results[42]... stdClass Object stdClass Object ( ( [a] => 42 [a] => 42 [b] => three [b] => three [c] => Three [c] => Three ) ) -------------- -------------- -------------- -------------- arr... arr... Array Array ( ( [a] => 2 [a] => 2 [b] => two [b] => two [c] => Two [c] => Two ) ) key = 2 key = 2 row... row... stdClass Object stdClass Object ( ( [a] => 2 [a] => 2 [b] => two [b] => two [c] => Two [c] => Two ) ) results[2]... results[2]... stdClass Object stdClass Object ( ( [a] => 2 [a] => 2 [b] => two [b] => two [c] => Two [c] => Two ) ) -------------- -------------- $result ABOUT TO BE RETURNED... $result ABOUT TO BE RETURNED... Array Array ( ( [42] => stdClass Object [42] => stdClass Object ( ( [a] => 42 | [a] => [b] => three | [b] => 1 [c] => Three | [c] => 1 ) ) [2] => stdClass Object [2] => stdClass Object ( ( [a] => 2 [a] => 2 [b] => two [b] => two [c] => Two [c] => Two ) ) ) ) -------------- next part -------------- --TEST-- DB_driver::get --SKIPIF-- * @internal */ chdir(dirname(__FILE__)); require_once './driver/skipif.inc'; ?> --FILE-- phptest table. */ require_once './mktable.inc'; /** * Local error callback handler. * * Drops the phptest table, prints out an error message and kills the * process. * * @param object $o PEAR error object automatically passed to this method * @return void * @see PEAR::setErrorHandling() */ function pe($o){ global $dbh; $dbh->setErrorHandling(PEAR_ERROR_RETURN); $dbh->query('DROP TABLE phptest'); die($o->toString()); } $dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); $dbh->query("INSERT INTO phptest VALUES (2, 'two', 'Two', '2002-02-22')"); $dbh->query("INSERT INTO phptest VALUES (42, 'three', 'Three', '2003-03-23')"); // print phpversion() . "\n"; print "testing getAssoc with false force, array params, DB_FETCHMODE_OBJECT:\n"; $ret =& $dbh->getAssoc('SELECT a, b, c FROM phptest WHERE a < ? ORDER BY b', false, array(100), DB_FETCHMODE_OBJECT); $dbh->setErrorHandling(PEAR_ERROR_RETURN); $dbh->query('DROP TABLE phptest'); ?> --EXPECT-- testing getAssoc with false force, array params, DB_FETCHMODE_OBJECT: -------------- arr... Array ( [a] => 42 [b] => bing [c] => This is a test ) key = 42 row... stdClass Object ( [a] => 42 [b] => bing [c] => This is a test ) results[42]... stdClass Object ( [a] => 42 [b] => bing [c] => This is a test ) -------------- -------------- arr... Array ( [a] => 42 [b] => three [c] => Three ) key = 42 row... stdClass Object ( [a] => 42 [b] => three [c] => Three ) results[42]... stdClass Object ( [a] => 42 [b] => three [c] => Three ) -------------- -------------- arr... Array ( [a] => 2 [b] => two [c] => Two ) key = 2 row... stdClass Object ( [a] => 2 [b] => two [c] => Two ) results[2]... stdClass Object ( [a] => 2 [b] => two [c] => Two ) -------------- $result ABOUT TO BE RETURNED... Array ( [42] => stdClass Object ( [a] => 42 [b] => three [c] => Three ) [2] => stdClass Object ( [a] => 2 [b] => two [c] => Two ) ) From dcech at phpwerx.net Sun Feb 1 23:58:00 2004 From: dcech at phpwerx.net (Dan Cech) Date: Sun, 01 Feb 2004 23:58:00 -0500 Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem In-Reply-To: <20040202000719.GB18625@panix.com> References: <20040202000719.GB18625@panix.com> Message-ID: <401DD8D8.3090309@phpwerx.net> Daniel Convissor wrote: > Hi Folks: > > I just uploaded the latest release of PEAR DB, 1.6.0RC3. > > Can someone who's more familliar with PHP 5 than I please help fix the > following problem? > > The DB_common::getAssoc() method works fine in PHP 4 but is producing > really weird results under PHP 5. If you're wondering, PHP 5 is a windows > snapshot from today. Hmm, I don't use PEAR DB myself, but looking at the relevant lines from common.php: if ($fetchmode == DB_FETCHMODE_ASSOC) { while (is_array($row = $res->fetchRow(DB_FETCHMODE_ASSOC))) { reset($row); $key = current($row); unset($row[key($row)]); if ($group) { $results[$key][] = $row; } else { $results[$key] = $row; } } } elseif ($fetchmode == DB_FETCHMODE_OBJECT) { while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $arr = get_object_vars($row); $key = current($arr); if ($group) { $results[$key][] = $row; } else { $results[$key] = $row; } } } else { It appears the code is not resetting the internal pointer of the array returned by get_object_vars ($row), which may be causing the odd behaviour.... I would suggest changing both $key = current($row); lines in the above code to $key = reset($row); and removing the existing call in the FETCHMODE_ASSOC section. Just my thoughts.... Dan From dcech at phpwerx.net Mon Feb 2 00:10:04 2004 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 02 Feb 2004 00:10:04 -0500 Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem In-Reply-To: <20040202000719.GB18625@panix.com> References: <20040202000719.GB18625@panix.com> Message-ID: <401DDBAC.3060103@phpwerx.net> Daniel Convissor wrote: > Hi Folks: > > I just uploaded the latest release of PEAR DB, 1.6.0RC3. > > Can someone who's more familliar with PHP 5 than I please help fix the > following problem? > > The DB_common::getAssoc() method works fine in PHP 4 but is producing > really weird results under PHP 5. If you're wondering, PHP 5 is a windows > snapshot from today. Ok, looking again the issue I mentioned is not going to cause your problem...it's definitely a tricky one... My guess would be that it is somehow related to the PHP5 behaviour of returning objects by reference rather than by value...it is possible that you have some odd reference problem happening, which would explain why the initial print_r debugging works but once the second loop goes through there are problems. I would be tempted to put an unset($row); at the end of your while loop just to make sure that you are not unwittingly overwriting any references... Dan From adam at trachtenberg.com Mon Feb 2 09:01:53 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Mon, 2 Feb 2004 09:01:53 -0500 (EST) Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem In-Reply-To: <20040202000719.GB18625@panix.com> References: <20040202000719.GB18625@panix.com> Message-ID: On Sun, 1 Feb 2004, Daniel Convissor wrote: > Can someone who's more familliar with PHP 5 than I please help fix the > following problem? > > The DB_common::getAssoc() method works fine in PHP 4 but is producing > really weird results under PHP 5. If you're wondering, PHP 5 is a windows > snapshot from today. It took me a while to get the whole testing framework up and running, but now that I have, your script seems to cause a core dump. I have a backtrace, but it would be nicer to see if we can get this down to a shorter script that doesn't involve lots of includes and database accesses. FWIW, I'm using the SQLite driver because it required the least amount of set up on my machine. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From ejp at well.com Mon Feb 2 11:48:34 2004 From: ejp at well.com (Edward Potter) Date: Mon, 2 Feb 2004 11:48:34 -0500 Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem In-Reply-To: <401DD8D8.3090309@phpwerx.net> References: <20040202000719.GB18625@panix.com> <401DD8D8.3090309@phpwerx.net> Message-ID: Yipes, php is beginning to look more like perl everyday! :-) On Feb 1, 2004, at 11:58 PM, Dan Cech wrote: > > if ($fetchmode == DB_FETCHMODE_ASSOC) { > while (is_array($row = > $res->fetchRow(DB_FETCHMODE_ASSOC))) { > reset($row); > $key = current($row); > unset($row[key($row)]); > if ($group) { > $results[$key][] = $row; > } else { > $results[$key] = $row; > } > } .......... > //----------------------------------------- http://mygoo.typepad.com http://mygoo.typepad.com/coder From Cbielanski at inta.org Mon Feb 2 11:56:48 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Mon, 2 Feb 2004 11:56:48 -0500 Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem Message-ID: It appears to me that "perl-style" is the outcome of a sort of "parallel evolution" in any language using the "." as something other than the member operator. Especially when it's OO in even the vaguest sense :) I mean, you've got to get there somehow when you can't say "object.member()", right? Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 -----Original Message----- From: Edward Potter [mailto:ejp at well.com] Sent: Monday, February 02, 2004 11:49 AM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem Yipes, php is beginning to look more like perl everyday! :-) On Feb 1, 2004, at 11:58 PM, Dan Cech wrote: > > if ($fetchmode == DB_FETCHMODE_ASSOC) { > while (is_array($row = > $res->fetchRow(DB_FETCHMODE_ASSOC))) { > reset($row); > $key = current($row); > unset($row[key($row)]); > if ($group) { > $results[$key][] = $row; > } else { > $results[$key] = $row; > } > } .......... > //----------------------------------------- http://mygoo.typepad.com http://mygoo.typepad.com/coder _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From danielc at analysisandsolutions.com Mon Feb 2 15:16:34 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 2 Feb 2004 15:16:34 -0500 Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem In-Reply-To: References: <20040202000719.GB18625@panix.com> Message-ID: <20040202201634.GA15822@panix.com> Hi Adam: On Mon, Feb 02, 2004 at 09:01:53AM -0500, Adam Maccabee Trachtenberg wrote: > > It took me a while to get the whole testing framework up and running, Sorry about that. Thanks for your perseverance. > but now that I have, your script seems to cause a core dump. Interesting. > I have a backtrace, but it would be nicer to see if we can get this > down to a shorter script that doesn't involve lots of includes and > database accesses. Done. I've pared down the PEAR. Still produces weird output, but not the same weird output. Also, the output changes if the SQLite file is unlinked at the end! Wacky! THANKS! --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 -------------- next part -------------- --TEST-- PEAR DB getAssoc Messed Up Under PHP 5 --FILE-- --EXPECT-- -------------- arr... Array ( [a] => 42 [b] => bing [c] => This is a test ) key = 42 row... stdClass Object ( [a] => 42 [b] => bing [c] => This is a test ) results[42]... stdClass Object ( [a] => 42 [b] => bing [c] => This is a test ) -------------- -------------- arr... Array ( [a] => 42 [b] => three [c] => Three ) key = 42 row... stdClass Object ( [a] => 42 [b] => three [c] => Three ) results[42]... stdClass Object ( [a] => 42 [b] => three [c] => Three ) -------------- -------------- arr... Array ( [a] => 2 [b] => two [c] => Two ) key = 2 row... stdClass Object ( [a] => 2 [b] => two [c] => Two ) results[2]... stdClass Object ( [a] => 2 [b] => two [c] => Two ) -------------- $result ABOUT TO BE RETURNED... Array ( [42] => stdClass Object ( [a] => 42 [b] => three [c] => Three ) [2] => stdClass Object ( [a] => 2 [b] => two [c] => Two ) ) From adam at trachtenberg.com Mon Feb 2 17:15:07 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Mon, 2 Feb 2004 17:15:07 -0500 (EST) Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem In-Reply-To: <20040202201634.GA15822@panix.com> References: <20040202000719.GB18625@panix.com> <20040202201634.GA15822@panix.com> Message-ID: On Mon, 2 Feb 2004, Daniel Convissor wrote: > On Mon, Feb 02, 2004 at 09:01:53AM -0500, Adam Maccabee Trachtenberg wrote: > > I have a backtrace, but it would be nicer to see if we can get this > > down to a shorter script that doesn't involve lots of includes and > > database accesses. > > Done. I've pared down the PEAR. Still produces weird output, but not the > same weird output. Also, the output changes if the SQLite file is > unlinked at the end! Wacky! Here is the shortest script I can come up with that still causes a crash: $array = array(1); $element = (object) array('a' => 1); get_object_vars($element); $array[] = $element; print_r($array); It's super subtle, you need to: 1) Use an array with a string key: array('a' => 1) 2) Cast it to an object and call get_object_vars() on the result. 3) Assign this cast object to an array with multiple elements. 4) Call print_r() on the resulting array. If I remove any of these, the crash goes away. I can generate a backtrace if you can't reproduce this on your machine. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From danielc at analysisandsolutions.com Mon Feb 2 22:04:55 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 2 Feb 2004 22:04:55 -0500 Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem In-Reply-To: References: <20040202000719.GB18625@panix.com> <20040202201634.GA15822@panix.com> Message-ID: <20040203030455.GA23324@panix.com> Hi Adam: On Mon, Feb 02, 2004 at 05:15:07PM -0500, Adam Maccabee Trachtenberg wrote: > > 1) Use an array with a string key: array('a' => 1) > 2) Cast it to an object and call get_object_vars() on the result. > 3) Assign this cast object to an array with multiple elements. > 4) Call print_r() on the resulting array. > > If I remove any of these, the crash goes away. I can generate a > backtrace if you can't reproduce this on your machine. Nice job. The thing is even more subtle than that, because your script runs fine on my machine... Array ( [0] => 1 [1] => stdClass Object ( [a] => 1 ) ) I hate these kinds of bugs. There's something similar to this happening with the Interbase extension in PHP 4. Total pain. I've tried to tweak things to make it act up on my machine, but no luck so far. Yeah, can you send me a backtrace and the details of your OS/PHP config please? I'll open up a bug report combining our issues. Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Mon Feb 2 22:31:56 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 2 Feb 2004 22:31:56 -0500 Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem In-Reply-To: <20040203030455.GA23324@panix.com> References: <20040202000719.GB18625@panix.com> <20040202201634.GA15822@panix.com> <20040203030455.GA23324@panix.com> Message-ID: <20040203033156.GA28651@panix.com> On Mon, Feb 02, 2004 at 10:04:55PM -0500, Daniel Convissor wrote: > Nice job. The thing is even more subtle than that, because your script > runs fine on my machine... DOH! I was running PHP when I executed your example. The output is wacky under PHP 5 on Win2k. Again, thanks so much Adam. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Tue Feb 3 00:55:27 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 3 Feb 2004 00:55:27 -0500 Subject: [nycphp-talk] PHP 5 guru: help fix simple PEAR DB problem In-Reply-To: <20040203033156.GA28651@panix.com> References: <20040202000719.GB18625@panix.com> <20040202201634.GA15822@panix.com> <20040203030455.GA23324@panix.com> <20040203033156.GA28651@panix.com> Message-ID: <20040203055527.GA9513@panix.com> Howdy: It's been reported as a bug: http://bugs.php.net/bug.php?id=27123 --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jsiegel1 at optonline.net Tue Feb 3 12:46:55 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Tue, 03 Feb 2004 12:46:55 -0500 Subject: [nycphp-talk] PHP Mail problem on Windows Server Message-ID: <401FDE8F.7020900@optonline.net> I'm getting the following error message - "Warning: mail(): SMTP server response: 503 This mail server requires authentication." - using the mail function with PHP on Windows. Since I've been spoiled and have been using only Linux (or FreeBSD) ... I've got no clue what needs to be done on Windows server. Jeff Siegel From yury at heavenspa.com Tue Feb 3 12:59:40 2004 From: yury at heavenspa.com (yury at heavenspa.com) Date: Tue, 3 Feb 2004 12:59:40 -0500 Subject: [nycphp-talk] PHP sessions and displaying who's online References: <401FDE8F.7020900@optonline.net> Message-ID: <00a201c3ea7f$7f343560$0400a8c0@heavenspanyc> Folks.. is there a simple effective way to do this *without* using mySQL? if there is a tutorial/link, i'd appreciate it.. example: there are 25 visitors online and 3,000,000 visitors since yesterday. regards yruy From tom at supertom.com Tue Feb 3 12:56:27 2004 From: tom at supertom.com (tom at supertom.com) Date: Tue, 03 Feb 2004 12:56:27 -0500 Subject: [nycphp-talk] PHP Mail problem on Windows Server In-Reply-To: <401FDE8F.7020900@optonline.net> Message-ID: Jeff, Is this on a shared server or a box you built yourself? If it is a box you built yourself, you can probably put the mail server of your upstream provider in php.ini to get around the problem, assuming the box is going to stay where it is for now. If the server really needs authenication, you may have to use sockets to send mail, but lets hope that's not the case! I have very limited experience in this, just thought I'd try to help. Good Luck, Tom *************************************************** What's Tom listening to right now? Find out here: http://www.supertom.com/current_track.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Jeff Siegel Sent: Tuesday, February 03, 2004 12:47 PM To: NYPHP Talk Subject: [nycphp-talk] PHP Mail problem on Windows Server I'm getting the following error message - "Warning: mail(): SMTP server response: 503 This mail server requires authentication." - using the mail function with PHP on Windows. Since I've been spoiled and have been using only Linux (or FreeBSD) ... I've got no clue what needs to be done on Windows server. Jeff Siegel _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From mitchy at spacemonkeylabs.com Tue Feb 3 13:02:19 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Tue, 03 Feb 2004 13:02:19 -0500 Subject: [nycphp-talk] PHP Mail problem on Windows Server In-Reply-To: <401FDE8F.7020900@optonline.net> References: <401FDE8F.7020900@optonline.net> Message-ID: <401FE22B.5000909@spacemonkeylabs.com> Jeff Siegel wrote: > I'm getting the following error message - > "Warning: mail(): SMTP server response: 503 This mail server requires > authentication." - using the mail function with PHP on Windows. Since > I've been spoiled and have been using only Linux (or FreeBSD) ... I've > got no clue what needs to be done on Windows server. What is this?!?! A secured Exchange server?!?! (scratches forehead) It simply cannot be. ;^P Seriously, what is the server running for SMTP services, Exchange? -- Mitch From mitchy at spacemonkeylabs.com Tue Feb 3 13:14:00 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Tue, 03 Feb 2004 13:14:00 -0500 Subject: [nycphp-talk] PHP sessions and displaying who's online In-Reply-To: <00a201c3ea7f$7f343560$0400a8c0@heavenspanyc> References: <401FDE8F.7020900@optonline.net> <00a201c3ea7f$7f343560$0400a8c0@heavenspanyc> Message-ID: <401FE4E8.8010102@spacemonkeylabs.com> yury at heavenspa.com wrote: > Folks.. is there a simple effective way to do this *without* using mySQL? > > if there is a tutorial/link, i'd appreciate it.. > > example: there are 25 visitors online and 3,000,000 visitors since > yesterday. If you pointed all of your session tempfiles to the same directory (like '/tmp/phpsess' or some such) then I suppose you could parse all the files in that directory to get a count. But I don't know a logical way to track the number of sessions and such, unless you wanted to write to a text file on the filesystem... It is definitely easier to use a database (PostgreSQL!), as with a decent database (PostgreSQL!) you can generate all the statistics that you need. Yes, the database (PostgreSQL!) is the best route to go. Did i mention PostgreSQL? Another question on this topic, is there a best-practice for LAMP^D^D^D^D LAPP community websites where you need to track online- and recent-logins and such? I'd love to hear any working knowledge that dictates a superior approach... For example, I'm thinking about a high-traffic website that would use pound up front, racks of apaches for httpd, sql relay in front of the database groups, and clusters of slaves for reads (and some homegrown goofiness for CRUD operations). Where would you put session data for this, and how would you get your 'XXX online, XXX this week' type of information? -- Mitch From dcech at phpwerx.net Tue Feb 3 13:22:57 2004 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 03 Feb 2004 13:22:57 -0500 Subject: [nycphp-talk] PHP Mail problem on Windows Server In-Reply-To: <401FDE8F.7020900@optonline.net> References: <401FDE8F.7020900@optonline.net> Message-ID: <401FE701.4010602@phpwerx.net> Jeff Siegel wrote: > I'm getting the following error message - > "Warning: mail(): SMTP server response: 503 This mail server requires > authentication." - using the mail function with PHP on Windows. Since > I've been spoiled and have been using only Linux (or FreeBSD) ... I've > got no clue what needs to be done on Windows server. You're going to kick yourself Jeff. Dan From jsiegel1 at optonline.net Tue Feb 3 13:24:18 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Tue, 03 Feb 2004 13:24:18 -0500 Subject: [nycphp-talk] PHP Mail problem on Windows Server In-Reply-To: <401FE22B.5000909@spacemonkeylabs.com> References: <401FDE8F.7020900@optonline.net> <401FE22B.5000909@spacemonkeylabs.com> Message-ID: <401FE752.7000608@optonline.net> It's using MailEnable. I think it needs to be configured to allow local IP address (127.0.0.1) to send mail. Jeff Mitch Pirtle wrote: > Jeff Siegel wrote: > >> I'm getting the following error message - >> "Warning: mail(): SMTP server response: 503 This mail server requires >> authentication." - using the mail function with PHP on Windows. Since >> I've been spoiled and have been using only Linux (or FreeBSD) ... I've >> got no clue what needs to be done on Windows server. > > > What is this?!?! A secured Exchange server?!?! > > (scratches forehead) > > It simply cannot be. ;^P > > Seriously, what is the server running for SMTP services, Exchange? > > -- Mitch > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" From jsiegel1 at optonline.net Tue Feb 3 13:24:55 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Tue, 03 Feb 2004 13:24:55 -0500 Subject: [nycphp-talk] PHP Mail problem on Windows Server In-Reply-To: References: Message-ID: <401FE777.1020300@optonline.net> Tom, It's on a shared box using Win 2003 and mailenable which, I believe, handles SMTP services. I think I may have a solution. http://www.mailenable.com/kb/Content/Article.asp?ID=ME020044 Jeff tom at supertom.com wrote: > Jeff, > > Is this on a shared server or a box you built yourself? If it is a box you > built yourself, you can probably put the mail server of your upstream > provider in php.ini to get around the problem, assuming the box is going to > stay where it is for now. > > If the server really needs authenication, you may have to use sockets to > send mail, but lets hope that's not the case! > > I have very limited experience in this, just thought I'd try to help. > > Good Luck, > > Tom > > > > > > *************************************************** > What's Tom listening to right now? Find out here: > http://www.supertom.com/current_track.php > > > > > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Jeff Siegel > Sent: Tuesday, February 03, 2004 12:47 PM > To: NYPHP Talk > Subject: [nycphp-talk] PHP Mail problem on Windows Server > > > I'm getting the following error message - > "Warning: mail(): SMTP server response: 503 This mail server requires > authentication." - using the mail function with PHP on Windows. Since > I've been spoiled and have been using only Linux (or FreeBSD) ... I've > got no clue what needs to be done on Windows server. > > Jeff Siegel > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" From jsiegel1 at optonline.net Tue Feb 3 13:28:15 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Tue, 03 Feb 2004 13:28:15 -0500 Subject: [nycphp-talk] PHP Mail problem on Windows Server In-Reply-To: <401FE701.4010602@phpwerx.net> References: <401FDE8F.7020900@optonline.net> <401FE701.4010602@phpwerx.net> Message-ID: <401FE83F.2080109@optonline.net> Oh yeah...we both looked at this some time ago. However, I did discover that MailEnable needs to be configured to allow local applications to send mail (http://www.mailenable.com/kb/Content/Article.asp?ID=ME020044) so...I'll see what the sysadmin says. Jeff Dan Cech wrote: > Jeff Siegel wrote: > >> I'm getting the following error message - >> "Warning: mail(): SMTP server response: 503 This mail server requires >> authentication." - using the mail function with PHP on Windows. Since >> I've been spoiled and have been using only Linux (or FreeBSD) ... I've >> got no clue what needs to be done on Windows server. > > > You're going to kick yourself Jeff. > > > > Dan > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" From jsiegel1 at optonline.net Tue Feb 3 13:45:57 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Tue, 03 Feb 2004 13:45:57 -0500 Subject: [nycphp-talk] PHP Mail problem on Windows Server In-Reply-To: <401FE83F.2080109@optonline.net> References: <401FDE8F.7020900@optonline.net> <401FE701.4010602@phpwerx.net> <401FE83F.2080109@optonline.net> Message-ID: <401FEC65.20800@optonline.net> Seems the suggestion at http://www.mailenable.com/kb/Content/Article.asp?ID=ME020044 solved the problem. Jeff -- Jeff Siegel wrote: > Oh yeah...we both looked at this some time ago. > However, I did discover that MailEnable needs to be configured to allow > local applications to send mail > (http://www.mailenable.com/kb/Content/Article.asp?ID=ME020044) so...I'll > see what the sysadmin says. > > Jeff > > > Dan Cech wrote: > >> Jeff Siegel wrote: >> >>> I'm getting the following error message - >>> "Warning: mail(): SMTP server response: 503 This mail server requires >>> authentication." - using the mail function with PHP on Windows. Since >>> I've been spoiled and have been using only Linux (or FreeBSD) ... >>> I've got no clue what needs to be done on Windows server. >> >> >> >> You're going to kick yourself Jeff. >> >> >> >> Dan >> >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk >> > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" From tgales at tgaconnect.com Tue Feb 3 13:58:21 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 3 Feb 2004 13:58:21 -0500 Subject: [nycphp-talk] PHP sessions and displaying who's online In-Reply-To: <401FE4E8.8010102@spacemonkeylabs.com> Message-ID: <000301c3ea87$b2567180$bf8d3818@oberon1> Mitch Pirtle writes: > For example, I'm thinking about a high-traffic website that would use > pound up front, racks of apaches for httpd, sql relay in front of the > database groups, and clusters of slaves for reads (and some homegrown > goofiness for CRUD operations). Where would you put session data for > this, and how would you get your 'XXX online, XXX this week' type of > information? > Have a look at: http://devel.mohawksoft.com/msession.html and http://us4.php.net/msession This may not give you 'all the answers' but it should provide some food for thought. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From adam at trachtenberg.com Tue Feb 3 14:45:27 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 3 Feb 2004 14:45:27 -0500 (EST) Subject: [nycphp-talk] PHP sessions and displaying who's online In-Reply-To: <00a201c3ea7f$7f343560$0400a8c0@heavenspanyc> References: <401FDE8F.7020900@optonline.net> <00a201c3ea7f$7f343560$0400a8c0@heavenspanyc> Message-ID: On Tue, 3 Feb 2004 yury at heavenspa.com wrote: > Folks.. is there a simple effective way to do this *without* using mySQL? > > if there is a tutorial/link, i'd appreciate it.. > > example: there are 25 visitors online and 3,000,000 visitors since > yesterday. I'm making the assumption here that you don't want to use any database and that you're just not philosophically opposed to MySQL. If that's the case, consider SQLite. It's a database library that uses flat files instead of a separate application, so there's less administrative hassle. SQLite is bundled with PHP 5 and available under 4.x from PECL. (http://pecl.php.net) There's also a bundled session handler that works with PHP's session code. To enable it, set session.save_handler to sqlite in your php.ini file. Note: Using SQLite is slower than just using files; however, if you're not a high traffic web site, this should not be a problem. (Which I'm guessing you are, since you don't want to use MySQL.) -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From sryBoston at hotmail.com Tue Feb 3 17:41:47 2004 From: sryBoston at hotmail.com (-sry) Date: Tue, 3 Feb 2004 17:41:47 -0500 Subject: [nycphp-talk] Fw: reading cookie expirations Message-ID: Hiya, A fellow wwwacie is trying to do something that seems to me to be perfectly straightforward, but either I'm still far more ignorant of PHP than I thought (I've *been* reading, nearly every day!! Geez, there's enough docs on that site to make me go blind!!) or this just can't be done. Below is his post / request - he's cc'd on this note so please cc him on replies. In an off-list continuation, he noted, that the $HTTP_COOKIE_VARS array is just an array of cookies, not an array of values for *a* cookie. Is he right? :-( Really? :-(((( bahhhh....so how do we get the other stuff besides name and value? now *I* want to know! -sry ----- Original Message ----- From: "Rahmin Pavlovic" To: Sent: Tuesday, February 03, 2004 3:55 PM Subject: Re: [wwwac] php: reading cookie expirations > > Let me try this again - > > I'm setting a cooking via php like ye - > > setcookie("name","value", time() + 86400); //24hrs > > Sometimes it's 30 days - > > setcookie("name","value", time() + (86400*30)); //30 days > > Sometimes it's one year - > > setcookie("name","value", time() + 31536000); //1yr > > Works fine. > > I want to be able to then read the cookie and determine it's expiry date. > > Seems simple enough, but it appears as tho all my read options are limited to 'value'. > > Is there anyway to test a cookie's expiration date in php? > > Or better yet - is there any way to read the fully qualified cookie string? > > name=value; expires=date; path=path; domain=domain-name; secure > > You know, cause that would be hot. > > I can do this in js, but I'd rather not.. > > > > > ## The World Wide Web Artists' Consortium --- http://www.wwwac.org/ ## > ## To Unsubscribe, send an e-mail to: wwwac-unsubscribe at lists.wwwac.org ## > > From adam at trachtenberg.com Tue Feb 3 17:51:58 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 3 Feb 2004 17:51:58 -0500 (EST) Subject: [nycphp-talk] Fw: reading cookie expirations In-Reply-To: References: Message-ID: On Tue, 3 Feb 2004, -sry wrote: > In an off-list continuation, he noted, that the $HTTP_COOKIE_VARS > array is just an array of cookies, not an array of values for *a* > cookie. Is he right? :-( Really? :-(((( bahhhh....so how do we get > the other stuff besides name and value? now *I* want to know! Cookies do not return the information that you're looking for. They only return the cookie's name and value. (And maybe the path and domain.) See RFC 2109 for more information: http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2109.html -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From Cbielanski at inta.org Tue Feb 3 18:04:20 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Tue, 3 Feb 2004 18:04:20 -0500 Subject: [nycphp-talk] Fw: reading cookie expirations Message-ID: The answer might very likely be an arg string not unlike a GET string, buried in the "value" value. I'll scope the RFC again, but I can't think of anything preventing your cookie storing name="mycookie" value="expiry=&foo1=bar1&foo2=bar2..." This will allow for a handy parsing (since hey!! it's a URI!!) Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 -----Original Message----- From: Adam Maccabee Trachtenberg [mailto:adam at trachtenberg.com] Sent: Tuesday, February 03, 2004 5:52 PM To: NYPHP Talk Cc: rahmin at insite-out.com Subject: Re: [nycphp-talk] Fw: reading cookie expirations On Tue, 3 Feb 2004, -sry wrote: > In an off-list continuation, he noted, that the $HTTP_COOKIE_VARS > array is just an array of cookies, not an array of values for *a* > cookie. Is he right? :-( Really? :-(((( bahhhh....so how do we get > the other stuff besides name and value? now *I* want to know! Cookies do not return the information that you're looking for. They only return the cookie's name and value. (And maybe the path and domain.) See RFC 2109 for more information: http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2109.html -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From shiflett at php.net Tue Feb 3 19:01:28 2004 From: shiflett at php.net (Chris Shiflett) Date: Tue, 3 Feb 2004 16:01:28 -0800 (PST) Subject: [nycphp-talk] Fw: reading cookie expirations In-Reply-To: Message-ID: <20040204000128.73581.qmail@web14305.mail.yahoo.com> --- Adam Maccabee Trachtenberg wrote: > Cookies do not return the information that you're looking for. They > only return the cookie's name and value. (And maybe the path and > domain.) You're right - just the name and value. > See RFC 2109 for more information: > > http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2109.html I think this is one of the cases where industry implementation and RFC 2109 differ. I have found Netscape's original specification to be more accurate in terms of what actually happens: http://wp.netscape.com/newsref/std/cookie_spec.html Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ From tgales at tgaconnect.com Tue Feb 3 19:15:24 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 3 Feb 2004 19:15:24 -0500 Subject: [nycphp-talk] Fw: reading cookie expirations In-Reply-To: Message-ID: <000101c3eab3$fc4baf90$e98d3818@oberon1> -sry writes: > In an off-list continuation, he noted, that the > $HTTP_COOKIE_VARS array is just an array of cookies, not an > array of values for *a* cookie. Is he right? :-( Really? > :-(((( bahhhh....so how do we get the other stuff besides > name and value? now *I* want to know! Assuming your PHP is greater than 4.1.0 this may interest you: "HTTP Cookies: $_COOKIE Note: Introduced in 4.1.0. In earlier versions, use $HTTP_COOKIE_VARS." and "$HTTP_COOKIE_VARS contains the same initial information, but is not an autoglobal (Note that HTTP_COOKIE_VARS and $_COOKIE are different variables and that PHP handles them as such)" from: http://us4.php.net/manual/en/reserved.variables.php#reserved.variables.coo kies T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From mgulver at britishlibrary.net Tue Feb 3 19:39:28 2004 From: mgulver at britishlibrary.net (K. Marcus Gulver) Date: Wed, 4 Feb 2004 1:39:28 +0100 Subject: [nycphp-talk] PHP Mail problem on Windows Server Message-ID: <200402040040.i140e3Tn010924@smtp14.fre.skanova.net> ****TRANSCRIPT OF ORIGINAL MESSAGE**** 2004-02-03, 13:45:00 you wrote: >>>> I'm getting the following error message - >>>> "Warning: mail(): SMTP server response: 503 This mail server requires >>>> authentication." - using the mail function with PHP on Windows. Since >>>> I've been spoiled and have been using only Linux (or FreeBSD) ... >>>> I've got no clue what needs to be done on Windows server. ****END OF TRANSCRIPT OF ORIGINAL MESSAGE*** I'm not sure about the error code message numbers. But it sounds like that the server wishes to establish that the sender is authorized to send by forcing you to check for new mail first before sending. I had this problem once. Did not find any solution (maybe beacuse I use the Chinese program Foxmail) Nevertheless a quick fix was just changing the SMTP server to another one not requiring this. Hope this helps. This feauture is a anti-SPAM configuration apperently. Marcus From jsiegel1 at optonline.net Tue Feb 3 22:21:14 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Tue, 03 Feb 2004 22:21:14 -0500 Subject: [nycphp-talk] PHP Mail problem on Windows Server In-Reply-To: <200402040040.i140e3Tn010924@smtp14.fre.skanova.net> References: <200402040040.i140e3Tn010924@smtp14.fre.skanova.net> Message-ID: <4020652A.8060306@optonline.net> Turned out that MailEnable was not set to accept mail from the web app. Once it was set to accept mail generated by IP address, specifically 127.0.0.1, the problem was solved. Jeff K. Marcus Gulver wrote: > ****TRANSCRIPT OF ORIGINAL MESSAGE**** > 2004-02-03, 13:45:00 you wrote: > > >>>>>I'm getting the following error message - >>>>>"Warning: mail(): SMTP server response: 503 This mail server requires >>>>>authentication." - using the mail function with PHP on Windows. Since >>>>>I've been spoiled and have been using only Linux (or FreeBSD) ... >>>>>I've got no clue what needs to be done on Windows server. > > > ****END OF TRANSCRIPT OF ORIGINAL MESSAGE*** > > I'm not sure about the error code message numbers. But it sounds like that > the server wishes to establish that the sender is authorized to send by > forcing you to check for new mail first before sending. I had this problem > once. Did not find any solution (maybe beacuse I use the Chinese program > Foxmail) Nevertheless a quick fix was just changing the SMTP server to > another one not requiring this. Hope this helps. > > This feauture is a anti-SPAM configuration apperently. > > Marcus > > > > > > > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" From danielc at analysisandsolutions.com Wed Feb 4 02:23:41 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 4 Feb 2004 02:23:41 -0500 Subject: [nycphp-talk] PEAR DB 1.6.0RC4 was just released Message-ID: <20040204072340.GA4362@panix.com> Hi Folks: I just released version 1.6.0RC4 of PEAR DB. Several things have been fixed since I mentioned RC2 at the meeting. Also, if you're using 1.5.0 variants or earlier, definitely check out the new version for loads of enhancements and way fewer bugs. I've also spent a bunch of time documenting the new functionality and fixing the old docs. Most of the changes are already viewable on the PEAR website and most of the remaining improvements should be in place when the docs get rebuilt Sunday around 1am EST. So, please download the package and test it out as well as read the documentation. Please file bug reports if stuff doesn't work or is unclear. Download: http://pear.php.net/get/DB-1.6.0RC4.tgz Manual: http://pear.php.net/manual/en/package.database.php Report Bugs: http://pear.php.net/bugs/report.php?package=DB Home Page: http://pear.php.net/package/DB Enjoy, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jonbaer at jonbaer.net Wed Feb 4 03:36:17 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 4 Feb 2004 03:36:17 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in Microsoft Internet Explorer Message-ID: <002f01c3eaf9$f6a26520$6400a8c0@thinkpad> thought this might be of interest to the list (sorry to anyone whose bandwidth gets eaten up) ... then again im sure we all use linux and have nothing to fear to begin with :-) the interesting part of course is that MS will discontinue their non standard(?) use of the url form: http://user:pass at site.com:port/foo/bar.html making anything using parse_url($url) possibly break, but then again if ur using this scheme to begin with you should be spanked :-) ... - jon ----- Original Message ----- From: "CERT Advisory" To: Sent: Monday, February 02, 2004 8:58 PM Subject: TA04-033A: Multiple Vulnerabilities in Microsoft Internet Explorer > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Multiple Vulnerabilities in Microsoft Internet Explorer > > Original issue date: February 02, 2004 > Last revised: -- > Source: US-CERT > > Systems Affected > > Microsoft Windows systems running > > * Internet Explorer 5.01 > * Internet Explorer 5.50 > * Internet Explorer 6 > > Previous, unsupported, versions of Internet Explorer may also be > affected. > > Overview > > Microsoft Internet Explorer (IE) contains multiple vulnerabilities, > the most serious of which could allow a remote attacker to execute > arbitrary code with the privileges of the user running IE. > > Description > > Microsoft Security Bulletin MS04-004 describes three vulnerabilities > in Internet Explorer. These vulnerabilities are listed below. More > detailed information is available in the individual vulnerability > notes. Note that in addition to IE, any applications that use the IE > HTML rendering engine to interpret HTML documents may present > additional attack vectors for these vulnerabilities. > > VU#784102 - Microsoft Internet Explorer Travel Log Cross Domain > Vulnerability > > A cross-domain scripting vulnerability exists in the Travel Log > functionality of Internet Explorer. This vulnerability could allow a > remote attacker to execute arbitrary script in a different domain, > including the Local Machine Zone. > (Other resources: CAN-2003-01026) > > VU#413886 - Microsoft Internet Explorer Drag-and-Drop Operation > Vulnerability > > Internet Explorer allows remote attackers to direct drag and drop > behaviors and other mouse click actions by using method caching > (SaveRef) to access the window.moveBy method. > (Other resources: CAN-2003-01027) > > VU#652278 - Microsoft Internet Explorer does not properly display URLs > > Microsoft Internet Explorer does not properly display the location of > HTML documents. An attacker could exploit this behavior to mislead > users into revealing sensitive information. > (Other resources: CAN-2003-01025) > > Impact > > These vulnerabilities have different impacts, ranging from disguising > the true location of a URL to executing arbitrary commands or code. > Please see the individual vulnerability notes for specific > information. The most serious of these vulnerabilities (VU#784102) > could allow a remote attacker to execute arbitrary code with the > privileges of the user running IE. The attacker could exploit this > vulnerability by convincing the user to access a specially crafted > HTML document, such as a web page or HTML email message. No user > intervention is required beyond viewing the attacker's HTML document > with IE. > > Solutions > > Apply a patch > > Apply the appropriate patch as specified by Microsoft Security > Bulletin MS04-004. > > * Microsoft Security Bulletin MS04-004 - > > > Note: The fix included in MS04-004 for VU#652278 may cause sites that > use URLs of the form "username:password at www.example.com" to break. > This change, along with workarounds for users and administrators of > such sites, is covered in Microsoft KB Article 834489. > > Vendor Information > > This section contains information provided by vendors. When vendors > report new information, this section is updated and the changes are > noted in the revision history. If a vendor is not listed below, we > have not received their comments. > > Microsoft > > Please see Microsoft Security Bulletin MS04-004. > _________________________________________________________________ > > References > > * CERT/CC Vulnerability Note VU#784102 - > > > * CERT/CC Vulnerability Note VU#413886 - > > > * CERT/CC Vulnerability Note VU#652278 - > > > * Microsoft Security Bulletin MS04-004 - > > > * Microsoft KB Article 834489 - > > > * CVE CAN-2003-01025 - > > > * CVE CAN-2003-01026 - > > > * CVE CAN-2003-01027 - > > _________________________________________________________________ > > Feedback can be directed to the authors, Allen Householder and Art > Manion. > _________________________________________________________________ > > Copyright 2004 Carnegie Mellon University. > > Revision History > > February 02, 2004: Initial release > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.1 (GNU/Linux) > > iD8DBQFAHvI/XlvNRxAkFWARAvpgAJsFng4fQDA1iOursbppOf8JoX2HXQCgt+B8 > iK8Z8VaOs6MZsMuUGccHFko= > =bHZu > -----END PGP SIGNATURE----- > From nyphp at enobrev.com Wed Feb 4 04:35:11 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Wed, 4 Feb 2004 04:35:11 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer In-Reply-To: <002f01c3eaf9$f6a26520$6400a8c0@thinkpad> Message-ID: > ... then again im sure > we all use linux and have nothing to fear to begin with :-) Speaking of which, how many of you use linux as your primary desktop? Now that I don't do much design, it's more and more tempting every day, but I still feel I'll suffer some windows withdrawal... Outlook and photoshop for instance. > the interesting part of course is that MS will discontinue their non > standard(?) use of the url form: Definitely good news. Mark From leam at reuel.net Wed Feb 4 05:19:09 2004 From: leam at reuel.net (leam) Date: Wed, 04 Feb 2004 05:19:09 -0500 Subject: [nycphp-talk] Re: linux desktop (wuz: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer) In-Reply-To: References: Message-ID: <4020C71D.5030607@reuel.net> Mark Armendariz wrote: >>... then again im sure >>we all use linux and have nothing to fear to begin with :-) > > > Speaking of which, how many of you use linux as your primary desktop? Now > that I don't do much design, it's more and more tempting every day, but I > still feel I'll suffer some windows withdrawal... Outlook and photoshop for > instance. I do, but I'm fairly non-graphically inclined. You may want to check out OS X if you want the power of unix and the looks of Windows. My wife switched over and she likes it. ciao! leam From jonbaer at jonbaer.net Wed Feb 4 05:43:29 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 4 Feb 2004 05:43:29 -0500 Subject: [nycphp-talk] Re: linux desktop (wuz: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer) References: <4020C71D.5030607@reuel.net> Message-ID: <008201c3eb0b$bc336bc0$6400a8c0@thinkpad> > > Speaking of which, how many of you use linux as your primary desktop? Now > > that I don't do much design, it's more and more tempting every day, but I > > still feel I'll suffer some windows withdrawal... Outlook and photoshop for i was in the same boat until i realized KDE/QT was one of the most powerful things ever programmed :-) although i will probably still be dual booting my thinkpad between xp and redhat 9 for the next 10 years ... i was very happy to see alot of new "import" features on linux, so i end up mounting the xp partition as a drive and import all my messages between outlook + kmail. the design is what kills it, id have to take a 3 month class on gimp to get up to speed on doing the same work w/ photoshop :-( i think thats the *only* thing keeping it as a primary desktop for me. - jon From nyphp at enobrev.com Wed Feb 4 06:22:37 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Wed, 4 Feb 2004 06:22:37 -0500 Subject: [nycphp-talk] Re: linux desktop (wuz: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer) In-Reply-To: <4020C71D.5030607@reuel.net> Message-ID: Leam: > I do, but I'm fairly non-graphically inclined. You may want > to check out OS X if you want the power of unix and the looks > of Windows. My wife switched over and she likes it. I have been considering this, but I have a hard time justifying the high price of mac hardware. OSX is REALLY interesting overall. Would LOVE to see OSX for the PC. > i was very happy to see > alot of new "import" features on linux, so i end up mounting > the xp partition as a drive and import all my messages > between outlook + kmail. > the design is what kills it, id have to take a 3 month class > on gimp to get up to speed on doing the same work w/ > photoshop :-( Interesting, and a damned good reason to give it a shot. Think I might have to give it a shot. Regarding using gimp, I absolutely agree. Admittedly, I haven't given gimp much of a chance in my short trials of it, but being an adobe junkie for 10 years is just a hard thing to break away from. Wouldn't mind seeing the flash ide on linux as well. Then I'd have about no use for xp, besides maybe for a couple games I never really have time to play. Mark From jonbaer at jonbaer.net Wed Feb 4 07:07:24 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 4 Feb 2004 07:07:24 -0500 Subject: [nycphp-talk] Re: linux desktop (wuz: TA04-033A: MultipleVulnerabilities in MicrosoftInternet Explorer) References: Message-ID: <00ab01c3eb17$751bfed0$6400a8c0@thinkpad> btw, anyone catch the linux commercial during the superbowl? i thought it was pretty good, got my attention ... in case you missed it: http://www-306.ibm.com/e-business/doc/content/ondemand/tvspot.html "linux is shaking things up" - jon From brian at preston-campbell.com Wed Feb 4 07:26:43 2004 From: brian at preston-campbell.com (Brian Preston-Campbell) Date: Wed, 4 Feb 2004 07:26:43 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer In-Reply-To: References: Message-ID: <200402040726.43665.brian@preston-campbell.com> On Wednesday 04 February 2004 04:35 am, Mark Armendariz wrote: > > ... then again im sure > > we all use linux and have nothing to fear to begin with :-) > > Speaking of which, how many of you use linux as your primary desktop? Now > that I don't do much design, it's more and more tempting every day, but I > still feel I'll suffer some windows withdrawal... Outlook and photoshop for > instance. > > > the interesting part of course is that MS will discontinue their non > > standard(?) use of the url form: > > Definitely good news. > > Mark > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk I do, both on my desktop and laptop -- the latter gets me in trouble on occasion, like when I get stuck in the field with Windows only hardware (only happened once). On my desktop I have Win4Lin for the purpose of running Photoshop and checking sites in IE (although I heard CrossOver Office can do this as well and is slightly less expensive -- $89 for Win4Lin, COO is $59). I can live without Outlook thanks to KMail. For emergencies, I do have one W2K box however. Linux is not yet for everyone, but every day the gap closes a little more. Aside from that, you don't have to reboot every two days or get the blue screen of death when in the middle of something important. Brian From jonbaer at jonbaer.net Wed Feb 4 07:47:10 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 4 Feb 2004 07:47:10 -0500 Subject: [nycphp-talk] linux desktop References: <200402040726.43665.brian@preston-campbell.com> Message-ID: <00c201c3eb1d$03aa3090$6400a8c0@thinkpad> > happened once). On my desktop I have Win4Lin for the purpose of running > Photoshop and checking sites in IE (although I heard CrossOver Office can that is actually a good point ... a few months ago I ran VMware and was completely blown away, unfortunatly I was doing networking testing and could not run multiple adapters but beyond that I felt it was amazing stuff (the $300 price was a little steep, but for professionals well worth it) ... http://www.vmware.com/landing/ws4_home.html screenies: http://www.vmware.com/products/desktop/ws_screens.html i never got to the point of running the client on linux + photoshop of windows but im sure its doable. i think this is how i came across the bluefish editor ... http://bluefish.openoffice.nl/ - jon From tgales at tgaconnect.com Wed Feb 4 07:57:00 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 4 Feb 2004 07:57:00 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer In-Reply-To: <200402040726.43665.brian@preston-campbell.com> Message-ID: <000001c3eb1e$6153bd50$e98d3818@oberon1> Brian Preston-Campbell writes: "...reboot every two days or get the blue screen of death when in the middle of something important." When was the last time anyone saw a 'blue screen'? (I don't think I've seen one for six of seven years) T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From brian at preston-campbell.com Wed Feb 4 07:58:47 2004 From: brian at preston-campbell.com (Brian Preston-Campbell) Date: Wed, 4 Feb 2004 07:58:47 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer In-Reply-To: <000001c3eb1e$6153bd50$e98d3818@oberon1> References: <000001c3eb1e$6153bd50$e98d3818@oberon1> Message-ID: <200402040758.47019.brian@preston-campbell.com> Then you aren't trying hard enough. On Wednesday 04 February 2004 07:57 am, Tim Gales wrote: > Brian Preston-Campbell writes: > "...reboot every two days or get the blue > screen of death when in the middle of > something important." > > When was the last time anyone saw a 'blue screen'? > (I don't think I've seen one for six of seven years) > > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.com > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From leam at reuel.net Wed Feb 4 08:12:42 2004 From: leam at reuel.net (leam) Date: Wed, 04 Feb 2004 07:12:42 -0600 Subject: [nycphp-talk] RE: BSOD Message-ID: > Brian Preston-Campbell writes: > "...reboot every two days or get the blue > screen of death when in the middle of > something important." > > When was the last time anyone saw a 'blue screen'? > (I don't think I've seen one for six of seven years) Last week on a managers computer. Oddly, he had been off for a couple days and it had died without him even there. The week before it was another co-workers. Blue is a pretty color, though.... ciao! leam From tgales at tgaconnect.com Wed Feb 4 08:21:22 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 4 Feb 2004 08:21:22 -0500 Subject: [nycphp-talk] RE: BSOD In-Reply-To: Message-ID: <000301c3eb21$c8d4c020$e98d3818@oberon1> leam writes: (on frequency of getting blues screens) " Last week on a managers computer. Oddly, he had been off for a couple days and it had died without him even there. The week before it was another co-workers." Out of curiosity, did you check the system and application logs? T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From dan at mx2pro.com Wed Feb 4 08:59:05 2004 From: dan at mx2pro.com (Dan Horning) Date: Wed, 4 Feb 2004 08:59:05 -0500 Subject: [nycphp-talk] RE: BSOD In-Reply-To: <000301c3eb21$c8d4c020$e98d3818@oberon1> Message-ID: <20040204135910.03547A863B@virtu.nyphp.org> you don't wanna know ... it's what happens when you assist at a private school with a low budget... ie -----> win 98$^@$%&^ on machines no higher than 400 Mhz.... anyone got worse ? anyone know someone who wants to donate to this org?? lol I think you get the idea Dan Horning - Music, Technology & Photography http://www.dsoundmn.com/ Technical Systems Administration 1-866-284-3150 (Office/Home) > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Tim Gales > Sent: Wednesday, February 04, 2004 8:21 AM > To: 'NYPHP Talk' > Subject: RE: [nycphp-talk] RE: BSOD > > leam writes: > (on frequency of getting blues screens) > " Last week on a managers computer. Oddly, he had been off for > a couple days and it had died without him even there. The > week before it was another co-workers." > > Out of curiosity, did you check the system and > application logs? > > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.com > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From bpang at bpang.com Wed Feb 4 09:36:26 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Wed, 4 Feb 2004 09:36:26 -0500 (EST) Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer In-Reply-To: References: <002f01c3eaf9$f6a26520$6400a8c0@thinkpad> Message-ID: <.38.117.145.89.1075905386.squirrel@www.bpang.com> > Speaking of which, how many of you use linux as your primary desktop? I do. And I have even taught myself to use The Gimp!! It could still help me to learn how to script-fu it, but otherwise, it works fine for me. TRYING to rebuild a new desktop using something other than RedHat now. Which other distro has a nice point-and-click, make-the-hard-decisions for you install GUI like RedHat? I tried Debian and couldn't get it to bring up X. Tring Gentoo now, but it's taking forever, and I'm starting to get confused and will probably have to do it a second time to correct my mistakes from the first pass. Opinions? Advice? thanks From joshmccormack at travelersdiary.com Wed Feb 4 09:41:33 2004 From: joshmccormack at travelersdiary.com (joshmccormack at travelersdiary.com) Date: Wed, 4 Feb 2004 08:41:33 -0600 (CST) Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer In-Reply-To: <.38.117.145.89.1075905386.squirrel@www.bpang.com> Message-ID: On Wed, 4 Feb 2004 bpang at bpang.com wrote: > > Speaking of which, how many of you use linux as your primary desktop? > > I do. And I have even taught myself to use The Gimp!! It could still help > me to learn how to script-fu it, but otherwise, it works fine for me. > > TRYING to rebuild a new desktop using something other than RedHat now. > > Which other distro has a nice point-and-click, make-the-hard-decisions for > you install GUI like RedHat? > I tried Debian and couldn't get it to bring up X. > Tring Gentoo now, but it's taking forever, and I'm starting to get > confused and will probably have to do it a second time to correct my > mistakes from the first pass. > > Opinions? Advice? > > thanks You can use Knoppix as a Debian installer. Gentoo takes a considerable amount of tweaking and patience for compiling. I think it has it's place, but wouldn't recommend it as a desktop you'll make your living off ofunless you really, really know what you're doing. Josh From brian at preston-campbell.com Wed Feb 4 09:53:18 2004 From: brian at preston-campbell.com (Brian Preston-Campbell) Date: Wed, 4 Feb 2004 09:53:18 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer In-Reply-To: <.38.117.145.89.1075905386.squirrel@www.bpang.com> References: <002f01c3eaf9$f6a26520$6400a8c0@thinkpad> <.38.117.145.89.1075905386.squirrel@www.bpang.com> Message-ID: <200402040953.18940.brian@preston-campbell.com> Mandrake 9.2 On Wednesday 04 February 2004 09:36 am, bpang at bpang.com wrote: > > Speaking of which, how many of you use linux as your primary desktop? > > I do. And I have even taught myself to use The Gimp!! It could still help > me to learn how to script-fu it, but otherwise, it works fine for me. > > TRYING to rebuild a new desktop using something other than RedHat now. > > Which other distro has a nice point-and-click, make-the-hard-decisions for > you install GUI like RedHat? > I tried Debian and couldn't get it to bring up X. > Tring Gentoo now, but it's taking forever, and I'm starting to get > confused and will probably have to do it a second time to correct my > mistakes from the first pass. > > Opinions? Advice? > > thanks > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From dmintz at davidmintz.org Wed Feb 4 10:07:49 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 4 Feb 2004 10:07:49 -0500 (EST) Subject: [nycphp-talk] Re: linux desktop In-Reply-To: <00ab01c3eb17$751bfed0$6400a8c0@thinkpad> References: <00ab01c3eb17$751bfed0$6400a8c0@thinkpad> Message-ID: On Wed, 4 Feb 2004, jon baer wrote: > btw, > > anyone catch the linux commercial during the superbowl? i thought it was > pretty good, got my attention ... in case you missed it: > > http://www-306.ibm.com/e-business/doc/content/ondemand/tvspot.html > > "linux is shaking things up" I did and I shouted out loud "YEAH!!!" at full volume when it was over. Kinda got me where I live. The kid is about the age I was when Muhammed Ali was the age he was in the clip, and I've always been a huge admirer, and of course I love the Penguin too. My, those marketers are clever, they know how to get to this forty-something male. Continuing the desktop OS thread: I'm a RedHat 9 dude on my home desktop machine, and a Win2K dude at work where I have less choice in the matter. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From dmintz at davidmintz.org Wed Feb 4 10:12:19 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 4 Feb 2004 10:12:19 -0500 (EST) Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer In-Reply-To: References: Message-ID: On Wed, 4 Feb 2004 joshmccormack at travelersdiary.com wrote: > You can use Knoppix as a Debian installer. How do you do that? Sounds intriguing. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From leam at reuel.net Wed Feb 4 10:27:24 2004 From: leam at reuel.net (leam) Date: Wed, 04 Feb 2004 09:27:24 -0600 Subject: [nycphp-talk] RE: BSOD Message-ID: > leam writes: > (on frequency of getting blues screens) > " Last week on a managers computer. Oddly, he had been off for > a couple days and it had died without him even there. The > week before it was another co-workers." > > Out of curiosity, did you check the system and > application logs? No, it's a corp machine and I'm just a user outside the data center. ciao! leam -- >From hans not junk at nyphp.com Wed Feb 4 10:27:44 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 8EC57A87F6 for ; Wed, 4 Feb 2004 10:27:44 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 4 Feb 2004 07:27:43 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87771E72 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Zend Studio and Oracle Thread-Index: AcPrM6DC0ffbb/eZTymOr8yn1Mh/7w== From: "Hans Zaunere" To: "NYPHP Talk" Subject: [nycphp-talk] Zend Studio and Oracle X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 15:27:45 -0000 Hi all, I need to profile some code and I'm using Zend Studio under Windows XP. The code, however, speaks to an Oracle database via OCI8 and I'm finding that Zend Studio's included PHP version doesn't have the OCI8 extension installed. Any clues on getting Studio's PHP to include OCI8, or to have Studio use another PHP that I supply? I'm aware of the extensions to the server side (which is Linux in this case) but it's a production box and I'd rather not muck with it. Thanks, Hans From rinaudom at tiscali.it Wed Feb 4 10:28:19 2004 From: rinaudom at tiscali.it (rinaudom at tiscali.it) Date: Wed, 4 Feb 2004 16:28:19 +0100 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in Microsoft Internet Explorer Message-ID: <400CE17B0002730A@mail-6.tiscali.it> Hi all. I use **ONLY** Linux for work and desktop-related tasks. My distro is Slackware 9.1 - also very very good for development - provides Apache 1.3.29 (updated package from 1.3.28), MySQL 4.0.15a, PHP 4.3.3 ready and working, Quanta Plus and EMACS for PHP development, Mozilla 1.4 and/or Netscape 7.1 . __________________________________________________________________ Tiscali ADSL SENZA CANONE: Attivazione GRATIS, contributo adesione GRATIS, modem GRATIS, 50 ore di navigazione GRATIS. ABBONARTI TI COSTA SOLO UN CLICK! http://point.tiscali.it/adsl/index.shtml From dcallaghan at linuxmail.org Wed Feb 4 10:17:44 2004 From: dcallaghan at linuxmail.org (Dave Callaghan) Date: Wed, 04 Feb 2004 10:17:44 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer Message-ID: <20040204151744.3D41457C002@ws5-4.us4.outblaze.com> > Speaking of which, how many of you use linux as your primary desktop? Linux is my primary desktop at home for personal use, on my laptop for development work and also as my personal business computer for securities. At my current contract job, their environment is Windows 2K, but I use as many FLOSS applications as I can. There is give and take with some of these scenarios. At work, for instance, people see me using Mozilla and just can't get enough of tabbed browsing. I find it very difficult to use IE at this point. As far as OpenOffice goes, I send out finished documents in PDF. Managers love this. Also, I save slideshows to Flash and then save it to a flash key drive (or whatever those USB devices are called), and they fall all over themselves. I told the sales guys about a web site that brands them with your corporate logo and they all want Open Office now. I code with Emacs on Windows. However, I really can't live without Pivot Tables. I know not everyone uses them, but for those who do, you can't live without them. Same goes for its interoperability with SQL Server. Its also the same reason why I use Access. Its not sufficiently powerful for what I do as a database engine, but its a nice front end to SQL Server. Its just quicker than typing SQL into Query Analyzer. So at this stage, I really need both packages for some tasks. For personal business, OpenOffice and Evolution, combined with GNUPG, give me all the security I need in transacting business. And I use GNUCash, because of its integration with QuickBooks. Just because you accountant wants QuickBook files doesn't mean you really have to use QuickBooks. And I don't download my bank statement bcs Citibank's fee for doing so is higher than the cost of just doing it myself. -- ______________________________________________ Check out the latest SMS services @ http://www.linuxmail.org This allows you to send and receive SMS through your mailbox. Powered by Outblaze From joshmccormack at travelersdiary.com Wed Feb 4 10:59:41 2004 From: joshmccormack at travelersdiary.com (joshmccormack at travelersdiary.com) Date: Wed, 4 Feb 2004 09:59:41 -0600 (CST) Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer In-Reply-To: Message-ID: On Wed, 4 Feb 2004, David Mintz wrote: > On Wed, 4 Feb 2004 joshmccormack at travelersdiary.com wrote: > > > You can use Knoppix as a Debian installer. > > How do you do that? Sounds intriguing. Here's a LinuxWorld article on it: http://www.linuxworld.com/story/32797.htm And I think there are a bunch of other write ups if you search around (Debian installer Knoppix). Josh From tgales at tgaconnect.com Wed Feb 4 11:02:11 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 4 Feb 2004 11:02:11 -0500 Subject: [nycphp-talk] Zend Studio and Oracle In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87771E72@ehost011-1.exch011.intermedia.net> Message-ID: <000401c3eb38$40286170$e98d3818@oberon1> Han Zauenere writes: "Any clues on getting Studio's PHP to include OCI8" I thought it was as simple as going to the snapshots and getting the php_oci8.dll (and of course uncommenting the extension in php.ini) Did you already try that? T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From csnyder at chxo.com Wed Feb 4 11:09:10 2004 From: csnyder at chxo.com (Chris Snyder) Date: Wed, 04 Feb 2004 11:09:10 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in Microsoft Internet Explorer In-Reply-To: <400CE17B0002730A@mail-6.tiscali.it> References: <400CE17B0002730A@mail-6.tiscali.it> Message-ID: <40211926.1010407@chxo.com> Reason number #45758-20/a to use Mozilla over Internet Explorer: HTTP PUT publishing from Composer. If you script it right on the server, you can do the following: 1) View page in Mozilla Browser 2) Ctrl-E to edit the page full WYSIWYG in Composer 3) Ctrl-Shit-S to publish it back to the server 4) Refresh the page in the Browser, all done Mozilla is truly the killer dinosaur, er, app. csnyder From danielc at analysisandsolutions.com Wed Feb 4 11:21:51 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 4 Feb 2004 11:21:51 -0500 Subject: [nycphp-talk] Zend Studio and Oracle In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87771E72@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F87771E72@ehost011-1.exch011.intermedia.net> Message-ID: <20040204162151.GA9201@panix.com> Hi Hans: On Wed, Feb 04, 2004 at 07:27:43AM -0800, Hans Zaunere wrote: > > I need to profile some code and I'm using Zend Studio under Windows XP. > The code, however, speaks to an Oracle database via OCI8 and I'm finding > that Zend Studio's included PHP version doesn't have the OCI8 extension > installed. I sometimes use Zend Studio to analyze PEAR DB, which uses the oci8 functions. Didn't have any problem. I'm using my own PHP version (4.3.5 dev) and have the oci8 dll uncommented in my php.ini. You may just need to uncomment it in the given php.ini file since the oci8 functions have been around for a while so should even exist in the old version of PHP (what is it, 4.2.0?) Zend bundles with Studio. Good luck, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From tgales at tgaconnect.com Wed Feb 4 11:25:45 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 4 Feb 2004 11:25:45 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer In-Reply-To: <40211926.1010407@chxo.com> Message-ID: <000501c3eb3b$8accc7e0$e98d3818@oberon1> Chris Snyder writes: "Mozilla is truly the killer dinosaur..." Hmmn, thought it was a lizard -- I'd better re-check... ("The Mozilla editor provides HTML and plain text editing functionality in Gecko-based applications" http://www.mozilla.org/editor/ ) T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From chubbard at next-online.net Wed Feb 4 11:40:49 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Wed, 04 Feb 2004 08:40:49 -0800 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer In-Reply-To: <000001c3eb1e$6153bd50$e98d3818@oberon1> References: <000001c3eb1e$6153bd50$e98d3818@oberon1> Message-ID: <40212091.6030803@next-online.net> I've seen it a couple times on Windows XP Home within the last 3 months. It's somewhat different, compared to my ole buddy on NT. Tim Gales wrote: >Brian Preston-Campbell writes: >"...reboot every two days or get the blue > screen of death when in the middle of > something important." > >When was the last time anyone saw a 'blue screen'? >(I don't think I've seen one for six of seven years) > >T. Gales & Associates >'Helping People Connect with Technology' > >http://www.tgaconnect.com > > > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > From Cbielanski at inta.org Wed Feb 4 11:50:26 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Wed, 4 Feb 2004 11:50:26 -0500 Subject: OT [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicros oftInternet Explorer Message-ID: It occured to me that most XP users will never see the BSOD more than a split second because they've given it the nasty disposition of rebooting on all but the most heinous of STOP messages... Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 -----Original Message----- From: Chris Hubbard [mailto:chubbard at next-online.net] Sent: Wednesday, February 04, 2004 11:41 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer I've seen it a couple times on Windows XP Home within the last 3 months. It's somewhat different, compared to my ole buddy on NT. Tim Gales wrote: >Brian Preston-Campbell writes: >"...reboot every two days or get the blue > screen of death when in the middle of > something important." > >When was the last time anyone saw a 'blue screen'? >(I don't think I've seen one for six of seven years) > >T. Gales & Associates >'Helping People Connect with Technology' > >http://www.tgaconnect.com > > > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk >From hans not junk at nyphp.com Wed Feb 4 12:21:44 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id AF18DA863B for ; Wed, 4 Feb 2004 12:21:44 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Zend Studio and Oracle Date: Wed, 4 Feb 2004 09:21:45 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87771EA5 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Zend Studio and Oracle Thread-Index: AcPrOEEHN1wN6/SuQD6Pi3nV2PPKowACv6XQ From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 17:21:45 -0000 Thanks guys... > I thought it was as simple as going to the=20 > snapshots and getting the php_oci8.dll=20 >=20 > (and of course uncommenting the extension=20 > in php.ini) I have a version of PHP on WindowsXP with everything I need (which I do actually use occasionally) but I can't get Studio to use it. It wants to use it's bundled PHP. H From mitchy at spacemonkeylabs.com Wed Feb 4 12:34:55 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Wed, 04 Feb 2004 12:34:55 -0500 Subject: OT [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicros oftInternet Explorer In-Reply-To: References: Message-ID: <40212D3F.8000307@spacemonkeylabs.com> Chris Bielanski wrote: > It occured to me that most XP users will never see the BSOD more than a > split second because they've given it the nasty disposition of rebooting on > all but the most heinous of STOP messages... All this talk about BSOD's has me terrified, wondering when it is going to happen to me. I'm an old (OLD!) *nix user from 1984, Windows-free since 1996. And Macromedia's tools have forced me to start living the dual-boot dream in order to quickly create layouts, templates and Flash. But I tell you something - this thing NEVER crashes. Really, and I am the last person to figure out how to manage an XP box. I download patches (some of them, at least!) and that's about it. Then again, no Kazaa, no video games, no fun... Maybe I'm on to something here. My only complaint is the lousy driver support for my el'cheapo AC97 onboard sound, which consequently sounds GREAT through ALSA. :( -- Mitch From brian at preston-campbell.com Wed Feb 4 12:35:11 2004 From: brian at preston-campbell.com (Brian Preston-Campbell) Date: Wed, 4 Feb 2004 12:35:11 -0500 Subject: OT [nycphp-talk] Fw: TA04-033A: Multiple =?iso-8859-1?q?Vulnerabilities=09inMicros=20oftInternet?= Explorer In-Reply-To: References: Message-ID: <200402041235.11139.brian@preston-campbell.com> That's got to be murder on your filesystem -- oh, I forgot about scandisk, it will save the day. Brian On Wednesday 04 February 2004 11:50 am, Chris Bielanski wrote: > It occured to me that most XP users will never see the BSOD more than a > split second because they've given it the nasty disposition of rebooting on > all but the most heinous of STOP messages... > > Thanks, > Chris Bielanski - [CBielanski at inta.org] > Web Programmer, > International Trademark Association - [www.inta.org] > 1133 Ave. of the Americas - Manhattan > p - 212/642-1745 > > > > > > -----Original Message----- > From: Chris Hubbard [mailto:chubbard at next-online.net] > Sent: Wednesday, February 04, 2004 11:41 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities > inMicrosoftInternet Explorer > > > I've seen it a couple times on Windows XP Home within the last 3 > months. It's somewhat different, compared to my ole buddy on NT. > > Tim Gales wrote: > >Brian Preston-Campbell writes: > >"...reboot every two days or get the blue > > screen of death when in the middle of > > something important." > > > >When was the last time anyone saw a 'blue screen'? > >(I don't think I've seen one for six of seven years) > > > >T. Gales & Associates > >'Helping People Connect with Technology' > > > >http://www.tgaconnect.com > > > > > > > >_______________________________________________ > >talk mailing list > >talk at lists.nyphp.org > >http://lists.nyphp.org/mailman/listinfo/talk > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From tgales at tgaconnect.com Wed Feb 4 12:42:26 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 4 Feb 2004 12:42:26 -0500 Subject: [nycphp-talk] Zend Studio and Oracle In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87771EA5@ehost011-1.exch011.intermedia.net> Message-ID: <000901c3eb46$4143db30$e98d3818@oberon1> I know the java launcher thing uses its own zend1 engine. Still you could phpinfo (in the ide) and determine where exactly the ini file exists and then edit it. If you got the oci dll from the zend install you should use that one. good luck T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Hans Zaunere > Sent: Wednesday, February 04, 2004 12:22 PM > To: NYPHP Talk > Subject: RE: [nycphp-talk] Zend Studio and Oracle > > > > Thanks guys... > > > I thought it was as simple as going to the > > snapshots and getting the php_oci8.dll > > > > (and of course uncommenting the extension > > in php.ini) > > I have a version of PHP on WindowsXP with everything I need > (which I do actually use occasionally) but I can't get Studio > to use it. It wants to use it's bundled PHP. > > H > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk > From danielc at analysisandsolutions.com Wed Feb 4 12:51:35 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 4 Feb 2004 12:51:35 -0500 Subject: [nycphp-talk] Zend Studio and Oracle In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87771EA5@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F87771EA5@ehost011-1.exch011.intermedia.net> Message-ID: <20040204175135.GA20875@panix.com> On Wed, Feb 04, 2004 at 09:21:45AM -0800, Hans Zaunere wrote: > > I have a version of PHP on WindowsXP with everything I need (which I do > actually use occasionally) but I can't get Studio to use it. It wants > to use it's bundled PHP. I know the option to use the bundled PHP version or not is handled during the install. Perhaps there's a preference somewhere you can set? Or you could reinstall. Or, you could overwrite the PHP version the IDE is using. Or... --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From chubbard at next-online.net Wed Feb 4 13:11:42 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Wed, 04 Feb 2004 10:11:42 -0800 Subject: [nycphp-talk] user authentication security structure Message-ID: <402135DE.8060004@next-online.net> All, Thanks for all your suggestions and feedback to date. The following is a description of the login and user-authentication mechanism I'm planning to implement in our application, based on the discussion here and other research I've done. If you've got ways to improve it, please make suggestions. Assumptions: * all client browsers will have cookies enabled. If they don't they get redirected to a page that tells them to enable cookies before they have the chance to log in. * all pages (especially login) will be within SSL * will be using custom session handlers (aka Sean's article in php|arch) Requirements: * users can bookmark any page in the application. When the user tries to return to a bookmarked page after the session has expired, then they are presented with the login page. after a successful login they're redirected to the bookmarked page. Flow: * user enters their username and password and submits the form * code makes sure the data submitted is "clean" * code checks username and password against values in db * if they match create a cookie that will expire in 10 (or so) seconds * create a session * redirect to home page or bookmarked page. * at home page read the temp cookie and the session data, if they correspond create a new cookie that will expire in N minutes. * when user clicks "log out" destroy the session and either empty the cookie or fill it with garbage. Thoughts: I'm thinking of putting a timestamp into the login cookie, so if it's presented and it's too old, I can redirect to the login page I may add a counter to the login cookie, if you don't get in after 3 or N attempts you get redirected to some (random) web address. I've been thinking about using the cookie ID to sign and encrypt the session ID and then using the session ID to sign and encrypt the cookie ID but that might be overkill. I may put the login page into it's own folder ./login/login.php, and have the login cookie be specific to that folder. Once I get this flat I'll make the pattern publicly available with diagrams and documentation. I'm not sure whether it makes sense to include the code (we use Oracle with some internal classes), so probably won't include complete code. Thoughts, comments, suggestions? Chris From tgales at tgaconnect.com Wed Feb 4 13:18:13 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 4 Feb 2004 13:18:13 -0500 Subject: [nycphp-talk] Zend Studio and Oracle In-Reply-To: <000901c3eb46$4143db30$e98d3818@oberon1> Message-ID: <000a01c3eb4b$41419f00$e98d3818@oberon1> Maybe an example will help Let's say phpinfo (from inside the ide) says something like this: System Windows XP build 2600 Build Date May 28 2003 15:06:05 Server API CGI/FastCGI Virtual Directory Support enabled Configuration File (php.ini) Path c:\zend\bin\php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety enabled Registered PHP Streams php, http, ftp, compress.zlib okay you open up the c:\zend\bin\php.ini and you add somethng like: zend_extension_ts=C:\zend\lib\ZendDebuggerLocal.dll zend_debugger.allow_hosts=127.0.0.1/32 session.save_path=C:\zend\tmp ;; stuff added include_path = ".\;C:\php\includes;C:\php\PEAR\pear;C:\php\PEAR;include extension_dir = ".\;C:\php\extensions" extension=php_oci8.dll ;; error_reporting = E_ALL log_errors = On track_errors=1 error_log = php4_errrors.log display_errors=Off register_argc_argv = on ============= this assumes your php_oci8.dll can work with php 4.3.2 Warning: I never tried this -- but it seems like it should work... T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From shiflett at php.net Wed Feb 4 13:32:25 2004 From: shiflett at php.net (Chris Shiflett) Date: Wed, 4 Feb 2004 10:32:25 -0800 (PST) Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer In-Reply-To: Message-ID: <20040204183225.68866.qmail@web14309.mail.yahoo.com> > Speaking of which, how many of you use linux as your primary desktop? I've used Linux as my only OS since about '96 or so, which is how old my computer is. :-) I recently got a PowerBook, but that decision was hardware-based and not because of the OS. The only thing I could see using Windows for is UltraEdit. I'm just not as good with vi as I am with UltraEdit, and I really wish Linux had something comparable. That's one sweet editor. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ From danielc at analysisandsolutions.com Wed Feb 4 13:32:55 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 4 Feb 2004 13:32:55 -0500 Subject: [nycphp-talk] oracle delimited identifiers Message-ID: <20040204183254.GA26053@panix.com> Hi Y'all: Working on a new method for PEAR DB that would quote identifiers. The SQL standard, and Oracle supports, delimiting identifiers using double quotes: create table "name w space" (... This works fine in Oracle. The SQL standard also says if one wants to use quotes inside the name, escape them with double quotes: create table "name w ""quote and space" (... But, when I do this under Oracle, it chokes saying "ORA-03001: unimplemented feature." So, in Oracle, are quotes inside delimited identifiers verboten or is there some other escaping method? Tried finding it in the docs and oracle news group archives but couldn't locate an answer in a reasonable amount of time. Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From chubbard at next-online.net Wed Feb 4 13:49:21 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Wed, 04 Feb 2004 10:49:21 -0800 Subject: [nycphp-talk] PEAR::DB Oracle BLOBs Message-ID: <40213EB1.9060307@next-online.net> An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Wed Feb 4 13:59:10 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 4 Feb 2004 13:59:10 -0500 Subject: [nycphp-talk] PEAR::DB Oracle BLOBs In-Reply-To: <40213EB1.9060307@next-online.net> References: <40213EB1.9060307@next-online.net> Message-ID: <20040204185910.GA3096@panix.com> Dude: Send your message in text only format and we'll all be glad to read it. See http://www.expita.com/nomime.html on how to do it and why. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jlacey at att.net Wed Feb 4 14:01:24 2004 From: jlacey at att.net (John Lacey) Date: Wed, 04 Feb 2004 12:01:24 -0700 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer In-Reply-To: <000501c3eb3b$8accc7e0$e98d3818@oberon1> References: <000501c3eb3b$8accc7e0$e98d3818@oberon1> Message-ID: <40214184.70502@att.net> Tim Gales wrote: > Chris Snyder writes: > "Mozilla is truly the killer dinosaur..." > > Hmmn, thought it was a lizard -- > I'd better re-check... > > ("The Mozilla editor provides HTML and plain > text editing functionality in Gecko-based > applications" http://www.mozilla.org/editor/ ) > if you're talking moz composer, be careful if you want to maintain xhtml compat... for example, it takes
and writes them back out as
John From enunez at tiaa-cref.org Wed Feb 4 14:16:18 2004 From: enunez at tiaa-cref.org (Nunez, Eddy) Date: Wed, 4 Feb 2004 12:16:18 -0700 Subject: [nycphp-talk] oracle delimited identifiers Message-ID: <7CE0EC1FC2D0D411910700508BE38D0F0A6D9E2D@msxnyusr01.msx.ops.tiaa-cref.org> I'm been working with Oracle a long time. I have been trying to avoid using double quotes for strings. Single quotes (') works best. And, yes, doubling up on the quotes acts as an escape character for them in strings. -EAN -----Original Message----- From: Daniel Convissor [mailto:danielc at analysisandsolutions.com] Sent: Wednesday, February 04, 2004 1:33 PM To: NYPHP Talk Subject: [nycphp-talk] oracle delimited identifiers Hi Y'all: Working on a new method for PEAR DB that would quote identifiers. The SQL standard, and Oracle supports, delimiting identifiers using double quotes: create table "name w space" (... This works fine in Oracle. The SQL standard also says if one wants to use quotes inside the name, escape them with double quotes: create table "name w ""quote and space" (... But, when I do this under Oracle, it chokes saying "ORA-03001: unimplemented feature." So, in Oracle, are quotes inside delimited identifiers verboten or is there some other escaping method? Tried finding it in the docs and oracle news group archives but couldn't locate an answer in a reasonable amount of time. Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk ************************************************************** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ************************************************************** From chubbard at next-online.net Wed Feb 4 14:15:03 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Wed, 04 Feb 2004 11:15:03 -0800 Subject: [nycphp-talk] text: PEAR::DB Oracle BLOBs Message-ID: <402144B7.8010102@next-online.net> All, text version Has anyone used PEAR::DB to read and write BLOBs into Oracle? I've got an application that writes incoming email attachments (typically pdf and jpg) to a blob field in oracle. And I want to write the blob not from a file, but from a string. I haven't found the mechanism in PEAR to do this. Here's the code I'm using (it doesn't work): $sql = "INSERT INTO communication_content (id, id_communication, is_body_part, compression_method, content_type, content, date_record_added) VALUES (comm_content_id_seq.NEXTVAL, '". $a["id_communication"] ."', '". $a["is_body_part"] ."', '". $a["compression_method"] ."', '". $a["content_type"] ."', :the_blob, sysdate)"; $stmt = OCIParse($conn,$sql); OCIBindByName($stmt, ':the_blob', $lob, -1, OCI_B_BLOB); $lob->WriteTemporary($a["content"]); OCIExecute($stmt, OCI_DEFAULT); $lob->close(); $lob->free(); OCICommit($conn); Here's the error: *Warning*: ociexecute(): OCIStmtExecute: ORA-02019: connection description for remote database not found ORA-02063: preceding line from DOCS in */Users/chubbard/Sites/imap/email_parser.php* on line *309* INSERT INTO communication_content (id, id_communication, is_body_part, compression_method, content_type, content, date_record_added) VALUES (comm_content_id_seq.NEXTVAL, '332', '1', 'application/x-gzip', 'application/pdf', :the_blob, sysdate) *Warning*: ociexecute(): OCIStmtExecute: ORA-02019: connection description for remote database not found ORA-02063: preceding line from DOCS in */Users/chubbard/Sites/imap/email_parser.php* on line *309 *Thanks in advance. Chris From danielc at analysisandsolutions.com Wed Feb 4 14:23:49 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 4 Feb 2004 14:23:49 -0500 Subject: [nycphp-talk] oracle delimited identifiers In-Reply-To: <7CE0EC1FC2D0D411910700508BE38D0F0A6D9E2D@msxnyusr01.msx.ops.tiaa-cref.org> References: <7CE0EC1FC2D0D411910700508BE38D0F0A6D9E2D@msxnyusr01.msx.ops.tiaa-cref.org> Message-ID: <20040204192349.GA9293@panix.com> Hi Eddy: On Wed, Feb 04, 2004 at 12:16:18PM -0700, Nunez, Eddy wrote: > > I'm been working with Oracle a long time. I have been trying to avoid > using double quotes for strings. Single quotes (') works best. > And, yes, doubling up on the quotes acts as an escape character for them > in strings. I'm talking about delimiting table and column names. Double quotes are needed for that. As far as literals (such as strings you're going to insert into a field), you're right, single quotes are the way to go. Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jlacey at att.net Wed Feb 4 14:25:41 2004 From: jlacey at att.net (John Lacey) Date: Wed, 04 Feb 2004 12:25:41 -0700 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities inMicrosoftInternet Explorer In-Reply-To: <200402040953.18940.brian@preston-campbell.com> References: <002f01c3eaf9$f6a26520$6400a8c0@thinkpad> <.38.117.145.89.1075905386.squirrel@www.bpang.com> <200402040953.18940.brian@preston-campbell.com> Message-ID: <40214735.2070200@att.net> Brian Preston-Campbell wrote: > Mandrake 9.2 > > On Wednesday 04 February 2004 09:36 am, bpang at bpang.com wrote: > >>>Speaking of which, how many of you use linux as your primary desktop? >> >>I do. And I have even taught myself to use The Gimp!! It could still help >>me to learn how to script-fu it, but otherwise, it works fine for me. >> >>TRYING to rebuild a new desktop using something other than RedHat now. >> >>Which other distro has a nice point-and-click, make-the-hard-decisions for >>you install GUI like RedHat? >>I tried Debian and couldn't get it to bring up X. >>Tring Gentoo now, but it's taking forever, and I'm starting to get >>confused and will probably have to do it a second time to correct my >>mistakes from the first pass. >> >>Opinions? Advice? >> >>thanks >> > I've dabbled in RH since 4, and have used 7.x extensively. I've worked with 8 and 9 and have recently loaded Fedora, but Linux has never been my primary desktop except when I run it on top of VMWare -- which is nice for developing/testing. I also use SNAGIT to capture installation screenshots when loading Linux on XP via VMware. I use my Wacom Intuos tablet with the GIMP and am now writing all my Open Source courseware using OOo -- works great. And Mozilla 1.6 rawks. It's my email client too. Firebird and Thurderbird are also nice. Mandrake setup looks pretty friendly, but I've never actually used it once I got it installed. I have had several distros on VMware and it's a great tool to show people all the common flavors with little more than a mouseclick. Knoppix is too cool for words, and I've actually used it to recover a win98 product ID for a friend who bought a used computer. If pressed, I think I could teach an entire LAMP course using Knoppix. They're supposed to be coming out with ver. 3.4 in a coupla weeks that I believe will have kernel 2.6 and other goodies. btw, I'm on a dialup and downloading an ISO is out of the question, so I buy all my stuff from: http://www.edmunds-enterprises.com/linux/index.php "real cheap" :) John From csnyder at chxo.com Wed Feb 4 14:47:08 2004 From: csnyder at chxo.com (Chris Snyder) Date: Wed, 04 Feb 2004 14:47:08 -0500 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer In-Reply-To: <40214184.70502@att.net> References: <000501c3eb3b$8accc7e0$e98d3818@oberon1> <40214184.70502@att.net> Message-ID: <40214C3C.6020103@chxo.com> John Lacey wrote: > if you're talking moz composer, be careful if you want to maintain > xhtml compat... for example, it takes
and writes them back out > as
> That's what Tidy is for. :-) At least it sends back HTML 4.0 compliant code, and it will apply styles instead of font tags (a default? user preference). All in all, none too shabby. From jlacey at att.net Wed Feb 4 14:51:24 2004 From: jlacey at att.net (John Lacey) Date: Wed, 04 Feb 2004 12:51:24 -0700 Subject: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer In-Reply-To: <40214C3C.6020103@chxo.com> References: <000501c3eb3b$8accc7e0$e98d3818@oberon1> <40214184.70502@att.net> <40214C3C.6020103@chxo.com> Message-ID: <40214D3C.2050900@att.net> Chris Snyder wrote: > John Lacey wrote: > >> if you're talking moz composer, be careful if you want to maintain >> xhtml compat... for example, it takes
and writes them back out >> as
>> > That's what Tidy is for. :-) > > At least it sends back HTML 4.0 compliant code, and it will apply styles > instead of font tags (a default? user preference). All in all, none too > shabby. > Some prefer Colgate over Crest :) From Cbielanski at inta.org Wed Feb 4 14:56:08 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Wed, 4 Feb 2004 14:56:08 -0500 Subject: OT RE: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in Mi crosoftInternet Explorer Message-ID: and some prefer Slurm over Soylent Cola (which "varies from person to person" ;) ) Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 -----Original Message----- From: John Lacey [mailto:jlacey at att.net] Sent: Wednesday, February 04, 2004 2:51 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Fw: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer Chris Snyder wrote: > John Lacey wrote: > >> if you're talking moz composer, be careful if you want to maintain >> xhtml compat... for example, it takes
and writes them back out >> as
>> > That's what Tidy is for. :-) > > At least it sends back HTML 4.0 compliant code, and it will apply styles > instead of font tags (a default? user preference). All in all, none too > shabby. > Some prefer Colgate over Crest :) _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From webmaster at localnotion.com Wed Feb 4 16:50:53 2004 From: webmaster at localnotion.com (Matthew Terenzio) Date: Wed, 4 Feb 2004 16:50:53 -0500 Subject: [nycphp-talk] Re: linux desktop (wuz: TA04-033A: Multiple Vulnerabilities in MicrosoftInternet Explorer) In-Reply-To: <4020C71D.5030607@reuel.net> References: <4020C71D.5030607@reuel.net> Message-ID: <34805BEE-575C-11D8-BC0D-0003938BDF32@localnotion.com> > You may want to check out OS X if you want the power of unix and the > looks of Windows Power of Unix yes, looks of Windows, very very loosely, and in fact its the other way around. And it seems much richer to me. On Feb 4, 2004, at 5:19 AM, leam wrote: > Mark Armendariz wrote: >>> ... then again im sure we all use linux and have nothing to fear to >>> begin with :-) >> Speaking of which, how many of you use linux as your primary desktop? >> Now >> that I don't do much design, it's more and more tempting every day, >> but I >> still feel I'll suffer some windows withdrawal... Outlook and >> photoshop for >> instance. > > I do, but I'm fairly non-graphically inclined. You may want to check > out OS X if you want the power of unix and the looks of Windows. My > wife switched over and she likes it. > > ciao! > > leam > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From danielc at analysisandsolutions.com Wed Feb 4 17:15:22 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 4 Feb 2004 17:15:22 -0500 Subject: [nycphp-talk] oracle delimited identifiers In-Reply-To: <20040204183254.GA26053@panix.com> References: <20040204183254.GA26053@panix.com> Message-ID: <20040204221522.GA7736@panix.com> Hi Folks: Chris Hubbard passed my question onto a friend who says: Actually, you can't have double quotes in an object name in Oracle. This is from the SQL Reference Manual: Quoted identifiers can contain any characters and punctuations marks as well as spaces. However, neither quoted nor nonquoted identifiers can contain double quotation marks. So, thank you Chris! --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From chubbard at next-online.net Wed Feb 4 17:20:01 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Wed, 04 Feb 2004 14:20:01 -0800 Subject: [nycphp-talk] oracle delimited identifiers In-Reply-To: <20040204221522.GA7736@panix.com> References: <20040204183254.GA26053@panix.com> <20040204221522.GA7736@panix.com> Message-ID: <40217011.1040400@next-online.net> Dan, You're welcome. Glad I could help someone! Chris Daniel Convissor wrote: >Hi Folks: > >Chris Hubbard passed my question onto a friend who says: > >Actually, you can't have double quotes in an object name in Oracle. This >is from the SQL Reference Manual: > >Quoted identifiers can contain any characters and punctuations marks as >well as spaces. However, neither quoted nor nonquoted identifiers can >contain double quotation marks. > > >So, thank you Chris! > >--Dan > > > From danielc at analysisandsolutions.com Wed Feb 4 17:38:02 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 4 Feb 2004 17:38:02 -0500 Subject: [nycphp-talk] text: PEAR::DB Oracle BLOBs In-Reply-To: <402144B7.8010102@next-online.net> References: <402144B7.8010102@next-online.net> Message-ID: <20040204223802.GA8952@panix.com> Hi Chris: On Wed, Feb 04, 2004 at 11:15:03AM -0800, Chris Hubbard wrote: > Has anyone used PEAR::DB to read and write BLOBs into Oracle? I haven't tried BLOBS, but I've used CLOBS via Prepare/Execute. See this test include file for examples: DB/tests/prepexe.inc. For those out there that are curious, the Prepare/Execute documentation is at http://pear.php.net/manual/en/package.database.db.intro-execute.php > I've got an application that writes incoming email attachments > (typically pdf and jpg) to a blob field in oracle. And I want to write > the blob not from a file, but from a string. But does it work from a file? Have you tried it as a string in DB? Have you tried it as a file in DB? Dealing with binaries is something on my agenda for DB, but getting out a bug free (okay, so significantly bug reduced) release in the near future is even higher. :) Anyway, if you're doing further testing of how to do this with PEAR DB, do make sure to obtain the latest release so we can be on the same page. I can't really comment on the approach in your code because I haven't messed around with BLOBS. Good luck! --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From salmaz8347 at hotmail.com Wed Feb 4 18:49:02 2004 From: salmaz8347 at hotmail.com (SALMAN MAZHAR) Date: Wed, 04 Feb 2004 18:49:02 -0500 Subject: [nycphp-talk] QUESTION Message-ID: Hi, If I have to ask any questions about PHP, do I send them to this address, that is: talk at lists.nyphp.org or is there any other procedure to get into this discussion forum. Thanks, Salman. _________________________________________________________________ Learn how to choose, serve, and enjoy wine at Wine @ MSN. http://wine.msn.com/ From mitchy at spacemonkeylabs.com Wed Feb 4 20:03:22 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Wed, 04 Feb 2004 20:03:22 -0500 Subject: [nycphp-talk] Question about resources for PHP4-based classes Message-ID: <4021965A.7000306@spacemonkeylabs.com> Hey listolas, Forced to be thinking in PHP4-based classes, I'm wondering where others on the list have found their most helpful resources on the 'Net. The PHP documentation is correct, but I'm looking for something a little more verbose. For example, it is commonly stated that PHP4 classes are clearly 'stapled on'. Where is a good resource for insight into how to overcome these, ah, 'features'? I'm about to jump into a huge project that is totally PHP4-meets-OOP and want to know just how unhappy I will become after all these years in c and python :^P -- Mitch From chubbard at next-online.net Wed Feb 4 20:14:40 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Wed, 04 Feb 2004 17:14:40 -0800 Subject: [nycphp-talk] user authentication security structure In-Reply-To: <402135DE.8060004@next-online.net> References: <402135DE.8060004@next-online.net> Message-ID: <40219900.4080004@next-online.net> No takers? Chris Hubbard wrote: > All, > Thanks for all your suggestions and feedback to date. The following > is a description of the login and user-authentication mechanism I'm > planning to implement in our application, based on the discussion here > and other research I've done. If you've got ways to improve it, > please make suggestions. > > Assumptions: > * all client browsers will have cookies enabled. If they don't they > get redirected to a page that tells them to enable cookies before they > have the chance to log in. > * all pages (especially login) will be within SSL > * will be using custom session handlers (aka Sean's article in php|arch) > > Requirements: > * users can bookmark any page in the application. When the user tries > to return to a bookmarked page after the session has expired, then > they are presented with the login page. after a successful login > they're redirected to the bookmarked page. > > Flow: > * user enters their username and password and submits the form > * code makes sure the data submitted is "clean" > * code checks username and password against values in db > * if they match create a cookie that will expire in 10 (or so) seconds > * create a session > * redirect to home page or bookmarked page. > * at home page read the temp cookie and the session data, if they > correspond create a new cookie that will expire in N minutes. > * when user clicks "log out" destroy the session and either empty the > cookie or fill it with garbage. > > Thoughts: > I'm thinking of putting a timestamp into the login cookie, so if it's > presented and it's too old, I can redirect to the login page > I may add a counter to the login cookie, if you don't get in after 3 > or N attempts you get redirected to some (random) web address. > I've been thinking about using the cookie ID to sign and encrypt the > session ID and then using the session ID to sign and encrypt the > cookie ID but that might be overkill. > I may put the login page into it's own folder ./login/login.php, and > have the login cookie be specific to that folder. > > Once I get this flat I'll make the pattern publicly available with > diagrams and documentation. I'm not sure whether it makes sense to > include the code (we use Oracle with some internal classes), so > probably won't include complete code. > > Thoughts, comments, suggestions? > Chris > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From tgales at tgaconnect.com Wed Feb 4 20:36:41 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 4 Feb 2004 20:36:41 -0500 Subject: [nycphp-talk] Question about resources for PHP4-based classes In-Reply-To: <4021965A.7000306@spacemonkeylabs.com> Message-ID: <001501c3eb88$8188c650$e98d3818@oberon1> Mitch Pirtle writes: " Forced to be thinking in PHP4-based classes, I'm wondering where others on the list have found their most helpful resources on the 'Net..." I am a big fan of O'Reilly's Safari. You can read the book and make sure its what you want before you plunk down any cash. A good resource is Chapter 7. Classes and Objects from PHP Cookbook By David Sklar, Adam Trachtenberg which you can find at Safari. Both the authors are on this list -- so you could ask them questions here. (Adam sent you a really good link on statistics with php at ibm.com ) T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From tgales at tgaconnect.com Wed Feb 4 21:17:02 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 4 Feb 2004 21:17:02 -0500 Subject: [nycphp-talk] Object-Oriented Evolution of PHP Message-ID: <001601c3eb8e$2510d790$e98d3818@oberon1> Here is an article that may be of interest to readers of this list: 'The Object-Oriented Evolution of PHP' by Zeev Suraski at: http://www.devx.com/webdev/Article/10007/0/page/1 In the article the author highlights the advantages of PHP 5 by contrasting how the object models differ between version 4 and version 5. The article is from November of last year and so it might be 'old hat' to some. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From mitchy at spacemonkeylabs.com Wed Feb 4 21:24:22 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Wed, 04 Feb 2004 21:24:22 -0500 Subject: [nycphp-talk] user authentication security structure In-Reply-To: <40219900.4080004@next-online.net> References: <402135DE.8060004@next-online.net> <40219900.4080004@next-online.net> Message-ID: <4021A956.40808@spacemonkeylabs.com> Chris Hubbard wrote: > No takers? Ok, no arm twisting! :^P >> * will be using custom session handlers (aka Sean's article in php|arch) Gotta pick that issue up. Been looking at a combination of pound and msessions for my next biggie, wondering if there's any collective wisdom on this list that I could gain insight from. >> Requirements: >> * users can bookmark any page in the application. When the user tries >> to return to a bookmarked page after the session has expired, then >> they are presented with the login page. after a successful login >> they're redirected to the bookmarked page. Make sure you redirect them and pass the original page's location as a parameter - I did this for one customer, and they were counting on their browser 'remembering' their login information... But this doesn't work if you login from a different URL every time! I thought I was being shifty, but in effect was making them crazy. >> Flow: >> * user enters their username and password and submits the form >> * code makes sure the data submitted is "clean" >> * code checks username and password against values in db >> * if they match create a cookie that will expire in 10 (or so) seconds >> * create a session >> * redirect to home page or bookmarked page. >> * at home page read the temp cookie and the session data, if they >> correspond create a new cookie that will expire in N minutes. >> * when user clicks "log out" destroy the session and either empty the >> cookie or fill it with garbage. Use the timestamp stored with the session - I've never seen anyone hit the 'logout' button, ever. >> Thoughts: >> I'm thinking of putting a timestamp into the login cookie, so if it's >> presented and it's too old, I can redirect to the login page Bingo. The question I have is where are you storing the session data? What kind of performance requirements do you have? -- Mitch From jlacey at att.net Wed Feb 4 21:33:23 2004 From: jlacey at att.net (John Lacey) Date: Wed, 04 Feb 2004 19:33:23 -0700 Subject: [nycphp-talk] Object-Oriented Evolution of PHP In-Reply-To: <001601c3eb8e$2510d790$e98d3818@oberon1> References: <001601c3eb8e$2510d790$e98d3818@oberon1> Message-ID: <4021AB73.6090502@att.net> Tim Gales wrote: > Here is an article that may be of > interest to readers of this list: > > 'The Object-Oriented Evolution of PHP' > by Zeev Suraski > at: > http://www.devx.com/webdev/Article/10007/0/page/1 > > In the article the author highlights the advantages > of PHP 5 by contrasting how the object models > differ between version 4 and version 5. > thanks Tim... PHP5 info seems pretty sparse so far. The two things I've been using are the php5/ze2 [php.net] official changes page and a pdf of a slide presentation that I found by Derrick Rethans from Linux Tag 2003. I'm wanting to include php5 info for my next series of courses J btw, after several ppl gave it high marks on here, I bought a copy of ultraedit... very good stuff so far -- reminds me a little of 'Brief' (by UnderWare believe it or not :) from my software engineering days From adam at trachtenberg.com Thu Feb 5 01:26:03 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Thu, 5 Feb 2004 01:26:03 -0500 (EST) Subject: [nycphp-talk] Object-Oriented Evolution of PHP In-Reply-To: <4021AB73.6090502@att.net> References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> Message-ID: On Wed, 4 Feb 2004, John Lacey wrote: > thanks Tim... PHP5 info seems pretty sparse so far. The two things > I've been using are the php5/ze2 [php.net] official changes page and a > pdf of a slide presentation that I found by Derrick Rethans from Linux > Tag 2003. I'm wanting to include php5 info for my next series of courses Good PHP 5 information is hard to find. If you have a particular area you're looking for, I can probably give you some pointers. (This offer extends to others, too, of course.) For basic information, start at http://talks.php.net and look at the recent presentations. Quality, however, varies from talk to talk and presentations are not updated when material changes, so take everything with a grain of salt. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From adam at trachtenberg.com Thu Feb 5 01:34:21 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Thu, 5 Feb 2004 01:34:21 -0500 (EST) Subject: [nycphp-talk] Question about resources for PHP4-based classes In-Reply-To: <4021965A.7000306@spacemonkeylabs.com> References: <4021965A.7000306@spacemonkeylabs.com> Message-ID: On Wed, 4 Feb 2004, Mitch Pirtle wrote: > For example, it is commonly stated that PHP4 classes are clearly > 'stapled on'. Where is a good resource for insight into how to overcome > these, ah, 'features'? There are no great resources that I know of that discuss PHP 4 and OO. I would say the site that does the best job is probably PHP Patterns (http://www.phppatterns.com/), if you're in to that kind of thing. > I'm about to jump into a huge project that is totally PHP4-meets-OOP and > want to know just how unhappy I will become after all these years in c > and python :^P Objects in PHP 4 are really structs with functions. You will probably hate it. Objects are passed by value and everything is public. If you're truly looking for a good PHP meets OOP platform, I would suggest PHP 5. PHP 5 implements most of the Java OO model. (Constructors, destructors, PPP, final, interfaces, abstract classes, static, accessors, etc.) While I wouldn't call PHP 5 production quality today, it works perfectly well for development. I would say that crashing is less than a problem than memory leaking, so worse comes to worse you restart Apache. :) Depending upon your time frame, PHP 5 will be released before you launch and you'll be a much happier camper during development. (And you won't need to port your application to PHP 5 in 4 months.) -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From jonbaer at jonbaer.net Thu Feb 5 01:33:16 2004 From: jonbaer at jonbaer.net (jon baer) Date: Thu, 5 Feb 2004 01:33:16 -0500 Subject: [nycphp-talk] Object-Oriented Evolution of PHP References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> Message-ID: <007001c3ebb1$f089b040$6400a8c0@thinkpad> anyone ever take a look on eBay for "PHP 5"? http://search.ebay.com/search/search.dll?query=php+5 i actually got the mastering php 5 cd just for the hell of it and it was a bit of a con (there was 1 small chapter on php5 coming features) lesson learned :-\ ... - jon ----- Original Message ----- From: "Adam Maccabee Trachtenberg" To: "NYPHP Talk" Sent: Thursday, February 05, 2004 1:26 AM Subject: Re: [nycphp-talk] Object-Oriented Evolution of PHP > Good PHP 5 information is hard to find. If you have a particular area > you're looking for, I can probably give you some pointers. (This offer > extends to others, too, of course.) From adam at trachtenberg.com Thu Feb 5 01:56:36 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Thu, 5 Feb 2004 01:56:36 -0500 (EST) Subject: [nycphp-talk] Object-Oriented Evolution of PHP In-Reply-To: <007001c3ebb1$f089b040$6400a8c0@thinkpad> References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> <007001c3ebb1$f089b040$6400a8c0@thinkpad> Message-ID: On Thu, 5 Feb 2004, jon baer wrote: > i actually got the mastering php 5 cd just for the hell of it and it was a > bit of a con (there was 1 small chapter on php5 coming features) lesson > learned :-\ ... Any book (or CD) today that claims to "cover PHP 5" is lying. There have been many significant changes to PHP 5 in the last few months and while a book may be mostly correct, they will omit some features, cover some features were dropped from PHP 5, and document other features incorrectly. For instance, just this week way you clone objects went from $new = $old->__clone() to $new = clone $old. Not a big deal, except that you don't want your reference guide to show you the old syntax. There's also a book on the market that discusses PHP 5 and namespaces. Namespaces were dropped from PHP 5 months ago, but this book is out there saying they're in. If you don't know better, you'll end up very confused. PHP 5 is exciting, but we probably need the rest of February for PHP 5 to settle down completely and give developers time to see if the features in PHP 5 are both designed and implemented correctly. On a positive note, it looks like a SOAP extension written in C will be bundled with PHP 5. Previously, you needed to install a SOAP package written in PHP, which meant that SOAP was slowish and you couldn't count on SOAP being installed on your machine. (Actually, you could usually count on it not being installed.) This extension will provide developers with a significant speed increase (I would never claim SOAP is fast) and (depending upon how solid the extension shapes up to be) it will be enabled by default. Unfortunately, like most things PHP 5, documentation is non-existent. :) -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From jsiegel1 at optonline.net Thu Feb 5 06:09:09 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Thu, 05 Feb 2004 06:09:09 -0500 Subject: [nycphp-talk] QUESTION In-Reply-To: References: Message-ID: <40222455.60001@optonline.net> This is the place to post your questions. Jeff SALMAN MAZHAR wrote: > Hi, > > If I have to ask any questions about PHP, do I send them to this > address, that is: talk at lists.nyphp.org or is there any other procedure > to get into this discussion forum. > > Thanks, > Salman. > > _________________________________________________________________ > Learn how to choose, serve, and enjoy wine at Wine @ MSN. > http://wine.msn.com/ > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" From jlacey at att.net Thu Feb 5 09:16:50 2004 From: jlacey at att.net (John Lacey) Date: Thu, 05 Feb 2004 07:16:50 -0700 Subject: [nycphp-talk] Object-Oriented Evolution of PHP In-Reply-To: <007001c3ebb1$f089b040$6400a8c0@thinkpad> References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> <007001c3ebb1$f089b040$6400a8c0@thinkpad> Message-ID: <40225052.6090106@att.net> jon baer wrote: > anyone ever take a look on eBay for "PHP 5"? > > http://search.ebay.com/search/search.dll?query=php+5 > > i actually got the mastering php 5 cd just for the hell of it and it was a > bit of a con (there was 1 small chapter on php5 coming features) lesson > learned :-\ ... > > - jon I found another site advertising php5 learning packages, but at over $50, I was a little suspicious because I haven't found much on the web, and secondly, I've noticed a coupla posts on here about forthcoming php5 books and they're still months off. I'm looking forward to their release. I've had pretty good luck buying used books on amazon. A while back Dan Convissor was looking at the SQL99 Complete book ($70) and amazon had it 'used' for $12 and change -- and it was like new when I bought my copy. John >From hans not junk at nyphp.com Thu Feb 5 09:19:07 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 6C54BA85F0 for ; Thu, 5 Feb 2004 09:19:07 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] QUESTION Date: Thu, 5 Feb 2004 06:19:06 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87771FD3 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] QUESTION Thread-Index: AcPreX0I8xXYiBT6TjCAOkV67xnbyAAeZsXQ From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 14:19:07 -0000 > If I have to ask any questions about PHP, do I send them to this address,=20 > that is: talk at lists.nyphp.org or is there any other procedure=20 > to get into this discussion forum. This is the place to post your questions, using the address you state above. There are also online web forums at http://nyphp.org/forums if you prefer that. H >From hans not junk at nyphp.com Thu Feb 5 09:22:54 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 6F165A85F0 for ; Thu, 5 Feb 2004 09:22:54 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Object-Oriented Evolution of PHP Date: Thu, 5 Feb 2004 06:22:53 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87771FD6 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Object-Oriented Evolution of PHP Thread-Index: AcPrkHUsQM/6dQvxS+GINMi1CQkA4AAYxAIw From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 14:22:54 -0000 > thanks Tim... PHP5 info seems pretty sparse so far. The two things=20 > I've been using are the php5/ze2 [php.net] official changes page and a > pdf of a slide presentation that I found by Derrick Rethans from Linux > Tag 2003. I'm wanting to include php5 info for my next=20 > series of courses Yeah, the definitive sources of information I've found are of course: http://us2.php.net/ChangeLog-5.php http://us2.php.net/zend-engine-2.php > btw, after several ppl gave it high marks on here, I bought a copy of=20 > ultraedit... very good stuff so far -- reminds me a little of 'Brief' > (by UnderWare believe it or not :) from my software engineering days Hah! Brief was awesome, and I find ultraedit to be right inline with it. H >From hans not junk at nyphp.com Thu Feb 5 09:31:20 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 21F1CA85F0 for ; Thu, 5 Feb 2004 09:31:20 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Question about resources for PHP4-based classes Date: Thu, 5 Feb 2004 06:31:19 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87771FDC at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Question about resources for PHP4-based classes Thread-Index: AcPrg9yI776suuGfT0qtw0NHx9mQmAAcDkWQ From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 14:31:20 -0000 > Forced to be thinking in PHP4-based classes, I'm wondering where others=20 > on the list have found their most helpful resources on the 'Net. The=20 > PHP documentation is correct, but I'm looking for something a little=20 > more verbose. As far as style? Many basic OO techniques for C++/Java (for example) can be applied in PHP, even under PHP 4. Of course, you can't get overly academic since PHP's OO implementation is sparse - but that's probably a good thing anyway :) > For example, it is commonly stated that PHP4 classes are clearly=20 > 'stapled on'. Where is a good resource for insight into how=20 > to overcome these, ah, 'features'? Develop under PHP 5 :) > I'm about to jump into a huge project that is totally PHP4-meets-OOP and=20 > want to know just how unhappy I will become after all these years in c > and python :^P It's not that bad. With PHP 5 on the horizon now, I generaly program *without* attempting all the little hackish OO techniques that were common with PHP 4. Soon enough, my code will run under PHP 5 and to me it's worth a little performance hit now, vs the porting issues later on. OO is a concept and style of application architecture - you can do OO in C :) H >From hans not junk at nyphp.com Thu Feb 5 09:39:31 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 5FA6CA8627 for ; Thu, 5 Feb 2004 09:39:31 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] user authentication security structure Date: Thu, 5 Feb 2004 06:39:29 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87771FDF at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] user authentication security structure Thread-Index: AcPrSpi5CcrJb37OTuW34AOt8mEAMAAqpTMw From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 14:39:31 -0000 > Thanks for all your suggestions and feedback to date. The following is=20 > a description of the login and user-authentication mechanism I'm=20 > planning to implement in our application, based on the discussion here > and other research I've done. If you've got ways to improve it, please=20 > make suggestions. >=20 > Assumptions: > * all client browsers will have cookies enabled. If they don't they get=20 > redirected to a page that tells them to enable cookies before they have=20 > the chance to log in. > * all pages (especially login) will be within SSL > * will be using custom session handlers (aka Sean's article in php|arch) >=20 > Requirements: > * users can bookmark any page in the application. When the user tries > to return to a bookmarked page after the session has expired, then they=20 > are presented with the login page. after a successful login they're=20 > redirected to the bookmarked page. >=20 > Flow: > * user enters their username and password and submits the form > * code makes sure the data submitted is "clean" > * code checks username and password against values in db > * if they match create a cookie that will expire in 10 (or so) seconds > * create a session > * redirect to home page or bookmarked page. > * at home page read the temp cookie and the session data, if they=20 > correspond create a new cookie that will expire in N minutes. > * when user clicks "log out" destroy the session and either empty the=20 > cookie or fill it with garbage. Looks good overall. > I'm thinking of putting a timestamp into the login cookie, so if it's=20 > presented and it's too old, I can redirect to the login page > I may add a counter to the login cookie, if you don't get in after 3 or=20 > N attempts you get redirected to some (random) web address. Cookies can be forged, per two above points. > I've been thinking about using the cookie ID to sign and encrypt the=20 > session ID and then using the session ID to sign and encrypt=20 > the cookie ID but that might be overkill. Maybe.. I'd personally sign things with a value that never goes out across the internet (ie, private). > I may put the login page into it's own folder ./login/login.php, and=20 > have the login cookie be specific to that folder. I'm not sure I see the value in this - especially since cookies could be forged anyway - but I might easily be missing something else. > Once I get this flat I'll make the pattern publicly available with=20 > diagrams and documentation. I'm not sure whether it makes sense to=20 > include the code (we use Oracle with some internal classes), so probably=20 > won't include complete code. That'd be great. Patterns/diagrams are 75% of the work :) H From jlacey at att.net Thu Feb 5 09:52:48 2004 From: jlacey at att.net (John Lacey) Date: Thu, 05 Feb 2004 07:52:48 -0700 Subject: [nycphp-talk] Object-Oriented Evolution of PHP In-Reply-To: References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> Message-ID: <402258C0.8070408@att.net> Adam Maccabee Trachtenberg wrote: > Good PHP 5 information is hard to find. If you have a particular area > you're looking for, I can probably give you some pointers. (This offer > extends to others, too, of course.) I'll put together a few pointed questions... btw all the courses I offer at this point are of the intro type, I've nothing to say to people with advanced skills. My purpose is evangelizing Open Source and providing people a good foundation at a reasonable price. > > For basic information, start at http://talks.php.net and look at the > recent presentations. Quality, however, varies from talk to talk and > presentations are not updated when material changes, so take > everything with a grain of salt. > didn't know about the talks.php.net area -- thanks John From jsiegel1 at optonline.net Thu Feb 5 10:27:47 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Thu, 05 Feb 2004 10:27:47 -0500 Subject: [nycphp-talk] PHundamentals - Article Review Needed - VHosting on Mac Message-ID: <402260F3.7000306@optonline.net> Can anyone offer a technical review of the following PHundamentals article on setting up Virtual Hosting on the Mac? http://phundamentals.nyphp.org/PH_virtualhosting_mac.php Anything that needs alteration/clarification can be posted to the "talk" list. TIA, Jeff Siegel/Michael Southwell - The PHundamentals Team -- From adam at trachtenberg.com Thu Feb 5 10:45:17 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Thu, 5 Feb 2004 10:45:17 -0500 (EST) Subject: [nycphp-talk] PHundamentals - Article Review Needed - VHosting on Mac In-Reply-To: <402260F3.7000306@optonline.net> References: <402260F3.7000306@optonline.net> Message-ID: On Thu, 5 Feb 2004, Jeff Siegel wrote: > http://phundamentals.nyphp.org/PH_virtualhosting_mac.php > > Anything that needs alteration/clarification can be posted to the "talk" > list. You need to encode HTML entities. In particular, look under 3c. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From dmintz at davidmintz.org Thu Feb 5 10:48:48 2004 From: dmintz at davidmintz.org (David Mintz) Date: Thu, 5 Feb 2004 10:48:48 -0500 (EST) Subject: [nycphp-talk] oracle delimited identifiers In-Reply-To: <20040204221522.GA7736@panix.com> References: <20040204183254.GA26053@panix.com> <20040204221522.GA7736@panix.com> Message-ID: > > Quoted identifiers can contain any characters and punctuations marks as > well as spaces. However, neither quoted nor nonquoted identifiers can > contain double quotation marks. What sort of perv would want to use double quotes in a table or column name, anyway? --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From danielc at analysisandsolutions.com Thu Feb 5 11:08:20 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 5 Feb 2004 11:08:20 -0500 Subject: [nycphp-talk] oracle delimited identifiers In-Reply-To: References: <20040204183254.GA26053@panix.com> <20040204221522.GA7736@panix.com> Message-ID: <20040205160820.GA9215@panix.com> On Thu, Feb 05, 2004 at 10:48:48AM -0500, David Mintz wrote: > > What sort of perv would want to use double quotes in a table or column > name, anyway? Agreed. Delimited identifiers in general are one of those things in the category of: just because you CAN do something doesn't mean you SHOULD do something. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jsiegel1 at optonline.net Thu Feb 5 11:13:39 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Thu, 05 Feb 2004 11:13:39 -0500 Subject: [nycphp-talk] PHundamentals - Article Review Needed - VHosting on Mac In-Reply-To: References: <402260F3.7000306@optonline.net> Message-ID: <40226BB3.1090009@optonline.net> It's fixed. The article was written by someone else and I quickly tossed it up there. Jeff Adam Maccabee Trachtenberg wrote: > On Thu, 5 Feb 2004, Jeff Siegel wrote: > > >>http://phundamentals.nyphp.org/PH_virtualhosting_mac.php >> >>Anything that needs alteration/clarification can be posted to the "talk" >>list. > > > You need to encode HTML entities. In particular, look under 3c. > > -adam > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" From dmintz at davidmintz.org Thu Feb 5 12:01:18 2004 From: dmintz at davidmintz.org (David Mintz) Date: Thu, 5 Feb 2004 12:01:18 -0500 (EST) Subject: [nycphp-talk] PEAR DB_Cache: is this a bug? In-Reply-To: References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> <007001c3ebb1$f089b040$6400a8c0@thinkpad> Message-ID: Hey all. I've been playing with DB_Cache and encountered a behavior in fetchRow() that seems weird -- or I'm doing something stupid, always a leading theory. The version of my Cache package is 1.5.3 and the file (Cache/DB.php) containing the class (Cache_DB_Result) containing the method says revision 1.7 I think it will save words to just show it to you: http://177coles.dyndns.org/test/ It seems that the internal cursor starts one too high and overruns the end of the array. You get a row missing at the beginning and a "undefined offest" warning at the end of the loop. I hacked up a crude fix that makes the problem ~apparently~ go away and I can show ya that too if anyone's interested. Even more interesting, if you call fetchRow with arguments DB_FETCHMODE_XXX and a $rownum, you go into an infinite loop. I didn't try to fix that. It's hard to imagine nobody else noticing these problems, but I found nothing either in the PEAR bug reports or by doing some Googling. (Hence my alternative theory, that I'm missing something.) Does anyone know if this is still being maintained, or is it the end of the line? --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From dan at cain.sh Thu Feb 5 12:34:23 2004 From: dan at cain.sh (Daniel J Cain Jr.) Date: Thu, 05 Feb 2004 11:34:23 -0600 Subject: [nycphp-talk] Object-Oriented Evolution of PHP In-Reply-To: References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> <007001c3ebb1$f089b040$6400a8c0@thinkpad> Message-ID: <1076002462.30822.3.camel@gigabeast.home.cain.sh> > For instance, just this week way you clone objects went from $new = > $old->__clone() to $new = clone $old. Not a big deal, except that you > don't want your reference guide to show you the old syntax. How can a person keep informed of changes like the way clone is implemented in PHP5? Is there a mailing list dedicated to this kind of information? From tgales at tgaconnect.com Thu Feb 5 13:10:33 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Thu, 5 Feb 2004 13:10:33 -0500 Subject: [nycphp-talk] Object-Oriented Evolution of PHP In-Reply-To: <1076002462.30822.3.camel@gigabeast.home.cain.sh> Message-ID: <002101c3ec13$596d60a0$e98d3818@oberon1> you can try: http://news.php.net/group.php?group=php.internals its basically aimed at people who want to help develop php -- but there's nothing to prevent you from 'lurking' there in order to keep abreast of what's going on... T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Daniel J Cain Jr. > Sent: Thursday, February 05, 2004 12:34 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Object-Oriented Evolution of PHP > > > > For instance, just this week way you clone objects went from $new = > > $old->__clone() to $new = clone $old. Not a big deal, > except that you > > don't want your reference guide to show you the old syntax. > > How can a person keep informed of changes like the way clone > is implemented in PHP5? Is there a mailing list dedicated to > this kind of information? > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk > From adam at trachtenberg.com Thu Feb 5 13:11:11 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Thu, 5 Feb 2004 13:11:11 -0500 (EST) Subject: [nycphp-talk] Object-Oriented Evolution of PHP In-Reply-To: <1076002462.30822.3.camel@gigabeast.home.cain.sh> References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> <007001c3ebb1$f089b040$6400a8c0@thinkpad> <1076002462.30822.3.camel@gigabeast.home.cain.sh> Message-ID: On Thu, 5 Feb 2004, Daniel J Cain Jr. wrote: > How can a person keep informed of changes like the way clone is > implemented in PHP5? Is there a mailing list dedicated to this kind of > information? There is no list that specifically just mentions PHP 5 changes like this. There is, however, the "Internals" list which is where core developers (and others) discuss changes to PHP. This is a somewhat technical list, as PHP development is done in C, not PHP. You can subscribe to the list or review the archives at: http://www.php.net/mailing-lists.php As an aside, this is a no-nonsense list and you're expected to know what you're talking about when you make a post. Also, watching people write programming languages is similar to watching people make sausage or write legislation. You may prefer not to know how it's done. :) -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From danielc at analysisandsolutions.com Thu Feb 5 13:11:12 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 5 Feb 2004 13:11:12 -0500 Subject: [nycphp-talk] Object-Oriented Evolution of PHP In-Reply-To: <1076002462.30822.3.camel@gigabeast.home.cain.sh> References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> <007001c3ebb1$f089b040$6400a8c0@thinkpad> <1076002462.30822.3.camel@gigabeast.home.cain.sh> Message-ID: <20040205181111.GA23430@panix.com> On Thu, Feb 05, 2004 at 11:34:23AM -0600, Daniel J Cain Jr. wrote: > > How can a person keep informed of changes like the way clone is > implemented in PHP5? Is there a mailing list dedicated to this kind of > information? internals at lists.php.net --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From Cbielanski at inta.org Thu Feb 5 13:43:06 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Thu, 5 Feb 2004 13:43:06 -0500 Subject: [nycphp-talk] range in switch/case Message-ID: I'm being lazy - in Pascal/Delphi you can assign a range as a case in a switch statement. for example... case(0..255) or case('A'..'Z'). Does PHP have a facility to do this? I note that the above doesn't like me very much ;) Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 From adam at trachtenberg.com Thu Feb 5 13:46:25 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Thu, 5 Feb 2004 13:46:25 -0500 (EST) Subject: [nycphp-talk] range in switch/case In-Reply-To: References: Message-ID: On Thu, 5 Feb 2004, Chris Bielanski wrote: > I'm being lazy - in Pascal/Delphi you can assign a range as a case in a > switch statement. for example... case(0..255) or case('A'..'Z'). > > Does PHP have a facility to do this? I note that the above doesn't like me > very much ;) No. Switch to an if()...elseif()...else() and use a regular expression character class or something similar inside the if(). There was a brief talk of adding this to PHP, but it was rejected. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From danielc at analysisandsolutions.com Thu Feb 5 13:48:27 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 5 Feb 2004 13:48:27 -0500 Subject: [nycphp-talk] range in switch/case In-Reply-To: References: Message-ID: <20040205184826.GA26662@panix.com> Hi Chris: On Thu, Feb 05, 2004 at 01:43:06PM -0500, Chris Bielanski wrote: > I'm being lazy - in Pascal/Delphi you can assign a range as a case in a > switch statement. for example... case(0..255) or case('A'..'Z'). > > Does PHP have a facility to do this? I note that the above doesn't like me > very much ;) No. But your cases can flow into each other: switch () { case 1: case 2: case 3: // do something break; default: // do something else } -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From Cbielanski at inta.org Thu Feb 5 13:52:57 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Thu, 5 Feb 2004 13:52:57 -0500 Subject: [nycphp-talk] range in switch/case Message-ID: Cool, just wanted a definitive 'no' :) As it is, I don't really care if the user manages to jam some odd value in there since it's building a SELECT statement and nothing "dangerous". Hooray for 'default' case!! :P Thanks! Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 -----Original Message----- From: Adam Maccabee Trachtenberg [mailto:adam at trachtenberg.com] Sent: Thursday, February 05, 2004 1:46 PM To: NYPHP Talk Subject: Re: [nycphp-talk] range in switch/case On Thu, 5 Feb 2004, Chris Bielanski wrote: > I'm being lazy - in Pascal/Delphi you can assign a range as a case in a > switch statement. for example... case(0..255) or case('A'..'Z'). > > Does PHP have a facility to do this? I note that the above doesn't like me > very much ;) No. Switch to an if()...elseif()...else() and use a regular expression character class or something similar inside the if(). There was a brief talk of adding this to PHP, but it was rejected. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From tgales at tgaconnect.com Thu Feb 5 14:19:25 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Thu, 5 Feb 2004 14:19:25 -0500 Subject: [nycphp-talk] Pearl's beneath Swine -- a purely subjective blog entry (a rant) Message-ID: <002a01c3ec1c$f870b040$e98d3818@oberon1> As the subject suggests this is just a rant -- but I found it entertaining. "After years of working with Perl, I've finally come to admit the ugly truth to myself: Perl sucks..." Chris Cummer from: http://www.postal-code.com/mrhappy/blog/archives/000321.html T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From agfische at email.smith.edu Thu Feb 5 14:23:35 2004 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 5 Feb 2004 14:23:35 -0500 Subject: [nycphp-talk] Pearl's beneath Swine -- a purely subjective blog entry (a rant) In-Reply-To: <002a01c3ec1c$f870b040$e98d3818@oberon1> References: <002a01c3ec1c$f870b040$e98d3818@oberon1> Message-ID: He he, did the trick for me. Nice to have a good laugh in the middle of the day. -Aaron On Feb 5, 2004, at 2:19 PM, Tim Gales wrote: > As the subject suggests this is just a rant -- > but I found it entertaining. > > "After years of working with Perl, I've finally > come to admit the ugly truth to myself: > Perl sucks..." > Chris Cummer from: > http://www.postal-code.com/mrhappy/blog/archives/000321.html > > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.com From danielc at analysisandsolutions.com Thu Feb 5 14:39:46 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 5 Feb 2004 14:39:46 -0500 Subject: [nycphp-talk] two more security focus summaries Message-ID: <20040205193945.GA3152@panix.com> ----------------------------- SecurityFocus Newsletter #233 ----------------------------- PHPShop Project Multiple Vulnerabilities http://www.securityfocus.com/bid/9437 Mambo Open Source mod_mainmenu.php Remote File Include Vulne... http://www.securityfocus.com/bid/9445 Invision Power Board Index.php Cross-Site Scripting Vulnerab... http://www.securityfocus.com/bid/9447 YABB SE SSI.PHP ID_MEMBER SQL Injection Vulnerability http://www.securityfocus.com/bid/9449 PHPix Remote Arbitrary Command Execution Vulnerability http://www.securityfocus.com/bid/9458 ----------------------------- SecurityFocus Newsletter #234 ----------------------------- Gallery Remote Global Variable Injection Vulnerability http://www.securityfocus.com/bid/9490 Antologic Antolinux Administrative Interface NDCR Parameter ... http://www.securityfocus.com/bid/9495 Xoops Viewtopic.php Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/9497 Kietu Index.PHP Remote File Include Vulnerability http://www.securityfocus.com/bid/9499 -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at prusak.com Thu Feb 5 16:15:19 2004 From: lists at prusak.com (Ophir Prusak) Date: Thu, 05 Feb 2004 16:15:19 -0500 Subject: [nycphp-talk] PEAR DB_Cache: is this a bug? In-Reply-To: References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> <007001c3ebb1$f089b040$6400a8c0@thinkpad> Message-ID: <4022B267.9070800@prusak.com> Hi David, I never used pear's cache libs before, but have been thinking of using something like it. I just checked your code on my machine and am getting the same results: http://www.stationplay.com/dev/cache_test.php Seems like a bug to me. I'm curious to know what other similar solutions you've looked at. I saw PEAR has a cache lite as well. Ophir David Mintz wrote: >Hey all. > >I've been playing with DB_Cache and encountered a behavior in fetchRow() >that seems weird -- or I'm doing something stupid, always a leading >theory. > >The version of my Cache package is 1.5.3 and the file (Cache/DB.php) >containing the class (Cache_DB_Result) containing the method says revision >1.7 I think it will save words to just show it to you: > >http://177coles.dyndns.org/test/ > >It seems that the internal cursor starts one too high and overruns the end >of the array. You get a row missing at the beginning and a "undefined >offest" warning at the end of the loop. I hacked up a crude fix that makes >the problem ~apparently~ go away and I can show ya that too if anyone's >interested. > >Even more interesting, if you call fetchRow with arguments >DB_FETCHMODE_XXX and a $rownum, you go into an infinite loop. I didn't try >to fix that. > >It's hard to imagine nobody else noticing these problems, but I found >nothing either in the PEAR bug reports or by doing some Googling. (Hence >my alternative theory, that I'm missing something.) > >Does anyone know if this is still being maintained, or is it the end of >the line? > > >--- >David Mintz >http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > From dmintz at davidmintz.org Thu Feb 5 16:33:48 2004 From: dmintz at davidmintz.org (David Mintz) Date: Thu, 5 Feb 2004 16:33:48 -0500 (EST) Subject: [nycphp-talk] PEAR DB_Cache: is this a bug? In-Reply-To: <4022B267.9070800@prusak.com> References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> <007001c3ebb1$f089b040$6400a8c0@thinkpad> <4022B267.9070800@prusak.com> Message-ID: On Thu, 5 Feb 2004, Ophir Prusak wrote: > > I never used pear's cache libs before, but have been thinking of using > something like it. > I just checked your code on my machine and am getting the same results: > http://www.stationplay.com/dev/cache_test.php > > Seems like a bug to me. > > I'm curious to know what other similar solutions you've looked at. > I saw PEAR has a cache lite as well. I might have a look. Thanks. I guess I should have mentioned that I ran my code with PHP 4.3.4/Win2K and 4.3.2/Linux and Mysql 4.0.something, same results. I did this to lines 325-338 and the problem apparently goes away (not thoroughly tested): if ($rownum === null) { // $this->cursor++; } else { die ("If you pass us a \$rownum we go into an infinite loop."); // $this->cursor = $rownum; } // if ($rownum < sizeof($this->rows)) { if ($this->cursor < sizeof($this->rows)) { // $row = $this->rows[$this->cursor]; $row = $this->rows[$this->cursor++]; } else { return false; } //------------------------------ --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From lists at prusak.com Thu Feb 5 16:38:18 2004 From: lists at prusak.com (Ophir Prusak) Date: Thu, 05 Feb 2004 16:38:18 -0500 Subject: [nycphp-talk] range in switch/case In-Reply-To: References: Message-ID: <4022B7CA.1060909@prusak.com> If you really want to use switch, you can use use switch (TRUE) and in the case something like ($a < 10 && $a > 100). It's not really any better than if / elseif, but it looks cool :) Ophir Chris Bielanski wrote: >Cool, just wanted a definitive 'no' :) As it is, I don't really care if the >user manages to jam some odd value in there since it's building a SELECT >statement and nothing "dangerous". > >Hooray for 'default' case!! :P > >Thanks! >Chris Bielanski - [CBielanski at inta.org] >Web Programmer, >International Trademark Association - [www.inta.org] >1133 Ave. of the Americas - Manhattan >p - 212/642-1745 > > > > > >-----Original Message----- >From: Adam Maccabee Trachtenberg [mailto:adam at trachtenberg.com] >Sent: Thursday, February 05, 2004 1:46 PM >To: NYPHP Talk >Subject: Re: [nycphp-talk] range in switch/case > > >On Thu, 5 Feb 2004, Chris Bielanski wrote: > > > >>I'm being lazy - in Pascal/Delphi you can assign a range as a case in a >>switch statement. for example... case(0..255) or case('A'..'Z'). >> >>Does PHP have a facility to do this? I note that the above doesn't like me >>very much ;) >> >> > >No. Switch to an if()...elseif()...else() and use a regular expression >character class or something similar inside the if(). > >There was a brief talk of adding this to PHP, but it was rejected. > >-adam > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cbielanski at inta.org Thu Feb 5 16:45:49 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Thu, 5 Feb 2004 16:45:49 -0500 Subject: [nycphp-talk] range in switch/case Message-ID: Yeah, that's true, but any control structure that needs (TRUE) as a running condition is IMHO a Bad Thing(tm)... Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 -----Original Message----- From: Ophir Prusak [mailto:lists at prusak.com] Sent: Thursday, February 05, 2004 4:38 PM To: NYPHP Talk Subject: Re: [nycphp-talk] range in switch/case If you really want to use switch, you can use use switch (TRUE) and in the case something like ($a < 10 && $a > 100). It's not really any better than if / elseif, but it looks cool :) Ophir Chris Bielanski wrote: Cool, just wanted a definitive 'no' :) As it is, I don't really care if the user manages to jam some odd value in there since it's building a SELECT statement and nothing "dangerous". Hooray for 'default' case!! :P Thanks! Chris Bielanski - [ CBielanski at inta.org ] Web Programmer, International Trademark Association - [ www.inta.org ] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 -----Original Message----- From: Adam Maccabee Trachtenberg [ mailto:adam at trachtenberg.com ] Sent: Thursday, February 05, 2004 1:46 PM To: NYPHP Talk Subject: Re: [nycphp-talk] range in switch/case On Thu, 5 Feb 2004, Chris Bielanski wrote: I'm being lazy - in Pascal/Delphi you can assign a range as a case in a switch statement. for example... case(0..255) or case('A'..'Z'). Does PHP have a facility to do this? I note that the above doesn't like me very much ;) No. Switch to an if()...elseif()...else() and use a regular expression character class or something similar inside the if(). There was a brief talk of adding this to PHP, but it was rejected. -adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.net Thu Feb 5 17:18:23 2004 From: jonbaer at jonbaer.net (jon baer) Date: Thu, 5 Feb 2004 17:18:23 -0500 Subject: [nycphp-talk] range in switch/case (bug?) References: <4022B7CA.1060909@prusak.com> Message-ID: <003901c3ec35$f8413270$6400a8c0@thinkpad> hey - here is an example (but i just ran this as a test and my result for 0 was not what i expected, hmm - seems it automatically cast the 0 into a FALSE im guessing): 6): echo "x = $x: yes!\n"; continue; default: echo "x = $x: no!\n"; break; } } ?> Result: Jon Baer at thinkpad /mnt/desktop $ php test.php x = 0: no! x = 1: yes! x = 2: yes! x = 3: no! x = 4: no! x = 5: no! x = 6: no! x = 7: yes! x = 8: yes! x = 9: yes! ----- Original Message ----- From: Ophir Prusak To: NYPHP Talk Sent: Thursday, February 05, 2004 4:38 PM Subject: Re: [nycphp-talk] range in switch/case If you really want to use switch, you can use use switch (TRUE) and in the case something like ($a < 10 && $a > 100). -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Thu Feb 5 18:13:54 2004 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 05 Feb 2004 18:13:54 -0500 Subject: [nycphp-talk] range in switch/case (bug?) In-Reply-To: <003901c3ec35$f8413270$6400a8c0@thinkpad> References: <4022B7CA.1060909@prusak.com> <003901c3ec35$f8413270$6400a8c0@thinkpad> Message-ID: <4022CE32.6090401@phpwerx.net> The syntax should be: for ($x = 0; $x < 10; $x++) { switch (TRUE) { case ($x < 3 || $x > 6): echo "x = $x: yes!\n"; break; default: echo "x = $x: no!\n"; } } Dan jon baer wrote: > > hey - here is an example (but i just ran this as a test and my result > for 0 was not what i expected, hmm - seems it automatically cast the 0 > into a FALSE im guessing): > > > for ($x = 0; $x < 10; $x++) { > switch ($x) { > > case ($x < 3 || $x > 6): > echo "x = $x: yes!\n"; > continue; > default: > echo "x = $x: no!\n"; > break; > > } > > } > > ?> > > Result: > > Jon Baer at thinkpad /mnt/desktop > $ php test.php > x = 0: no! > x = 1: yes! > x = 2: yes! > x = 3: no! > x = 4: no! > x = 5: no! > x = 6: no! > x = 7: yes! > x = 8: yes! > x = 9: yes! > > ----- Original Message ----- > *From:* Ophir Prusak > *To:* NYPHP Talk > *Sent:* Thursday, February 05, 2004 4:38 PM > *Subject:* Re: [nycphp-talk] range in switch/case > > > If you really want to use switch, you can use use switch (TRUE) and > in the case something like ($a < 10 && $a > 100). > > > ------------------------------------------------------------------------ > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From nyphp at enobrev.com Fri Feb 6 00:23:22 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Fri, 6 Feb 2004 00:23:22 -0500 Subject: [nycphp-talk] Error Handling and Management Message-ID: I was wondering how you guys handle your errors from project to project. I consitently have an error handling class at the back of my mind which would handle all errors and report them correctly, whether it be to an external bug tracking app or customer support app, a log file, etc. But the bridge between ideas and writing code for such a thing is of yet unbuilt. Currently, I end up adding seperate error reporting per project and per class depending on the needs of the application. So I was wondering what methods you use. Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmintz at davidmintz.org Fri Feb 6 07:32:10 2004 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 6 Feb 2004 07:32:10 -0500 (EST) Subject: [nycphp-talk] PEAR DB_Cache: partial retraction In-Reply-To: References: <001601c3eb8e$2510d790$e98d3818@oberon1> <4021AB73.6090502@att.net> <007001c3ebb1$f089b040$6400a8c0@thinkpad> Message-ID: The bit about the infinite loop is nonsense, I now realize. The rest still stands. On Thu, 5 Feb 2004, David Mintz wrote: > Even more interesting, if you call fetchRow with arguments > DB_FETCHMODE_XXX and a $rownum, you go into an infinite loop. I didn't try > to fix that. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >From hans not junk at nyphp.com Fri Feb 6 09:20:01 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 62C0FA85FE for ; Fri, 6 Feb 2004 09:20:01 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Error Handling and Management Date: Fri, 6 Feb 2004 06:19:57 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772131 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Error Handling and Management Thread-Index: AcPscVXroiEILrAgRPm8JAnuhgW+/gASppxQ From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2004 14:20:01 -0000 > I was wondering how you guys handle your errors from project=20 > to project. I consitently have an error handling class at=20 > the back of my mind which would handle all errors and report=20 > them correctly, whether it be to an external bug tracking app=20 > or customer support app, a log file, etc. But the bridge=20 > between ideas and writing code for such a thing is of yet=20 > unbuilt. Currently, I end up adding seperate error reporting=20 > per project and per class depending on the needs of the=20 > application. So I was wondering what methods you use. In most cases I take the easy/minimal approach. That is, to show a generic page with little information about the actual error, but then use trigger_error() to log details. This could easily be extended to page/email someone, but having reports to a bug tracking app would take a little more work (ie, custom handler for whatever app you're interfacing with). At one point, I was an avid user of setting a custom function to handle errors, but I've shyed away from that lately. Generally, trigger_error() and then a redirect or include of an error page handles all that I need, without the overhead of building a function (which must always include the default php error handling) for each site. H From jsiegel1 at optonline.net Fri Feb 6 12:23:46 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Fri, 06 Feb 2004 12:23:46 -0500 Subject: [nycphp-talk] ODBC - DBF files Message-ID: <4023CDA2.2040104@optonline.net> I'm connecting to a local dbf file (ACT database, to be exact). The code below seems to work correctly. However, it some records are not getting picked up. I ran SQL Trace to see if the SQL fetch calls failed but there were no indications of failure. Just wondering if there is something else I might try. I'm using PHP 4.3.3 on Win XP and the Dbase ODBC drivers that are bundled with WinXP. $link = odbc_connect('act','jeffrey siegel','') or die(odbc_error()); $query = "SELECT UNIQUE_ID, FNAME, LNAME, COMPANY, PHONE FROM Contacts.dbf ORDER BY COMPANY"; $result = odbc_exec($link,$query); while(odbc_fetch_row($result)){ $ary[] = odbc_fetch_array($result); } print_r($ary); ======== TIA, Jeff Siegel From tgales at tgaconnect.com Fri Feb 6 13:02:46 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 6 Feb 2004 13:02:46 -0500 Subject: [nycphp-talk] ODBC - DBF files In-Reply-To: <4023CDA2.2040104@optonline.net> Message-ID: <005201c3ecdb$6d555e10$e98d3818@oberon1> Jeff Siegel writes: "I ran SQL Trace to see if the SQL fetch calls failed but there were no indications of failure. Just wondering if there is something else I might try." ODBC has a trace you can set in its configuration. You might give that a shot... T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From jsiegel1 at optonline.net Fri Feb 6 13:26:05 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Fri, 06 Feb 2004 13:26:05 -0500 Subject: [nycphp-talk] ODBC - DBF files In-Reply-To: <005201c3ecdb$6d555e10$e98d3818@oberon1> References: <005201c3ecdb$6d555e10$e98d3818@oberon1> Message-ID: <4023DC3D.9000007@optonline.net> Tried that...but the problem may lie elsewhere. Just did some more searching and found that "ACT! 6.0/5.0/2000/4.0 is not fully ODBC compliant." http://itdomino.act.com/act.nsf/docid/1998081014202501 Jeff Tim Gales wrote: > Jeff Siegel writes: > "I ran SQL Trace to see if the SQL fetch calls failed but > there were no indications of failure. Just wondering if there is > something else I might try." > > ODBC has a trace you can set in its configuration. > You might give that a shot... > > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.com > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" >From hans not junk at nyphp.com Fri Feb 6 20:13:19 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 604A4A8605 for ; Fri, 6 Feb 2004 20:13:19 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 6 Feb 2004 17:13:16 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772273 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Excel Annoyances Needed for New Book Thread-Index: AcPs+HUPj6hOWhM+SDqmBImNn+7r0gAHufjQ From: "Hans Zaunere" To: "NYPHP Talk" Subject: [nycphp-talk] FW: Excel Annoyances Needed for New Book X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2004 01:13:19 -0000 Hi folks, Please contact Marsee directly if interested. Thanks, H > O'Reilly is pulling together a new book called "Excel Annoyances" and > we'd like your help! As you might guess from the title, this book aims > to identify the problems, snarls, quirks, bugs, and just dumb things > about Excel that drive users nuts. Oh yeah--it also aims to=20 > solve these annoyances, too. >=20 > If any members of your group use Excel--be they newbies or Excel > masters--and they have annoyances they'd like to see solved, have them > email me (marsee at oreilly.com) with "Excel Annoyance" in the subject > line. Just have them note what version of Excel and Windows (or Mac > OS) they're using. >=20 > Thanks for sharing. We'll make sure to get copies of "Excel > Annoyances" sent to your group shortly after publication. >=20 >=20 > --Marsee >=20 >=20 > *** > An example: >=20 > LET ME COUNT THE DAYS >=20 > THE ANNOYANCE: I know you can do date calculations in Excel, whether = it's > to find how many days late I am on a car payment or to see how long = it's > been since my last haircut. It's pretty easy to determine the number = of > days between two dates; just subtract one from the other. But when I = do > that, the result is another date! Huh? >=20 > THE FIX: In a blank worksheet, try this little exercise, which should > show your age in days: >=20 > 1. In cell A1, enter your birth date in MM/DD/YYYY format. >=20 > 2. In cell B1, enter the formula =3Dtoday() to display the current = date. >=20 > 3. In cell C1, enter the formula =3Db1-a1. >=20 > You'll notice that the result of the formula in C1 is some other date, > which appears to have no correlation to either of the first dates. How > come? When you enter a formula, Excel matches the formatting of the > formula's inputs. This works well when you're doing calculations on > dollar amounts or percentages; the result comes out formatted just > the way you'd want. But in our example, Excel formatted the formula > result--a number of days--as a date. >=20 > *** >=20 >=20 >=20 From wiw at nyc.rr.com Fri Feb 6 23:07:45 2004 From: wiw at nyc.rr.com (Bill Wolf) Date: Fri, 6 Feb 2004 23:07:45 -0500 Subject: [nycphp-talk] Q re setting up PHP image Gallery system & NetPBM Message-ID: <200402070407.i1747kZa013736@nycsmtp3out.rdc-nyc.rr.com> As I'm learning how php works, I'm trying to set up Gallery on my host. It doesn't have some of the required binaries such as NETPBM. All I can find from the NetPBM site is either the source code or Redhat RPM's. I'm not sure how or if I can install this on my shared host. Any suggestions? Thanks -Bill From chendry at nyc.rr.com Sat Feb 7 01:09:30 2004 From: chendry at nyc.rr.com (Christopher Hendry) Date: Sat, 7 Feb 2004 01:09:30 -0500 Subject: [nycphp-talk] Q re setting up PHP image Gallery system & NetPBM In-Reply-To: <200402070407.i1747kZa013736@nycsmtp3out.rdc-nyc.rr.com> Message-ID: -> doesn't have some of the required binaries such as NETPBM. All I can find -> from the NetPBM site is either the source code or Redhat RPM's. I'm not -> sure how or if I can install this on my shared host. Any suggestions? I'd say either ask your host if they'd install it or if they have it somewhere...or get another gallery. Or, if you're feeling crazy, try to replicate their environment locally and build it from source and then try to run it locally on your host. Does NETPBM have any dependencies...dunno. Probably another gallery. :) C From nyphp at enobrev.com Sat Feb 7 01:13:59 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Sat, 7 Feb 2004 01:13:59 -0500 Subject: [nycphp-talk] Q re setting up PHP image Gallery system & NetPBM In-Reply-To: Message-ID: Most hosts I've worked with had little issue installing netpbm for me in the past, so definitely give your hosting customer service rep a shot. Matk > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Christopher Hendry > Sent: Saturday, February 07, 2004 1:10 AM > To: NYPHP Talk > Subject: RE: [nycphp-talk] Q re setting up PHP image Gallery > system & NetPBM > > > -> doesn't have some of the required binaries such as NETPBM. > All I can > find > -> from the NetPBM site is either the source code or Redhat > RPM's. I'm > -> not sure how or if I can install this on my shared host. > Any suggestions? > > I'd say either ask your host if they'd install it or if they > have it somewhere...or get another gallery. > > Or, if you're feeling crazy, try to replicate their > environment locally and > build it from source and then try to run it locally on your > host. Does > NETPBM have any dependencies...dunno. > > Probably another gallery. :) > > C > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > > From felix at students.poly.edu Sat Feb 7 01:44:35 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Sat, 7 Feb 2004 01:44:35 -0500 Subject: [nycphp-talk] Q re setting up PHP image Gallery system & NetPBM In-Reply-To: <200402070407.i1747kZa013736@nycsmtp3out.rdc-nyc.rr.com> References: <200402070407.i1747kZa013736@nycsmtp3out.rdc-nyc.rr.com> Message-ID: <20040207014435.24bb7a9f.felix@students.poly.edu> I think Gallery also works with imagemagick which is usually a more common tool and usually most hosts have it. On Fri, 6 Feb 2004 23:07:45 -0500 "Bill Wolf" wrote: > As I'm learning how php works, I'm trying to set up Gallery on my > host. It doesn't have some of the required binaries such as NETPBM. > All I can find from the NetPBM site is either the source code or > Redhat RPM's. I'm not sure how or if I can install this on my shared > host. Any suggestions? > > Thanks > -Bill > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- felix[at]bebinary.com http://www.zaslavskiy.net/ From leam at reuel.net Sat Feb 7 07:44:30 2004 From: leam at reuel.net (leam) Date: Sat, 07 Feb 2004 07:44:30 -0500 Subject: [nycphp-talk] Changing "\n" in textarea Message-ID: <4024DDAE.5070509@reuel.net> Okay, noob here. I am using a textarea for a form that will get put into a MySQL text column. The problem is that I have it write to a flat file first, lines terminated by newlines. How do I pull out newlines in the text area and make then "

" type things before it get written to the flatfile? ciao! leam From keith at keithjr.net Sat Feb 7 08:42:26 2004 From: keith at keithjr.net (keith at keithjr.net) Date: Sat, 7 Feb 2004 08:42:26 -0500 (EST) Subject: [nycphp-talk] Changing "\n" in textarea In-Reply-To: <4024DDAE.5070509@reuel.net> References: <4024DDAE.5070509@reuel.net> Message-ID: <1370.144.223.25.130.1076161346.squirrel@www.keithjr.net> $newtext = str_replace("\n","

",$oldtext); that would replace any newlines with new paragraph tags in html. You could also use
for the newline. > Okay, noob here. > > I am using a textarea for a form that will get put into a MySQL text > column. The problem is that I have it write to a flat file first, lines > terminated by newlines. > > How do I pull out newlines in the text area and make then "

" type > things before it get written to the flatfile? > > ciao! > > leam > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From keith at keithjr.net Sat Feb 7 08:44:21 2004 From: keith at keithjr.net (keith at keithjr.net) Date: Sat, 7 Feb 2004 08:44:21 -0500 (EST) Subject: [nycphp-talk] Q re setting up PHP image Gallery system & NetPBM In-Reply-To: <20040207014435.24bb7a9f.felix@students.poly.edu> References: <200402070407.i1747kZa013736@nycsmtp3out.rdc-nyc.rr.com> <20040207014435.24bb7a9f.felix@students.poly.edu> Message-ID: <1373.144.223.25.130.1076161461.squirrel@www.keithjr.net> I use coppermine photo gallery, and that uses GD, which tends to be pretty common.. > I think Gallery also works with imagemagick which is usually a more > common tool and usually most hosts have it. > > On Fri, 6 Feb 2004 23:07:45 -0500 > "Bill Wolf" wrote: > >> As I'm learning how php works, I'm trying to set up Gallery on my >> host. It doesn't have some of the required binaries such as NETPBM. >> All I can find from the NetPBM site is either the source code or >> Redhat RPM's. I'm not sure how or if I can install this on my shared >> host. Any suggestions? >> >> Thanks >> -Bill >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk >> > > > -- > felix[at]bebinary.com > http://www.zaslavskiy.net/ > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From dcech at phpwerx.net Sat Feb 7 09:01:46 2004 From: dcech at phpwerx.net (Dan Cech) Date: Sat, 07 Feb 2004 09:01:46 -0500 Subject: [nycphp-talk] Changing "\n" in textarea In-Reply-To: <1370.144.223.25.130.1076161346.squirrel@www.keithjr.net> References: <4024DDAE.5070509@reuel.net> <1370.144.223.25.130.1076161346.squirrel@www.keithjr.net> Message-ID: <4024EFCA.2010203@phpwerx.net> If you want to generate 'proper' closed tags you should use: $newtext = '

' . str_replace ("\n",'

',trim ($oldtext)) . '

'; or for '
' tags: $newtext = str_replace ("\n", '
', trim ($oldtext)); The trim is used to prevent extra tags being appended if there are any trailing or leading newlines. Dan keith at keithjr.net wrote: > $newtext = str_replace("\n","

",$oldtext); > > that would replace any newlines with new paragraph tags in html. You could > also use
for the newline. > > >>Okay, noob here. >> >>I am using a textarea for a form that will get put into a MySQL text >>column. The problem is that I have it write to a flat file first, lines >>terminated by newlines. >> >>How do I pull out newlines in the text area and make then "

" type >>things before it get written to the flatfile? >> >>ciao! >> >>leam >> >>_______________________________________________ >>talk mailing list >>talk at lists.nyphp.org >>http://lists.nyphp.org/mailman/listinfo/talk >> > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From danielc at analysisandsolutions.com Sat Feb 7 12:58:11 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 7 Feb 2004 12:58:11 -0500 Subject: [nycphp-talk] PEAR DB 1.6.0RC5 released, please test it Message-ID: <20040207175811.GB11991@panix.com> Hello Again: Another release of PEAR DB was made yesterday, 1.6.0RC5. The most important change was fixing the bug for people who use arrays for the DSN information when connecting. It also adds a new method called quoteIdentifier(), which is used for delimiting identifiers (such as field names and table names). I'm planning to issue the stable 1.6.0 release on Tuesday. So, please download the package and test it out. File bug reports if stuff doesn't work or is unclear. Download: http://pear.php.net/get/DB Manual: http://pear.php.net/manual/en/package.database.php Report Bugs: http://pear.php.net/bugs/report.php?package=DB Home Page: http://pear.php.net/package/DB Oh, and if you like the new features, the fixing of over 40 bugs, and/or the documentation improvements that have happened since 1.5.0RC2, take note of my "Wishlist" page at http://www.analysisandsolutions.com/donate/donate.htm The Financial Donations secition is now working again, too. Enjoy, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From bpang at bpang.com Sat Feb 7 16:18:53 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Sat, 7 Feb 2004 16:18:53 -0500 (EST) Subject: [nycphp-talk] knoppix as debian installer Message-ID: <.38.117.145.89.1076188733.squirrel@www.bpang.com> I wanted to report back that I tried this and it's pretty great. For starters, the idea of using the knoppix CD to boot up a system straight into linux (running off the CD) is brilliant. I was trying it on an already wiped system, so I don't know if it would mount windows volumes from the CD boot-up. The install was as easy as the article makes it out to be... although the apt-get upgrade process is taking a little longer than advertised, it's still very easy. I have it running KDE (default), tho' I have only used Gnome before. KDE seems a little more fancy-schmancy which may be desireable to some, or end up being just so much extra fluff (How do I get this mouse shadow and transparency to go away? Is such an effect really necessary or just using up precious resources?). Any opinions on which is better?? KDE or Gnome? (Who am I kidding, of course there are!) I just ran the install, and didn't research if there are arguments to control it (like, don't install certain packages, etc), but it's usually easy enough to remove stuff later. Thanks, Josh, for posting this article. On Wed, 4 Feb 2004, David Mintz wrote: > On Wed, 4 Feb 2004 joshmccormack at travelersdiary.com wrote: > > > You can use Knoppix as a Debian installer. > > How do you do that? Sounds intriguing. Here's a LinuxWorld article on it: http://www.linuxworld.com/story/32797.htm And I think there are a bunch of other write ups if you search around (Debian installer Knoppix). Josh From jonbaer at jonbaer.net Sat Feb 7 16:46:15 2004 From: jonbaer at jonbaer.net (jon baer) Date: Sat, 7 Feb 2004 16:46:15 -0500 Subject: [nycphp-talk] knoppix as debian installer References: <.38.117.145.89.1076188733.squirrel@www.bpang.com> Message-ID: <003601c3edc3$d2731970$6400a8c0@thinkpad> one thing i always thought would have been cool would be a PHP compilation demo CD which @ boot would start mysql + apache off the bat and either showcase tons of PHP apps or give a good real live source->feature examples. knoppix is top notch but i wish it was alot easier to recompile + burn. also for "security-minded" folks there is also a great version of knoppix at http://www.knoppix-std.org, it gives a good example of what i mean to have like a knoppix-php cd. - jon From Cbielanski at inta.org Mon Feb 9 10:33:18 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Mon, 9 Feb 2004 10:33:18 -0500 Subject: [nycphp-talk] Kinda OT: Open Office tied into MySQL Message-ID: I've been tasked with looking at the prospect of using OpenOffice to tie into MySQL as an Access-like application. The premise being that we could use OpenOffice to do design and data-capture on the front end, and on the back end, use it to administer and run reports. I'd like to knwo if anyone could share their experiences of doing this or something like it with OpenOffice, and I'd really appreciate if I could get any resources you people may have found useful in researching or implementing this process. Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 From stephen at musgrave.org Mon Feb 9 10:38:31 2004 From: stephen at musgrave.org (Stephen Musgrave) Date: Mon, 09 Feb 2004 10:38:31 -0500 Subject: [nycphp-talk] upload file to remote server via form Message-ID: hello LIST >> i currently have a functioning script that allows the visitor to the web site to fill out a form, select a file and upload all of the contents to the server. the text goes into a database and the file to the file system. now the script needs to have the ability to send that file to not just the local file system but remote file systems as well. it doesn't look like move_uploaded_file() can get the job done, only allowing you to move the file out of the tmp directory and to the local file system. then there's the idea of first using move_uploaded_file() and then using ftp_put() to get it over to the other server. but that doesn't seem too elegant and i'm wondering if there's a slicker way. i looked at the PEAR package page for HTTP_Upload and it doesn't seem to offer this kind of support. I did a quick search on PHP Classes as well and it doesn't seem to offer a solution either. any ideas? approaches? thanks: STEPHEN. ] http://stephen.musgrave.org/ From Cbielanski at inta.org Mon Feb 9 10:43:25 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Mon, 9 Feb 2004 10:43:25 -0500 Subject: [nycphp-talk] upload file to remote server via form Message-ID: I'm a sucker for shell scripts and RCOPY for those kinds of operations... Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 > -----Original Message----- > From: Stephen Musgrave [mailto:stephen at musgrave.org] > Sent: Monday, February 09, 2004 10:39 AM > To: nyPHP - Talk Talk > Subject: [nycphp-talk] upload file to remote server via form > > > > hello LIST >> > > i currently have a functioning script that allows the visitor > to the web > site to fill out a form, select a file and upload all of the > contents to the > server. the text goes into a database and the file to the > file system. > > now the script needs to have the ability to send that file to > not just the > local file system but remote file systems as well. > > it doesn't look like move_uploaded_file() can get the job done, only > allowing you to move the file out of the tmp directory and to > the local file > system. > > then there's the idea of first using move_uploaded_file() and > then using > ftp_put() to get it over to the other server. but that > doesn't seem too > elegant and i'm wondering if there's a slicker way. > > i looked at the PEAR package page for HTTP_Upload and it > doesn't seem to > offer this kind of support. I did a quick search on PHP > Classes as well and > it doesn't seem to offer a solution either. > > any ideas? approaches? > > thanks: STEPHEN. > > ] http://stephen.musgrave.org/ > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From jlacey at att.net Mon Feb 9 11:07:27 2004 From: jlacey at att.net (John Lacey) Date: Mon, 09 Feb 2004 09:07:27 -0700 Subject: [nycphp-talk] Kinda OT: Open Office tied into MySQL In-Reply-To: References: Message-ID: <4027B03F.1010705@att.net> Chris Bielanski wrote: > I've been tasked with looking at the prospect of using OpenOffice to tie > into MySQL as an Access-like application. The premise being that we could > use OpenOffice to do design and data-capture on the front end, and on the > back end, use it to administer and run reports. > > I'd like to knwo if anyone could share their experiences of doing this or > something like it with OpenOffice, and I'd really appreciate if I could get > any resources you people may have found useful in researching or > implementing this process. > there's a .pdf with some info at this url http://documentation.openoffice.org/thirdparty.html John >From hans not junk at nyphp.com Mon Feb 9 11:31:44 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 89927A8602 for ; Mon, 9 Feb 2004 11:31:44 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] upload file to remote server via form Date: Mon, 9 Feb 2004 08:31:36 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F877723C5 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] upload file to remote server via form Thread-Index: AcPvItO7ZzsU1qt3T7qz4vTa+9R77QABxAeA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2004 16:31:45 -0000 > i currently have a functioning script that allows the visitor to the web > site to fill out a form, select a file and upload all of the contents to the > server. the text goes into a database and the file to the=20 > file system. >=20 > now the script needs to have the ability to send that file to not just the > local file system but remote file systems as well. >=20 > it doesn't look like move_uploaded_file() can get the job done, only > allowing you to move the file out of the tmp directory and to=20 > the local file system. >=20 > then there's the idea of first using move_uploaded_file() and then using > ftp_put() to get it over to the other server. but that doesn't seem too > elegant and i'm wondering if there's a slicker way. >=20 > i looked at the PEAR package page for HTTP_Upload and it doesn't seem to > offer this kind of support. I did a quick search on PHP Classes as well and > it doesn't seem to offer a solution either. It depends... how is the remote file system accessible? If SSH is present, you could do the following in PHP: `scp /local/file username at host.com:/remote/directory`; This assumes you would have a shared key between the local server and the remote server (so you don't have to enter the password). If this is not the case, you could use popen() instead of the backs, which would allow you to write the password to scp stdin. If ssh is not available, then there's FTP of course (which isn't nearly as secure as scp, obviously). If the remote box has HTTP, you could post the file to it, with a script to handle it on the remote end. If there's NFS... rsync... cvs... all depends what services are available :) H From dmintz at davidmintz.org Mon Feb 9 12:07:00 2004 From: dmintz at davidmintz.org (David Mintz) Date: Mon, 9 Feb 2004 12:07:00 -0500 (EST) Subject: [nycphp-talk] MySQL Control Center GUI error msg In-Reply-To: <003601c3edc3$d2731970$6400a8c0@thinkpad> References: <.38.117.145.89.1076188733.squirrel@www.bpang.com> <003601c3edc3$d2731970$6400a8c0@thinkpad> Message-ID: mysqlcc likes to give me this error -- or perhaps, a mere warning -- thus: Could not load Syntax File: 'C:/Documents and Settings/mintzd.MINTZD/Desktop/syntax.txt' I've googled and browsed mysql.com/doc and come up empty. It ain't the end of the world -- the tool keeps on working -- but it would be nice to solve this. Any clues? --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From tgales at tgaconnect.com Mon Feb 9 12:15:52 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 9 Feb 2004 12:15:52 -0500 Subject: [nycphp-talk] MySQL Control Center GUI error msg In-Reply-To: Message-ID: <000101c3ef30$5f04bac0$e98d3818@oberon1> Try putting 'syntax.txt' in the directory where the executable exists -- most likely place: C:\Program Files\mysqlcc T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Mintz > Sent: Monday, February 09, 2004 12:07 PM > To: NYPHP Talk > Subject: [nycphp-talk] MySQL Control Center GUI error msg > > > > mysqlcc likes to give me this error -- or perhaps, a mere > warning -- thus: > > Could not load Syntax File: 'C:/Documents and > Settings/mintzd.MINTZD/Desktop/syntax.txt' > > I've googled and browsed mysql.com/doc and come up empty. It > ain't the end of the world -- the tool keeps on working -- > but it would be nice to solve this. > > Any clues? > > > --- > David Mintz > http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- > Sopranos 24:17 _______________________________________________ > talk mailing list > talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk > From tgales at tgaconnect.com Mon Feb 9 12:23:35 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 9 Feb 2004 12:23:35 -0500 Subject: [nycphp-talk] MySQL Control Center GUI error msg In-Reply-To: <000101c3ef30$5f04bac0$e98d3818@oberon1> Message-ID: <000201c3ef31$737b4400$e98d3818@oberon1> 'C:/Documents and Settings/mintzd.MINTZD/Desktop/syntax.txt' whoops thought your slashes went the other way... T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From csnyder at chxo.com Mon Feb 9 13:07:29 2004 From: csnyder at chxo.com (Chris Snyder) Date: Mon, 09 Feb 2004 13:07:29 -0500 Subject: [nycphp-talk] MySQL Query Cache Message-ID: <4027CC61.1070004@chxo.com> I was surprised to find out this weekend that MySQL 4.x has a built-in query cache. http://www.mysql.com/doc/en/Query_Cache_Configuration.html In order to turn it on you either need to add a command line flag to mysqld_safe when you start the server, or add it to a my.cnf configuration (under [mysqld]). The cache size is specified in bytes. The following are roughly equivalent ways to create a 20MB query cache... Command line: /usr/local/mysql/bin/mysqld_safe --user=mysql --skip-networking --query-cache-size=20971520 --or -- Using /etc/my.cnf: [mysqld] user=mysql skip-networking query-cache-size=20971520 From mitchy at spacemonkeylabs.com Mon Feb 9 13:34:30 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Mon, 09 Feb 2004 13:34:30 -0500 Subject: [nycphp-talk] MySQL Query Cache In-Reply-To: <4027CC61.1070004@chxo.com> References: <4027CC61.1070004@chxo.com> Message-ID: <4027D2B6.7020508@spacemonkeylabs.com> Chris Snyder wrote: > I was surprised to find out this weekend that MySQL 4.x has a built-in > query cache. > http://www.mysql.com/doc/en/Query_Cache_Configuration.html As a PostgreSQL bigot, I get similar functionality through the use of adodb; but the big difference with MySQL's caching is that MySQL is smart enough to know a cache has been affected by data updates, and rebuilds the cache - adodb is strictly time-based, but requires no round-trips to the db box. Out of curiosity, anyone here with strong opinions on either, and want to share? I'm strictly on the fence, as I love adodb's independence and network-friendly approach, but also love MySQL's 'refreshing' capability... -- Mitch From dmintz at davidmintz.org Mon Feb 9 13:52:38 2004 From: dmintz at davidmintz.org (David Mintz) Date: Mon, 9 Feb 2004 13:52:38 -0500 (EST) Subject: [nycphp-talk] MySQL Control Center GUI error msg In-Reply-To: <000101c3ef30$5f04bac0$e98d3818@oberon1> References: <000101c3ef30$5f04bac0$e98d3818@oberon1> Message-ID: You nailed it bro. Turns out that when I was launching MysqlCC from a shortcut on the windoze desktop, the working directory was the desktop so it was bitching about no syntax file. I adjusted the shortcut's "Start in" property and now mysqlcc is happy. Thanks. On Mon, 9 Feb 2004, Tim Gales wrote: > Try putting 'syntax.txt' > in the directory where the > executable exists -- > most likely place: > C:\Program Files\mysqlcc > > Subject: [nycphp-talk] MySQL Control Center GUI error msg > > > > > > > > mysqlcc likes to give me this error -- or perhaps, a mere > > warning -- thus: > > > > Could not load Syntax File: 'C:/Documents and > > Settings/mintzd.MINTZD/Desktop/syntax.txt' > > > > I've googled and browsed mysql.com/doc and come up empty. It > > ain't the end of the world -- the tool keeps on working -- > > but it would be nice to solve this. > > > > Any clues? > > > > > > --- > > David Mintz > > http://davidmintz.org/ > > > > "Anybody else got a problem with Webistics?" -- > > Sopranos 24:17 _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >From hans not junk at nyphp.com Mon Feb 9 16:27:10 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 98E5CA8602 for ; Mon, 9 Feb 2004 16:27:10 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] MySQL Query Cache Date: Mon, 9 Feb 2004 13:27:09 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F8777249D at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] MySQL Query Cache Thread-Index: AcPvO2BpW0UlR1SyRLSQfYosdYTFVAAF5sCA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2004 21:27:11 -0000 > > I was surprised to find out this weekend that MySQL 4.x has a built-in=20 > > query cache. > > http://www.mysql.com/doc/en/Query_Cache_Configuration.html >=20 > As a PostgreSQL bigot, I get similar functionality through the use of=20 > adodb; but the big difference with MySQL's caching is that MySQL is=20 > smart enough to know a cache has been affected by data updates, and=20 > rebuilds the cache - adodb is strictly time-based, but requires no=20 > round-trips to the db box. >=20 > Out of curiosity, anyone here with strong opinions on either, and want > to share? I'm strictly on the fence, as I love adodb's independence and=20 > network-friendly approach, but also love MySQL's 'refreshing'=20 > capability... I've used MySQL query cache and it's great. I generally have it off by default, but then specify SQL_CACHE in SELECT statements that are intensive. This has given me the best of both worlds. Lastly, I'm anti /database abstraction/client side query cache (which is an oxymoron)/ so I won't touch on that much more :) H From cmerlo at ncc.edu Mon Feb 9 18:37:10 2004 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 9 Feb 2004 18:37:10 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question Message-ID: <20040209233710.GA558@ncc.edu> Folks: I'm running a query that has a count( column_name ) statement in it. The query only returns a row if the count is positive. Is there any way to force MySQL to also generate a row if the count is zero? MySQL's docs on the subject don't seem to say anything (probably because this is a weird request, and I need to rethink my query). TIA. -c -- cmerlo at ncc.edu http://turing.matcmp.ncc.edu/~cmerlo In theory, there is no difference between theory and practice. In practice, there is. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: From tgales at tgaconnect.com Mon Feb 9 18:48:34 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 9 Feb 2004 18:48:34 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: <20040209233710.GA558@ncc.edu> Message-ID: <002701c3ef67$3b476330$e98d3818@oberon1> Christopher R. Merlo writes: "Is there any way to force MySQL to also generate a row if the count is zero?" You might try adding a 'sentinel' record. e.g. if you have a table of phone numbers with area_code , exchange, and number you can have a 'sentinel' record at the end with an area code of '999' (that way if you get a count of 1 it means there aren't any valid records) Your processing then has to specifically skip the special area code of 999 (not too clean) you were probably on the right track when you said it might be time to think things over again. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From jonbaer at jonbaer.net Mon Feb 9 18:51:45 2004 From: jonbaer at jonbaer.net (jon baer) Date: Mon, 9 Feb 2004 18:51:45 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question References: <20040209233710.GA558@ncc.edu> Message-ID: <00bb01c3ef67$ad375360$6400a8c0@thinkpad> whats the full query? sounds like u need a WHERE statement in there, either WHERE column NOT NULL or something else ... - jon ----- Original Message ----- From: "Christopher R. Merlo" To: "NYPHP Talk" Sent: Monday, February 09, 2004 6:37 PM Subject: [nycphp-talk] MySQL count( * ) syntax question > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From cmerlo at ncc.edu Mon Feb 9 18:54:53 2004 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 9 Feb 2004 18:54:53 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: <002701c3ef67$3b476330$e98d3818@oberon1> References: <20040209233710.GA558@ncc.edu> <002701c3ef67$3b476330$e98d3818@oberon1> Message-ID: <20040209235453.GB558@ncc.edu> On 2004-02-09 18:48 -0500, Tim Gales wrote: > You might try adding a 'sentinel' record. Well, the table where the zero counts should occur is a table of students' attendance records. Each row has a date, student ID, and in column "attended", a value of 1, 2, or 3. 1 = present, 2 = absent, 3 = excused. The query basically looks like this: select id, first, last, etc., count( attended ) from login, attendance where id = student /* where login.id = attendance.student */ and attended = 2 group by... Basically, I want to select every student, and the amount of times he/she was absent (including never). But I only get the students who were absent at least once. I can't think of another way to get that, other than what feels like it would be a severe kludge. -- cmerlo at ncc.edu http://turing.matcmp.ncc.edu/~cmerlo In theory, there is no difference between theory and practice. In practice, there is. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: From mitchy at spacemonkeylabs.com Mon Feb 9 19:09:11 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Mon, 09 Feb 2004 19:09:11 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: <20040209235453.GB558@ncc.edu> References: <20040209233710.GA558@ncc.edu> <002701c3ef67$3b476330$e98d3818@oberon1> <20040209235453.GB558@ncc.edu> Message-ID: <40282127.50601@spacemonkeylabs.com> Christopher R. Merlo wrote: > On 2004-02-09 18:48 -0500, Tim Gales wrote: > > >>You might try adding a 'sentinel' record. > > > Well, the table where the zero counts should occur is a table of > students' attendance records. Each row has a date, student ID, and in > column "attended", a value of 1, 2, or 3. 1 = present, 2 = absent, 3 > = excused. > > The query basically looks like this: > select id, first, last, etc., count( attended ) > from login, attendance > where id = student /* where login.id = attendance.student */ > and attended = 2 > group by... > > Basically, I want to select every student, and the amount of times > he/she was absent (including never). But I only get the students who > were absent at least once. I can't think of another way to get that, > other than what feels like it would be a severe kludge. Would that kludge include the use of mysql_num_rows? You could just add that to your processing, or perhaps play about with SUM() and GROUP BY... From cmerlo at ncc.edu Mon Feb 9 19:17:16 2004 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 9 Feb 2004 19:17:16 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: <40282127.50601@spacemonkeylabs.com> References: <20040209233710.GA558@ncc.edu> <002701c3ef67$3b476330$e98d3818@oberon1> <20040209235453.GB558@ncc.edu> <40282127.50601@spacemonkeylabs.com> Message-ID: <20040210001716.GA1594@ncc.edu> On 2004-02-09 19:09 -0500, Mitch Pirtle wrote: > >Basically, I want to select every student, and the amount of times > >he/she was absent (including never). But I only get the students who > >were absent at least once. I can't think of another way to get that, > >other than what feels like it would be a severe kludge. > > Would that kludge include the use of mysql_num_rows? You could just add > that to your processing, or perhaps play about with SUM() and GROUP BY... Yeah, essentially a second query within the foreach of the first query. I suppose it'll work, but then I won't be able to sort the first query by amount of absences. If that's the best solution, then so be it. I've been reading ppl's advice on devshed and dbforums about using a left join instead of just "from login, attendace". I think I'm following their advice, and it's not working. This query: mysql> select l.first, l.last, count( a.attended ) -> from attendance as a left join login as l -> on ( l.id = a.student ) -> where a.attended = 2 and l.section = 1 -> group by l.id -> ; still only gives me the rows where the count > 0. I've also switched the order of the tables in the from line without success. -- cmerlo at ncc.edu http://turing.matcmp.ncc.edu/~cmerlo In theory, there is no difference between theory and practice. In practice, there is. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: From mjdewitt at alexcommgrp.com Mon Feb 9 19:22:15 2004 From: mjdewitt at alexcommgrp.com (DeWitt, Michael) Date: Mon, 9 Feb 2004 19:22:15 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question Message-ID: Chris, Since sub-selects I think are not really available, perhaps you could do this in two steps? select your records into a temp table and then report from there. Inner joins will definitely drop rows when one of the tables returns no rows. get everyone who has been absent more than one time select id, first, last,count(*) absences into temp from login inner join attendance on login.id = attendance.student and attendance=2 group by id, first, last,attended get everyone who has never been absent select id, first, last, 0 absences into temp from login left outer join attendance on login.id = attendance.student and attendance not in (1,2,3) select id, first, last, absences from temp order by absences drop table temp Hope this helps Mike > -----Original Message----- > From: Christopher R. Merlo [SMTP:cmerlo at ncc.edu] > Sent: Monday, February 09, 2004 6:55 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] MySQL count( * ) syntax question > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk << Message: Untitled > Attachment >> From mjdewitt at alexcommgrp.com Mon Feb 9 19:24:56 2004 From: mjdewitt at alexcommgrp.com (DeWitt, Michael) Date: Mon, 9 Feb 2004 19:24:56 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question Message-ID: Oops I needed to correct my language about the first select: > Chris, > > Since sub-selects I think are not really available, perhaps you could do > this in two steps? select your records into a temp table and then report > from there. Inner joins will definitely drop rows when one of the tables > returns no rows. > > get everyone who has been absent one or more times > > select id, first, last,count(*) absences > into temp from login > inner join attendance on login.id = attendance.student and attendance=2 > group by id, first, last,attended > > > get everyone who has never been absent > > select id, first, last, 0 absences > into temp from login > left outer join attendance on login.id = attendance.student and attendance > not in (1,2,3) > > > select id, first, last, absences from temp order by absences > > drop table temp > > Hope this helps > > Mike > > > > > > > > -----Original Message----- > > From: Christopher R. Merlo [SMTP:cmerlo at ncc.edu] > > Sent: Monday, February 09, 2004 6:55 PM > > To: NYPHP Talk > > Subject: Re: [nycphp-talk] MySQL count( * ) syntax question > > > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk << Message: Untitled > > Attachment >> > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From danielc at analysisandsolutions.com Mon Feb 9 19:27:53 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 9 Feb 2004 19:27:53 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: References: Message-ID: <20040210002753.GA28001@panix.com> Hey Folks: I haven't been following the thread closely, so forgive me if this was mentioned. Two options: 1) Run the query then check the row count via mysql_num_rows(). No rows means no records. 2) Add a bogus column to the query: select count(*), '' as x from user where user='y'; --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From tgales at tgaconnect.com Mon Feb 9 19:42:46 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 9 Feb 2004 19:42:46 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: <20040209235453.GB558@ncc.edu> Message-ID: <004401c3ef6e$cd876770$e98d3818@oberon1> Christopher R. Merlo writes: "Each row has a date, student ID, and in column "attended", a value of 1, 2, or 3" The name of the column attended suggest it should have only two values. If you only had two possible values, you would technically be doing 'two valued first order predicate calculus' -- the fancy name for Boolean algebra -- something that data- bases are well geared for (well they can handle anyway) (since there is a difference between theory and practice I 'll skip the math and give you a suggestion) alter the table and add a column absent (which could be excused or unexcused). you can see that there is a parallel between two columns which could have a 0 or 1 and the binary representation of three values with 01 10 and 11. (you're sort of synthesizing four-valued first order predicate algebra -- yes four -- '00' represents that pesky null) Let me know if you can make heads or tails of this post. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com >From hans not junk at nyphp.com Mon Feb 9 20:08:48 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 308DFA8602 for ; Mon, 9 Feb 2004 20:08:48 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] MySQL count( * ) syntax question Date: Mon, 9 Feb 2004 17:08:47 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772520 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] MySQL count( * ) syntax question Thread-Index: AcPvZamqh6Tj50zpTaGODs7NQC0SeQAB/P8Q From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 01:08:48 -0000 > I'm running a query that has a count( column_name ) statement in it. > The query only returns a row if the count is positive. Is there any > way to force MySQL to also generate a row if the count is zero? > MySQL's docs on the subject don't seem to say anything (probably > because this is a weird request, and I need to rethink my query). I think there are two issues here. For one, using COUNT() will return a row, containing a count of zero. select count(user) from user where user='not.a.user' +-------------+ | count(user) | +-------------+ | 0 | +-------------+ But from seeing your query in followup posts, I think you might want something like: SELECT id,first,last,COUNT(attended) FROM login LEFT JOIN attendance ON attendance.student=login.id AND attendance.attended=2 GROUP BY id This is one of the finer, and more annoying "features" of mysql (and I'm still not sure that'll work). H From danielc at analysisandsolutions.com Mon Feb 9 20:17:08 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 9 Feb 2004 20:17:08 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87772520@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F87772520@ehost011-1.exch011.intermedia.net> Message-ID: <20040210011708.GA7021@panix.com> On Mon, Feb 09, 2004 at 05:08:47PM -0800, Hans Zaunere wrote: > I think there are two issues here. For one, using COUNT() will return a > row, containing a count of zero. But, if my memory serves me correclty, in PHP, that "row" doesn't show up if the count is 0. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 >From hans not junk at nyphp.com Mon Feb 9 20:22:54 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 231BCA8602 for ; Mon, 9 Feb 2004 20:22:54 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] MySQL count( * ) syntax question Date: Mon, 9 Feb 2004 17:22:54 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772522 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] MySQL count( * ) syntax question Thread-Index: AcPvc6BIFiLBcbBlSd6C9RFnbXxuoAAAH1Tg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 01:22:54 -0000 > > I think there are two issues here. For one, using COUNT() will = return a > > row, containing a count of zero. >=20 > But, if my memory serves me correclty, in PHP, that "row"=20 > doesn't show up if the count is 0. Hmm... array(1) { [0]=3D> string(1) "0" } H From danielc at analysisandsolutions.com Mon Feb 9 20:26:56 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 9 Feb 2004 20:26:56 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87772522@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F87772522@ehost011-1.exch011.intermedia.net> Message-ID: <20040210012656.GA8268@panix.com> On Mon, Feb 09, 2004 at 05:22:54PM -0800, Hans Zaunere wrote: > > array(1) { > [0]=> > string(1) "0" > } Thanks. Serves me right for shooting off my fingers before testing... Wondering what along these lines I AM remembering. :) --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jsiegel1 at optonline.net Mon Feb 9 21:19:23 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Mon, 09 Feb 2004 21:19:23 -0500 Subject: [nycphp-talk] NEW PHundamentals Question Message-ID: <40283FAB.6080106@optonline.net> Almost every website has an HTML form for visitors to complete. But how do you know that the person who completed the form did so through your website? The question for this month's PHundamentals article is: What method(s) do you use to assure that no one has 'spoofed', i.e., 'forged', a form submission?" -- Jeff Siegel / Michael Southwell The PHundamentals Team From jonbaer at jonbaer.net Mon Feb 9 21:47:01 2004 From: jonbaer at jonbaer.net (jon baer) Date: Mon, 9 Feb 2004 21:47:01 -0500 Subject: [nycphp-talk] NEW PHundamentals Question References: <40283FAB.6080106@optonline.net> Message-ID: <000f01c3ef80$28e8bea0$6400a8c0@thinkpad> it can be found on your own forum ... i have used it also in the past: http://forums.nyphp.org/index.php?act=Reg&CODE=00 the security code confirmation / dynamic image input is pretty much like visually signing a form + preventing 3rd party dumping. as per for accounting to the real valid information that was sent in, id like to see that code :-) - jon ----- Original Message ----- From: "Jeff Siegel" To: "NYPHP Talk" Sent: Monday, February 09, 2004 9:19 PM Subject: [nycphp-talk] NEW PHundamentals Question > Almost every website has an HTML form for visitors to complete. But how > do you know that the person who completed the form did so through your > website? The question for this month's PHundamentals article is: What > method(s) do you use to assure that no one has 'spoofed', i.e., > 'forged', a form submission?" > > -- > Jeff Siegel / Michael Southwell > The PHundamentals Team > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From jsiegel1 at optonline.net Mon Feb 9 21:58:18 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Mon, 09 Feb 2004 21:58:18 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <000f01c3ef80$28e8bea0$6400a8c0@thinkpad> References: <40283FAB.6080106@optonline.net> <000f01c3ef80$28e8bea0$6400a8c0@thinkpad> Message-ID: <402848CA.9020806@optonline.net> That's one method that's growing in popularity. Prior to using this method, was there another method that you've used? Jeff jon baer wrote: > it can be found on your own forum ... i have used it also in the past: > > http://forums.nyphp.org/index.php?act=Reg&CODE=00 > > the security code confirmation / dynamic image input is pretty much like > visually signing a form + preventing 3rd party dumping. as per for > accounting to the real valid information that was sent in, id like to see > that code :-) > > - jon > > ----- Original Message ----- > From: "Jeff Siegel" > To: "NYPHP Talk" > Sent: Monday, February 09, 2004 9:19 PM > Subject: [nycphp-talk] NEW PHundamentals Question > > > >>Almost every website has an HTML form for visitors to complete. But how >>do you know that the person who completed the form did so through your >>website? The question for this month's PHundamentals article is: What >>method(s) do you use to assure that no one has 'spoofed', i.e., >>'forged', a form submission?" >> >>-- >>Jeff Siegel / Michael Southwell >>The PHundamentals Team >> >> >> >> >>_______________________________________________ >>talk mailing list >>talk at lists.nyphp.org >>http://lists.nyphp.org/mailman/listinfo/talk >> > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" From jonbaer at jonbaer.net Mon Feb 9 22:05:47 2004 From: jonbaer at jonbaer.net (jon baer) Date: Mon, 9 Feb 2004 22:05:47 -0500 Subject: [nycphp-talk] NEW PHundamentals Question References: <40283FAB.6080106@optonline.net><000f01c3ef80$28e8bea0$6400a8c0@thinkpad> <402848CA.9020806@optonline.net> Message-ID: <002001c3ef82$c851b210$6400a8c0@thinkpad> the last method was session hashing for the page to create a unique entry token and then hiding it ... if the sessions + keys didnt match you would know they came from somewhere else. i think the real key is just to have something unique in your POST as to distinguish it from something else. this method is actually pretty similar to using the graphic except the server does the work. one time keys work for pretty much anything. im guessing cookie dropping can work as well since the would have to come from @ least one entry page on your website before spotting the registration. would be interested in what the php security cookbook has to say about this :-) - jon ----- Original Message ----- From: "Jeff Siegel" To: "NYPHP Talk" Sent: Monday, February 09, 2004 9:58 PM Subject: Re: [nycphp-talk] NEW PHundamentals Question > That's one method that's growing in popularity. > Prior to using this method, was there another method that you've used? > > Jeff From bpang at bpang.com Mon Feb 9 22:12:38 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Mon, 9 Feb 2004 22:12:38 -0500 (EST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <402848CA.9020806@optonline.net> References: <40283FAB.6080106@optonline.net><000f01c3ef80$28e8bea0$6400a8c0@thinkp ad> <402848CA.9020806@optonline.net> Message-ID: <.38.117.145.89.1076382758.squirrel@www.bpang.com> check the http referer? or is that so obvious that there's an easy way around it? > That's one method that's growing in popularity. > Prior to using this method, was there another method that you've used? > > Jeff > > jon baer wrote: >> it can be found on your own forum ... i have used it also in the past: >> >> http://forums.nyphp.org/index.php?act=Reg&CODE=00 >> >> the security code confirmation / dynamic image input is pretty much like >> visually signing a form + preventing 3rd party dumping. as per for >> accounting to the real valid information that was sent in, id like to >> see >> that code :-) >> >> - jon >> >> ----- Original Message ----- >> From: "Jeff Siegel" >> To: "NYPHP Talk" >> Sent: Monday, February 09, 2004 9:19 PM >> Subject: [nycphp-talk] NEW PHundamentals Question >> >> >> >>>Almost every website has an HTML form for visitors to complete. But how >>>do you know that the person who completed the form did so through your >>>website? The question for this month's PHundamentals article is: What >>>method(s) do you use to assure that no one has 'spoofed', i.e., >>>'forged', a form submission?" >>> >>>-- >>>Jeff Siegel / Michael Southwell >>>The PHundamentals Team >>> >>> >>> >>> >>>_______________________________________________ >>>talk mailing list >>>talk at lists.nyphp.org >>>http://lists.nyphp.org/mailman/listinfo/talk >>> >> >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk >> > > -- > Found on the Simpson's Website: > "Ooooooh, they have the internet on computers now!" > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From dcech at phpwerx.net Mon Feb 9 22:17:32 2004 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 09 Feb 2004 22:17:32 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: <20040210001716.GA1594@ncc.edu> References: <20040209233710.GA558@ncc.edu> <002701c3ef67$3b476330$e98d3818@oberon1> <20040209235453.GB558@ncc.edu> <40282127.50601@spacemonkeylabs.com> <20040210001716.GA1594@ncc.edu> Message-ID: <40284D4C.2080401@phpwerx.net> The reason you are only getting results for students who were absent at least once is that your WHERE a.attended = 2 is cutting the result set down to only those students who missed at least one class. To retrieve a list of students and the number of classes attended, missed and excused you should use: SELECT l.first, l.last, count(a.attended) AS attended, count(b.attended) AS missed, count(c.attended) AS excused FROM login l LEFT JOIN attendance a ON a.student=l.id AND a.attended=1 LEFT JOIN attendance b ON b.student=l.id AND b.attended=2 LEFT JOIN attendance c ON c.student=l.id AND c.attended=3 WHERE l.section=1 GROUP BY l.id That will give you a result showing the number of classes attended, missed and excused for each student in section 1. Dan Christopher R. Merlo wrote: > On 2004-02-09 19:09 -0500, Mitch Pirtle wrote: > > >>>Basically, I want to select every student, and the amount of times >>>he/she was absent (including never). But I only get the students who >>>were absent at least once. I can't think of another way to get that, >>>other than what feels like it would be a severe kludge. >> >>Would that kludge include the use of mysql_num_rows? You could just add >>that to your processing, or perhaps play about with SUM() and GROUP BY... > > > Yeah, essentially a second query within the foreach of the first > query. I suppose it'll work, but then I won't be able to sort the > first query by amount of absences. If that's the best solution, then > so be it. > > I've been reading ppl's advice on devshed and dbforums about using a > left join instead of just "from login, attendace". I think I'm > following their advice, and it's not working. This query: > > mysql> select l.first, l.last, count( a.attended ) > -> from attendance as a left join login as l > -> on ( l.id = a.student ) > -> where a.attended = 2 and l.section = 1 > -> group by l.id > -> ; > > still only gives me the rows where the count > 0. I've also switched > the order of the tables in the from line without success. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk >From hans not junk at nyphp.com Mon Feb 9 22:19:11 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 04C15A87E1 for ; Mon, 9 Feb 2004 22:19:11 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] NEW PHundamentals Question Date: Mon, 9 Feb 2004 19:19:07 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772542 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] NEW PHundamentals Question Thread-Index: AcPvg8JBGoc/vU9hS8WtT34v86yNOQAAIUjg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 03:19:11 -0000 > check the http referer? > or is that so obvious that there's an easy way around it? That's very easy to forge. > > That's one method that's growing in popularity. > > Prior to using this method, was there another method that you've = used? > > > > Jeff > > > > jon baer wrote: > >> it can be found on your own forum ... i have used it also in the = past: > >> > >> http://forums.nyphp.org/index.php?act=3DReg&CODE=3D00 > >> > >> the security code confirmation / dynamic image input is pretty much = like > >> visually signing a form + preventing 3rd party dumping. as per for > >> accounting to the real valid information that was sent in, id like = to > >> see that code :-) I think it's key to remember that a browser is only skin deep... so to = speak. For instance, consider someone telnets to port 80 and issues raw = HTTP requests. How can this be handled? Or even easier, suppose = someone is using LiveHTTPHeaders (the Mozilla plugin). It makes forging = HTTP requests and replay attacks trivial. I'm not ready to make any recommendations yet... just wanted to throw = some things on the table :) H From jonbaer at jonbaer.net Mon Feb 9 22:19:06 2004 From: jonbaer at jonbaer.net (jon baer) Date: Mon, 9 Feb 2004 22:19:06 -0500 Subject: [nycphp-talk] NEW PHundamentals Question References: <40283FAB.6080106@optonline.net><000f01c3ef80$28e8bea0$6400a8c0@thinkpad> <402848CA.9020806@optonline.net> <.38.117.145.89.1076382758.squirrel@www.bpang.com> Message-ID: <004c01c3ef84$a442d230$6400a8c0@thinkpad> well there's curl which allows a plethora of options for passing the right context of info along ... curl -e www.mysite.com http://www.yoursite.com/ [args] - jon ----- Original Message ----- From: To: "NYPHP Talk" Sent: Monday, February 09, 2004 10:12 PM Subject: Re: [nycphp-talk] NEW PHundamentals Question > check the http referer? > or is that so obvious that there's an easy way around it? > > From dcech at phpwerx.net Mon Feb 9 22:26:55 2004 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 09 Feb 2004 22:26:55 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <002001c3ef82$c851b210$6400a8c0@thinkpad> References: <40283FAB.6080106@optonline.net><000f01c3ef80$28e8bea0$6400a8c0@thinkpad> <402848CA.9020806@optonline.net> <002001c3ef82$c851b210$6400a8c0@thinkpad> Message-ID: <40284F7F.9060201@phpwerx.net> I'm with Jon on this one. One-time only tokens tied to the session and with an expiry date are wonderful pieces of gear. I leave securing the session as an exercise for the user, at present I use a system which links each session to a single IP, making it somewhat more difficult to implement CSRF type attacks...though as with any system a determined attacker could manage to get around it. Dan jon baer wrote: > the last method was session hashing for the page to create a unique entry > token and then hiding it ... > > > > if the sessions + keys didnt match you would know they came from somewhere > else. i think the real key is just to have something unique in your POST as > to distinguish it from something else. this method is actually pretty > similar to using the graphic except the server does the work. one time keys > work for pretty much anything. > > im guessing cookie dropping can work as well since the would have to come > from @ least one entry page on your website before spotting the > registration. would be interested in what the php security cookbook has to > say about this :-) > > - jon > > ----- Original Message ----- > From: "Jeff Siegel" > To: "NYPHP Talk" > Sent: Monday, February 09, 2004 9:58 PM > Subject: Re: [nycphp-talk] NEW PHundamentals Question > > > >>That's one method that's growing in popularity. >>Prior to using this method, was there another method that you've used? >> >>Jeff > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From jsiegel1 at optonline.net Mon Feb 9 22:29:11 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Mon, 09 Feb 2004 22:29:11 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <002001c3ef82$c851b210$6400a8c0@thinkpad> References: <40283FAB.6080106@optonline.net> <000f01c3ef80$28e8bea0$6400a8c0@thinkpad> <402848CA.9020806@optonline.net> <002001c3ef82$c851b210$6400a8c0@thinkpad> Message-ID: <40285007.3000402@optonline.net> Any reason to choose one over the other? Jeff jon baer wrote: > the last method was session hashing for the page to create a unique entry > token and then hiding it ... > > > > if the sessions + keys didnt match you would know they came from somewhere > else. i think the real key is just to have something unique in your POST as > to distinguish it from something else. this method is actually pretty > similar to using the graphic except the server does the work. one time keys > work for pretty much anything. > > im guessing cookie dropping can work as well since the would have to come > from @ least one entry page on your website before spotting the > registration. would be interested in what the php security cookbook has to > say about this :-) > > - jon > > ----- Original Message ----- > From: "Jeff Siegel" > To: "NYPHP Talk" > Sent: Monday, February 09, 2004 9:58 PM > Subject: Re: [nycphp-talk] NEW PHundamentals Question > > > >>That's one method that's growing in popularity. >>Prior to using this method, was there another method that you've used? >> >>Jeff > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Found on the Simpson's Website: "Ooooooh, they have the internet on computers now!" From dcech at phpwerx.net Mon Feb 9 22:39:57 2004 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 09 Feb 2004 22:39:57 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <40283FAB.6080106@optonline.net> References: <40283FAB.6080106@optonline.net> Message-ID: <4028528D.1010601@phpwerx.net> Jeff Siegel wrote: > Almost every website has an HTML form for visitors to complete. But how > do you know that the person who completed the form did so through your > website? The question for this month's PHundamentals article is: What > method(s) do you use to assure that no one has 'spoofed', i.e., > 'forged', a form submission?" I guess the real question here is what you are trying to guard against. One attack against forms is for a script to simulate multiple users, causing the system to potentially crash under the load. The only defense I know of against this is the dynamic image, which essentially requires a human operator to be able to decipher the image. The second attack you are trying to protect against is that a user may maliciously submit a form in an attempt to 'spoof' or 'forge' a submission by another user. For this type of attack I would recommend a one time token system backed up by a fairly secure session management system to tie each form to a session (and time) and then protect that session. Dan From jonbaer at jonbaer.net Mon Feb 9 22:53:18 2004 From: jonbaer at jonbaer.net (jon baer) Date: Mon, 9 Feb 2004 22:53:18 -0500 Subject: [nycphp-talk] NEW PHundamentals Question References: <40283FAB.6080106@optonline.net><000f01c3ef80$28e8bea0$6400a8c0@thinkpad><402848CA.9020806@optonline.net><002001c3ef82$c851b210$6400a8c0@thinkpad> <40285007.3000402@optonline.net> Message-ID: <007401c3ef89$6ba131b0$6400a8c0@thinkpad> i guess it really depends on how secure you want to be + what u r protecting, providing we are talking about the fact that you might not be ssl/tls/ssht your stuff to begin with, if you are id say no, not really anything to worry, if you are say sitting @ a cafe - browsing in the wide open and going to access/submit this page you are most likely giving the hacker a harder challenge to pickoff the raw image data vs. the key string itself. in which constructing a string back is easier (although tools do exist for picking off images, etherape i think can) ... i dunno, i think if ur super paranoid about who is going to register/enter/submit for something you probably shouldnt have a public form in the first place :-) i dont see many tools besides the searchengine submit ones that pose a threat to automating entries, oh and maybe the sql injection test toolkits which seem to be popping up. - jon ----- Original Message ----- From: "Jeff Siegel" To: "NYPHP Talk" Sent: Monday, February 09, 2004 10:29 PM Subject: Re: [nycphp-talk] NEW PHundamentals Question > Any reason to choose one over the other? > > Jeff From adam at trachtenberg.com Tue Feb 10 00:23:40 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 10 Feb 2004 00:23:40 -0500 (EST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <4028528D.1010601@phpwerx.net> References: <40283FAB.6080106@optonline.net> <4028528D.1010601@phpwerx.net> Message-ID: On Mon, 9 Feb 2004, Dan Cech wrote: > The only defense I know of against this is the dynamic image, which > essentially requires a human operator to be able to decipher the image. Even that's not foolproof. http://boingboing.net/2004_01_01_archive.html#107525288693964966 -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From cmerlo at ncc.edu Tue Feb 10 00:26:43 2004 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Tue, 10 Feb 2004 00:26:43 -0500 Subject: [nycphp-talk] MySQL count( * ) syntax question In-Reply-To: <40284D4C.2080401@phpwerx.net> References: <20040209233710.GA558@ncc.edu> <002701c3ef67$3b476330$e98d3818@oberon1> <20040209235453.GB558@ncc.edu> <40282127.50601@spacemonkeylabs.com> <20040210001716.GA1594@ncc.edu> <40284D4C.2080401@phpwerx.net> Message-ID: <20040210052643.GB6027@ncc.edu> Dan: That's it. Simple, elegant, and correct. Thanks a bunch. -c -- cmerlo at ncc.edu http://turing.matcmp.ncc.edu/~cmerlo Oh! They have the Internet on computers now! - Homer Simpson -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: From cmerlo at ncc.edu Tue Feb 10 00:37:50 2004 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Tue, 10 Feb 2004 00:37:50 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <40283FAB.6080106@optonline.net> References: <40283FAB.6080106@optonline.net> Message-ID: <20040210053750.GC6027@ncc.edu> On 2004-02-09 21:19 -0500, Jeff Siegel wrote: > The question for this month's PHundamentals article is: What > method(s) do you use to assure that no one has 'spoofed', i.e., > 'forged', a form submission?" I should probably preface this by mentioning that my site isn't exactly at the top of anyone's bookmark list. Also, my primary concern is that a student types his/her e-mail address correctly, because I use e-mail as the primary method of communication outside of the classroom and office hours. What I do is ask the student to enter first and last names and an e-mail address, and choose his/her course from a drop-down. I then generate a random string of 16 letters and digits, and throw it into a table with the student's name and address. I send this 16-byte code in an e-mail, attached to the end of a URL, as so: "Please click here: http://turing.../new.php?random-string-here" new.php then looks up that $_GET string in the DB. If it's there, the e-mail address is obviously valid, and the student can continue creating an account. This record is deleted from the table when account creation is done. If the address wasn't valid, for whatever reason (lots of AOL users forget the '@aol.com'), the mail never gets there, and I delete that record at the end of the semester. Maybe not the most secure thing in the world, but it ain't britneyspears.com, either. -- cmerlo at ncc.edu http://turing.matcmp.ncc.edu/~cmerlo Oh! They have the Internet on computers now! - Homer Simpson -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: From jonbaer at jonbaer.net Tue Feb 10 01:33:05 2004 From: jonbaer at jonbaer.net (jon baer) Date: Tue, 10 Feb 2004 01:33:05 -0500 Subject: [nycphp-talk] NEW PHundamentals Question References: <40283FAB.6080106@optonline.net> <4028528D.1010601@phpwerx.net> Message-ID: <00fd01c3ef9f$bddd47a0$6400a8c0@thinkpad> i knew SOMEONE would bring up OCR lol ... face it PHP needs a biometrics module with DNA testing, we know ... {place saliva here to continue} ----- Original Message ----- From: "Adam Maccabee Trachtenberg" To: "NYPHP Talk" Sent: Tuesday, February 10, 2004 12:23 AM Subject: Re: [nycphp-talk] NEW PHundamentals Question > On Mon, 9 Feb 2004, Dan Cech wrote: > > > The only defense I know of against this is the dynamic image, which > > essentially requires a human operator to be able to decipher the image. > > Even that's not foolproof. From shiflett at php.net Tue Feb 10 02:19:32 2004 From: shiflett at php.net (Chris Shiflett) Date: Mon, 9 Feb 2004 23:19:32 -0800 (PST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <40283FAB.6080106@optonline.net> Message-ID: <20040210071932.40602.qmail@web14308.mail.yahoo.com> --- Jeff Siegel wrote: > Almost every website has an HTML form for visitors to complete. But > how do you know that the person who completed the form did so through > your website? The question for this month's PHundamentals article is: > What method(s) do you use to assure that no one has 'spoofed', i.e. > 'forged', a form submission?" Nice question. :-) First, we must realize that a forged form submission really means a forged HTTP request, either GET or POST. If your script differentiates between the two (e.g., you don't use register_globals and rely on $_GET and $_POST instead), a forged request must reproduce the request method expected. Otherwise, either method will do. This can be important, depending on the type of attack. I briefly read through the replies so far, and here are some comments: 1. Captchas. As Jon mentioned, these are pretty popular, and they're quite effective. But, it's also unrealistic to use a captcha for every form. Your users will get annoyed. Also, as Adam mentioned, they're not foolproof. I assume the link he gave describes using porn sites to help provide answers to captchas. This is a very creative attack, and to be honest, it could be used to subvert many safeguards. 2. Shared secrets. Whether you call these one-time tokens, hashes, or whatever, the idea is typically the same. You create a secret that is intended to only be known by the server and the legitimate user. Implementations vary widely, but these methods are my favorite. They're transparent to your users, and they're difficult enough to exploit that they protect against a number of different attacks, some you may not even be familiar with. One implementation would be to store the secret in the user's session: $secret = md5(time()); $_SESSION['secret'] = $secret; And then use it as a hidden form variable in the form: (Every time you display the form, you would regenerate this secret, so that the user always has a current, fresh, and correct secret). The receiving page can check this. You can improve the security of this method by restricting the timeout window (rather than relying on the session timeout, which might be too large for your needs), or you can allow more user flexibility by keeping a short history of valid tokens (which might help avoid potential problems with the user's frequent use of the back button, although there really shouldn't be any). As with most things, the best solutions depends on your application, but something is better than nothing. 3. HTTP Referer. Do not use this for anything except taking statistics or for your own curiosity. 4. IP address. See 3. Also, I saw a comment about IP address checking and how it helps to prevent CSRF. IP address checking adversely affects legitimate users and does nothing to prevent a CSRF attack (because the request is coming from the legitimate user). See here for a diagram that may better illustrate this: http://shiflett.org/talks/apachecon2003/19 As Hans mentioned, this is all about forging requests. It is important to understand what this means. Let's assume this HTML form, that is located (hypothetically speaking) at http://example.org/form.php:

It would seem safe to assume that we will be able to reference $_POST['myvar'] and have it be either foo or bar. Assuming the user selects foo, the request will look something like this: POST /submit.php HTTP/1.1 Host: example.org Content-Type: application/x-www-form-urlencoded Content-Length: 9 myvar=foo That seems simple enough, right? Consider someone from sco.com who writes a similar script, only it looks like this:
With this simple form, this evil person (Darl?) can now submit anything as the value of $_POST['myvar']. In fact, there was nothing to prevent the creator of the form from including unexpected form variables or anything that can be achieved with an HTML form. More sophisticated attacks might just use raw HTTP rather than bothering to generate a form for every desired type of attack. You can telnet to port 80 and type in one of the requests I listed above. In fact, try this one to log into the NYPHP forums: POST /index.php?act=Login&CODE=01&CookieDate=1 HTTP/1.1 Host: forums.nyphp.org Connection: close Referer: http://forums.nyphp.org/ Cookie: session_id=12345 Content-Type: application/x-www-form-urlencoded Content-Length: 44 UserName=myname&PassWord=mypass&CookieDate=1 Just change myname to be your username, mypass to be your password, and the content length to be the new length of the POST data. Of course, you'll also want to change the value being sent as the session_id, else you'll become a victim of my session fixation attack. :-) Even more advanced attacks leave out the typing and use specific software written to automate attacks. Literally anything sent from the client is suspect, and this is why you should at least hide behind a mature Web server such as Apache rather than trust something like IIS to handle all of the crazy stuff that people try. I'm not kidding about this or bashing Microsoft either; it's seriously a bad idea, and hopefully you now understand why. Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From shiflett at php.net Tue Feb 10 02:24:51 2004 From: shiflett at php.net (Chris Shiflett) Date: Mon, 9 Feb 2004 23:24:51 -0800 (PST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <00fd01c3ef9f$bddd47a0$6400a8c0@thinkpad> Message-ID: <20040210072451.41152.qmail@web14308.mail.yahoo.com> --- jon baer wrote: > i knew SOMEONE would bring up OCR That wasn't OCR. It's actually a very creative technique. As far as I'm aware, Yahoo was the first one that was attacked with this method. Rasmus was talking about it at ApacheCon. Maybe this would make a nice NYPHP demo? :-) Complete with porn? Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From shiflett at php.net Tue Feb 10 02:27:13 2004 From: shiflett at php.net (Chris Shiflett) Date: Mon, 9 Feb 2004 23:27:13 -0800 (PST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <20040210071932.40602.qmail@web14308.mail.yahoo.com> Message-ID: <20040210072713.30870.qmail@web14311.mail.yahoo.com> --- Chris Shiflett wrote: > 1. Captchas. As Jon mentioned, these are pretty popular, and they're > quite effective. I should also have mentioned that these were designed to prevent automation, not to prevent spoofing. That's why they're not very realistic for solving this specific problem, even though they do provide some protection. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From nyphp at enobrev.com Tue Feb 10 02:49:56 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Tue, 10 Feb 2004 02:49:56 -0500 Subject: [nycphp-talk] Using PEAR? Message-ID: I've been avoiding it for quite some time for who knows why. I've read up on it every few months, and I've finally decided to truly consider using it, especially since it's now being built into the PHP distro. So am I the only loser on this board NOT using PEAR? Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.net Tue Feb 10 03:00:38 2004 From: jonbaer at jonbaer.net (jon baer) Date: Tue, 10 Feb 2004 03:00:38 -0500 Subject: [nycphp-talk] NEW PHundamentals Question References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> Message-ID: <011f01c3efab$f9401b40$6400a8c0@thinkpad> > 4. IP address. See 3. > > Also, I saw a comment about IP address checking and how it helps to excellent points ... on a small note a group of us actually 'bombed' a database example once on a friend who asked me to review some of his work, the tool of choice was nemesis by jeff nathan (http://nemesis.sourceforge.net/), he had designed a simple php web tool relying on IP addresses, the point I tried to make w/ tools like winpcap/nemesis was the fact that you could forge the request all the way down to the MAC level so he was looking @ 100,000+ entries seeming to come from a single IP w/ different MACs filled w/ junk ... a point being that you dont really need a response in order to do damage ... (granted we knew the IP) ... was just to show that the IP is not the win all solution either. - jon From dcech at phpwerx.net Tue Feb 10 07:02:01 2004 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 10 Feb 2004 07:02:01 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <011f01c3efab$f9401b40$6400a8c0@thinkpad> References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> <011f01c3efab$f9401b40$6400a8c0@thinkpad> Message-ID: <4028C839.5000004@phpwerx.net> Yeah, it was me who (incorrectly) mentioned CSRF, what I meant was that IP address checking helps to avoid the most common session hijacking attacks, and also (if session IDs are being passed in urls) sessions being unwittingly exposed by users. Chris mentioned that it is inconvenient for users, I understand that IP address checking would be wildly inconvenient for dialup users, etc on a long term basis, but can't think of anyone whose IP address would regularly change during a session. The porn attacks on captchas is definitely inventive and no doubt very effective, harnessing the power of 15 year olds everywhere....I love it. Jon has a good point about not actually requiring a response to do damage. The mechanism to generate the captchas had better be efficient or you're opening yourself up for a DOS attack from anyone who can flood the form with GET requests... Dan jon baer wrote: >>4. IP address. See 3. >> >>Also, I saw a comment about IP address checking and how it helps to > > > excellent points ... on a small note a group of us actually 'bombed' a > database example once on a friend who asked me to review some of his work, > the tool of choice was nemesis by jeff nathan > (http://nemesis.sourceforge.net/), he had designed a simple php web tool > relying on IP addresses, the point I tried to make w/ tools like > winpcap/nemesis was the fact that you could forge the request all the way > down to the MAC level so he was looking @ 100,000+ entries seeming to come > from a single IP w/ different MACs filled w/ junk ... a point being that you > dont really need a response in order to do damage ... (granted we knew the > IP) ... was just to show that the IP is not the win all solution either. > > - jon > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From mwithington at PLMresearch.com Tue Feb 10 07:32:49 2004 From: mwithington at PLMresearch.com (Mark Withington) Date: Tue, 10 Feb 2004 07:32:49 -0500 Subject: [nycphp-talk] Using PEAR? Message-ID: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE3586A6716@network.PLMresearch.com> You are not alone... -------------------------- Mark L. Withington PLMresearch v: 508-746-2383 m: 508-801-0181 Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mark Armendariz Sent: Tuesday, February 10, 2004 2:50 AM To: 'NYPHP Talk' Subject: [nycphp-talk] Using PEAR? I've been avoiding it for quite some time for who knows why. I've read up on it every few months, and I've finally decided to truly consider using it, especially since it's now being built into the PHP distro. So am I the only loser on this board NOT using PEAR? Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Tue Feb 10 07:55:11 2004 From: leam at reuel.net (leam) Date: Tue, 10 Feb 2004 06:55:11 -0600 Subject: [nycphp-talk] NEW PHundamentals Question Message-ID: Dan wrote: > Chris mentioned that it is inconvenient for users, I understand that IP > address checking would be wildly inconvenient for dialup users, etc on a > long term basis, but can't think of anyone whose IP address would > regularly change during a session. I have a friend who works for a large ISP, his changes every few minutes. It even breaks ssh sessions over broadband into his box. ciao! leam From tom at supertom.com Tue Feb 10 08:41:44 2004 From: tom at supertom.com (tom at supertom.com) Date: Tue, 10 Feb 2004 08:41:44 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE3586A6716@network.PLMresearch.com> Message-ID: MessageI agree, you are not alone. We have been following its progress and are now starting to look at it again for serious use. What prompted the change in opinion for us was an installation of a piece of software (which believe it or not I am forgetting) that we chose to install required it. Plus, we had been developing in PHP long before PEAR, so we had (and still have) lots of homegrown code that we rely upon, and really weren't in a position to change it "just because". Coincidently, this month at the LIPHP meeting (www.liphp.org), we will be having a general discussion on PEAR, going over the various tools provided by it, and running through some examples. Tom http://www.liphp.org *************************************************** What's Tom listening to right now? Find out here: http://www.supertom.com/current_track.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Mark Withington Sent: Tuesday, February 10, 2004 7:33 AM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] Using PEAR? You are not alone... -------------------------- Mark L. Withington PLMresearch v: 508-746-2383 m: 508-801-0181 Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mark Armendariz Sent: Tuesday, February 10, 2004 2:50 AM To: 'NYPHP Talk' Subject: [nycphp-talk] Using PEAR? I've been avoiding it for quite some time for who knows why. I've read up on it every few months, and I've finally decided to truly consider using it, especially since it's now being built into the PHP distro. So am I the only loser on this board NOT using PEAR? Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitchy at spacemonkeylabs.com Tue Feb 10 08:52:38 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Tue, 10 Feb 2004 08:52:38 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: References: Message-ID: <4028E226.1050405@spacemonkeylabs.com> Mark Armendariz wrote: > > I've been avoiding it for quite some time for who knows why. I've read > up on it every few months, and I've finally decided to truly consider > using it, especially since it's now being built into the PHP distro. I was the same way until a couple years ago - around the time they got the installer working ;^) Now I use DB, Auth, HTML_QuickForm, Text_Password, and thanks to this very list I am using Math_Stats for calculating standard deviation....... If it's been written already, then I'm gonna use it! Why do we always gotta reinvent the wheel? (slaps forehead) -- Mitch From yury at heavenspa.com Tue Feb 10 09:38:18 2004 From: yury at heavenspa.com (yury at heavenspa.com) Date: Tue, 10 Feb 2004 09:38:18 -0500 Subject: [nycphp-talk] title display based on page view References: <4028E226.1050405@spacemonkeylabs.com> Message-ID: <004001c3efe3$863327e0$0400a8c0@heavenspanyc> hiya folks. was up late last night and wonderd if this could be done. Dynamic Titles based on page view new_york.php new_jersey.php north_dakota.php title = nyc, wtc, city title = atlantic city, beach title = blah, blah, blah Could someone please explain how to generate a title based on page view, and can it be done..an example would be great. regards yury From Cbielanski at inta.org Tue Feb 10 09:36:05 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Tue, 10 Feb 2004 09:36:05 -0500 Subject: [nycphp-talk] title display based on page view Message-ID: I can think of several ways to do that starting with looking at $_SERVER['PHP_SELF'], or in the URL. Unfortunately, it would be necessary to get more details on what you're trying to accomplish - this information opn the problem is awfully vague. Tell us more! Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 > -----Original Message----- > From: yury at heavenspa.com [mailto:yury at heavenspa.com] > Sent: Tuesday, February 10, 2004 9:38 AM > To: NYPHP Talk > Subject: [nycphp-talk] title display based on page view > > > hiya folks. was up late last night and wonderd if this could be done. > Dynamic Titles based on page view > > new_york.php > new_jersey.php > north_dakota.php > > title = nyc, wtc, city > title = atlantic city, beach > title = blah, blah, blah > > Could someone please explain how to generate a title based on > page view, and > can it be done..an example would be great. > > regards > yury > > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From bpang at bpang.com Tue Feb 10 09:43:04 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Tue, 10 Feb 2004 09:43:04 -0500 (EST) Subject: [nycphp-talk] Using PEAR? In-Reply-To: References: Message-ID: <.38.117.145.89.1076424184.squirrel@www.bpang.com> nope... I have all this stuff that I wrote that works for me. Perhaps if it is going to be bundled I will consider converting. > So am I the only loser on this board NOT using PEAR? From yury at heavenspa.com Tue Feb 10 10:05:32 2004 From: yury at heavenspa.com (yury at heavenspa.com) Date: Tue, 10 Feb 2004 10:05:32 -0500 Subject: [nycphp-talk] title display based on page view References: Message-ID: <004a01c3efe7$54209090$0400a8c0@heavenspanyc> Chris hrmm I guess I'm still 1/2 asleep. I'd like to help some pages get relevant titles based on which page is displayed. So the example is like so: i have 51 pages - each page is a state name : state.php i'd like to have 51 titles that have a few of the major cities from that state. I'd like the title to be displayed based on the state.php page.. I guess i could do a huge swtich/case, but was wondering if there is a smart/simple way.. hope this made more sense :) regards yury ----- Original Message ----- From: "Chris Bielanski" To: "'NYPHP Talk'" Sent: Tuesday, February 10, 2004 9:36 AM Subject: RE: [nycphp-talk] title display based on page view > I can think of several ways to do that starting with looking at > $_SERVER['PHP_SELF'], or in the URL. Unfortunately, it would be necessary to > get more details on what you're trying to accomplish - this information opn > the problem is awfully vague. Tell us more! > > Thanks, > Chris Bielanski - [CBielanski at inta.org] > Web Programmer, > International Trademark Association - [www.inta.org] > 1133 Ave. of the Americas - Manhattan > p - 212/642-1745 > > > > > > > -----Original Message----- > > From: yury at heavenspa.com [mailto:yury at heavenspa.com] > > Sent: Tuesday, February 10, 2004 9:38 AM > > To: NYPHP Talk > > Subject: [nycphp-talk] title display based on page view > > > > > > hiya folks. was up late last night and wonderd if this could be done. > > Dynamic Titles based on page view > > > > new_york.php > > new_jersey.php > > north_dakota.php > > > > title = nyc, wtc, city > > title = atlantic city, beach > > title = blah, blah, blah > > > > Could someone please explain how to generate a title based on > > page view, and > > can it be done..an example would be great. > > > > regards > > yury > > > > > > > > > > > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From bpang at bpang.com Tue Feb 10 09:57:24 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Tue, 10 Feb 2004 09:57:24 -0500 (EST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <20040210053750.GC6027@ncc.edu> References: <40283FAB.6080106@optonline.net> <20040210053750.GC6027@ncc.edu> Message-ID: <.38.117.145.89.1076425044.squirrel@www.bpang.com> What can I get if I break into britneyspears.com? > Maybe not the most secure thing in the world, but it ain't > britneyspears.com, either. Would this PHundamental be easier to answer if it also asked: "What [data/function] is being protected and who/what is it being protected from?" From leam at reuel.net Tue Feb 10 09:57:39 2004 From: leam at reuel.net (leam) Date: Tue, 10 Feb 2004 08:57:39 -0600 Subject: [nycphp-talk] Include file questions Message-ID: Noob here again, wondering about include files. 1. Where is a good place to put them so that they are outside the docroot yet centrally located for the apache/mysql/php instance? 2. Do you tend to have uniquely configured include files or just a few for overall use? For example, if you had two different instances of MySQL running, would you have seperate include files for the pages that referenced each or would you use one with differnet variable names? 3. What are some things you usually use for include files? What are some things you*could* put in that you don't? Thanks! leam -- From Cbielanski at inta.org Tue Feb 10 10:05:27 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Tue, 10 Feb 2004 10:05:27 -0500 Subject: [nycphp-talk] title display based on page view Message-ID: Ahhh much more digestible - a huge case statement won't be necessary, but to get it done fast, I'd probably encode all of the pagenames and titles into an array where $key => $value is equivalent to 'page_name.php' => 'title text' $titles = array('new_york.php'=> 'nyc, new york, wtc', 'new_jersey.php' => 'newark, atlantic city, garden state', ...); I'd write it as a separate module and include it, for clarity's sake. HTH, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 > -----Original Message----- > From: yury at heavenspa.com [mailto:yury at heavenspa.com] > Sent: Tuesday, February 10, 2004 10:06 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] title display based on page view > > > Chris hrmm I guess I'm still 1/2 asleep. I'd like to help > some pages get > relevant titles based on which page is displayed. So the > example is like so: > > i have 51 pages - each page is a state name : state.php > > i'd like to have 51 titles that have a few of the major > cities from that > state. > > I'd like the title to be displayed based on the state.php > page.. I guess i > could do a huge swtich/case, but was wondering if there is a > smart/simple > way.. > > hope this made more sense :) > > regards > yury > ----- Original Message ----- > From: "Chris Bielanski" > To: "'NYPHP Talk'" > Sent: Tuesday, February 10, 2004 9:36 AM > Subject: RE: [nycphp-talk] title display based on page view > > > > I can think of several ways to do that starting with looking at > > $_SERVER['PHP_SELF'], or in the URL. Unfortunately, it > would be necessary > to > > get more details on what you're trying to accomplish - this > information > opn > > the problem is awfully vague. Tell us more! > > > > Thanks, > > Chris Bielanski - [CBielanski at inta.org] > > Web Programmer, > > International Trademark Association - [www.inta.org] > > 1133 Ave. of the Americas - Manhattan > > p - 212/642-1745 > > > > > > > > > > > > > -----Original Message----- > > > From: yury at heavenspa.com [mailto:yury at heavenspa.com] > > > Sent: Tuesday, February 10, 2004 9:38 AM > > > To: NYPHP Talk > > > Subject: [nycphp-talk] title display based on page view > > > > > > > > > hiya folks. was up late last night and wonderd if this > could be done. > > > Dynamic Titles based on page view > > > > > > new_york.php > > > new_jersey.php > > > north_dakota.php > > > > > > title = nyc, wtc, city > > > title = atlantic city, beach > > > title = blah, blah, blah > > > > > > Could someone please explain how to generate a title based on > > > page view, and > > > can it be done..an example would be great. > > > > > > regards > > > yury > > > > > > > > > > > > > > > > > > _______________________________________________ > > > talk mailing list > > > talk at lists.nyphp.org > > > http://lists.nyphp.org/mailman/listinfo/talk > > > > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From jsiegel1 at optonline.net Tue Feb 10 10:04:57 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Tue, 10 Feb 2004 10:04:57 -0500 Subject: [nycphp-talk] Include file questions In-Reply-To: References: Message-ID: <4028F319.8080306@optonline.net> For question 1, See: http://phundamentals.nyphp.org/ Specifically, "Site Structure: Where to Locate Includes?" Jeff Siegel =============== leam wrote: > Noob here again, wondering about include files. > > 1. Where is a good place to put them so that they are outside the > docroot yet centrally located for the apache/mysql/php instance? > > 2. Do you tend to have uniquely configured include files or just a few > for overall use? For example, if you had two different instances of > MySQL running, would you have seperate include files for the pages that > referenced each or would you use one with differnet variable names? > > 3. What are some things you usually use for include files? What are some > things you*could* put in that you don't? > > Thanks! > > leam From dcech at phpwerx.net Tue Feb 10 10:07:02 2004 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 10 Feb 2004 10:07:02 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: References: Message-ID: <4028F396.2070802@phpwerx.net> About a year ago I looked at both PEAR::DB and ADOdb, and chose ADOdb. I don't remember exactly why, I think at the time ADOdb had a larger feature set and was under more active development. I have had no complaints whatsoever about the speed or reliability of the system, and have become somewhat involved in development. I know that Hans is vehemently against the idea of a database abstraction layer, but I am very much for it. The overhead involved is minimal, and the gains are potentially huge. I am currently working on a project (phpGACL ) which uses ADOdb and we have users using MySQL, Postgres, Oracle, MSSQL, and IIRC Sybase. Without something like ADOdb or PEAR::DB we would have no chance at being able to support these users. ADOdb (I'm not sure if PEAR::DB has similar functionality) also supports a system for platform-independent data definitions through the ADOdb DataDictionary and adodb-xmlschema. I'm doing a lot of work on both of these tools and a major release is scheduled to coincide with the release of ADOdb 4.12. Dan Mark Armendariz wrote: > I've been avoiding it for quite some time for who knows why. I've read > up on it every few months, and I've finally decided to truly consider > using it, especially since it's now being built into the PHP distro. > > So am I the only loser on this board NOT using PEAR? > > Mark From leam at reuel.net Tue Feb 10 10:28:41 2004 From: leam at reuel.net (leam) Date: Tue, 10 Feb 2004 09:28:41 -0600 Subject: [nycphp-talk] Include file questions Message-ID: Too cool! I have more reading to do now! Thanks! leam > For question 1, See: http://phundamentals.nyphp.org/ > Specifically, "Site Structure: Where to Locate Includes?" > > Jeff Siegel > =============== From adam at trachtenberg.com Tue Feb 10 10:49:53 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 10 Feb 2004 10:49:53 -0500 (EST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <4028C839.5000004@phpwerx.net> References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> <011f01c3efab$f9401b40$6400a8c0@thinkpad> <4028C839.5000004@phpwerx.net> Message-ID: On Tue, 10 Feb 2004, Dan Cech wrote: > The porn attacks on captchas is definitely inventive and no doubt very > effective, harnessing the power of 15 year olds everywhere....I love it. > Jon has a good point about not actually requiring a response to do > damage. The mechanism to generate the captchas had better be efficient > or you're opening yourself up for a DOS attack from anyone who can flood > the form with GET requests... I'm not really sure why captcha generation would be the weak link that someone would use to DOS the box. Wouldn't it be easier to write a Windows virus to just flood the box with requests? However, if you were really worried about the extra load, it would trivial pre-generate 1,000,000 captchas and serve the images up randomly upon request. If you were super concerned, you could even offload this task to a separate server optimized for serving static content. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! >From hans not junk at nyphp.com Tue Feb 10 11:00:40 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 68726A87FC for ; Tue, 10 Feb 2004 11:00:40 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 10 Feb 2004 08:00:35 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F877725FA at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: OT: genius WAS: NEW PHundamentals Question Thread-Index: AcPvpvsmUpkozQM1SdClfzTLUslpJwAR79Jw From: "Hans Zaunere" To: "NYPHP Talk" Subject: [nycphp-talk] OT: genius WAS: NEW PHundamentals Question X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 16:00:40 -0000 > > i knew SOMEONE would bring up OCR >=20 > That wasn't OCR. It's actually a very creative technique. As far as I'm > aware, Yahoo was the first one that was attacked with this method. Rasmus > was talking about it at ApacheCon. "The ingenious crack is to offer a free porn site which requires that you key in the solution to a captcha -- which has been inlined from Yahoo or Hotmail -- before you can gain access. Free porn sites attract lots of users around the clock, and the spammers were able to generate captcha solutions fast enough to create as many throw-away email accounts as they wanted." Really, that is genius. Almost kind of makes me to join force with spammers... *duck* - it's certainly more clever than anything Norton or McAfee have come up with :) =20 > Maybe this would make a nice NYPHP demo? :-) Complete with porn? Sure... a PHundamentals called: "Gotchas with Captchas" :) H From adam at trachtenberg.com Tue Feb 10 11:01:40 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 10 Feb 2004 11:01:40 -0500 (EST) Subject: [nycphp-talk] title display based on page view In-Reply-To: <004a01c3efe7$54209090$0400a8c0@heavenspanyc> References: <004a01c3efe7$54209090$0400a8c0@heavenspanyc> Message-ID: On Tue, 10 Feb 2004 yury at heavenspa.com wrote: > Chris hrmm I guess I'm still 1/2 asleep. I'd like to help some pages get > relevant titles based on which page is displayed. So the example is like so: > > i have 51 pages - each page is a state name : state.php > > i'd like to have 51 titles that have a few of the major cities from that > state. > > I'd like the title to be displayed based on the state.php page.. I guess i > could do a huge swtich/case, but was wondering if there is a smart/simple > way.. Are you saying you have 51 distinct physical pages (new_york.php, connecticut.php, etc.) and want to write a PHP function that looks at the file name and can generate the correct HTML title? Or that you have 1 physical page (state.php) and 51 "virtual" pages? If you have the first, try placing something like this in a file that's included in all pages: $titles = array('new_york.php' => 'New York Title', 'connecticut.php' => 'Connecticut Title', ...); $path_parts = pathinfo($_SERVER['PHP_SELF']); $title = $titles[$path_parts['basename']]; ... print "$title"; However, what you should really do is switch to the second setup and pull all content, including the title, out of a database based on a passed in page name. That solve the title problem and generalizes the solution. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From shiflett at php.net Tue Feb 10 11:03:50 2004 From: shiflett at php.net (Chris Shiflett) Date: Tue, 10 Feb 2004 08:03:50 -0800 (PST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <4028C839.5000004@phpwerx.net> Message-ID: <20040210160350.98843.qmail@web14301.mail.yahoo.com> --- Dan Cech wrote: > Chris mentioned that it is inconvenient for users, I understand that > IP address checking would be wildly inconvenient for dialup users, etc > on a long term basis, but can't think of anyone whose IP address would > regularly change during a session. The classic example is AOL, which uses round-robin proxies to let its users out onto the real Internet. With an AOL user, you may observe a user's IP address changing for every single request. I'm not a big networking expert, but I assume there are other situations that can cause problems with this approach as well. I assume most of these fit into one of two categories: 1. One user can have many IPs. 2. Many users can have one IP. Because of this, and because I'm not a TCP/IP expert, I focus on HTTP and up. > The porn attacks on captchas is definitely inventive and no doubt very > effective, harnessing the power of 15 year olds everywhere....I love > it. Yes, I thought this was genius. :-) > Jon has a good point about not actually requiring a response to do > damage. The mechanism to generate the captchas had better be efficient > or you're opening yourself up for a DOS attack from anyone who can > flood the form with GET requests... This is definitely true if you generate them on the fly or something, but I don't think that's the way to go. With pre-generated images, this shouldn't really be an issue. Also, if anyone is a captcha expert, I think this would make a great presentation of some sort. I know Yahoo uses ez-gimpy (you can find it from http://www.captcha.net/), and I've gotten that to work, but I couldn't figure out how to generate images without having Gimp running under X. I've only played with it out of curiosity, though. Anyone have any experience they can share at a more professional level? Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From Cbielanski at inta.org Tue Feb 10 11:09:37 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Tue, 10 Feb 2004 11:09:37 -0500 Subject: [nycphp-talk] title display based on page view Message-ID: Agreed, a DB-based solution is much better overall :) I spat out the quick and dirty response! > -----Original Message----- > From: Adam Maccabee Trachtenberg [mailto:adam at trachtenberg.com] > Sent: Tuesday, February 10, 2004 11:02 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] title display based on page view > > > On Tue, 10 Feb 2004 yury at heavenspa.com wrote: > > > Chris hrmm I guess I'm still 1/2 asleep. I'd like to help > some pages get > > relevant titles based on which page is displayed. So the > example is like so: > > > > i have 51 pages - each page is a state name : state.php > > > > i'd like to have 51 titles that have a few of the major > cities from that > > state. > > > > I'd like the title to be displayed based on the state.php > page.. I guess i > > could do a huge swtich/case, but was wondering if there is > a smart/simple > > way.. > > Are you saying you have 51 distinct physical pages (new_york.php, > connecticut.php, etc.) and want to write a PHP function that looks at > the file name and can generate the correct HTML title? Or that you > have 1 physical page (state.php) and 51 "virtual" pages? > > If you have the first, try placing something like this in a file > that's included in all pages: > > $titles = array('new_york.php' => 'New York Title', > 'connecticut.php' => 'Connecticut Title', > ...); > > $path_parts = pathinfo($_SERVER['PHP_SELF']); > $title = $titles[$path_parts['basename']]; > > ... > > print "$title"; > > However, what you should really do is switch to the second setup and > pull all content, including the title, out of a database based on a > passed in page name. That solve the title problem and > generalizes the solution. > > -adam > > -- > adam at trachtenberg.com > author of o'reilly's php cookbook > avoid the holiday rush, buy your copy today! > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > >From hans not junk at nyphp.com Tue Feb 10 11:08:43 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 65FBBA8666 for ; Tue, 10 Feb 2004 11:08:43 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Using PEAR? Date: Tue, 10 Feb 2004 08:08:42 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772601 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Using PEAR? Thread-Index: AcPv3E53ZXttJnxLTtarU3Hjg915WAAE8ofg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 16:08:43 -0000 > Coincidently, this month at the LIPHP meeting=20 > (www.liphp.org), we will be having a general discussion on=20 > PEAR, going over the various tools provided by it, and=20 > running through some examples. Whow.. that's scary. NYPHP is having a PEAR::DB presentation feb-24th at our regular meeting. I guess great groups think alike :) H From yury at heavenspa.com Tue Feb 10 11:18:46 2004 From: yury at heavenspa.com (yury at heavenspa.com) Date: Tue, 10 Feb 2004 11:18:46 -0500 Subject: [nycphp-talk] title display based on page view References: <004a01c3efe7$54209090$0400a8c0@heavenspanyc> Message-ID: <00ee01c3eff1$8f4dc020$0400a8c0@heavenspanyc> Adam, (quote)I have 51 actual pages and want to write a PHP function that looks at the file name and can generate the correct HTML title (quote) exactly :) wow it took me atleast 30-40 words to describe that, and you did it in 1 sentance.. hehe Not using a db... i'll check out your code - thanks. regards yury ----- Original Message ----- From: "Adam Maccabee Trachtenberg" To: "NYPHP Talk" Sent: Tuesday, February 10, 2004 11:01 AM Subject: Re: [nycphp-talk] title display based on page view > On Tue, 10 Feb 2004 yury at heavenspa.com wrote: > > > Chris hrmm I guess I'm still 1/2 asleep. I'd like to help some pages get > > relevant titles based on which page is displayed. So the example is like so: > > > > i have 51 pages - each page is a state name : state.php > > > > i'd like to have 51 titles that have a few of the major cities from that > > state. > > > > I'd like the title to be displayed based on the state.php page.. I guess i > > could do a huge swtich/case, but was wondering if there is a smart/simple > > way.. > > Are you saying you have 51 distinct physical pages (new_york.php, > connecticut.php, etc.) and want to write a PHP function that looks at > the file name and can generate the correct HTML title? Or that you > have 1 physical page (state.php) and 51 "virtual" pages? > > If you have the first, try placing something like this in a file > that's included in all pages: > > $titles = array('new_york.php' => 'New York Title', > 'connecticut.php' => 'Connecticut Title', > ...); > > $path_parts = pathinfo($_SERVER['PHP_SELF']); > $title = $titles[$path_parts['basename']]; > > ... > > print "$title"; > > However, what you should really do is switch to the second setup and > pull all content, including the title, out of a database based on a > passed in page name. That solve the title problem and generalizes the solution. > > -adam > > -- > adam at trachtenberg.com > author of o'reilly's php cookbook > avoid the holiday rush, buy your copy today! > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From yury at heavenspa.com Tue Feb 10 11:20:03 2004 From: yury at heavenspa.com (yury at heavenspa.com) Date: Tue, 10 Feb 2004 11:20:03 -0500 Subject: [nycphp-talk] OT: genius WAS: NEW PHundamentals Question References: <41EE526EC2D3C74286415780D3BA9F877725FA@ehost011-1.exch011.intermedia.net> Message-ID: <00f601c3eff1$be4ab630$0400a8c0@heavenspanyc> I've got the porn site already built if you need a test bed -- lol.. yury ----- Original Message ----- From: "Hans Zaunere" To: "NYPHP Talk" Sent: Tuesday, February 10, 2004 11:00 AM Subject: [nycphp-talk] OT: genius WAS: NEW PHundamentals Question > > i knew SOMEONE would bring up OCR > > That wasn't OCR. It's actually a very creative technique. As far as I'm > aware, Yahoo was the first one that was attacked with this method. Rasmus > was talking about it at ApacheCon. "The ingenious crack is to offer a free porn site which requires that you key in the solution to a captcha -- which has been inlined from Yahoo or Hotmail -- before you can gain access. Free porn sites attract lots of users around the clock, and the spammers were able to generate captcha solutions fast enough to create as many throw-away email accounts as they wanted." Really, that is genius. Almost kind of makes me to join force with spammers... *duck* - it's certainly more clever than anything Norton or McAfee have come up with :) > Maybe this would make a nice NYPHP demo? :-) Complete with porn? Sure... a PHundamentals called: "Gotchas with Captchas" :) H _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From jsiegel1 at optonline.net Tue Feb 10 11:23:46 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Tue, 10 Feb 2004 11:23:46 -0500 Subject: [nycphp-talk] OT: genius WAS: NEW PHundamentals Question In-Reply-To: <41EE526EC2D3C74286415780D3BA9F877725FA@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F877725FA@ehost011-1.exch011.intermedia.net> Message-ID: <40290592.4050108@optonline.net> >>Maybe this would make a nice NYPHP demo? :-) Complete with porn? > Sure... a PHundamentals called: "Gotchas with Captchas" Better title? "Gotchas with Captchas and Pitchas" ? Jeff Siegel Hans Zaunere wrote: >>>i knew SOMEONE would bring up OCR >> >>That wasn't OCR. It's actually a very creative technique. As far as > > I'm > >>aware, Yahoo was the first one that was attacked with this method. > > Rasmus > >>was talking about it at ApacheCon. > > > "The ingenious crack is to offer a free porn site which requires that > you key in the solution to a captcha -- which has been inlined from > Yahoo or Hotmail -- before you can gain access. Free porn sites attract > lots of users around the clock, and the spammers were able to generate > captcha solutions fast enough to create as many throw-away email > accounts as they wanted." > > Really, that is genius. Almost kind of makes me to join force with > spammers... *duck* - it's certainly more clever than anything Norton or > McAfee have come up with :) > > >>Maybe this would make a nice NYPHP demo? :-) Complete with porn? > > > Sure... a PHundamentals called: "Gotchas with Captchas" :) > > H > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From wiw at nyc.rr.com Tue Feb 10 12:14:17 2004 From: wiw at nyc.rr.com (Bill Wolf) Date: Tue, 10 Feb 2004 12:14:17 -0500 Subject: [nycphp-talk] Q) learning php - drawing table border around empty Message-ID: <200402101714.i1AHEGZa006094@nycsmtp3out.rdc-nyc.rr.com> I have a question about populating a table with values from a query that sometimes are null. When the table's drawn, no border is drawn around those elements which looks awkward. I've tried doing some things where I force in " " into the query results but it doesn't seem to take take. Suggestions? $result = mysql_query("select show_id, month, day, year, location, details , venue from $database_table order by year, month, day",$db) or die_now("

Could not select shows

" ); ... while($row = mysql_fetch_array($result)) { $the_id = $row["show_id"]; $the_month = $row["month"]; $the_day = $row["day"]; $the_year = $row["year"]; $the_location = $row["location"]; $the_details = $row["details"]; $the_venue = $row["venue"]; ... // shows echo("\t\n\t\t$the_month" . "/" . "$the_day" . "/" . "$the_year" . "\n"); From Cbielanski at inta.org Tue Feb 10 12:19:01 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Tue, 10 Feb 2004 12:19:01 -0500 Subject: [nycphp-talk] Q) learning php - drawing table border around em pty Message-ID: What browser are you viewing in? AFAIK the   should do the trick... > -----Original Message----- > From: Bill Wolf [mailto:wiw at nyc.rr.com] > Sent: Tuesday, February 10, 2004 12:14 PM > To: talk at lists.nyphp.org > Subject: [nycphp-talk] Q) learning php - drawing table border around > empty > > > I have a question about populating a table with values from a > query that > sometimes are null. > > When the table's drawn, no border is drawn around those > elements which > looks awkward. I've tried doing some things where I force in > " " into > the query results but it doesn't seem to take take. Suggestions? > > > > $result = mysql_query("select show_id, month, day, year, > location, details , > venue > from $database_table order by year, > month, day",$db) > or die_now("

Could not select shows

" ); > ... > > while($row = mysql_fetch_array($result)) { > $the_id = $row["show_id"]; > $the_month = $row["month"]; > $the_day = $row["day"]; > $the_year = $row["year"]; > $the_location = $row["location"]; > $the_details = $row["details"]; > $the_venue = $row["venue"]; > > ... > > // shows > echo("\t valign='top'>\n\t\t$the_month" . "/" . > "$the_day" . "/" . "$the_year" . "\n"); > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From tom at supertom.com Tue Feb 10 12:11:35 2004 From: tom at supertom.com (tom at supertom.com) Date: Tue, 10 Feb 2004 12:11:35 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87772601@ehost011-1.exch011.intermedia.net> Message-ID: Yeah, although I probably got the idea from you guys, and just didn't realize it. But I digress - these are both two great groups. This is the one-year anniversary for LIPHP - we are having a party, PEAR talk and book giveway (thanks O'reilly!) - fun for all! I'll make the official announcement next week. Tom www.liphp.org *************************************************** What's Tom listening to right now? Find out here: http://www.supertom.com/current_track.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Hans Zaunere Sent: Tuesday, February 10, 2004 11:09 AM To: NYPHP Talk Subject: RE: [nycphp-talk] Using PEAR? > Coincidently, this month at the LIPHP meeting > (www.liphp.org), we will be having a general discussion on > PEAR, going over the various tools provided by it, and > running through some examples. Whow.. that's scary. NYPHP is having a PEAR::DB presentation feb-24th at our regular meeting. I guess great groups think alike :) H _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk >From hans not junk at nyphp.com Tue Feb 10 12:19:51 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 1E0E3A865D for ; Tue, 10 Feb 2004 12:19:51 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Include file questions Date: Tue, 10 Feb 2004 09:19:50 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772655 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Include file questions Thread-Index: AcPv5j9rDHByxRm0Tzyy9kcxoHHLKAAEzcnA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 17:19:51 -0000 > 1. Where is a good place to put them so that they are outside the > docroot yet centrally located for the apache/mysql/php instance? As Jeff already pointed out, http://phundamentals.nyphp.org is the source for this. > 2. Do you tend to have uniquely configured include files or just a few > for overall use? For example, if you had two different instances of > MySQL running, would you have seperate include files for the pages that > referenced each or would you use one with differnet variable names? I generally setup a hierarchy of include files. That is to say, a top level, which creates DB connections, each with different variable names. The only consideration is if you won't need a particular DB connection on every request, and performance is that important. If both of these are issues, then I'll do the DB connection in a specific include file (generally where the class/functions that will use it are) or in a class/function itself. > 3. What are some things you usually use for include files? What are some > things you*could* put in that you don't? Organizing code :) Include files are generally libraries of code, whether it be procedural or object orientated. Commonly, people have executeable code in include files, which I never like doing. This means, that IMO at least, include files should only ever contain functions and classes. There is one exception to this. The top level include for your application can contain DB connection code, setting up constants, and other application environment settings. This isn't to say it *has to* (for instance, people put this type of stuff in a function or class) but it can. H From crisscott at netzero.com Tue Feb 10 12:44:41 2004 From: crisscott at netzero.com (Scott Mattocks) Date: Tue, 10 Feb 2004 12:44:41 -0500 Subject: [nycphp-talk] Q) learning php - drawing table border around em pty In-Reply-To: References: Message-ID: <40291889.4080006@netzero.com> If you want the borders to show for all cells you need to set it up in the table tag. Try something like this: ... Scott Mattocks Chris Bielanski wrote: > What browser are you viewing in? AFAIK the   should do the trick... > > >>-----Original Message----- >>From: Bill Wolf [mailto:wiw at nyc.rr.com] >>Sent: Tuesday, February 10, 2004 12:14 PM >>To: talk at lists.nyphp.org >>Subject: [nycphp-talk] Q) learning php - drawing table border around >>empty >valign='top'>\n\t\t\n"); >> >>_______________________________________________ >>talk mailing list >>talk at lists.nyphp.org >>http://lists.nyphp.org/mailman/listinfo/talk >> > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > From agfische at email.smith.edu Tue Feb 10 12:45:43 2004 From: agfische at email.smith.edu (Aaron Fischer) Date: Tue, 10 Feb 2004 12:45:43 -0500 Subject: [nycphp-talk] Q) learning php - drawing table border around em pty > valign='top'>\n\t\t\n"); >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk >> > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From danielc at analysisandsolutions.com Tue Feb 10 13:05:48 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 10 Feb 2004 13:05:48 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: References: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE3586A6716@network.PLMresearch.com> Message-ID: <20040210180548.GB20430@panix.com> Hi Tom: On Tue, Feb 10, 2004 at 08:41:44AM -0500, tom at supertom.com wrote: > > Coincidently, this month at the LIPHP meeting (www.liphp.org), we will > be having a general discussion on PEAR, going over the various tools > provided by it, and running through some examples. Keep in mind DB is nearing a stable/official 1.6.0 release and it will be out well before your meeting. See the change log http://pear.php.net/package-changelog.php?package=DB for a huge list of improvements. Also, check out the improved docs at http://pear.php.net/manual/en/package.database.php --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Tue Feb 10 13:07:58 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 10 Feb 2004 13:07:58 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: <4028F396.2070802@phpwerx.net> References: <4028F396.2070802@phpwerx.net> Message-ID: <20040210180758.GC20430@panix.com> Hi Dan: On Tue, Feb 10, 2004 at 10:07:02AM -0500, Dan Cech wrote: > > ADOdb (I'm not sure if PEAR::DB has similar > functionality) also supports a system for platform-independent data > definitions through the ADOdb DataDictionary and adodb-xmlschema. DB doesn't but MDB and/or DB_DataObject do. http://pear.php.net/package/MDB/ (stable) http://pear.php.net/package/MDB2/ (alpha) http://pear.php.net/package/DB_DataObject/ --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jlacey at att.net Tue Feb 10 14:18:28 2004 From: jlacey at att.net (John Lacey) Date: Tue, 10 Feb 2004 12:18:28 -0700 Subject: [nycphp-talk] xampp Message-ID: <40292E84.5090006@att.net> a new version of xampp for windows was posted today http://www.apachefriends.org/index-en.html New features are: * Apache 2.0.48 * MySQL 4.0.17 * PHP 4.3.4 + mod_php 4.3.4 * Perl 5.8.2 + mod_perl 1.99_12 * Openssl 0.9.7c + mod_ssl 2.0.48 * SQLite 2.8.11 * PHPMyAdmin 2.5.5 pl1 John From nyphp at enobrev.com Tue Feb 10 14:21:41 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Tue, 10 Feb 2004 14:21:41 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87772601@ehost011-1.exch011.intermedia.net> Message-ID: > Whow.. that's scary. NYPHP is having a PEAR::DB presentation > feb-24th at our regular meeting. Just one more reason for me to make my first meeting. That along with the thawing of NYC. Mark From mwithington at PLMresearch.com Tue Feb 10 14:55:40 2004 From: mwithington at PLMresearch.com (Mark L. Withington) Date: Tue, 10 Feb 2004 14:55:40 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE35890A2E3@network.PLMresearch.com> Message-ID: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358915C92@network.PLMresearch.com> Bummer, I'm out-of-the country that week (usually in Boston so I'm always out-of-town). Would've made this one my first meeting too. Anyone know a good PEAR primer that I can buy (I realize it's probably on line for free, but I've got lots of time to kill in an airplane). I'd like to try and get a better handle on all this PEAR stuff. -------------------------- Mark L. Withington PLMresearch "eBusiness for the Midsize Enterprise" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 http://www.PLMresearch.com Netscape/AOL/MSN IM: PLMresearch mwithington at plmresearch.com Public Key: http://www.PLMresearch.com/keys/MLW_public_key.asc Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Mark Armendariz Sent: Tuesday, February 10, 2004 2:22 PM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] Using PEAR? > Whow.. that's scary. NYPHP is having a PEAR::DB presentation > feb-24th at our regular meeting. Just one more reason for me to make my first meeting. That along with the thawing of NYC. Mark _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From mitchy at spacemonkeylabs.com Tue Feb 10 15:16:24 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Tue, 10 Feb 2004 15:16:24 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358915C92@network.PLMresearch.com> References: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358915C92@network.PLMresearch.com> Message-ID: <40293C18.7060503@spacemonkeylabs.com> Mark L. Withington wrote: > Bummer, I'm out-of-the country that week (usually in Boston so I'm always > out-of-town). Would've made this one my first meeting too. Anyone know a > good PEAR primer that I can buy (I realize it's probably on line for free, > but I've got lots of time to kill in an airplane). I'd like to try and get > a better handle on all this PEAR stuff. Take your (linux?)laptop, and while connected to the 'Net do the folowing: pear list-updates // shows updates pear upgrade-all // upgrades all installed packages pear install DB // excellent DB class :) pear install HTML_QuickForm // interesting HTML/Javascript forms Now on the airplane you have examples and documentation in /usr/share/pear (or wherever your PEAR is installed). Really. I've seen the new DB documentation online (and it is a huge improvement), but the examples are also excellent. That is how I learned PEAR, at least (and it was on planes AND trains) :) -- Mitch From adam at trachtenberg.com Tue Feb 10 15:16:38 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 10 Feb 2004 15:16:38 -0500 (EST) Subject: [nycphp-talk] Using PEAR? In-Reply-To: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358915C92@network.PLMresearch.com> References: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358915C92@network.PLMresearch.com> Message-ID: On Tue, 10 Feb 2004, Mark L. Withington wrote: > Bummer, I'm out-of-the country that week (usually in Boston so I'm always > out-of-town). Would've made this one my first meeting too. Anyone know a > good PEAR primer that I can buy (I realize it's probably on line for free, > but I've got lots of time to kill in an airplane). I'd like to try and get > a better handle on all this PEAR stuff. *** Blatent Plug Alert *** "PHP Cookbook" (O'Reilly 2003) has a section on PEAR and also covers PEAR DB. http://www.amazon.com/exec/obidos/ASIN/1565926811/trachtenberg-20/ref=nosim However, I would be remiss if I didn't plug David's new book: "Essential PHP Tools: Modules, Extensions, and Accelerators." (Apress 2004) In addition to being completely up-to-date, it has an extensive set of documentation on many PEAR (and non-PEAR) modules, including: PEAR DB, ADODB, HTML_QuickForm, Smarty, XML_Parser, SimpleXML, PEAR XML_RPC, PEAR SOAP, PEAR Mail and Mail_mime, PEAR Auth and Auth_HTTP, XDebug, APC, PHPA, and MMCache. (Whew!) While many of these packages have some form of online documentation, much of it is out-of-date, poorly written, or missing major portions. In particular, the PEAR SOAP chapter is *far and away* the best documentation I have seen on PHP and SOAP. The other chapters are good too, particularly if you like ice cream. Unfortunately, it's coming out new month. :( But you should buy it anyway. :) http://www.sklar.com/blog/archives/25_Essential_PHP_Tools.html http://www.amazon.com/exec/obidos/ASIN/1590592808/sklarcom-20/ref=nosim -adam Disclaimer: I co-wrote PHP Cookbook with David and technical edited Essential PHP Tools. -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From adam at trachtenberg.com Tue Feb 10 15:19:58 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 10 Feb 2004 15:19:58 -0500 (EST) Subject: [nycphp-talk] Using PEAR? In-Reply-To: References: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358915C92@network.PLMresearch.com> Message-ID: On Tue, 10 Feb 2004, Adam Maccabee Trachtenberg wrote: > Unfortunately, it's coming out new month. :( But you should buy it > anyway. :) Of course, "new" should be "next," as in March. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From mwithington at PLMresearch.com Tue Feb 10 15:29:48 2004 From: mwithington at PLMresearch.com (Mark L. Withington) Date: Tue, 10 Feb 2004 15:29:48 -0500 Subject: [nycphp-talk] Using PEAR? In-Reply-To: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE35890A2F9@network.PLMresearch.com> Message-ID: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358915CA2@network.PLMresearch.com> Thanks. Will do this and pursue Adam's suggestions as they're published. -------------------------- Mark L. Withington PLMresearch "eBusiness for the Midsize Enterprise" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 http://www.PLMresearch.com Netscape/AOL/MSN IM: PLMresearch mwithington at plmresearch.com Public Key: http://www.PLMresearch.com/keys/MLW_public_key.asc Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Mitch Pirtle Sent: Tuesday, February 10, 2004 3:16 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Using PEAR? Mark L. Withington wrote: > Bummer, I'm out-of-the country that week (usually in Boston so I'm always > out-of-town). Would've made this one my first meeting too. Anyone know a > good PEAR primer that I can buy (I realize it's probably on line for free, > but I've got lots of time to kill in an airplane). I'd like to try and get > a better handle on all this PEAR stuff. Take your (linux?)laptop, and while connected to the 'Net do the folowing: pear list-updates // shows updates pear upgrade-all // upgrades all installed packages pear install DB // excellent DB class :) pear install HTML_QuickForm // interesting HTML/Javascript forms Now on the airplane you have examples and documentation in /usr/share/pear (or wherever your PEAR is installed). Really. I've seen the new DB documentation online (and it is a huge improvement), but the examples are also excellent. That is how I learned PEAR, at least (and it was on planes AND trains) :) -- Mitch _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From jlacey at att.net Tue Feb 10 15:35:00 2004 From: jlacey at att.net (John Lacey) Date: Tue, 10 Feb 2004 13:35:00 -0700 Subject: [nycphp-talk] Using PEAR? In-Reply-To: References: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358915C92@network.PLMresearch.com> Message-ID: <40294074.6090700@att.net> Adam Maccabee Trachtenberg wrote: > *** Blatent Plug Alert *** > > "PHP Cookbook" (O'Reilly 2003) has a section on PEAR and also covers > PEAR DB. > > http://www.amazon.com/exec/obidos/ASIN/1565926811/trachtenberg-20/ref=nosim > > However, I would be remiss if I didn't plug David's new book: > "Essential PHP Tools: Modules, Extensions, and Accelerators." (Apress > 2004) > > In addition to being completely up-to-date, it has an extensive set of > documentation on many PEAR (and non-PEAR) modules, including: PEAR DB, > ADODB, HTML_QuickForm, Smarty, XML_Parser, SimpleXML, PEAR XML_RPC, > PEAR SOAP, PEAR Mail and Mail_mime, PEAR Auth and Auth_HTTP, XDebug, > APC, PHPA, and MMCache. (Whew!) > > While many of these packages have some form of online documentation, > much of it is out-of-date, poorly written, or missing major > portions. In particular, the PEAR SOAP chapter is *far and away* the > best documentation I have seen on PHP and SOAP. The other chapters are > good too, particularly if you like ice cream. > I'll second the plug(s) since I have "every book" :) the contributors on this list have written and they're quite good, if I'm allowed an understatment. Having co-authored and technically edited 8 or so networking-related books (LANs, WANs, protocols, blah...) I appreciate the difficulty of putting together something that speaks to people who are trying to learn. I'm eagerly awaiting the coming titles. John >From hans not junk at nyphp.com Tue Feb 10 16:03:51 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id D0C88A85F0 for ; Tue, 10 Feb 2004 16:03:50 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] NEW PHundamentals Question Date: Tue, 10 Feb 2004 13:03:50 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F877726F4 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] NEW PHundamentals Question Thread-Index: AcPv74As5nGH+RdeT42X2nbiPLkvigAKXUcw From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 21:03:51 -0000 > --- Dan Cech wrote: > > Chris mentioned that it is inconvenient for users, I understand that > > IP address checking would be wildly inconvenient for dialup users, etc > > on a long term basis, but can't think of anyone whose IP address would > > regularly change during a session. >=20 > The classic example is AOL, which uses round-robin proxies to let its > users out onto the real Internet. With an AOL user, you may observe a > user's IP address changing for every single request. >=20 > I'm not a big networking expert, but I assume there are other situations > that can cause problems with this approach as well. I assume most of these > fit into one of two categories: >=20 > 1. One user can have many IPs. > 2. Many users can have one IP. >=20 > Because of this, and because I'm not a TCP/IP expert, I focus=20 > on HTTP and up. No TCP/IP required... that sums it up perfectly. I've been told, as a rule of thumb, not to EVER depend on IPs for proof of anything, especially on the web. > Also, if anyone is a captcha expert, I think this would make a great > presentation of some sort. I know Yahoo uses ez-gimpy (you can find it > from http://www.captcha.net/), and I've gotten that to work, but I > couldn't figure out how to generate images without having Gimp running > under X. I've only played with it out of curiosity, though. Anyone have > any experience they can share at a more professional level? Agreed... this is a very interesting subject. Heck, CMU isn't too far... who's interested in contacting them to see if they'd take a trip here? H >From hans not junk at nyphp.com Tue Feb 10 16:06:03 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 7FCF2A85F0 for ; Tue, 10 Feb 2004 16:06:03 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Using PEAR? Date: Tue, 10 Feb 2004 13:06:03 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F877726F6 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Using PEAR? Thread-Index: AcPv55Dn8KSs+qHZRqOiMBMTgOPPzwAMhVHg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 21:06:03 -0000 > About a year ago I looked at both PEAR::DB and ADOdb, and chose ADOdb. > I don't remember exactly why, I think at the time ADOdb had a larger=20 > feature set and was under more active development. >=20 > I have had no complaints whatsoever about the speed or reliability of=20 > the system, and have become somewhat involved in development. >=20 > I know that Hans is vehemently against the idea of a database=20 > abstraction layer, but I am very much for it. The overhead involved is=20 > minimal, and the gains are potentially huge. :) > I am currently working on a project (phpGACL=20 > ) which uses ADOdb and we have users=20 > using MySQL, Postgres, Oracle, MSSQL, and IIRC Sybase. Without=20 > something like ADOdb or PEAR::DB we would have no chance at being able > to support these users. >=20 > ADOdb (I'm not sure if PEAR::DB has similar=20 > functionality) also supports a system for platform-independent data=20 > definitions through the ADOdb DataDictionary and adodb-xmlschema. I'm > doing a lot of work on both of these tools and a major release is=20 > scheduled to coincide with the release of ADOdb 4.12. Since we're doing PEAR::DB this month, maybe next month is set for ADOdb? Maybe even a face off at the next meeting? :) H From adam at trachtenberg.com Tue Feb 10 16:15:59 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 10 Feb 2004 16:15:59 -0500 (EST) Subject: [nycphp-talk] Using PEAR? In-Reply-To: <41EE526EC2D3C74286415780D3BA9F877726F6@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F877726F6@ehost011-1.exch011.intermedia.net> Message-ID: On Tue, 10 Feb 2004, Hans Zaunere wrote: > Since we're doing PEAR::DB this month, maybe next month is set for > ADOdb? Maybe even a face off at the next meeting? :) Always being someone to volunteer another, David might be a good referee for that match because he covers both PEAR DB and ADOdb in his new book. I'm sure that he'd have already jumped in here, but he's out in California speaking at the O'Reilly Emerging Technology Conference. :) -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! >From hans not junk at nyphp.com Tue Feb 10 16:54:48 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 58D86A85F0 for ; Tue, 10 Feb 2004 16:54:48 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] NEW PHundamentals Question Date: Tue, 10 Feb 2004 13:54:46 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772717 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] NEW PHundamentals Question Thread-Index: AcPvfFC2Ait7wecrSRi/wWYuf9FpCwAnvuMg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 21:54:48 -0000 > Almost every website has an HTML form for visitors to complete. But how=20 > do you know that the person who completed the form did so through your > website? The question for this month's PHundamentals article is: What=20 You can't. > method(s) do you use to assure that no one has 'spoofed', i.e.,=20 > 'forged', a form submission?" There are none. ---- Well ok, maybe that's a bit harsh. I think it's important to look at this from a strictly protocol perspective. If I'm a fast typer, or have written a program to help me, I can talk to any web server without them having a clue whether I'm a "real" user or not. This may seem obvious, but it warrants another look. To pick apart the original question: "how do you know that the person who completed the form did so through your website?" Let's even assume the site uses tokens to identify and track forms. 1) A malicious user browses around (using a regular browser) to the form he's looking to attack. 2) Upon arrival at the form, the site gladly generates a one time token and sends it to the browser. 3) Instead of submitting the form, however, the attacker loads up his own program, which can send custom HTTP requests. The attacker has his one time code, yet can inject any data through a form submission... and the server never knows that the form submission is actually happening "through the site" - which I read as "through a browser." So, there's a second part: "What method(s) do you use to assure that no one has 'spoofed', i.e., 'forged', a form submission?" Since preventing spoofing and forgery is impossible (even with SSL) it really becomes a matter of data integrity. Assuming important and highly sensitive information (since if it wasn't an important site, why would you care about form submittals anyway?), these items can help prevent problems: -- know what you send out. Keep track of forms you've put out on the wire, and develop a policy for accepting form submittals (for instance time outs, multiple forms per user id, multiple submissions, not accepting forms you don't expect, etc). This can be implemented using tokens. -- know what you want back. This is really the crucial part. Just because a >> valign='top'>\n\t\t\n"); > >> > >> _______________________________________________ > >> talk mailing list > >> talk at lists.nyphp.org > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > From joel at tagword.com Tue Feb 10 18:14:12 2004 From: joel at tagword.com (Joel De Gan) Date: Tue, 10 Feb 2004 18:14:12 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> <011f01c3efab$f9401b40$6400a8c0@thinkpad> <4028C839.5000004@phpwerx.net> Message-ID: <1076454852.7591.49.camel@bezel> > what's a Captcha? Captcha is an image verification. it is supposed to stop bots, but there are quite a few people who write anti-captcha programs (I have had to do some for my work to get around images) Here is one I made for my email whitelist that is very effective in keeping spam out of my inbox http://lucifer.intercosmos.net/mail/ The source is on the main site for creating them in php. to get around them you can utilize a program called gocr (gocr.sourceforge.net) which is a very easily trainable commandline program that output the OCR chars from an image. You can get around colors using imagemagik 'convert' and lines are easily removed be converting an image to black and white, then placing into a multi-dimensional array in php and identifying vertical and horizontal lines and removing them. it is pretty easy, here are some functions for doing it. 0){ $isaline = false; }//fi }//rof // this is a line if($isaline){ for ($x=0;$x 0) && ($imarr[$y][$x+1] <> 0) ) ){ $imarr[$y][$x]=2; // remove it }//fi }//rof }//rof return $imarr; } // for debug function printhtmlimg($imarr, $debug=1){ $ret = "\n
>> >> >>I have a question about populating a table with values from a >>query that >>sometimes are null. >> >>When the table's drawn, no border is drawn around those >>elements which >>looks awkward. I've tried doing some things where I force in >>" " into >>the query results but it doesn't seem to take take. Suggestions? >> >> >> >>$result = mysql_query("select show_id, month, day, year, >>location, details , >>venue >> from $database_table order by year, >>month, day",$db) >> or die_now("

Could not select shows

" ); >>... >> >> while($row = mysql_fetch_array($result)) { >> $the_id = $row["show_id"]; >> $the_month = $row["month"]; >> $the_day = $row["day"]; >> $the_year = $row["year"]; >> $the_location = $row["location"]; >> $the_details = $row["details"]; >> $the_venue = $row["venue"]; >> >>... >> >> // shows >> echo("\t
$the_month" . "/" . >>"$the_day" . "/" . "$the_year" . " In-Reply-To: References: Message-ID: Another option is popping in an tag pointing to your 1x1 transparent spacer image instead of the  . This is also a good question to post to the front end mailing list . Hmm, email program is acting funky, apologies if this is a duplicate post. -Aaron On Feb 10, 2004, at 12:19 PM, Chris Bielanski wrote: > What browser are you viewing in? AFAIK the   should do the > trick... > >> -----Original Message----- >> From: Bill Wolf [mailto:wiw at nyc.rr.com] >> Sent: Tuesday, February 10, 2004 12:14 PM >> To: talk at lists.nyphp.org >> Subject: [nycphp-talk] Q) learning php - drawing table border around >> empty >> >> >> I have a question about populating a table with values from a >> query that >> sometimes are null. >> >> When the table's drawn, no border is drawn around those >> elements which >> looks awkward. I've tried doing some things where I force in >> " " into >> the query results but it doesn't seem to take take. Suggestions? >> >> >> >> $result = mysql_query("select show_id, month, day, year, >> location, details , >> venue >> from $database_table order by year, >> month, day",$db) >> or die_now("

Could not select shows

" ); >> ... >> >> while($row = mysql_fetch_array($result)) { >> $the_id = $row["show_id"]; >> $the_month = $row["month"]; >> $the_day = $row["day"]; >> $the_year = $row["year"]; >> $the_location = $row["location"]; >> $the_details = $row["details"]; >> $the_venue = $row["venue"]; >> >> ... >> >> // shows >> echo("\t
$the_month" . "/" . >> "$the_day" . "/" . "$the_year" . " References: Message-ID: <002e01c3f02a$b44b1ce0$f1a0d718@Vaio> I agree with Aaron! If you just put this in place of the null fields it'll solve your problem. An image with height or width of 1 won't show any errors on the page if the image isn't where you specify so this way ends up being pretty portable. For a small hack it works for me. Shawn ----- Original Message ----- From: "Aaron Fischer" To: "NYPHP Talk" Sent: Tuesday, February 10, 2004 12:45 PM Subject: Re: [nycphp-talk] Q) learning php - drawing table border around em pty > Another option is popping in an tag pointing to your 1x1 > transparent spacer image instead of the  . This is also a good > question to post to the front end mailing list > . > > Hmm, email program is acting funky, apologies if this is a duplicate > post. > > -Aaron > > On Feb 10, 2004, at 12:19 PM, Chris Bielanski wrote: > > > What browser are you viewing in? AFAIK the   should do the > > trick... > > > >> -----Original Message----- > >> From: Bill Wolf [mailto:wiw at nyc.rr.com] > >> Sent: Tuesday, February 10, 2004 12:14 PM > >> To: talk at lists.nyphp.org > >> Subject: [nycphp-talk] Q) learning php - drawing table border around > >> empty > >> > >> > >> I have a question about populating a table with values from a > >> query that > >> sometimes are null. > >> > >> When the table's drawn, no border is drawn around those > >> elements which > >> looks awkward. I've tried doing some things where I force in > >> " " into > >> the query results but it doesn't seem to take take. Suggestions? > >> > >> > >> > >> $result = mysql_query("select show_id, month, day, year, > >> location, details , > >> venue > >> from $database_table order by year, > >> month, day",$db) > >> or die_now("

Could not select shows

" ); > >> ... > >> > >> while($row = mysql_fetch_array($result)) { > >> $the_id = $row["show_id"]; > >> $the_month = $row["month"]; > >> $the_day = $row["day"]; > >> $the_year = $row["year"]; > >> $the_location = $row["location"]; > >> $the_details = $row["details"]; > >> $the_venue = $row["venue"]; > >> > >> ... > >> > >> // shows > >> echo("\t
$the_month" . "/" . > >> "$the_day" . "/" . "$the_year" . "
\n"; for ($cy=0;$cyCaptcha hacking
-or-
how to get around those annoying 'security' images."; echo "

This is a live demo of the 'line insertion' technique workaround.

"; echo "

Original

"; echo printhtmlimg($imarr); echo "

Horizontal filter (red removed)

"; echo printhtmlimg(dehorz($imarr)); /* now just fix this up and run through gocr after dumping back to file (remember to turn the reds to white) and start training it .. I managed about 80-90% accuracy with this. */ ?> And... I just went off on a tangent didn't I? Anyway.. well, in case you wanted to know how that is done in PHP... cheers -Joel De Gan joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From shiflett at php.net Tue Feb 10 19:11:32 2004 From: shiflett at php.net (Chris Shiflett) Date: Tue, 10 Feb 2004 16:11:32 -0800 (PST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: Message-ID: <20040211001132.94411.qmail@web14309.mail.yahoo.com> --- David Mintz wrote: > what's a Captcha? This is a good site to check out: http://www.captcha.net/ Although I can't find it anywhere on that site anymore, the term originated as an acronym for: Completely Automated Public Turing test to tell Computers and Humans Apart Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From shiflett at php.net Tue Feb 10 19:15:54 2004 From: shiflett at php.net (Chris Shiflett) Date: Tue, 10 Feb 2004 16:15:54 -0800 (PST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <41EE526EC2D3C74286415780D3BA9F877726F4@ehost011-1.exch011.intermedia.net> Message-ID: <20040211001554.66442.qmail@web14307.mail.yahoo.com> --- Hans Zaunere wrote: > Agreed... this is a very interesting subject. Heck, CMU isn't too > far... who's interested in contacting them to see if they'd take a trip > here? Good idea. I'll send an email, if you want. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From webmaster at localnotion.com Tue Feb 10 20:29:37 2004 From: webmaster at localnotion.com (Matthew Terenzio) Date: Tue, 10 Feb 2004 20:29:37 -0500 Subject: [nycphp-talk] Include file questions In-Reply-To: References: Message-ID: It's a yin-yang balance one must find when deciding on whether to include a file for re-use purposes, realizing that there will be a performance hit. Those are two things I think about. On Feb 10, 2004, at 9:57 AM, leam wrote: > Noob here again, wondering about include files. > > 1. Where is a good place to put them so that they are outside the > docroot yet centrally located for the apache/mysql/php instance? > > 2. Do you tend to have uniquely configured include files or just a few > for overall use? For example, if you had two different instances of > MySQL running, would you have seperate include files for the pages that > referenced each or would you use one with differnet variable names? > > 3. What are some things you usually use for include files? What are > some > things you*could* put in that you don't? > > Thanks! > > leam > -- > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From dmintz at davidmintz.org Tue Feb 10 20:51:57 2004 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 10 Feb 2004 20:51:57 -0500 (EST) Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <1076454852.7591.49.camel@bezel> References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> <011f01c3efab$f9401b40$6400a8c0@thinkpad> <4028C839.5000004@phpwerx.net> <1076454852.7591.49.camel@bezel> Message-ID: Fascinating. Initially I was thinking, oops, bad form, I shoulda googled before I asked "what's a Captcha." But WTF, this is too interesting. What a demented/delightful cat-and-mouse dynamic. On Tue, 10 Feb 2004, Joel De Gan wrote: > > what's a Captcha? > > Captcha is an image verification. > it is supposed to stop bots, but there are quite a few people who write > anti-captcha programs (I have had to do some for my work to get around > images) > Here is one I made for my email whitelist that is very effective in > keeping spam out of my inbox > http://lucifer.intercosmos.net/mail/ > > The source is on the main site for creating them in php. > > to get around them you can utilize a program called gocr > (gocr.sourceforge.net) which is a very easily trainable commandline > program that output the OCR chars from an image. You can get around > colors using imagemagik 'convert' and lines are easily removed be > converting an image to black and white, then placing into a > multi-dimensional array in php and identifying vertical and horizontal > lines and removing them. > > it is pretty easy, here are some functions for doing it. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From sklar at sklar.com Tue Feb 10 20:56:53 2004 From: sklar at sklar.com (David Sklar) Date: Tue, 10 Feb 2004 17:56:53 -0800 Subject: [nycphp-talk] Using PEAR? In-Reply-To: Message-ID: >> Since we're doing PEAR::DB this month, maybe next month is set for >> ADOdb? Maybe even a face off at the next meeting? :) > > Always being someone to volunteer another, David might be a good > referee for that match because he covers both PEAR DB and ADOdb in > his new book. > > I'm sure that he'd have already jumped in here, but he's out in > California speaking at the O'Reilly Emerging Technology Conference. :) I'd be happy to help out. I don't know if I would be the best ADOdb advocate but I could certainly keep things moving as a ref. I am indeed in San Diego now at the etech conference now. Lots of neat stuff and while not many of the talks involve PHP directly or explicitly, many of the random conversations I've had with people result in them telling me about the projects they're working on that use PHP. And, in an unrelated note/plug. The chapter in "Essential PHP Tools" about Mail talks a little bit about CAPTCHAs. David From jsiegel1 at optonline.net Tue Feb 10 22:35:38 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Tue, 10 Feb 2004 22:35:38 -0500 Subject: [nycphp-talk] Microsoft Warns of Widespread Windows Flaw Message-ID: <4029A30A.4080403@optonline.net> See: http://news.com.com/2100-7355_3-5156647.html === Jeff Siegel From jonbaer at jonbaer.net Wed Feb 11 00:25:10 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 11 Feb 2004 00:25:10 -0500 Subject: [nycphp-talk] browscap w/ wireless Message-ID: <002901c3f05f$6b6b4f60$6400a8c0@thinkpad> does anyone here use browscap capabilities (http://www.garykeith.com/browsers/downloads.asp) on their main index pages? im thinking of creating some simple dynamic hdml/wml pages for a site and want to split it using the same domain, ive done this before w/a rather complex java class but get_browser() seems pretty nice ... anyone use it for other things? session handling, ad serving, etc? - jon pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 From jonbaer at jonbaer.net Wed Feb 11 00:34:47 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 11 Feb 2004 00:34:47 -0500 Subject: [nycphp-talk] NEW PHundamentals Question References: <40283FAB.6080106@optonline.net><000f01c3ef80$28e8bea0$6400a8c0@thinkpad><402848CA.9020806@optonline.net><002001c3ef82$c851b210$6400a8c0@thinkpad> <40285007.3000402@optonline.net> Message-ID: <003d01c3f060$c38bedc0$6400a8c0@thinkpad> should have mentioned this, but the method to generate "priv_key" was: $priv_key = md5(uniqid(rand(), true)); which i find to be the best secure method ... - jon > Any reason to choose one over the other? > > Jeff > > jon baer wrote: > > > the last method was session hashing for the page to create a unique entry > > token and then hiding it ... > > > > From joel at tagword.com Wed Feb 11 00:43:32 2004 From: joel at tagword.com (Joel De Gan) Date: Wed, 11 Feb 2004 00:43:32 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> <011f01c3efab$f9401b40$6400a8c0@thinkpad> <4028C839.5000004@phpwerx.net> <1076454852.7591.49.camel@bezel> Message-ID: <1076478212.7609.67.camel@bezel> On Tue, 2004-02-10 at 20:51, David Mintz wrote: > Fascinating. Initially I was thinking, oops, bad form, I shoulda googled > before I asked "what's a Captcha." But WTF, this is too interesting. What > a demented/delightful cat-and-mouse dynamic. That is exactly what is going on. Everytime yahoo introduces a new captcha, someone releases a new "work-around" .. all the major sites are dealing with captcha work around programs. Small sites and personal sites are obviously not targets, but a 'good' captcha combined with email verification is a formidable foe. There are a lot of other ways around the captcha's and a lot of other ways to deal with them. Font captchas are super easy, training gocr to identify a new font only requires that you reload a page a few hundred times at most and then train gocr. (easy to get around those crazy fonts). Captcha's that use rotated text are the same, except that you re-rotate and pick the one that matches.. It sounds more difficult than it is.. etc.. etc.. There are also a lot of C programs that can identify points, you can have those programs output images of just the points and train gocr to work with those also. (the 'database' option in the newer gocr is what I am talking about). There are ones that have you pick three words from an image that has multiple words overlapping using alphablending. That has been broken with accuracy of 80%. The basic idea is, accuracy of greater than 0% allows bots in the door, they don't care, they can reload all day long. Some sites you just need to pull legit info, bank sites, advertising sites etc.. With sites like yahoo that are fighting automated spam-drops, any percentage is a huge issue.. Anyway, yea.. more info than you needed to know.. The whole dark underbelly of what captcha's are and why you would want to automate them and why people don't want them automated.. I just finished a project for bypassing one of our partners captchas so we could automate using curl to snag some pages we needed.. So you say "captcha?" and you got that... :) Cheers -Joel -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From jonbaer at jonbaer.net Wed Feb 11 01:02:13 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 11 Feb 2004 01:02:13 -0500 Subject: [nycphp-talk] NEW PHundamentals Question References: <20040210071932.40602.qmail@web14308.mail.yahoo.com><011f01c3efab$f9401b40$6400a8c0@thinkpad><4028C839.5000004@phpwerx.net><1076454852.7591.49.camel@bezel> <1076478212.7609.67.camel@bezel> Message-ID: <007b01c3f064$98308ba0$6400a8c0@thinkpad> is there any truth to the fact that e-voting systems are attempting to use captchas? does anyone know? ive come across a few articles that label captcha-like technology really being used as a legal (by law) type of digital signature, this would be interesting ... - jon ----- Original Message ----- From: "Joel De Gan" To: "NYPHP Talk" Sent: Wednesday, February 11, 2004 12:43 AM Subject: Re: [nycphp-talk] NEW PHundamentals Question > On Tue, 2004-02-10 at 20:51, David Mintz wrote: > > Fascinating. Initially I was thinking, oops, bad form, I shoulda googled > > before I asked "what's a Captcha." But WTF, this is too interesting. What > > a demented/delightful cat-and-mouse dynamic. > > That is exactly what is going on. From danielc at analysisandsolutions.com Wed Feb 11 03:04:11 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 11 Feb 2004 03:04:11 -0500 Subject: [nycphp-talk] please test PEAR DB 1.6.0RC6 Message-ID: <20040211080411.GB13226@panix.com> Hello Yet Again: Sorry to be crying wolf so many times over the past week, but another release of PEAR DB was made yesterday, 1.6.0RC6. The biggest improvement in this release is better mapping of error codes. Several DBMS's now properly report duplicate key constraint violations as DB_ERROR_CONSTRAINT. The DB_PORTABILITY_ERRORS portability option was added to ensure consistent codes between different database systems. Several bugs related to limitQuery() were found and quashed. tableInfo() was added for Informix and bugs fixed for InterBase. Plus, I eliminated bug I introduced in 1.6.0RC5 that caused 'undefined function' errors when lowercasing portability was off. Please download the package and test it out. File bug reports if stuff doesn't work or is unclear. Download: http://pear.php.net/get/DB Change Log: http://pear.php.net/package-changelog.php?package=DB Manual: http://pear.php.net/manual/en/package.database.php Report Bugs: http://pear.php.net/bugs/report.php?package=DB Home Page: http://pear.php.net/package/DB Oh, and if you like the new features, the tons of bug fixes, and/or the documentation improvements that have happened since 1.5.0RC2, share your happiness via my "Wishlist" page at http://www.analysisandsolutions.com/donate/donate.htm If you're curious why there have been so many release candidates, it's because the initial RC was pushed out ahead of schedule in order to get something into PHP 4.3.5RC2 so more people could test it. Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jonbaer at jonbaer.net Wed Feb 11 05:06:37 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 11 Feb 2004 05:06:37 -0500 Subject: [nycphp-talk] More natual language diff for php files/mods? Message-ID: <003a01c3f086$becb3c20$6400a8c0@thinkpad> i noticed in projects lately that the "mods" are coming in the form of something as such: --- BEFORE --- (3 lines of code) --- ADD --- (code) --- AFTER --- (3 lines of code) --- ADD --- (code) --- REPLACE --- (5 lines of code) --- WITH --- (code) some have plenty of mod changes so it looks automated, is there a tool for this? i mean a diff > patch < diff would do the same thing but it seems made for those people who just have to open a text editor + do the work themselves and looks cleaner ... - jon pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 From jsiegel1 at optonline.net Wed Feb 11 05:10:25 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Wed, 11 Feb 2004 05:10:25 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <003d01c3f060$c38bedc0$6400a8c0@thinkpad> References: <40283FAB.6080106@optonline.net> <000f01c3ef80$28e8bea0$6400a8c0@thinkpad> <402848CA.9020806@optonline.net> <002001c3ef82$c851b210$6400a8c0@thinkpad> <40285007.3000402@optonline.net> <003d01c3f060$c38bedc0$6400a8c0@thinkpad> Message-ID: <4029FF91.6070500@optonline.net> What do you do on the "receiving" end, so to speak, to verify that the key you receive is the one that you generated? Jeff jon baer wrote: > should have mentioned this, but the method to generate "priv_key" was: > > $priv_key = md5(uniqid(rand(), true)); > > which i find to be the best secure method ... > > - jon > > >>Any reason to choose one over the other? >> >>Jeff >> >>jon baer wrote: >> >> >>>the last method was session hashing for the page to create a unique > > entry > >>>token and then hiding it ... >>> >>> > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From jonbaer at jonbaer.net Wed Feb 11 05:27:02 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 11 Feb 2004 05:27:02 -0500 Subject: [nycphp-talk] NEW PHundamentals Question References: <40283FAB.6080106@optonline.net><000f01c3ef80$28e8bea0$6400a8c0@thinkpad><402848CA.9020806@optonline.net><002001c3ef82$c851b210$6400a8c0@thinkpad><40285007.3000402@optonline.net><003d01c3f060$c38bedc0$6400a8c0@thinkpad> <4029FF91.6070500@optonline.net> Message-ID: <004601c3f089$98d99d10$6400a8c0@thinkpad> well it's stored w/ the session id so its compared ... i actually ended up using it in a publishing CMS for players on a hockey team that wanted to be interviewed and to rate other players, they would enter their email address + a key was generated w/ the link, and the table was something like: id int, session varchar(32), email varchar(50), priv_key varchar(32), completed tinyint(1) default 0 so there were some comparisons to make sure the player was the actual player taking the interview. - jon ----- Original Message ----- From: "Jeff Siegel" To: "NYPHP Talk" Sent: Wednesday, February 11, 2004 5:10 AM Subject: Re: [nycphp-talk] NEW PHundamentals Question > What do you do on the "receiving" end, so to speak, to verify that the > key you receive is the one that you generated? > > Jeff From jonbaer at jonbaer.net Wed Feb 11 05:37:16 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 11 Feb 2004 05:37:16 -0500 Subject: [nycphp-talk] using unpack in form reading Message-ID: <004e01c3f08b$0692f300$6400a8c0@thinkpad> i have not seen it but can unpack be used to prevent sql injections? i tend to have strict fixed length for my stuff and have noticed if i do an unpack on an incoming variable it seems safe: $id = array_shift(unpack("A2id", $_POST['id'])); is this overkill? - jon pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 From jsiegel1 at optonline.net Wed Feb 11 06:10:15 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Wed, 11 Feb 2004 06:10:15 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <004601c3f089$98d99d10$6400a8c0@thinkpad> References: <40283FAB.6080106@optonline.net> <000f01c3ef80$28e8bea0$6400a8c0@thinkpad> <402848CA.9020806@optonline.net> <002001c3ef82$c851b210$6400a8c0@thinkpad> <40285007.3000402@optonline.net> <003d01c3f060$c38bedc0$6400a8c0@thinkpad> <4029FF91.6070500@optonline.net> <004601c3f089$98d99d10$6400a8c0@thinkpad> Message-ID: <402A0D97.8020307@optonline.net> I figured you stored it but I didn't want to put words in your mouth. Jeff jon baer wrote: > well it's stored w/ the session id so its compared ... > > i actually ended up using it in a publishing CMS for players on a hockey > team that wanted to be interviewed and to rate other players, they would > enter their email address + a key was generated w/ the link, and the table > was something like: > > id int, session varchar(32), email varchar(50), priv_key varchar(32), > completed tinyint(1) default 0 > > so there were some comparisons to make sure the player was the actual player > taking the interview. > > - jon > > ----- Original Message ----- > From: "Jeff Siegel" > To: "NYPHP Talk" > Sent: Wednesday, February 11, 2004 5:10 AM > Subject: Re: [nycphp-talk] NEW PHundamentals Question > > > >>What do you do on the "receiving" end, so to speak, to verify that the >>key you receive is the one that you generated? >> >>Jeff > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > >From hans not junk at nyphp.com Wed Feb 11 08:23:31 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 4B62BA85E9 for ; Wed, 11 Feb 2004 08:23:31 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] browscap w/ wireless Date: Wed, 11 Feb 2004 05:23:14 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772805 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] browscap w/ wireless Thread-Index: AcPwX4LvcwQxYyHCTOKXJKPD4yZakgAQobkg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2004 13:23:31 -0000 > does anyone here use browscap capabilities > (http://www.garykeith.com/browsers/downloads.asp) on their=20 > main index pages? I use it to detect if someone has a recent version of = Mozilla/Netscape/IE. People download reports from the site, and if it's = 4.7 (which is still very common at the university) the reports don't = work correctly. Browsecap works very nicely, though. H >From hans not junk at nyphp.com Wed Feb 11 09:20:21 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 37203A85E9 for ; Wed, 11 Feb 2004 09:20:21 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] NEW PHundamentals Question Date: Wed, 11 Feb 2004 06:20:18 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772811 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] NEW PHundamentals Question Thread-Index: AcPwND2HsGW4yVHxSLqWt/XlZNM59gAdhOsA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2004 14:20:21 -0000 > > Agreed... this is a very interesting subject. Heck, CMU isn't too > > far... who's interested in contacting them to see if they'd take a trip > > here? >=20 > Good idea. I'll send an email, if you want. Great... fire one off and we'll see what happens. Thanks Chris, H From crisscott at netzero.com Wed Feb 11 09:49:04 2004 From: crisscott at netzero.com (Scott Mattocks) Date: Wed, 11 Feb 2004 09:49:04 -0500 Subject: [nycphp-talk] Q) learning php - drawing table border around em pty
appear immediately is quite addictive). My primary complaint with it is the overhead of the WYSIWYG stuff. I'd prefer to be able to disable them entirely. I generally use it as my blunt tool, esepecially when working on html / php pages, or on sites that designers use, as a lot of the designers I work with use it, and I can 'see it as they do'. When working with more code heavy projects, I tend to go to Zend, but that's more of a lesser of evils choice. The code completion and code analyzer is pretty good. It gives you help with your defined vars and such, which I'd like to see expanded to array elements. I really like their object explorer for digging through larger classes, although there is plenty of room in that end for features, especially with php 5 rearing it's head. I haven't been able to get the cvs to work yet, but that's most likely due to my own ignorance. I'm dying to get into the debugger as I've heard great things about it here and elsewhere (one day I will have that local dev server to do so). The Ftp support is pretty good, although seemingly buggy at times. Oh, and the projects thing is just bad. It could be a great resource to have a feature by feature comparison and multiple reviews of the tools we use. I know, I'm always looking for better tools to make my code filled days more pleasant. Mark From jonbaer at jonbaer.net Wed Feb 18 20:00:28 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 18 Feb 2004 20:00:28 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@thinkpad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <006001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.com> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <402BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03.8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.9060400@adnet-sys.com> <402BF493.2080603@phpwerx.net><402CEDBB.2090407@adnet-sys.com> <4033D76E.1050101@adnet-sys.com> Message-ID: <050b01c3f683$c4271470$6400a8c0@thinkpad> My opinion is that you have to look @ the project you have in front of you and decide on whether its even possible to perform in a procedural fashion, many of the OO tasks are really performed for having a "state" on objects, a good example is threading, you cant really tend to develop a server without some objects having a type of state that go off and do work on their own. Then again the real PHP catch for me was doing alot more with alot less. Like in Java do you really need like 5 classes to perform a DB query? Some things are a complete overload but they are neat and concise that you can understand them, to me thats what objects and OO programming really do is give you a well defined detail on how something works, I can give you a generic object and you can see how it works and throw it into your app no problem (like the concept w/ Beans - and the concept of an "interface") ... however in the end its really all the same, whether you need to learn 1000+ classes in Java or 1000+ built-in methods in PHP youre still doing the same thing. I think OO is a much cleaner way to program. When I first started PHP before the OO my eyeballs would pop out debugging something. ----- Original Message ----- From: "Phil Powell" To: "NYPHP Talk" Sent: Wednesday, February 18, 2004 4:21 PM Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? > I am now learning how to write PHP not necessarily as flat script but as > an OO construct, that is, classes, "abstract" classes, "interfaces", > Singleton Design Patterns, etc. and it's really helping me out a lot > toward understanding how to come close to implementing it in Java. > From adam at digitalpulp.com Wed Feb 18 22:07:14 2004 From: adam at digitalpulp.com (Adam Fields) Date: Wed, 18 Feb 2004 22:07:14 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: <200402190039.i1J0dPb29313@panix3.panix.com> References: <200402190039.i1J0dPb29313@panix3.panix.com> Message-ID: <40342862.908@digitalpulp.com> James Wetterau wrote: > "Chris Hubbard" says: > .. > >>procedural -> OO is pointless unless: >>1. it makes it easier to maintain the code >>2. it makes it easier to improve the code >>3. it makes it easier to debug the code >>4. it makes it easier to pick up girls >>5. it makes it easier to show off at the users group (see #5) > > > You missed the big supposed selling point for OO: > > 6. It makes it easier to reuse the code (whether in the same way as > originally intended or in a slightly different way than originally > intended, without having to substantially rewrite). > > That's one the main goals, anyway. OO is an abstraction layer, and it's a different way of looking at your code and what the component pieces are. When you use objects, you have some flexibility to work with and adapt your component pieces in ways that are less easy to do with a different abstraction model. The actual capabilities depend on the implementation of the object model. It's entirely possible to overlay a simple object model on a procedural language, and get some of the syntactic and organizational advantages, without some of the more complex patterns (which is what PHP's object model is). However, some of Java's huge advantages aren't in the object model at all, they're in the virtual machine model. PHP scripts execute essentially in a vacuum. In contrast, all Java code runs in the context of the virtual machine and can communicate in various ways together (and if you extend it enough, across different VMs) - this way of thinking is really really different from PHP scripting. It's better for some things, overkill for others. From jv_nyphp at duikerbok.com Wed Feb 18 22:46:36 2004 From: jv_nyphp at duikerbok.com (Jose Villegas) Date: Wed, 18 Feb 2004 22:46:36 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: <4033F370.7090306@next-online.net> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@think pad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <0 06001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.co m> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <40 2BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03 .8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.90604 00@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adn et-sys.com><4033D76E.1050101@adnet-sys.com> <4033DC8F.9070901@phpwerx.net> <.65.126.132.102.1077144669.squirrel@www.bpang.com> <4033F370.7090306@next-online.net> Message-ID: <379AD5AC-628E-11D8-A1E8-000A95D78076@duikerbok.com> I don't use classes in my code unless I see a real benefit. One benefit of putting your functions in a class is that it simplifies your namespace. For example, if you have a whole bunch of templating functions, you can create a class named "Templates" for them. A printing function would then be $templateObject->print() instead of templatePrint(). You have to be more careful about names clashing with the second approach as opposed to the first. A second benefit is the ability to reuse variables instead of having to pass them each time a function is called. Let's say you're going to do a number of operations on a specific record in a database table. You could create a class called DbRecord that takes the table name and a name/value pair to identify the record: $dbRecord = new DbRecord('color', 'blue', 'table_name'); You can then set up an update function to generate specific sql statements and send database queries. $dbRecord->update('material', 'suede'); This function would set up the SQL statement, 'UPDATE table_name SET material="suede" WHERE color="blue"'. Jose From brent at landover.com Thu Feb 19 08:39:22 2004 From: brent at landover.com (Brent Baisley) Date: Thu, 19 Feb 2004 08:39:22 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: <4033F370.7090306@next-online.net> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@think pad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <0 06001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.co m> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <40 2BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03 .8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.90604 00@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adn et-sys.com><4033D76E.1050101@adnet-sys.com> <4033DC8F.9070901@phpwerx.net> <.65.126.132.102.1077144669.squirrel@www.bpang.com> <4033F370.7090306@next-online.net> Message-ID: <06AB168A-62E1-11D8-974B-000A95CD828E@landover.com> I just want to thank you privately for your excellent response. After reading it, I almost feel like I've been through therapy. I've read a lot about OO programming, design patterns and conceptual stuff, but never sat down and gave OO programming my full effort. I feel I have a firm grasp on the concepts of OO, but every time I toyed around with it, it seemed more work than it should be, and certainly more work than procedural coding. "Almost all the documentation... complicates the issue." Now I feel I've been just overthinking things. I've been looking for the bright light and angelic music, when I should have been looking for the cold beer next to the keyboard. Many Thanks. On Feb 18, 2004, at 6:21 PM, Chris Hubbard wrote: > Heh. You sound like where I have been. I spent a bunch of time trying > to figure out OO, making myself crazy. Then it dawned on me that I > hadn't had a need that OO would solve. > Most of my code used functions. Most of my code used the same > functions. So I started moving the functions into an included file. > Then I had two files; one a bunch of functions, and then the code > file. Then I started organizing the functions into different included > files. So I had 6 or so possible files and one code file. Then it > dawned on me that I was creating the effect of OO. So I rewrote the > files that contained the functions, so each file became a single > class, with a collection of methods instead of a single file with a > collection of functions. (note, as far as I can tell there's no real > difference between a method and a function in php) I had to go > through and change some stuff, like using $this-> all over the place. > When I was done I had a bunch of different classes that were a bit > harder to use than the different include files. After grumbling for a > while, someone suggested creating a single error handling method that > all the methods within a class would use. So now each class has > integrated error handling (error reporting), instead of every method. > Then I could add in things like a timer, debugging information. > Refactoring the code across all the class-methods is easier than if > they're just functions. > So: > procedural -> OO is pointless unless: > 1. it makes it easier to maintain the code > 2. it makes it easier to improve the code > 3. it makes it easier to debug the code > 4. it makes it easier to pick up girls > 5. it makes it easier to show off at the users group (see #5) > > Almost all the documentation about OO complicates the issue. It's > really not that difficult. If you're not understanding it, it's not > because you're missing the OO bone/gene/hair. It's because whoever is > explaining it to you doesn't understand it well enough to explain. > > Relax, drink a beer. It's not that complex. If you're thinking hard > about OO, you're doing the wrong thinking. Save your hard thinking to > solve the problem. Once you've groked the problem the OO stuff will > flow easily. > > Where to start: take any single function and convert it to a class: > function print_array($array) > { > print_r($array); > } > > becomes > class print_array > { > function print_array($array) > { > print_r($array); > } > } > > Both produce the same output. > > Hopefully this is clear and helpful. Rather than obscure and annoying. > Chris > > > bpang at bpang.com wrote: > >> I've been "trying" to cross over, or at least start writing OO code, >> for a >> long time, but I never can seem to fully catch on. >> I am pretty sure I could identify many instances where my code would >> benefit from OO, and I've been told that my procedural code is >> written in >> OO format, just without the use of objects. >> >> This may be near impossible to answer, but, what would you say is the >> key >> to "grasp the concepts behind OO" and to put it to use? >> >> I suppose if I forced myself to use it, I would probably figure it >> out, >> and I always feel a little "learning-disabled" for not having picked >> it up >> yet, even after some tutorials, etc, but then Felix comes along and >> makes >> me feel better about it... >> >> Felix said: >> "For most simple web based stuff you will almost never need to code >> objects yourself." >> >> >> >> >> >>> I think it is more than possible, though personally I prefer PHP to >>> Java, and for anything web-related I would almost certainly use PHP >>> rather than Java, purely because it is so flexible and easy to use. >>> As >>> for crossing over into OO, just take things one step at a time, once >>> you >>> grasp the concepts behind OO you will see plenty of situations where >>> you >>> could use OO design methods. For example there are countless >>> situations >>> where you can encapsulate functionality into a generic object, then >>> use >>> inheritance to specialise that object for your particular needs. >>> >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk >> > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > -- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 From bpang at bpang.com Thu Feb 19 09:51:01 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Thu, 19 Feb 2004 09:51:01 -0500 (EST) Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: <4033F370.7090306@next-online.net> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@think pad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> < 0 06001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys. co m> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <40 2BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402B ED03 .8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2. 90604 00@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.20904 07@adn et-sys.com><4033D76E.1050101@adnet-sys.com><4033DC8F.9070901@ph pwerx.net><.65.126.132.102.1077144669.squirrel@www.bpang.com> <4033F370.7090306@next-online.net> Message-ID: <.65.126.132.102.1077202261.squirrel@www.bpang.com> Thanks to all for your helpful responses. Chris, I am exactly at that point where I have moved and separated (most) everything out to functions in included files. A lot of the stuff I have, I have been able to reuse across multiple sites. For example, a whole collection of database functions, such that I never actually call mysql_query directly in my code. Or another that builds select menus for me. When I have a chance, I will certainly try some of the suggestions that have been posted. Between all the responses, it's as though new light has been shed on the situation. :) Lastly, are there any performance gains with OO over proceedural? From phillip.powell at adnet-sys.com Thu Feb 19 09:59:50 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Thu, 19 Feb 2004 09:59:50 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@think pad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> < 0 06001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys. co m> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <40 2BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402B ED03 .8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2. 90604 00@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.20904 07@adn et-sys.com><4033D76E.1050101@adnet-sys.com><4033DC8F.9070901@ph pwerx.net><.65.126.132.102.1077144669.squirrel@www.bpang.com> <4033F370.7090306@next-online.net> <.65.126.132.102.1077202261.squirrel@www.bpang.com> Message-ID: <4034CF66.4020505@adnet-sys.com> I'm doing something similar to that in my PHP app structuring. I will have one front-end PHP script, an "index.php", that will require and include .inc.php files that contain classes as well as one .inc.php that contains my global variables and functions. Sort of a procedural - OO blend. It's honestly the best way for me to do app development that, well, works for me and ultimately... works. Phil bpang at bpang.com wrote: >Thanks to all for your helpful responses. > >Chris, I am exactly at that point where I have moved and separated (most) >everything out to functions in included files. > >A lot of the stuff I have, I have been able to reuse across multiple sites. >For example, a whole collection of database functions, such that I never >actually call mysql_query directly in my code. >Or another that builds select menus for me. > >When I have a chance, I will certainly try some of the suggestions that >have been posted. Between all the responses, it's as though new light has >been shed on the situation. > >:) > >Lastly, are there any performance gains with OO over proceedural? >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > > -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From ashaw at iifwp.org Thu Feb 19 10:04:03 2004 From: ashaw at iifwp.org (Allen Shaw) Date: Thu, 19 Feb 2004 10:04:03 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@think pad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <0 06001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.co m> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <40 2BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03 .8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.90604 00@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adn et-sys.com><4033D76E.1050101@adnet-sys.com><4033DC8F.9070901@phpwerx.net><.65.126.132.102.1077144669.squirrel@www.bpang.com> <4033F370.7090306@next-online.net> Message-ID: <002901c3f6f9$9d9abfc0$8201a8c0@iifwp.local> ZenOO. I just love this: > procedural -> OO is pointless unless: > 1. it makes it easier to maintain the code > 2. it makes it easier to improve the code > 3. it makes it easier to debug the code > 4. it makes it easier to pick up girls > 5. it makes it easier to show off at the users group (see #5) > > Almost all the documentation about OO complicates the issue. It's > really not that difficult. If you're not understanding it, it's not > because you're missing the OO bone/gene/hair. It's because whoever is > explaining it to you doesn't understand it well enough to explain. > > Relax, drink a beer. It's not that complex. If you're thinking hard > about OO, you're doing the wrong thinking. Save your hard thinking to > solve the problem. Once you've groked the problem the OO stuff will > flow easily. - Allen From nyphp at jimbishop.org Thu Feb 19 10:20:18 2004 From: nyphp at jimbishop.org (jim.bishop) Date: Thu, 19 Feb 2004 07:20:18 -0800 (PST) Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: References: Message-ID: emacs. emacs. emacs. i use it for everything: PHP, ASP, JSP, perl. From phillip.powell at adnet-sys.com Thu Feb 19 11:02:41 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Thu, 19 Feb 2004 11:02:41 -0500 Subject: [nycphp-talk] OO Inheritance concept and problem Message-ID: <4034DE21.4040807@adnet-sys.com> $val = ${$val}; $this->dbServer = $this->dbHost . ":" . $this->dbPort; } function connect() { // RESOURCE LINK (OR NULL) METHOD $dbcnx = @mysql_connect($this->dbServer, $this->dbUser, $this->dbPwd); if (!$dbcnx) { return false; } else { $dbselect = mysql_select_db($this->dbName, $dbcnx); } if (!$dbselect) { return false; } else { return $dbcnx; } } function close() { // BOOLEAN METHOD if (@!mysql_close($this->connect())) return false; return true; } } class MySQLQuery { /*------------------------------------------------------------------------------------------------------------------------------------ This legacy class will perform queries and return results if applicable, also free results and returns affected rows also if applicable --------------------------------------------------------------------------------------------------------------------------------------*/ var $sql; // SQL STRING PROPERTY var $mySQLConn; // MySQLQuery CLASS OBJECT RESOURCE LINK PROPERTY function MySQLQuery($sql, $mySQLConn) { // CONSTRUCTOR $this->sql = $sql; $this->mySQLConn = $mySQLConn; } //------------------------------------------ --* GETTER/SETTER METHODS *-- -------------------------------------- function getResult() { // ARRAY-OF-OBJECT METHOD $runquery = $this->runQuery(); $count = 0; while ($row = mysql_fetch_object($runquery)) { $result[$count] = $row; $count++; } return $result; } function getRows($what = 'select') { // ARRAY METHOD $runquery = $this->runQuery(); $count = 0; if (strcmp(strtolower($what), 'affected') == 0) { $row = @mysql_affected_rows($this->mySQLConn); } else { $row = @mysql_num_rows($this->mySQLConn); } return $row; } //-------------------------------------------- --* END OF GETTER/SETTER METHODS *-- ------------------------------ function freeResult() { // VOID METHOD @mysql_free_result($this->runQuery()); } function runQuery() { // RESULT RESOURCE LINK METHOD $result = @mysql_query($this->sql, $this->mySQLConn); if (mysql_errno()) trigger_error(mysql_error() . ' using query: ' . $this->sql, E_USER_ERROR); return $result; } } class MethodGeneratorForActionPerformer { var $isSuccessful = true; // BOOLEAN PROPERTY DETERMINING IF ACTION WAS SUCCESSFUL var $hasDuplicateUniqueKey = false; // BOOLEAN PROPERTY DETERMINING UNIQUENESS var $errorArray = array(); // ASSOCIATIVE ARRAY PROPERTY FIELD => ERROR MSG var $tableName; // DB TABLE NAME PROPERTY var $fileName; // FILE NAME PROPERTY var $dbConn; // DB CONNECTION OBJECT var $dbConnObj; // DB RESOURCE LINK OBJECT function MethodGeneratorForActionPerformer() {} // CONSTRUCTOR //----------------------------------------------------* GETTER/SETTER METHODS *-------------------------------------------------------------- function getDBConn() { // RESOURCE LINK METHOD return $this->dbConn; } } class DBActionPerformer extends MethodGeneratorForActionPerformer { var $id; function DBActionPerformer($id = '') { // CONSTRUCTOR $this->id = $id; } //---------------------------------------------* DB ACTION METHODS *---------------------------------------------- function connect() { // VOID METHOD global $dbHost, $dbPort, $dbUser, $dbPwd, $dbDefaultName, $action; $this->dbConnObj =& new dbConnection($dbHost, $dbPort, $dbUser, $dbPwd, $dbDefaultName); $this->dbConn = $this->dbConnObj->connect(); if (!$this->dbConn) { $this->isSuccessful = false; $this->setErrorArray(array($action => 'Could not connect to the database')); } } function disconnect() { // VOID METHOD if ($this->dbConn) $this->dbConnObj->close(); $this->dbConnObj = null; $this->dbConn = null; } } class ActionPerformer extends DBActionPerformer { function ActionPerformer($id = '') { // CONSTRUCTOR $this->id = $id; } function add_dept() { // VOID METHOD $this->connect(); $sql = "SELECT * FROM blah"; $query =& new MySQLQuery($sql, $this->getDBConn()); $result = $query->getResult(); $result = null; $sql = "INSERT INTO blah (name) VALUES ('foo')"; $query =& new MySQLQuery($sql, $this->getDBConn()); if (!$query->runQuery()) $this->setErrorArray(array($action => 'Could not perform insert')); $query = null; $this->disconnect(); } } $actionPerformer =& new ActionPerformer($id); $actionPerformer->add_dept(); $actionPerformer = null; ?> I built this chain of classes (which normally reside in different .inc.php files due to scope) to handle specific database connections and actions. However, I am noticing that were I to replace this line in ActionPerformer::add_dept(): $result = $query->getResult(); With: $result =& $query->getResult(); All subsequent instantiations of any MySQLQuery objects result in wacky parameter assignments. For example, were I to do a print_r after the second line of: $query =& new MySQLQuery($sql, $this->getDBConn()); The output becomes: mysqlquery Object ( [sql] => INSERT INTO blah (name) VALUES ('foo') [mySQLConn] => Resource id #19 ) That's totaly ok.. but if I use this line instead: $result =& $query->getResult(); and then do the same actions below this is what I get: mysqlquery Object ( [sql] => Resource id #19 [mySQLConn] => Resource id #19 ) So my question is this: When should I be using the reference pointer '&' for object instantiation and why? Based on what you see so far, hopefully you're able to figure this out. Thanx Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From chubbard at next-online.net Thu Feb 19 12:03:23 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Thu, 19 Feb 2004 09:03:23 -0800 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: <06AB168A-62E1-11D8-974B-000A95CD828E@landover.com> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@think pad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <0 06001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.co m> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <40 2BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03 .8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.90604 00@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adn et-sys.com><4033D76E.1050101@adnet-sys.com> <4033DC8F.9070901@phpwerx.net> <.65.126.132.102.1077144669.squirrel@www.bpang.com> <4033F370.7090306@next-online.net> <06AB168A-62E1-11D8-974B-000A95CD828E@landover.com> Message-ID: <4034EC5B.9080506@next-online.net> Brent, There's nothing wrong with bright light and angelic music, as long as you can have a beer too. My biggest complaint about the "technology" world is the great effort done by almost everyone to make things more obscure than they really are. My description of OO is necessarily simplified. When you've written a handful of classes you'll be ready for the next conceptual step. It's not a conceptual leap. But for now don't worry about it. After you've refactored a class a couple times you get that elusive bright light, and all these weird OO concepts will start naturally, effortlessly making sense. You'll get there, so enjoy the path, drink a beer, write some code. Chris Brent Baisley wrote: > I just want to thank you privately for your excellent response. After > reading it, I almost feel like I've been through therapy. I've read a > lot about OO programming, design patterns and conceptual stuff, but > never sat down and gave OO programming my full effort. I feel I have a > firm grasp on the concepts of OO, but every time I toyed around with > it, it seemed more work than it should be, and certainly more work > than procedural coding. > > "Almost all the documentation... complicates the issue." Now I feel > I've been just overthinking things. I've been looking for the bright > light and angelic music, when I should have been looking for the cold > beer next to the keyboard. > > Many Thanks. > > > On Feb 18, 2004, at 6:21 PM, Chris Hubbard wrote: > >> Heh. You sound like where I have been. I spent a bunch of time >> trying to figure out OO, making myself crazy. Then it dawned on me >> that I hadn't had a need that OO would solve. >> Most of my code used functions. Most of my code used the same >> functions. So I started moving the functions into an included file. >> Then I had two files; one a bunch of functions, and then the code >> file. Then I started organizing the functions into different included >> files. So I had 6 or so possible files and one code file. Then it >> dawned on me that I was creating the effect of OO. So I rewrote the >> files that contained the functions, so each file became a single >> class, with a collection of methods instead of a single file with a >> collection of functions. (note, as far as I can tell there's no real >> difference between a method and a function in php) I had to go >> through and change some stuff, like using $this-> all over the place. >> When I was done I had a bunch of different classes that were a bit >> harder to use than the different include files. After grumbling for >> a while, someone suggested creating a single error handling method >> that all the methods within a class would use. So now each class has >> integrated error handling (error reporting), instead of every method. >> Then I could add in things like a timer, debugging information. >> Refactoring the code across all the class-methods is easier than if >> they're just functions. >> So: >> procedural -> OO is pointless unless: >> 1. it makes it easier to maintain the code >> 2. it makes it easier to improve the code >> 3. it makes it easier to debug the code >> 4. it makes it easier to pick up girls >> 5. it makes it easier to show off at the users group (see #5) >> >> Almost all the documentation about OO complicates the issue. It's >> really not that difficult. If you're not understanding it, it's not >> because you're missing the OO bone/gene/hair. It's because whoever >> is explaining it to you doesn't understand it well enough to explain. >> >> Relax, drink a beer. It's not that complex. If you're thinking hard >> about OO, you're doing the wrong thinking. Save your hard thinking >> to solve the problem. Once you've groked the problem the OO stuff >> will flow easily. >> >> Where to start: take any single function and convert it to a class: >> function print_array($array) >> { >> print_r($array); >> } >> >> becomes >> class print_array >> { >> function print_array($array) >> { >> print_r($array); >> } >> } >> >> Both produce the same output. >> >> Hopefully this is clear and helpful. Rather than obscure and annoying. >> Chris >> >> >> bpang at bpang.com wrote: >> >>> I've been "trying" to cross over, or at least start writing OO code, >>> for a >>> long time, but I never can seem to fully catch on. >>> I am pretty sure I could identify many instances where my code would >>> benefit from OO, and I've been told that my procedural code is >>> written in >>> OO format, just without the use of objects. >>> >>> This may be near impossible to answer, but, what would you say is >>> the key >>> to "grasp the concepts behind OO" and to put it to use? >>> >>> I suppose if I forced myself to use it, I would probably figure it out, >>> and I always feel a little "learning-disabled" for not having picked >>> it up >>> yet, even after some tutorials, etc, but then Felix comes along and >>> makes >>> me feel better about it... >>> >>> Felix said: >>> "For most simple web based stuff you will almost never need to code >>> objects yourself." >>> >>> >>> >>> >>> >>>> I think it is more than possible, though personally I prefer PHP to >>>> Java, and for anything web-related I would almost certainly use PHP >>>> rather than Java, purely because it is so flexible and easy to >>>> use. As >>>> for crossing over into OO, just take things one step at a time, >>>> once you >>>> grasp the concepts behind OO you will see plenty of situations >>>> where you >>>> could use OO design methods. For example there are countless >>>> situations >>>> where you can encapsulate functionality into a generic object, then >>>> use >>>> inheritance to specialise that object for your particular needs. >>>> >>> >>> _______________________________________________ >>> talk mailing list >>> talk at lists.nyphp.org >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk >> >> From lists at prusak.com Thu Feb 19 12:09:40 2004 From: lists at prusak.com (Ophir Prusak) Date: Thu, 19 Feb 2004 12:09:40 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: <40342862.908@digitalpulp.com> References: <200402190039.i1J0dPb29313@panix3.panix.com> <40342862.908@digitalpulp.com> Message-ID: <4034EDD4.7090103@prusak.com> Just wanted to throw in my 0.02 as well, Adam makes some excellent points. The subject of this thread says Java/OO but we really need to separate the two. 1. Java programming (and jsp pages for the sake of comparing to PHP) 2. OO programming. Obviously there is overlap here, but as Adam pointed out, Java's JVM has nothing to do with OO per se. I've done both OO and non OO PHP and have done some Java as well. 1. Pick the right tool for the job. I know this is a cliche, but there is no one solution fits all in programming. This also depends a lot on what you're comfortable with. 2. Think about the goals, not the means. You can get most of the main advantages of doing OO even in non OO code if you plan it correctly and use functions and naming conventions correctly. Doing it OO "pushes" you to design your code in a certain way, but you can accomplish the same goals without OO. You should always strive to write code that is: - reusable - maintainable - expandable - debug-able - separation of business logic and presentation - etc Ophir Adam Fields wrote: > James Wetterau wrote: > >> "Chris Hubbard" says: >> .. >> >>> procedural -> OO is pointless unless: >>> 1. it makes it easier to maintain the code >>> 2. it makes it easier to improve the code >>> 3. it makes it easier to debug the code >>> 4. it makes it easier to pick up girls >>> 5. it makes it easier to show off at the users group (see #5) >> >> >> >> You missed the big supposed selling point for OO: >> >> 6. It makes it easier to reuse the code (whether in the same way as >> originally intended or in a slightly different way than originally >> intended, without having to substantially rewrite). >> >> That's one the main goals, anyway. > > > OO is an abstraction layer, and it's a different way of looking at > your code and what the component pieces are. When you use objects, you > have some flexibility to work with and adapt your component pieces in > ways that are less easy to do with a different abstraction model. The > actual capabilities depend on the implementation of the object model. > It's entirely possible to overlay a simple object model on a > procedural language, and get some of the syntactic and organizational > advantages, without some of the more complex patterns (which is what > PHP's object model is). > > However, some of Java's huge advantages aren't in the object model at > all, they're in the virtual machine model. PHP scripts execute > essentially in a vacuum. In contrast, all Java code runs in the > context of the virtual machine and can communicate in various ways > together (and if you extend it enough, across different VMs) - this > way of thinking is really really different from PHP scripting. It's > better for some things, overkill for others. > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From rinaudom at tiscali.it Thu Feb 19 13:09:48 2004 From: rinaudom at tiscali.it (rinaudom at tiscali.it) Date: Thu, 19 Feb 2004 19:09:48 +0100 (CET) Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: References: Message-ID: I'm a Linux guy. I use Emacs with PHP mode and Quanta for the daily work. I have also used vi(m) and mcedit for a long time. I have tried Zend studio and Active State's Komodo, but I find them very slow, although they are great IDEs. I use BBEdit on MACs. Matteo Rinaudo From phillip.powell at adnet-sys.com Thu Feb 19 15:20:33 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Thu, 19 Feb 2004 15:20:33 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? References: <200402190039.i1J0dPb29313@panix3.panix.com> <40342862.908@digitalpulp.com> <4034EDD4.7090103@prusak.com> Message-ID: <40351A91.2040807@adnet-sys.com> This might be "blasphemy" in the Java camp, but for me PHP is helping me understand how Java-structured OO works out and helps me in my simple Java coding as well, though complex Java-related stuff is beyond me. At this point so is some PHP-related stuff too, like how on earth do you do this and not break: ||DELETE"; echo "$html"; // should give you the wrong link will break in PHP but if you do '$deptName' will break in Javascript - damned-if-you-do-damned-if-you-don't client-server riddle|| Ophir Prusak wrote: > > Just wanted to throw in my 0.02 as well, > > Adam makes some excellent points. > The subject of this thread says Java/OO but we really need to separate > the two. > 1. Java programming (and jsp pages for the sake of comparing to PHP) > 2. OO programming. > Obviously there is overlap here, but as Adam pointed out, Java's JVM > has nothing to do with OO per se. > > I've done both OO and non OO PHP and have done some Java as well. > > 1. Pick the right tool for the job. > I know this is a cliche, but there is no one solution fits all in > programming. > This also depends a lot on what you're comfortable with. > > 2. Think about the goals, not the means. > You can get most of the main advantages of doing OO even in non OO > code if you plan it correctly and use functions and naming conventions > correctly. Doing it OO "pushes" you to design your code in a certain > way, but you can accomplish the same goals without OO. > You should always strive to write code that is: > - reusable > - maintainable > - expandable > - debug-able > - separation of business logic and presentation > - etc > > Ophir > > Adam Fields wrote: > >> James Wetterau wrote: >> >>> "Chris Hubbard" says: >>> .. >>> >>>> procedural -> OO is pointless unless: >>>> 1. it makes it easier to maintain the code >>>> 2. it makes it easier to improve the code >>>> 3. it makes it easier to debug the code >>>> 4. it makes it easier to pick up girls >>>> 5. it makes it easier to show off at the users group (see #5) >>> >>> >>> >>> >>> You missed the big supposed selling point for OO: >>> >>> 6. It makes it easier to reuse the code (whether in the same way as >>> originally intended or in a slightly different way than originally >>> intended, without having to substantially rewrite). >>> >>> That's one the main goals, anyway. >> >> >> >> OO is an abstraction layer, and it's a different way of looking at >> your code and what the component pieces are. When you use objects, >> you have some flexibility to work with and adapt your component >> pieces in ways that are less easy to do with a different abstraction >> model. The actual capabilities depend on the implementation of the >> object model. It's entirely possible to overlay a simple object model >> on a procedural language, and get some of the syntactic and >> organizational advantages, without some of the more complex patterns >> (which is what PHP's object model is). >> >> However, some of Java's huge advantages aren't in the object model at >> all, they're in the virtual machine model. PHP scripts execute >> essentially in a vacuum. In contrast, all Java code runs in the >> context of the virtual machine and can communicate in various ways >> together (and if you extend it enough, across different VMs) - this >> way of thinking is really really different from PHP scripting. It's >> better for some things, overkill for others. >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude -------------- next part -------------- An HTML attachment was scrubbed... URL: From phillip.powell at adnet-sys.com Thu Feb 19 15:55:16 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Thu, 19 Feb 2004 15:55:16 -0500 Subject: [nycphp-talk] I need a very elementary-school explanation of '&' Message-ID: <403522B4.1050303@adnet-sys.com> $obj =& new Object(); $result =& $obj->getResult(); as opposed to $obj =& new Object(); $result = $obj->getResult(); Could someone please explain this to me in a very, VERY simple not-had-my-beer-yet way? Readings at www.zend.com and www.php.net were fruitless, they might as well have been in Hungarian. Sorry but this is a serious hindrance in my further PHP development because I always thought that by doing this you are saving memory: $result =& $obj->getResult(); That means $result points the same value in memory as $obj->getResult(); thereby saving memory allocation and performance. How off is that? Thanx Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From Cbielanski at inta.org Thu Feb 19 16:13:08 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Thu, 19 Feb 2004 16:13:08 -0500 Subject: [nycphp-talk] I need a very elementary-school explanation of ' &' Message-ID: My quick and dirty answer is "don't worry that much about optimization for space unless you a) know you must and b) have working code to optimize" :) so if you read Passing By Reference and related information, it goes like this: Pass By Value is assumed unless you use & in the assignment such as "=&" or "function &foo(){return &foo}" Pass by Value is essentially copying all the apples from the apple cart, leaving you with a cart full of apples, and the original cart full. Pass by Reference (using &) makes a copy of the apple cart. That means that if the original apple cart is unset, cleaned up, or changed, then your apple cart *should* undergo the same rigor. Pass By Reference is sometimes called "pass by handle" because the words "Reference" and "Handle" are pretty synonymous to most people. your snippets: > $obj =& new Object(); // this is a new Object, looks ok! > $result =& $obj->getResult(); // this provides you with the HANDLE to the variable returned in getResult() If &obj goes away, $result will probably react unfavorably, because $obj is responsible for all of its members, and $result is actually an "alias" of whatever getResult() kicks out. > > as opposed to > > $obj =& new Object(); > $result = $obj->getResult(); Simply, now anything can happen to $obj and $result will not change because of it - you received the VALUE (not the HANDLE or REFERENCE) of the variable kicked out by getResult() HTH ~Chris > -----Original Message----- > From: Phil Powell [mailto:phillip.powell at adnet-sys.com] > Sent: Thursday, February 19, 2004 3:55 PM > To: NYPHP Talk > Subject: [nycphp-talk] I need a very elementary-school > explanation of '&' > > > $obj =& new Object(); > $result =& $obj->getResult(); > > as opposed to > > $obj =& new Object(); > $result = $obj->getResult(); > > Could someone please explain this to me in a very, VERY simple > not-had-my-beer-yet way? Readings at www.zend.com and www.php.net were fruitless, they might as well have been in Hungarian. Sorry but this is a serious hindrance in my further PHP development because I always thought that by doing this you are saving memory: $result =& $obj->getResult(); That means $result points the same value in memory as $obj->getResult(); thereby saving memory allocation and performance. How off is that? Thanx Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From dmintz at davidmintz.org Thu Feb 19 16:45:07 2004 From: dmintz at davidmintz.org (David Mintz) Date: Thu, 19 Feb 2004 16:45:07 -0500 (EST) Subject: [nycphp-talk] I need a very elementary-school explanation of ' &' In-Reply-To: References: Message-ID: ......however -- and correct me if I'm mistaken here -- because of PHP's copy-on-write behavior, you don't save any memory by passing or returning by reference unless you change the data. Another reason not to worry about it in many cases. Further -- again, pls correct me if I'm wrong, as I'm just the bat boy among the heavy hitters here -- PHP5 will pass/assign objects by reference *by default*, so you have to clone off a copy if you *don't* want that. The =& notation will become superfluous. HTH --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From adam at trachtenberg.com Thu Feb 19 16:50:11 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Thu, 19 Feb 2004 16:50:11 -0500 (EST) Subject: [nycphp-talk] I need a very elementary-school explanation of ' &' In-Reply-To: References: Message-ID: On Thu, 19 Feb 2004, David Mintz wrote: > Further -- again, pls correct me if I'm wrong, as I'm just the bat boy > among the heavy hitters here -- PHP5 will pass/assign objects by reference > *by default*, so you have to clone off a copy if you *don't* want that. > The =& notation will become superfluous. This is correct. In PHP 5, objects are passed and assigned by reference and you need to use the clone operator to duplicate them. $original = new van_gogh_painting; $knock_off = clone $original; You can control the cloning process by defining a __clone() method inside the class; otherwise, you just get regular copy of all the object properties. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From phillip.powell at adnet-sys.com Thu Feb 19 17:26:24 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Thu, 19 Feb 2004 17:26:24 -0500 Subject: [nycphp-talk] I need a very elementary-school explanation of ' &' References: Message-ID: <40353810.7010300@adnet-sys.com> Well, so as long as I do not have to change my code as I have always used "$obj =& new Object()" as my assignment operation of choice to assign by reference (using PHP 4.3.2 here) Phil Adam Maccabee Trachtenberg wrote: >On Thu, 19 Feb 2004, David Mintz wrote: > > > >>Further -- again, pls correct me if I'm wrong, as I'm just the bat boy >>among the heavy hitters here -- PHP5 will pass/assign objects by reference >>*by default*, so you have to clone off a copy if you *don't* want that. >>The =& notation will become superfluous. >> >> > >This is correct. In PHP 5, objects are passed and assigned by >reference and you need to use the clone operator to duplicate them. > >$original = new van_gogh_painting; >$knock_off = clone $original; > >You can control the cloning process by defining a __clone() method >inside the class; otherwise, you just get regular copy of all the >object properties. > >-adam > > > -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From nyphp at karin-net.info Thu Feb 19 17:49:51 2004 From: nyphp at karin-net.info (nyphp at karin-net.info) Date: Thu, 19 Feb 2004 23:49:51 +0100 Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: References: Message-ID: <59796425.20040219234951@karin-net.info> I thought this topic was a nice dive in for me to introduce myself to the list. I just joined yesterday. My short intro: I'm a PHP hobbyist turned freelancer and student at university in the netherlands. First PHP experience in 2000 for a databases class, after that a lot of hobbying and since about a year PHPing 'professionaly'. I am not too well founded in the more advanced PHP topics but eager to learn all I can and am hoping to make PHP programming my (main) source of income in the near future. My IDE (I am a windows user for the time being at least, you'll have to forgive me)? I started out with UltraEdit with a favorite syntax highlighting and recently have started using PHPEdit. I really like PHPEdit though I must admit it's the first real (PHP) IDE I've used and there are certain things I still use UltraEdit for, such as things that require column mode (i.e. quick adaptions, like when I am porting from phpBB's template system to patTemplate). And when I need to make a fast change to a file on a remote server, since PHPEdit doesn't have FTP support (though I have a peeve with UltraEdit's FTP support not keeping connections alive and opening a new connection for all files you save with save all even when all say 5 files are from the same server, big pain when the server has a slow FTP login process). Anyway, that's my ramblings, I hope to learn and perhaps even contribute some in this list. Best regards, Karin van den Berg http://www.freelancephp.nl/index.php?language=english From bpang at bpang.com Thu Feb 19 21:26:24 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Thu, 19 Feb 2004 21:26:24 -0500 (EST) Subject: [nycphp-talk] chmod - sticky bits on dirs Message-ID: <.38.117.145.89.1077243984.squirrel@www.bpang.com> Can someone help me remember how to do this with chmod? I have a directory in which I want all files or sub-directories (existing and newly created/added) to be rwx by any member of the group which owns the directory. I thought it was something like chmod g+s but that doesn't seem to be doing it right... thanks From jlacey at att.net Thu Feb 19 21:34:40 2004 From: jlacey at att.net (John Lacey) Date: Thu, 19 Feb 2004 19:34:40 -0700 Subject: [nycphp-talk] chmod - sticky bits on dirs In-Reply-To: <.38.117.145.89.1077243984.squirrel@www.bpang.com> References: <.38.117.145.89.1077243984.squirrel@www.bpang.com> Message-ID: <40357240.9060303@att.net> bpang at bpang.com wrote: > Can someone help me remember how to do this with chmod? > > I have a directory in which I want all files or sub-directories (existing > and newly created/added) to be rwx by any member of the group which owns > the directory. > > I thought it was something like > chmod g+s > but that doesn't seem to be doing it right... try chmod -R 1777 but try it on a test tree first :) John From jlacey at att.net Thu Feb 19 22:00:26 2004 From: jlacey at att.net (John Lacey) Date: Thu, 19 Feb 2004 20:00:26 -0700 Subject: [nycphp-talk] interesting AMP tidbit on Groklaw Message-ID: <4035784A.6080504@att.net> ran across an interesting one on Groklaw just now... ..."I used Linux on a USAF project during the Kosovo conflict. We pulled the prototype out of my lab and wired a variety of locations throughout Italy with Samba data servers and Perl coded robots that surfed for data and cataloged it directly into MySQL databases. The databases were accessible via apache and PHP. We were credited with helping to save the life of a downed pilot because all the critical information was immediately available to commanders and the Special Ops team in their helicopters doing the extraction. One of the downed pilots was a commander we had met while wiring his intel shop a week before he was shot down...." full story here: http://www.groklaw.net/article.php?story=20040216213026637 enjoy, John From csnyder at chxo.com Thu Feb 19 22:37:33 2004 From: csnyder at chxo.com (Chris Snyder) Date: Thu, 19 Feb 2004 22:37:33 -0500 Subject: [nycphp-talk] chmod - sticky bits on dirs In-Reply-To: <40357240.9060303@att.net> References: <.38.117.145.89.1077243984.squirrel@www.bpang.com> <40357240.9060303@att.net> Message-ID: <403580FD.8060102@chxo.com> John Lacey wrote: > bpang at bpang.com wrote: > >> I have a directory in which I want all files or sub-directories >> (existing >> and newly created/added) to be rwx by any member of the group which owns >> the directory. > > > try chmod -R 1777 Hmmm, on BSD anyway, the sticky bit on directories causes them to be append only, restricting the deletion of files by anyone but their owners (and the owner of the directory). What I don't know how to do is just the opposite: some way to create a directory that would cause all files added to it, by any user, to automatically be group-writeable. (That is, not relying on the user to chmod 775 the files they add.) From bpang at bpang.com Thu Feb 19 23:14:32 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Thu, 19 Feb 2004 23:14:32 -0500 (EST) Subject: [nycphp-talk] chmod - sticky bits on dirs In-Reply-To: <403580FD.8060102@chxo.com> References: <.38.117.145.89.1077243984.squirrel@www.bpang.com><40357240.9060303@at t.net> <403580FD.8060102@chxo.com> Message-ID: <.38.117.145.89.1077250472.squirrel@www.bpang.com> http://geodsoft.com/howto/harden/groups.htm This site recommends changing the umask of the group users (about 3/5 of the way down the article) in addition to setting the GUID bit for the dir with chmod g+s "By setting the user's umask to 002 rather than the more standard 022, files they create will be group writable. If the user's primary group is a unique group that matches their user ID, then umasks of 022 and 002 are functionally identical, except in directories that are GUID. In these directories newly created files will be owner and group writable and world readable. In other directories, the files will still be group writable but since there are no other members of the group, they will effectively be only owner writable and group and world readable." Thoughts anyone? I tested and it does do the trick. > John Lacey wrote: > >> bpang at bpang.com wrote: >> >>> I have a directory in which I want all files or sub-directories >>> (existing >>> and newly created/added) to be rwx by any member of the group which >>> owns >>> the directory. >> >> >> try chmod -R 1777 > > > Hmmm, on BSD anyway, the sticky bit on directories causes them to be > append only, restricting the deletion of files by anyone but their > owners (and the owner of the directory). > > What I don't know how to do is just the opposite: some way to create a > directory that would cause all files added to it, by any user, to > automatically be group-writeable. (That is, not relying on the user to > chmod 775 the files they add.) > From phillip.powell at adnet-sys.com Fri Feb 20 10:10:10 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 20 Feb 2004 10:10:10 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help Message-ID: <40362352.5090207@adnet-sys.com> Taken from http://www-css.fnal.gov/dsg/external/freeware/mysql-vs-pgsql.html Triggers: MySQL: No triggers supported now and won't be added in the future. Oracle8:In PL/SQL. Possibility of writing triggers reacting on the events: BEFORE/AFTER DELETE/UPDATE/INSERT. INSTEAD OF triggers can be used for updating data through views. PostgreSQL: Declarative rules - extension to SQL. You can specify SELECT, INSERT, DELETE or UPDATE as a rule event. INSTEAD OF rules can be used for updating data through views. Procedural triggers in PL/PGSQL, PL/TCL, PL/Perl, C. CREATE CONSTRAINT TRIGGER creates a trigger to support a constraint. You can specify BEFORE or AFTER on INSERT, DELETE or UPDATE as a trigger event. I am having to create a cascade delete effect on table "department" that is configured in the following fashion: -- TABLE CONTAINING DEPARTMENTS FOR PERSONS create table if not exists department ( id int not null auto_increment, primary key (id), department_name varchar(50) not null, department_parent_id int, unique_key varchar(20) not null, record_entered datetime ); department_parent_id is a "foreign key constraint" (table is MyISAM thus no actual foreign key) set up to be recursively referring to another record (if not null) in the table. I am having to delete a department; if I do so, I would naturally have to delete all child records associated with the department. Best approach would be to do a "cascade delete" variation (deleting all child records first and then parent row), however, only MaxDB seems to support that (see http://www.mysql.com/documentation/maxdb/94/c38409c20611d5993d00508b6b8b11/content.htm and http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html ), however, that seems to be not possible since my tables are MyISAM by default. Therefore, I am offered the possibility of a trigger. However, the beforementioned article indicates triggers aren't supported in MySQL. What would then be your best recommendation, based upon the need and the schema, for me to ensure that all related records are deleted? I would prefer not to have to write a PHP script to have to do so, but is that all I'm stuck with? Thanx Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From phillip.powell at adnet-sys.com Fri Feb 20 10:13:19 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 20 Feb 2004 10:13:19 -0500 Subject: [nycphp-talk] I need a very elementary-school explanation of ' &' References: Message-ID: <4036240F.7000108@adnet-sys.com> Adam Maccabee Trachtenberg wrote: >On Thu, 19 Feb 2004, David Mintz wrote: > > > >>Further -- again, pls correct me if I'm wrong, as I'm just the bat boy >>among the heavy hitters here -- PHP5 will pass/assign objects by reference >>*by default*, so you have to clone off a copy if you *don't* want that. >>The =& notation will become superfluous. >> >> > >This is correct. In PHP 5, objects are passed and assigned by >reference and you need to use the clone operator to duplicate them. > >$original = new van_gogh_painting; >$knock_off = clone $original; > >You can control the cloning process by defining a __clone() method >inside the class; otherwise, you just get regular copy of all the >object properties. > >-adam > > > By the way am I offbase by also assuming that in PHP version 5 I would be ensuring that if an object is to be a Singleton, I would have to "turn off" cloning: public function __clone() { trigger_error("Cloning of this object is not supported", E_USER_ERROR); } Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From dmintz at davidmintz.org Fri Feb 20 10:22:04 2004 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 20 Feb 2004 10:22:04 -0500 (EST) Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help In-Reply-To: <40362352.5090207@adnet-sys.com> References: <40362352.5090207@adnet-sys.com> Message-ID: MyIsam doesn't support foreign key constraints but InnoDB does. If you use InnoDB tables you can have cascading deletes. Alternatively, tho you said you want to avoid it, you can do it yourself in the middle tier (PHP) -- it ain't that hard. See, e.g., "MySQL" by Paul DuBois, 2nd edition. On Fri, 20 Feb 2004, Phil Powell wrote: > I am having to create a cascade delete effect on table "department" that > is configured in the following fashion: > > I am having to delete a department; if I do so, I would naturally have > to delete all child records associated with the department. > Best approach would be to do a "cascade delete" variation (deleting all > child records first and then parent row), however, only > MaxDB seems to support that (see > http://www.mysql.com/documentation/maxdb/94/c38409c20611d5993d00508b6b8b11/content.htm > and > http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html ), > however, that seems to be not possible since my tables are MyISAM > by default. Therefore, I am offered the possibility of a trigger. > However, the beforementioned article indicates triggers > aren't supported in MySQL. > > What would then be your best recommendation, based upon the need and the > schema, for me to ensure that all related records are > deleted? I would prefer not to have to write a PHP script to have to do > so, but is that all I'm stuck with? --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From phillip.powell at adnet-sys.com Fri Feb 20 10:33:31 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 20 Feb 2004 10:33:31 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help References: <40362352.5090207@adnet-sys.com> Message-ID: <403628CB.1000803@adnet-sys.com> David Mintz wrote: >MyIsam doesn't support foreign key constraints but InnoDB does. If you use >InnoDB tables you can have cascading deletes. > >Alternatively, tho you said you want to avoid it, you can do it yourself >in the middle tier (PHP) -- it ain't that hard. > >See, e.g., "MySQL" by Paul DuBois, 2nd edition. > > > I know I can't use foreign key constraints; my tables are MyISAM tables. I was hoping for a back-end script (in TCL which I know natively) that would mimic the behavior of a cascade function, that way it is not being done in the middle-tier and perhaps might be a performance-saving option. Phil >On Fri, 20 Feb 2004, Phil Powell wrote: > > >>I am having to create a cascade delete effect on table "department" that >>is configured in the following fashion: >> >>I am having to delete a department; if I do so, I would naturally have >>to delete all child records associated with the department. >>Best approach would be to do a "cascade delete" variation (deleting all >>child records first and then parent row), however, only >>MaxDB seems to support that (see >>http://www.mysql.com/documentation/maxdb/94/c38409c20611d5993d00508b6b8b11/content.htm >>and >>http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html ), >>however, that seems to be not possible since my tables are MyISAM >>by default. Therefore, I am offered the possibility of a trigger. >>However, the beforementioned article indicates triggers >>aren't supported in MySQL. >> >>What would then be your best recommendation, based upon the need and the >>schema, for me to ensure that all related records are >>deleted? I would prefer not to have to write a PHP script to have to do >>so, but is that all I'm stuck with? >> >> > > >--- >David Mintz >http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > > -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From dcech at phpwerx.net Fri Feb 20 11:08:54 2004 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 20 Feb 2004 11:08:54 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help In-Reply-To: <40362352.5090207@adnet-sys.com> References: <40362352.5090207@adnet-sys.com> Message-ID: <40363116.6060905@phpwerx.net> Phil Powell wrote: > I am having to create a cascade delete effect on table "department" that > is configured in the following fashion: > > -- TABLE CONTAINING DEPARTMENTS FOR PERSONS > create table if not exists department ( > id int not null auto_increment, > primary key (id), > department_name varchar(50) not null, > department_parent_id int, > unique_key varchar(20) not null, > record_entered datetime > ); > > department_parent_id is a "foreign key constraint" (table is MyISAM thus > no actual foreign key) set up to be recursively > referring to another record (if not null) in the table. > > I am having to delete a department; if I do so, I would naturally have > to delete all child records associated with the department. snip > What would then be your best recommendation, based upon the need and the > schema, for me to ensure that all related records are > deleted? I would prefer not to have to write a PHP script to have to do > so, but is that all I'm stuck with? My recommendation is to look at using a more powerful structure to represent the relationship between your departments. Specifically I would recommend Joe Celko's Nested Sets or a variation thereof. You can find a lot of information in the archives of this list and the nyphp-dev list, and also plenty of resources on the net. A good place to start would be: This approach has many advantages, and would allow you to accomplish this type of delete quite efficiently, as well as offering additional ways to work with the data, such as a one-query answer to the problem of retrieving all ancestor or descendant departments. Dan From dmintz at davidmintz.org Fri Feb 20 11:34:58 2004 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 20 Feb 2004 11:34:58 -0500 (EST) Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help In-Reply-To: <40363116.6060905@phpwerx.net> References: <40362352.5090207@adnet-sys.com> <40363116.6060905@phpwerx.net> Message-ID: On Fri, 20 Feb 2004, Dan Cech wrote: > > You can find a lot of information in the archives of this list and the > nyphp-dev list, and also plenty of resources on the net. A good place to > start would be: > > Interesting! I'll let you know what I think as soon as I get done imagining a little worm crawling counter-clockwise along the tree. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From dcech at phpwerx.net Fri Feb 20 11:46:50 2004 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 20 Feb 2004 11:46:50 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help In-Reply-To: References: <40362352.5090207@adnet-sys.com> <40363116.6060905@phpwerx.net> Message-ID: <403639FA.5050401@phpwerx.net> David Mintz wrote: > On Fri, 20 Feb 2004, Dan Cech wrote: > >>You can find a lot of information in the archives of this list and the >>nyphp-dev list, and also plenty of resources on the net. A good place to >>start would be: >> >> > > Interesting! I'll let you know what I think as soon as I get done > imagining a little worm crawling counter-clockwise along the tree. Hehe, getting your head around the concept can be an 'interesting' experience, but the system can be very powerful indeed. Personally I use a variation which retains the parent_id field, allowing easy retrieval of direct parents and children, and also the ability to rebuild trees should they become severely monged. The biggest project I've applied this to has been phpGACL (), approximately doubling the speed of the program. Dan From danielc at analysisandsolutions.com Fri Feb 20 11:59:41 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 20 Feb 2004 11:59:41 -0500 Subject: [nycphp-talk] SecurityFocus Newsletter #236 Message-ID: <20040220165941.GA13698@panix.com> Apache-SSL Client Certificate Forging Vulnerability http://www.securityfocus.com/bid/9590 Apache mod_php Global Variables Information Disclosure Weakn... http://www.securityfocus.com/bid/9599 Mambo Open Source Itemid Parameter Cross-Site Scripting Vuln... http://www.securityfocus.com/bid/9588 Joe Lumbroso Jack's Formmail.php Unauthorized Remote File Up... http://www.securityfocus.com/bid/9591 Brad Fears PHPCodeCabinet comments.php HTML Injection Vulner... http://www.securityfocus.com/bid/9601 PHP-Nuke 'News' Module Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/9605 JShop E-Commerce Suite xSearch Cross-Site Scripting Vulnerab... http://www.securityfocus.com/bid/9609 PHP-Nuke 'Reviews' Module Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/9613 PHP-Nuke Public Message SQL Injection Vulnerability http://www.securityfocus.com/bid/9615 PHPNuke Category Parameter SQL Injection Vulnerability http://www.securityfocus.com/bid/9630 VisualShapers ezContents Multiple Module File Include Vulner... http://www.securityfocus.com/bid/9638 BosDev BosDates SQL Injection Vulnerability http://www.securityfocus.com/bid/9639 PHPCodeCabinet Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/9645 JelSoft VBulletin Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/9649 -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From phillip.powell at adnet-sys.com Fri Feb 20 12:30:44 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 20 Feb 2004 12:30:44 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help References: <40362352.5090207@adnet-sys.com> <40363116.6060905@phpwerx.net> Message-ID: <40364444.9070004@adnet-sys.com> Dan Cech wrote: > Phil Powell wrote: > >> I am having to create a cascade delete effect on table "department" >> that is configured in the following fashion: >> >> -- TABLE CONTAINING DEPARTMENTS FOR PERSONS >> create table if not exists department ( >> id int not null auto_increment, >> primary key (id), >> department_name varchar(50) not null, >> department_parent_id int, >> unique_key varchar(20) not null, >> record_entered datetime >> ); >> >> department_parent_id is a "foreign key constraint" (table is MyISAM >> thus no actual foreign key) set up to be recursively >> referring to another record (if not null) in the table. >> >> I am having to delete a department; if I do so, I would naturally >> have to delete all child records associated with the department. > > > snip > >> What would then be your best recommendation, based upon the need and >> the schema, for me to ensure that all related records are >> deleted? I would prefer not to have to write a PHP script to have to >> do so, but is that all I'm stuck with? > > > My recommendation is to look at using a more powerful structure to > represent the relationship between your departments. Specifically I > would recommend Joe Celko's Nested Sets or a variation thereof. > > You can find a lot of information in the archives of this list and the > nyphp-dev list, and also plenty of resources on the net. A good place > to start would be: > > > > This approach has many advantages, and would allow you to accomplish > this type of delete quite efficiently, as well as offering additional > ways to work with the data, such as a one-query answer to the problem > of retrieving all ancestor or descendant departments. > > Dan > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > Interesting.. I'll look into that more, but the article does not indicate whether this approach works for a very simple MySQL 3.23 model MyISAM table. If it doesn't implementing this would be fine, provided we tell every client that looks into our custom-built app to upgrade everything from PHP and MySQL on down before they can use our app they bought. Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From phillip.powell at adnet-sys.com Fri Feb 20 12:32:22 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 20 Feb 2004 12:32:22 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help References: <40362352.5090207@adnet-sys.com> Message-ID: <403644A6.7040803@adnet-sys.com> David Mintz wrote: >MyIsam doesn't support foreign key constraints but InnoDB does. If you use >InnoDB tables you can have cascading deletes. > >Alternatively, tho you said you want to avoid it, you can do it yourself >in the middle tier (PHP) -- it ain't that hard. > >See, e.g., "MySQL" by Paul DuBois, 2nd edition. > > > >On Fri, 20 Feb 2004, Phil Powell wrote: > > >>I am having to create a cascade delete effect on table "department" that >>is configured in the following fashion: >> >>I am having to delete a department; if I do so, I would naturally have >>to delete all child records associated with the department. >>Best approach would be to do a "cascade delete" variation (deleting all >>child records first and then parent row), however, only >>MaxDB seems to support that (see >>http://www.mysql.com/documentation/maxdb/94/c38409c20611d5993d00508b6b8b11/content.htm >>and >>http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html ), >>however, that seems to be not possible since my tables are MyISAM >>by default. Therefore, I am offered the possibility of a trigger. >>However, the beforementioned article indicates triggers >>aren't supported in MySQL. >> >>What would then be your best recommendation, based upon the need and the >>schema, for me to ensure that all related records are >>deleted? I would prefer not to have to write a PHP script to have to do >>so, but is that all I'm stuck with? >> >> > > >--- >David Mintz >http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > > for now, using more "open source" tools, I built a TCL script to perform the recursive cascading action upon the table by doing an exec on a shell script I wrote to do command-line mysql commands. Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From tgales at tgaconnect.com Fri Feb 20 13:11:35 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 20 Feb 2004 13:11:35 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help In-Reply-To: <40364444.9070004@adnet-sys.com> Message-ID: <001301c3f7dc$fab222f0$e98d3818@oberon1> regarding your response to Dan Cech's link () I think you could have just said: " thanks -- I'll look into it. " (without repeating so much of the thread) and adding: "Do you think that approach would work with a very simple MySQL 3.23 model ?" The point being: your thought was not so dependent on previous posts that it needs to include each of them or risk being misunderstood by being read out of context. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com p.s. I am trying to help you learn to edit your posts -- not just be 'snippy' From dcech at phpwerx.net Fri Feb 20 14:11:04 2004 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 20 Feb 2004 14:11:04 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - Help In-Reply-To: <40364444.9070004@adnet-sys.com> References: <40362352.5090207@adnet-sys.com> <40363116.6060905@phpwerx.net> <40364444.9070004@adnet-sys.com> Message-ID: <40365BC8.8080509@phpwerx.net> Phil Powell wrote: > Dan Cech wrote: >> My recommendation is to look at using a more powerful structure to >> represent the relationship between your departments. Specifically I >> would recommend Joe Celko's Nested Sets or a variation thereof. >> >> You can find a lot of information in the archives of this list and the >> nyphp-dev list, and also plenty of resources on the net. A good place >> to start would be: >> >> >> >> This approach has many advantages, and would allow you to accomplish >> this type of delete quite efficiently, as well as offering additional >> ways to work with the data, such as a one-query answer to the problem >> of retrieving all ancestor or descendant departments. >> > Interesting.. I'll look into that more, but the article does not > indicate whether this approach works for a very simple MySQL 3.23 model > MyISAM table. If it doesn't implementing this would be fine, provided > we tell every client that looks into our custom-built app to upgrade > everything from PHP and MySQL on down before they can use our app they > bought. The differences between MySQL 4.x and 3.23.x are not that great when dealing with the simple SQL required for this type of system, and thus far in all my PHP work I haven't found a situation where you can't come up with a solution which will work with the 2 different flavours of MySQL. Admittedly I try to restrict myself to code which will also function on PostgreSQL, Oracle and MSSQL, but my point is that the majority of problems can be solved without having to resort to vendor or release-specific SQL extensions, if that is what is required. As for using a shell script to execute queries through the MySQL command-line client, my opinion is that it is a Bad Thing. Admittedly you don't have the advantage of being able to use transactions anyway, but by designing your system this way you are not only breaking up what should really be an atomic database operation into several different parts, but also creating a solution which cannot be easily upgraded to take advantage of features such as transaction support. Dan From greg at click3x.com Fri Feb 20 14:28:21 2004 From: greg at click3x.com (Greg Faber) Date: Fri, 20 Feb 2004 14:28:21 -0500 Subject: [nycphp-talk] sending info through a hyperlink... Message-ID: Hi All- Just want to lower the level of discourse on this list for a few minutes. I have a newbie question for youze. I'm trying to build an extranet where "producers" can log in and create mini-sites where they can post pics and movs so their clients can view the progress of certain projects. Once a producer logs in he's greeted with a page that lists all his current active extranets. I want to make the list "hotlinked" so the producer can just click on the name of a mini-site and gets to the mini-site admin page where he can upload/delete movs and pics. If all the hyperlinks just link to a "mini_site_admin.php" file, how can I send the information pertaining to what link was actually clicked (hence identifying which mini-site is gonna get updated). Does it have something to do with $_SESSION[] variables? I suppose I could build it as a form and have a little radio button select which mini-site i want to update and then have a "submit" button, but I think it would be more intuitive to just click on the name. Have any suggestions? BTW, Adam, PHP Cookbook is pretty damn wicked. Thanks, Greg From Cbielanski at inta.org Fri Feb 20 14:36:39 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Fri, 20 Feb 2004 14:36:39 -0500 Subject: [nycphp-talk] sending info through a hyperlink... Message-ID: you can string a GET argument into the URL: href="mini_site_admin.php?site=my_site&foo=bar"... Then use the $_REQUEST array in the target page to sort it out and display the right content. It's eeeee-z. > -----Original Message----- > From: Greg Faber [mailto:greg at click3x.com] > Sent: Friday, February 20, 2004 2:28 PM > To: talk at lists.nyphp.org > Subject: [nycphp-talk] sending info through a hyperlink... > > > Hi All- > > Just want to lower the level of discourse on this list for a few > minutes. I have a newbie question for youze. > > I'm trying to build an extranet where "producers" can log in > and create > mini-sites where they can post pics and movs so their clients > can view > the progress of certain projects. Once a producer logs in > he's greeted > with a page that lists all his current active extranets. I > want to make > the list "hotlinked" so the producer can just click on the name of a > mini-site and gets to the mini-site admin page where he can > upload/delete movs and pics. If all the hyperlinks just link to a > "mini_site_admin.php" file, how can I send the information pertaining > to what link was actually clicked (hence identifying which > mini-site is > gonna get updated). Does it have something to do with $_SESSION[] > variables? > > I suppose I could build it as a form and have a little radio button > select which mini-site i want to update and then have a "submit" > button, but I think it would be more intuitive to just click on the > name. Have any suggestions? > > BTW, Adam, PHP Cookbook is pretty damn wicked. > > Thanks, > Greg > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From greg at click3x.com Fri Feb 20 14:37:31 2004 From: greg at click3x.com (Greg Faber) Date: Fri, 20 Feb 2004 14:37:31 -0500 Subject: [nycphp-talk] sending info through a hyperlink... In-Reply-To: References: Message-ID: <39B3DDBE-63DC-11D8-B2FE-000502F1DDFC@click3x.com> groovy, thanks.! On Feb 20, 2004, at 2:36 PM, Chris Bielanski wrote: > you can string a GET argument into the URL: > href="mini_site_admin.php?site=my_site&foo=bar"... > > Then use the $_REQUEST array in the target page to sort it out and > display > the right content. > > It's eeeee-z. > >> -----Original Message----- >> From: Greg Faber [mailto:greg at click3x.com] >> Sent: Friday, February 20, 2004 2:28 PM >> To: talk at lists.nyphp.org >> Subject: [nycphp-talk] sending info through a hyperlink... >> >> >> Hi All- >> >> Just want to lower the level of discourse on this list for a few >> minutes. I have a newbie question for youze. >> >> I'm trying to build an extranet where "producers" can log in >> and create >> mini-sites where they can post pics and movs so their clients >> can view >> the progress of certain projects. Once a producer logs in >> he's greeted >> with a page that lists all his current active extranets. I >> want to make >> the list "hotlinked" so the producer can just click on the name of a >> mini-site and gets to the mini-site admin page where he can >> upload/delete movs and pics. If all the hyperlinks just link to a >> "mini_site_admin.php" file, how can I send the information pertaining >> to what link was actually clicked (hence identifying which >> mini-site is >> gonna get updated). Does it have something to do with $_SESSION[] >> variables? >> >> I suppose I could build it as a form and have a little radio button >> select which mini-site i want to update and then have a "submit" >> button, but I think it would be more intuitive to just click on the >> name. Have any suggestions? >> >> BTW, Adam, PHP Cookbook is pretty damn wicked. >> >> Thanks, >> Greg >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk >> > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From csnyder at chxo.com Fri Feb 20 14:38:05 2004 From: csnyder at chxo.com (Chris Snyder) Date: Fri, 20 Feb 2004 14:38:05 -0500 Subject: [nycphp-talk] sending info through a hyperlink... In-Reply-To: References: Message-ID: <4036621D.8020309@chxo.com> Greg Faber wrote: > If all the hyperlinks just link to a "mini_site_admin.php" file, how > can I send the information pertaining to what link was actually > clicked (hence identifying which mini-site is gonna get updated). Any reason why linking to "mini_site_admin.php?site=$sitename" wouldn't work? mini_site_admin.php checks for $_GET['sitename'] early on, and if found sets $_SESSION['sitename'], which is used for subsequent requests. From phillip.powell at adnet-sys.com Fri Feb 20 14:53:05 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 20 Feb 2004 14:53:05 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - HelpQL References: <40362352.5090207@adnet-sys.com> <40363116.6060905@phpwerx.net> <40364444.9070004@adnet-sys.com> <40365BC8.8080509@phpwerx.net> Message-ID: <403665A1.1090802@adnet-sys.com> Dan Cech wrote: > Phil Powell wrote: > >> Dan Cech wrote: >> >>> My recommendation is to look at using a more powerful structure to >>> represent the relationship between your departments. Specifically I >>> would recommend Joe Celko's Nested Sets or a variation thereof. >>> >>> You can find a lot of information in the archives of this list and >>> the nyphp-dev list, and also plenty of resources on the net. A good >>> place to start would be: >>> >>> >>> >>> This approach has many advantages, and would allow you to accomplish >>> this type of delete quite efficiently, as well as offering >>> additional ways to work with the data, such as a one-query answer to >>> the problem of retrieving all ancestor or descendant departments. >>> >> Interesting.. I'll look into that more, but the article does not >> indicate whether this approach works for a very simple MySQL 3.23 >> model MyISAM table. If it doesn't implementing this would be fine, >> provided we tell every client that looks into our custom-built app to >> upgrade everything from PHP and MySQL on down before they can use our >> app they bought. > > > The differences between MySQL 4.x and 3.23.x are not that great when > dealing with the simple SQL required for this type of system, and thus > far in all my PHP work I haven't found a situation where you can't > come up with a solution which will work with the 2 different flavours > of MySQL. Admittedly I try to restrict myself to code which will also > function on PostgreSQL, Oracle and MSSQL, but my point is that the > majority of problems can be solved without having to resort to vendor > or release-specific SQL extensions, if that is what is required. > > As for using a shell script to execute queries through the MySQL > command-line client, my opinion is that it is a Bad Thing. Admittedly > you don't have the advantage of being able to use transactions anyway, > but by designing your system this way you are not only breaking up > what should really be an atomic database operation into several > different parts, but also creating a solution which cannot be easily > upgraded to take advantage of features such as transaction support. > > Dan > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > You do have a point.. I guess I just can't think of a solution that would fit the current environment. However, I would think that allowing for futuristic transactional support is in order by providing OO-level switches that determine the flavor of your MySQL and act accordingly. Sorry, but I don't understand the term "atomic" in this case. Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From lists at prusak.com Fri Feb 20 15:03:05 2004 From: lists at prusak.com (Ophir Prusak) Date: Fri, 20 Feb 2004 15:03:05 -0500 Subject: [nycphp-talk] sending info through a hyperlink... In-Reply-To: References: Message-ID: <403667F9.1070909@prusak.com> You might want to look into using wild card DNS and using the client name for the prefix for the host name. Wild card DNS means that you can forward http://.mysite.com to your site where blah can be anything. I'm assuming each mini-site has a unique string you could use. You could then have URLs in the form of: http://mini-site1.mysite.com/ http://mini-site2.mysite.com/ etc. You then always know what client mini-site you are in solely from the host name. Something along the lines of: $host_array = explode (".",$_SERVER["HTTP_HOST"]); $mini_site_name = $host_array[0]; This way you always have the site name available. Ophir Greg Faber wrote: > Hi All- > > Just want to lower the level of discourse on this list for a few > minutes. I have a newbie question for youze. > > I'm trying to build an extranet where "producers" can log in and > create mini-sites where they can post pics and movs so their clients > can view the progress of certain projects. Once a producer logs in > he's greeted with a page that lists all his current active extranets. > I want to make the list "hotlinked" so the producer can just click on > the name of a mini-site and gets to the mini-site admin page where he > can upload/delete movs and pics. If all the hyperlinks just link to a > "mini_site_admin.php" file, how can I send the information pertaining > to what link was actually clicked (hence identifying which mini-site > is gonna get updated). Does it have something to do with $_SESSION[] > variables? > > I suppose I could build it as a form and have a little radio button > select which mini-site i want to update and then have a "submit" > button, but I think it would be more intuitive to just click on the > name. Have any suggestions? > > BTW, Adam, PHP Cookbook is pretty damn wicked. > > Thanks, > Greg > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk >From hans not junk at nyphp.com Fri Feb 20 16:29:58 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 2E65BA85EA for ; Fri, 20 Feb 2004 16:29:58 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] chmod - sticky bits on dirs Date: Fri, 20 Feb 2004 13:30:04 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87937C93 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] chmod - sticky bits on dirs Thread-Index: AcP3WO8am84h/rjwRS2QDUxPLh1Y9gAn8NoA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 21:29:58 -0000 > I have a directory in which I want all files or=20 > sub-directories (existing > and newly created/added) to be rwx by any member of the group=20 > which owns > the directory. >=20 > I thought it was something like > chmod g+s > but that doesn't seem to be doing it right... You can't... the sticky bit (as a group) sets the files created within a directory to be owned the group of the directory. You could set a umask, however (unless I'm missing something here). H From dcech at phpwerx.net Fri Feb 20 16:34:08 2004 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 20 Feb 2004 16:34:08 -0500 Subject: [nycphp-talk] MySQL, MyISAM tables, | - HelpQL In-Reply-To: <403665A1.1090802@adnet-sys.com> References: <40362352.5090207@adnet-sys.com> <40363116.6060905@phpwerx.net> <40364444.9070004@adnet-sys.com> <40365BC8.8080509@phpwerx.net> <403665A1.1090802@adnet-sys.com> Message-ID: <40367D50.9050506@phpwerx.net> Phil Powell wrote: > Dan Cech wrote: >> The differences between MySQL 4.x and 3.23.x are not that great when >> dealing with the simple SQL required for this type of system, and thus >> far in all my PHP work I haven't found a situation where you can't >> come up with a solution which will work with the 2 different flavours >> of MySQL. Admittedly I try to restrict myself to code which will also >> function on PostgreSQL, Oracle and MSSQL, but my point is that the >> majority of problems can be solved without having to resort to vendor >> or release-specific SQL extensions, if that is what is required. >> >> As for using a shell script to execute queries through the MySQL >> command-line client, my opinion is that it is a Bad Thing. Admittedly >> you don't have the advantage of being able to use transactions anyway, >> but by designing your system this way you are not only breaking up >> what should really be an atomic database operation into several >> different parts, but also creating a solution which cannot be easily >> upgraded to take advantage of features such as transaction support. >> > You do have a point.. I guess I just can't think of a solution that > would fit the current environment. However, I would think that > allowing for futuristic transactional support is in order by providing > OO-level switches that determine the flavor of your MySQL and act > accordingly. Great! Though why you would need separate SQL for the 2 versions of MySQL is still something of a mystery to me, what exactly are you trying to do that would cause problems with 3.23.x? > Sorry, but I don't understand the term "atomic" in this case. What I mean by 'atomic' is that the operation should (theoretically) be a single indivisible operation. Unfortunately this is a dream which is almost always unattainable. What transactions do is to try and 'fake' this by letting you either commit or rollback the entire transaction as one unit, effectively turning your sequence of SQL commands into a single entity. On a side note, you can easily implement transaction support in your existing code (as well as support multiple databases) if you use the ADOdb database abstraction layer (I'm sure PEAR::DB can do it to, but I use ADOdb). Using these systems you can write code which will take advantage of transaction support if it is available, but still work on databases which do not support transactions. Dan >From hans not junk at nyphp.com Fri Feb 20 16:38:40 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 2DF35A85EA for ; Fri, 20 Feb 2004 16:38:40 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] constants vs globals Date: Fri, 20 Feb 2004 13:38:46 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87937C99 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] constants vs globals Thread-Index: AcP1ewG/DY7246w6SKqfG8UL6fnDywCfrRlA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 21:38:40 -0000 > At the PHP conference in New York last spring I remember someone asked > Rasmus a question: which is more expensive, accessing a=20 > global or defining > a constant? He said without hesitation "defining a constant."=20 > There was > silence for a couple beats, then on to the next question. At that same conference I chatted with Zeev about this issue, too. He concured, and said that defining a constant is more expensive than setting a variable. However, somehow I knew he wasn't telling the whole story, so I asked why... and why would anyone want a constant, aside from being static and globally scoped. He said that using constants, once defined, are less expensive than variables. So I said... "hah, thought you'd say something like that..." :) H From Cbielanski at inta.org Fri Feb 20 16:43:34 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Fri, 20 Feb 2004 16:43:34 -0500 Subject: [nycphp-talk] constants vs globals Message-ID: Now that's a classic case of too narrow a scope for a question to be useful and relevant. ...but at least you didn't get "Ummmmmm because Rasmus said it was, and I forget why..." ;) > -----Original Message----- > From: Hans Zaunere [mailto:hans not junk at nyphp.com] > Sent: Friday, February 20, 2004 4:39 PM > To: NYPHP Talk > Subject: RE: [nycphp-talk] constants vs globals > > > > > At the PHP conference in New York last spring I remember > someone asked > > Rasmus a question: which is more expensive, accessing a > > global or defining > > a constant? He said without hesitation "defining a constant." > > There was > > silence for a couple beats, then on to the next question. > > At that same conference I chatted with Zeev about this issue, too. He > concured, and said that defining a constant is more expensive than > setting a variable. > > However, somehow I knew he wasn't telling the whole story, so I asked > why... and why would anyone want a constant, aside from being > static and > globally scoped. > > He said that using constants, once defined, are less expensive than > variables. So I said... "hah, thought you'd say something > like that..." > :) > > H > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > >From hans not junk at nyphp.com Fri Feb 20 16:42:41 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 5814BA85EA for ; Fri, 20 Feb 2004 16:42:41 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] interesting AMP tidbit on Groklaw Date: Fri, 20 Feb 2004 13:42:48 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87937C9B at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] interesting AMP tidbit on Groklaw Thread-Index: AcP3XbLvXCkQz49fStuCCQ622fbuKAAnI+bA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 21:42:41 -0000 > full story here: > http://www.groklaw.net/article.php?story=3D20040216213026637 Excellent story... When someone asks "what does PHP stand for" you can say that it's a recursive acronym: PHP Helping People (this one credited to Gales/Lacey prior post on another list). H From dmintz at davidmintz.org Fri Feb 20 16:43:02 2004 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 20 Feb 2004 16:43:02 -0500 (EST) Subject: [nycphp-talk] constants vs globals In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87937C99@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F87937C99@ehost011-1.exch011.intermedia.net> Message-ID: On Fri, 20 Feb 2004, Hans Zaunere wrote: > > > At the PHP conference in New York last spring I remember someone asked > > Rasmus a question: which is more expensive, accessing a > > global or defining > > a constant? He said without hesitation "defining a constant." > > > At that same conference I chatted with Zeev about this issue, too. He > concured, and said that defining a constant is more expensive than > setting a variable. > > However, somehow I knew he wasn't telling the whole story, so I asked > why... and why would anyone want a constant, aside from being static and > globally scoped. > > He said that using constants, once defined, are less expensive than > variables. So I said... "hah, thought you'd say something like that..." > :) Heh! Which raises the question, then, how many times to you need to read a constant to break even on that up-front expense, as it were, as compared to a variable? Maybe this is angels-on-the-head-of-a-pin stuff. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From yury at heavenspa.com Fri Feb 20 16:55:16 2004 From: yury at heavenspa.com (yury at heavenspa.com) Date: Fri, 20 Feb 2004 16:55:16 -0500 Subject: [nycphp-talk] interesting AMP tidbit on Groklaw References: <41EE526EC2D3C74286415780D3BA9F87937C9B@ehost011-1.exch011.intermedia.net> Message-ID: <06f501c3f7fc$39f40ae0$0400a8c0@heavenspanyc> Its not Pretty Home Pages? : ^} ciao yury ----- Original Message ----- From: "Hans Zaunere" To: "NYPHP Talk" Sent: Friday, February 20, 2004 4:42 PM Subject: RE: [nycphp-talk] interesting AMP tidbit on Groklaw > full story here: > http://www.groklaw.net/article.php?story=20040216213026637 Excellent story... When someone asks "what does PHP stand for" you can say that it's a recursive acronym: PHP Helping People (this one credited to Gales/Lacey prior post on another list). H _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From dmintz at davidmintz.org Fri Feb 20 16:47:22 2004 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 20 Feb 2004 16:47:22 -0500 (EST) Subject: [nycphp-talk] interesting AMP tidbit on Groklaw In-Reply-To: <06f501c3f7fc$39f40ae0$0400a8c0@heavenspanyc> References: <41EE526EC2D3C74286415780D3BA9F87937C9B@ehost011-1.exch011.intermedia.net> <06f501c3f7fc$39f40ae0$0400a8c0@heavenspanyc> Message-ID: On Fri, 20 Feb 2004 yury at heavenspa.com wrote: > Its not Pretty Home Pages? : ^} Nor People Hate Perl? --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From amiller at hollywood101.com Fri Feb 20 16:49:12 2004 From: amiller at hollywood101.com (Alan T. Miller) Date: Fri, 20 Feb 2004 14:49:12 -0700 Subject: [nycphp-talk] interesting AMP tidbit on Groklaw References: <41EE526EC2D3C74286415780D3BA9F87937C9B@ehost011-1.exch011.intermedia.net> <06f501c3f7fc$39f40ae0$0400a8c0@heavenspanyc> Message-ID: <026a01c3f7fb$63576630$640a0a0a@webdev> It could be narrowed to Programmers Helping Programmers. Alan ----- Original Message ----- From: To: "NYPHP Talk" Sent: Friday, February 20, 2004 2:55 PM Subject: Re: [nycphp-talk] interesting AMP tidbit on Groklaw > Its not Pretty Home Pages? : ^} > > ciao > yury > ----- Original Message ----- > From: "Hans Zaunere" > To: "NYPHP Talk" > Sent: Friday, February 20, 2004 4:42 PM > Subject: RE: [nycphp-talk] interesting AMP tidbit on Groklaw > > > > > full story here: > > http://www.groklaw.net/article.php?story=20040216213026637 > > Excellent story... > > When someone asks "what does PHP stand for" you can say that it's a > recursive acronym: PHP Helping People > (this one credited to Gales/Lacey prior post on another list). > > > H > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > >From hans not junk at nyphp.com Fri Feb 20 16:50:08 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 4FA49A85F3 for ; Fri, 20 Feb 2004 16:50:08 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] constants vs globals Date: Fri, 20 Feb 2004 13:50:15 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87937CA6 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] constants vs globals Thread-Index: AcP3+o2gEAl5fKsJTr6Yqs7FJMjUzAAAP0zw From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 21:50:08 -0000 =20 > -----Original Message----- > From: talk-bounces at lists.nyphp.org=20 > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Mintz > Sent: Friday, February 20, 2004 4:43 PM > To: NYPHP Talk > Subject: RE: [nycphp-talk] constants vs globals >=20 > On Fri, 20 Feb 2004, Hans Zaunere wrote: >=20 > > > > > At the PHP conference in New York last spring I remember=20 > someone asked > > > Rasmus a question: which is more expensive, accessing a > > > global or defining > > > a constant? He said without hesitation "defining a constant." > > > > > > At that same conference I chatted with Zeev about this=20 > issue, too. He > > concured, and said that defining a constant is more expensive than > > setting a variable. > > > > However, somehow I knew he wasn't telling the whole story,=20 > so I asked > > why... and why would anyone want a constant, aside from=20 > being static and > > globally scoped. > > > > He said that using constants, once defined, are less expensive than > > variables. So I said... "hah, thought you'd say something=20 > like that..." > > :) >=20 >=20 > Heh! Which raises the question, then, how many times to you=20 > need to read a > constant to break even on that up-front expense, as it were,=20 > as compared > to a variable? Heh, now that you mention that, I did say ask. He didn't know - but we did talk a bit about it and I think I lead the witness to around 4 or 5 H From dmintz at davidmintz.org Fri Feb 20 17:13:27 2004 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 20 Feb 2004 17:13:27 -0500 (EST) Subject: [nycphp-talk] constants vs globals In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87937CA6@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F87937CA6@ehost011-1.exch011.intermedia.net> Message-ID: On Fri, 20 Feb 2004, Hans Zaunere wrote: > > Heh! Which raises the question, then, how many times to you > > need to read a > > constant to break even on that up-front expense, as it were, > > as compared > > to a variable? > > Heh, now that you mention that, I did say ask. He didn't know - but we > did talk a bit about it and I think I lead the witness to around 4 or 5 > But *parsing* the code that contains constants doesn't cost different from parsing code containing variables, or does it? If not, and if the accesses are wrapped in "if" blocks, whose execution depends on chance,then you'd have to devise some sophisticated benchmarking to simulate the real world and discover the answer..... ergo, I think it's time to go get a beer and forget this. Cheers! --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From dcech at phpwerx.net Fri Feb 20 17:21:53 2004 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 20 Feb 2004 17:21:53 -0500 Subject: [nycphp-talk] constants vs globals In-Reply-To: References: <41EE526EC2D3C74286415780D3BA9F87937CA6@ehost011-1.exch011.intermedia.net> Message-ID: <40368881.7010108@phpwerx.net> David Mintz wrote: > On Fri, 20 Feb 2004, Hans Zaunere wrote: >>>Heh! Which raises the question, then, how many times to you >>>need to read a >>>constant to break even on that up-front expense, as it were, >>>as compared >>>to a variable? >> >>Heh, now that you mention that, I did say ask. He didn't know - but we >>did talk a bit about it and I think I lead the witness to around 4 or 5 > > But *parsing* the code that contains constants doesn't cost different from > parsing code containing variables, or does it? If not, and if the accesses > are wrapped in "if" blocks, whose execution depends on chance,then you'd > have to devise some sophisticated benchmarking to simulate the real world > and discover the answer..... ergo, I think it's time to go get a beer and > forget this. Realistically when compared to all of the other possible optimisations you could perform, this is pretty low on the list. Personally I use constants for data which is just that, something which is not going to be different depending on the time of day, direction of the wind, etc. Anything else that I need either goes into the appropriate class or $GLOBALS['config']. Dan From adam at trachtenberg.com Fri Feb 20 17:28:42 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Fri, 20 Feb 2004 17:28:42 -0500 (EST) Subject: [nycphp-talk] constants vs globals In-Reply-To: <40368881.7010108@phpwerx.net> References: <41EE526EC2D3C74286415780D3BA9F87937CA6@ehost011-1.exch011.intermedia.net> <40368881.7010108@phpwerx.net> Message-ID: On Fri, 20 Feb 2004, Dan Cech wrote: > Personally I use constants for data which is just that, something which > is not going to be different depending on the time of day, direction of > the wind, etc. Anything else that I need either goes into the > appropriate class or $GLOBALS['config']. I am with Dan here. I rarely use constants, but when I do they're for stuff like PI. (Okay, that's built in, but you get the point.) Worrying about speed here is far less worrysome that accidentally defining the ratio of the circumference to the diameter of a circle. :) -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From dmintz at davidmintz.org Fri Feb 20 17:42:29 2004 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 20 Feb 2004 17:42:29 -0500 (EST) Subject: [nycphp-talk] constants vs globals In-Reply-To: References: <41EE526EC2D3C74286415780D3BA9F87937CA6@ehost011-1.exch011.intermedia.net> <40368881.7010108@phpwerx.net> Message-ID: Then it's all settled: BEER! (This being Friday evening and all). On Fri, 20 Feb 2004, Adam Maccabee Trachtenberg wrote: > On Fri, 20 Feb 2004, Dan Cech wrote: > > > Personally I use constants for data which is just that, something which > > is not going to be different depending on the time of day, direction of > > the wind, etc. Anything else that I need either goes into the > > appropriate class or $GLOBALS['config']. > > I am with Dan here. I rarely use constants, but when I do they're for > stuff like PI. (Okay, that's built in, but you get the point.) > > Worrying about speed here is far less worrysome that accidentally > defining the ratio of the circumference to the diameter of a circle. :) > > -adam > > -- > adam at trachtenberg.com > author of o'reilly's php cookbook > avoid the holiday rush, buy your copy today! > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From jsiegel1 at optonline.net Fri Feb 20 17:48:06 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Fri, 20 Feb 2004 17:48:06 -0500 Subject: [nycphp-talk] constants vs globals In-Reply-To: References: <41EE526EC2D3C74286415780D3BA9F87937CA6@ehost011-1.exch011.intermedia.net> <40368881.7010108@phpwerx.net> Message-ID: <40368EA6.7030101@optonline.net> > Then it's all settled: BEER! (This being Friday evening and all). Love the way you summed up the argument! :) Jeff Siegel David Mintz wrote: > > Then it's all settled: BEER! (This being Friday evening and all). > > > On Fri, 20 Feb 2004, Adam Maccabee Trachtenberg wrote: > > >>On Fri, 20 Feb 2004, Dan Cech wrote: >> >> >>>Personally I use constants for data which is just that, something which >>>is not going to be different depending on the time of day, direction of >>>the wind, etc. Anything else that I need either goes into the >>>appropriate class or $GLOBALS['config']. >> >>I am with Dan here. I rarely use constants, but when I do they're for >>stuff like PI. (Okay, that's built in, but you get the point.) >> >>Worrying about speed here is far less worrysome that accidentally >>defining the ratio of the circumference to the diameter of a circle. :) >> >>-adam >> >>-- >>adam at trachtenberg.com >>author of o'reilly's php cookbook >>avoid the holiday rush, buy your copy today! >>_______________________________________________ >>talk mailing list >>talk at lists.nyphp.org >>http://lists.nyphp.org/mailman/listinfo/talk >> > > > > --- > David Mintz > http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- Sopranos 24:17 > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From faber at linuxnj.com Sat Feb 21 16:58:44 2004 From: faber at linuxnj.com (Faber Fedor) Date: Sat, 21 Feb 2004 16:58:44 -0500 Subject: [nycphp-talk] Designing without register_globals Message-ID: <20040221215844.GA2362@uranus.faber.nom> Hi Gang, I'm new to the list and am in need of some expert advise. I'm a Linux consultant in New Jersey and PHP is one of my favorite languages although I don't get to use it much. One of my clients wants their website redone from scratch. Nothing fancy mind you, just your basic database-backed ecommerce with a brochure-ware front-end but it does have two interesting specifications. The one specification is the database back-end is a PICK database implemented under Linux as jBASE. For this reason, I can't use any off-theshelf ecommerce packages since everyone I've come across save one is more or less hardcoded for MySQL and or Postgresql. There is one person in CA that knows how to connect PHP to the jBASE database, but he isn't talking. At least not yet. But that's not why I'm writing to you today. The problem I'm asking you guys about deals with the second spec. I want the site to be easily modified by a non-geek who knows/can learn simple HTML. You can see the test site by looking at http://www.trimline.us/test. What I was thinking of doing was to take sections and put them in separate HTML files. The "What's new" section and the main content area are done like that. I simply do a include("whatsnew.html") in the index.php file and be done with it. The non-geek can easily edit the file with simple HTML. The probelm I'm running into deals with the menu bar and the shortcuts sections. I'd like to be able to click on "FAQ" and have faq.html appear in the main content area. On my site (http://www.linuxnj.com) I've done this by passing the variable $newpage back and forth, e.g. the URL for the "Services" link is "http://www.linuxnj.com/index.php?newpage=tech". This requires register_globals be turned on. BTW, the entire left sidebar is in a separate file that is included(). I do NOT want register_globas on in my client's site. So I've registered a variable called $_ENV["newpage"]. MY problem is I can't figure out how to set the variable when a user clicks on the "FAQ" link. On top of that, I'm afraid I need to put PHP code in the shortcuts.html file, which makes it more complicated for my end-user. Hmmm, I didn't mean to ramble on so much, especially for my first post. Sorry about that. So does anyone have any ideas how to pull this off? Or at least any good keywords to google with? -- Regards, Faber Linux New Jersey: Open Source Solutions for New Jersey http://www.linuxnj.com From felix at students.poly.edu Fri Feb 20 14:03:25 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Fri, 20 Feb 2004 14:03:25 -0500 Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <20040221215844.GA2362@uranus.faber.nom> References: <20040221215844.GA2362@uranus.faber.nom> Message-ID: <20040220140325.1f0195be.felix@students.poly.edu> I dont think that register_globals is your problem. register_globals has to do weather you can access a variable from Query string in a shortcut(possible insecure) way. You can alwasy get to Query string with $_GET. You want to keep state between requests but you dont watn to make a Query string in the url. You can use Sessions. I dont know how the ENV works that you use, at first i thought that would not work because apache may be running in deferent processes so not all php requests would have access to the same environment. I think you can potentialy do all kinds of stuff with mod_rewrite and set ENV with the RewriteRules. You can have different urls that all get rewriten to the same php script and in the rewrite rule you can set the original url into the ENV so the php script can access it. I dont dont have the code you would have to write it yourself or find it online. > On my site (http://www.linuxnj.com) I've done this by passing the > variable $newpage back and forth, e.g. the URL for the "Services" > link is "http://www.linuxnj.com/index.php?newpage=tech". This > requires register_globals be turned on. BTW, the entire left sidebar > is in a separate file that is included(). > > I do NOT want register_globas on in my client's site. So I've > registered a variable called $_ENV["newpage"]. MY problem is I can't > figure out how to set the variable when a user clicks on the "FAQ" > link. On top of that, I'm afraid I need to put PHP code in the > shortcuts.html file, which makes it more complicated for my end-user. From faber at linuxnj.com Sat Feb 21 17:32:52 2004 From: faber at linuxnj.com (Faber Fedor) Date: Sat, 21 Feb 2004 17:32:52 -0500 Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <20040220140325.1f0195be.felix@students.poly.edu> References: <20040221215844.GA2362@uranus.faber.nom> <20040220140325.1f0195be.felix@students.poly.edu> Message-ID: <20040221223252.GA2578@uranus.faber.nom> On Fri, Feb 20, 2004 at 02:03:25PM -0500, felix zaslavskiy wrote: > I dont think that register_globals is your problem. register_globals > has to do weather you can access a variable from Query string in a > shortcut(possible insecure) way. You can alwasy get to Query string with > $_GET. DOH! THAT'S how I'm supposed to do it! > You want to keep state between requests but you dont watn to make a > Query string in the url. You can use Sessions. I guess that's a better idea. I can't see any harm in putting the page name in the URL, but it is ugly. Let me go play with that... Thanks. -- Regards, Faber Linux New Jersey: Open Source Solutions for New Jersey http://www.linuxnj.com From mitchy at spacemonkeylabs.com Sat Feb 21 19:17:08 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Sat, 21 Feb 2004 19:17:08 -0500 Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <20040221223252.GA2578@uranus.faber.nom> References: <20040221215844.GA2362@uranus.faber.nom> <20040220140325.1f0195be.felix@students.poly.edu> <20040221223252.GA2578@uranus.faber.nom> Message-ID: <4037F504.2020801@spacemonkeylabs.com> Faber Fedor wrote: > I guess that's a better idea. I can't see any harm in putting the page > >name in the URL, but it is ugly. Let me go play with that... > Don't forget - mod_rewrite is your friend! http://httpd.apache.org/docs-2.0/misc/rewriteguide.html From jonbaer at jonbaer.net Sat Feb 21 19:38:16 2004 From: jonbaer at jonbaer.net (jon baer) Date: Sat, 21 Feb 2004 19:38:16 -0500 Subject: [nycphp-talk] Designing without register_globals References: <20040221215844.GA2362@uranus.faber.nom> Message-ID: <003b01c3f8dc$29912ee0$6400a8c0@thinkpad> > The one specification is the database back-end is a PICK database > implemented under Linux as jBASE. For this reason, I can't use any > off-theshelf ecommerce packages since everyone I've come across save one > is more or less hardcoded for MySQL and or Postgresql. There is one > person in CA that knows how to connect PHP to the jBASE database, but he > isn't talking. At least not yet. To me this would be the big problem ... since it accounts for 90% of any dynamic website, im interested too in how someone would connect to this db, would it be JDBC/Java/PHP? ODBC? Pretty interesting problem ... - jon From faber at linuxnj.com Sat Feb 21 21:31:13 2004 From: faber at linuxnj.com (Faber Fedor) Date: Sat, 21 Feb 2004 21:31:13 -0500 Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <003b01c3f8dc$29912ee0$6400a8c0@thinkpad> References: <20040221215844.GA2362@uranus.faber.nom> <003b01c3f8dc$29912ee0$6400a8c0@thinkpad> Message-ID: <20040222023113.GB3497@uranus.faber.nom> On Sat, Feb 21, 2004 at 07:38:16PM -0500, jon baer wrote: > > The one specification is the database back-end is a PICK database > > implemented under Linux as jBASE. For this reason, I can't use any > > off-theshelf ecommerce packages since everyone I've come across save one > > is more or less hardcoded for MySQL and or Postgresql. There is one > > person in CA that knows how to connect PHP to the jBASE database, but he > > isn't talking. At least not yet. > > To me this would be the big problem ... since it accounts for 90% of any > dynamic website, im interested too in how someone would connect to this db, > would it be JDBC/Java/PHP? ODBC? Pretty interesting problem ... Well, there is an ODBC driver for it, but it's use is mainly from/to Windows boxen. There is a Python connector for it as well. There is a way to connect directly via PHP; I just have to find out how. Once I find out, I'll be happy to tell y'all. Do you work much with PICK/jBASE? -- Regards, Faber Linux New Jersey: Open Source Solutions for New Jersey http://www.linuxnj.com From shiflett at php.net Sat Feb 21 22:41:07 2004 From: shiflett at php.net (Chris Shiflett) Date: Sat, 21 Feb 2004 19:41:07 -0800 (PST) Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <20040221215844.GA2362@uranus.faber.nom> Message-ID: <20040222034107.95510.qmail@web14301.mail.yahoo.com> --- Faber Fedor wrote: > The one specification is the database back-end is a PICK database > implemented under Linux as jBASE. For this reason, I can't use any > off-theshelf ecommerce packages since everyone I've come across save > one is more or less hardcoded for MySQL and or Postgresql. There is > one person in CA that knows how to connect PHP to the jBASE database, > but he isn't talking. At least not yet. I know several people, including myself, who have used PHP to speak to a Pick database (jBase implementation included). I can put you in contact with someone, if that's helpful. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From csnyder at chxo.com Sun Feb 22 00:19:23 2004 From: csnyder at chxo.com (Chris Snyder) Date: Sun, 22 Feb 2004 00:19:23 -0500 Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <20040222034107.95510.qmail@web14301.mail.yahoo.com> References: <20040222034107.95510.qmail@web14301.mail.yahoo.com> Message-ID: <40383BDB.20204@chxo.com> Chris Shiflett wrote: > I know several people, including myself, who have used PHP to speak to a > >Pick database (jBase implementation included). > I decided to go find out just what the heck a PICK database is. Elegant system back in the day (TRW, 1965), as there is only one type of data: untyped, variable length string. The flexibility inherent in that approach led to what looks to me like an OO db. From faber at linuxnj.com Sun Feb 22 00:56:16 2004 From: faber at linuxnj.com (Faber Fedor) Date: Sun, 22 Feb 2004 00:56:16 -0500 Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <20040222034107.95510.qmail@web14301.mail.yahoo.com> References: <20040221215844.GA2362@uranus.faber.nom> <20040222034107.95510.qmail@web14301.mail.yahoo.com> Message-ID: <20040222055616.GA4200@uranus.faber.nom> On Sat, Feb 21, 2004 at 07:41:07PM -0800, Chris Shiflett wrote: > --- Faber Fedor wrote: > > The one specification is the database back-end is a PICK database > > implemented under Linux as jBASE. For this reason, I can't use any > > off-theshelf ecommerce packages since everyone I've come across save > > one is more or less hardcoded for MySQL and or Postgresql. There is > > one person in CA that knows how to connect PHP to the jBASE database, > > but he isn't talking. At least not yet. > > I know several people, including myself, who have used PHP to speak to a > Pick database (jBase implementation included). Well, don't keep us in suspense, man!! Tell us! What is the Secret Connection String?! > I can put you in contact with someone, if that's helpful. Am I not already in contact with someone helpful? ;-) -- Regards, Faber Linux New Jersey: Open Source Solutions for New Jersey http://www.linuxnj.com From faber at linuxnj.com Sun Feb 22 01:06:58 2004 From: faber at linuxnj.com (Faber Fedor) Date: Sun, 22 Feb 2004 01:06:58 -0500 Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <40383BDB.20204@chxo.com> References: <20040222034107.95510.qmail@web14301.mail.yahoo.com> <40383BDB.20204@chxo.com> Message-ID: <20040222060658.GB4200@uranus.faber.nom> On Sun, Feb 22, 2004 at 12:19:23AM -0500, Chris Snyder wrote: > Chris Shiflett wrote: > > >I know several people, including myself, who have used PHP to speak to a > > > >Pick database (jBase implementation included). > > > > I decided to go find out just what the heck a PICK database is. > > Elegant system back in the day (TRW, 1965), as there is only one type of > data: untyped, variable length string. The flexibility inherent in that > approach led to what looks to me like an OO db. Their other Major Point is the Multi-valued field. AFAICT, it's a field that can hold multiple values (DUH!). I can see where that would be quite handy, but as their sole claim to fame... :-? >From what I can tell, they've "renamed" the PICK database(s) as a "multivalued database". There are several web sites/organizations called www.multivalue.(net|org|com). I've also seen them called "fourth normal databases". The coolest thing IMO they seem to do is to hash all of the data which allows for very quick retrieval. I've yet to find the technical details on how that works. -- Regards, Faber Linux New Jersey: Open Source Solutions for New Jersey http://www.linuxnj.com From emm at scriptdigital.com Sun Feb 22 13:17:08 2004 From: emm at scriptdigital.com (Emmanuel =?iso-8859-1?Q?D=E9carie?=) Date: Sun, 22 Feb 2004 13:17:08 -0500 Subject: [nycphp-talk] Re: your IDE? (was "Zend Survey") In-Reply-To: <20040218225117.31147A8772@virtu.nyphp.org> Message-ID: I do all my PHP work with BBEdit. I like it because it comes with a ton of tools (markup tools, PCRE search, etc...), it has a spartan interface, and is highly scriptable directly via Applescript or via text filters with Perl, PHP (php-cli), Python or any scripting languages that lives on the OS X shell. Also, the support team rocks, and they are open to suggestions to improve the app. For an example of scriptability see here (I'm the author of these): BBEdit Disk Browser Suite BBEditLib: AppleScript Library The Zend IDE could be interesting for me, but only for debugging purpose. Other than that, I don't see why in the world I would change my text editor. Cheers -Emmanuel -- Emmanuel D?carie / Programmation pour le Web - Programming for the Web - Blog: - AIM: scriptdigital From faber at linuxnj.com Sun Feb 22 13:18:10 2004 From: faber at linuxnj.com (Faber Fedor) Date: Sun, 22 Feb 2004 13:18:10 -0500 Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <4037F504.2020801@spacemonkeylabs.com> References: <20040221215844.GA2362@uranus.faber.nom> <20040220140325.1f0195be.felix@students.poly.edu> <20040221223252.GA2578@uranus.faber.nom> <4037F504.2020801@spacemonkeylabs.com> Message-ID: <20040222181810.GB18886@uranus.faber.nom> On Sat, Feb 21, 2004 at 07:17:08PM -0500, Mitch Pirtle wrote: > Faber Fedor wrote: > >I guess that's a better idea. I can't see any harm in putting the page > >name in the URL, but it is ugly. Let me go play with that... > > > Don't forget - mod_rewrite is your friend! > > http://httpd.apache.org/docs-2.0/misc/rewriteguide.html Okay, that is pretty cool. I finally got it working on the static pages; I can't wait to see what I do with it when I startaccessing the database. -- Regards, Faber Linux New Jersey: Open Source Solutions for New Jersey http://www.linuxnj.com From shiflett at php.net Sun Feb 22 22:41:49 2004 From: shiflett at php.net (Chris Shiflett) Date: Sun, 22 Feb 2004 19:41:49 -0800 (PST) Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <20040222055616.GA4200@uranus.faber.nom> Message-ID: <20040223034149.49702.qmail@web14309.mail.yahoo.com> --- Faber Fedor wrote: > Well, don't keep us in suspense, man!! Tell us! What is the Secret > Connection String?! The people I consulted for were using regular TCP/IP socket programs for communication, and they made up their own protocol, originally with fixed-length strings as data and later with XML. It worked very well, but they were using PHP "back in the day," so their original implementation was a hack, and it's hard to apply evolutionary changes to a hack and have it turn into a truly elegant solution. They were in the middle of switching to jBase when I moved to NYC, and supposedly they were going to be able to access data within Pick natively from PHP. > > I can put you in contact with someone, if that's helpful. > > Am I not already in contact with someone helpful? ;-) Well, I try to be helpful, but this isn't my area of expertise at all. I can explain how I was communicating with Pick, but I have friends who should now be doing something much better with jBase. I didn't want you to feel like that one guy was holding onto some sort of secret is all. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From shiflett at php.net Sun Feb 22 22:50:34 2004 From: shiflett at php.net (Chris Shiflett) Date: Sun, 22 Feb 2004 19:50:34 -0800 (PST) Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <20040222060658.GB4200@uranus.faber.nom> Message-ID: <20040223035034.63512.qmail@web14306.mail.yahoo.com> --- Faber Fedor wrote: > Their other Major Point is the Multi-valued field. AFAICT, it's a > field that can hold multiple values (DUH!). I can see where that > would be quite handy, but as their sole claim to fame... :-? There's definitely more to them than that. As an example, most companies that made heavy use of Pick wrote all of their business logic in Pick. It's more than a database - it's like an operating system, programming language, and database, all in one. > From what I can tell, they've "renamed" the PICK database(s) as a > "multivalued database". Pick is a brand that has sort of been diluted, just like Unix. Multi-valued database is the generic term. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From adam at trachtenberg.com Sun Feb 22 23:15:44 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Sun, 22 Feb 2004 23:15:44 -0500 (EST) Subject: [nycphp-talk] Designing without register_globals In-Reply-To: <20040223035034.63512.qmail@web14306.mail.yahoo.com> References: <20040223035034.63512.qmail@web14306.mail.yahoo.com> Message-ID: On Sun, 22 Feb 2004, Chris Shiflett wrote: > --- Faber Fedor wrote: > > Their other Major Point is the Multi-valued field. AFAICT, it's a > > field that can hold multiple values (DUH!). I can see where that > > would be quite handy, but as their sole claim to fame... :-? > > There's definitely more to them than that. As an example, most companies > that made heavy use of Pick wrote all of their business logic in Pick. > It's more than a database - it's like an operating system, programming > language, and database, all in one. This reminds me of Frontier/Usertalk it's a scripting language baked into an outliner baked into a object database with a web server front end. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From sklar at sklar.com Mon Feb 23 10:26:52 2004 From: sklar at sklar.com (David Sklar) Date: Mon, 23 Feb 2004 10:26:52 -0500 Subject: [nycphp-talk] [OT] meeting on 2/24 and handspring visor cradle Message-ID: Does anyone have a (serial or USB) handspring visor cradle that I could use for about 15 minutes at (before, after, etc.) the meeting tomorrow? Thanks, David From jonbaer at jonbaer.net Mon Feb 23 10:50:45 2004 From: jonbaer at jonbaer.net (jon baer) Date: Mon, 23 Feb 2004 10:50:45 -0500 Subject: [nycphp-talk] [OT] meeting on 2/24 and handspring visor cradle References: Message-ID: <011801c3fa24$ce8f72a0$6400a8c0@thinkpad> i have one for the prism i could bring (usb) ... ----- Original Message ----- From: "David Sklar" To: Sent: Monday, February 23, 2004 10:26 AM Subject: [nycphp-talk] [OT] meeting on 2/24 and handspring visor cradle > Does anyone have a (serial or USB) handspring visor cradle that I could > use for about 15 minutes at (before, after, etc.) the meeting tomorrow? > > Thanks, > David > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From Cbielanski at inta.org Mon Feb 23 11:21:04 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Mon, 23 Feb 2004 11:21:04 -0500 Subject: [nycphp-talk] February meeting of NYPHP Message-ID: Tomorrow night is this month's meeting, and it will be my first. I have some questions about getting there. Looks like the 4-5-6 to 23rd Street? confirm or correct, please! Also, how warm/cold does the meeting space get? ie, Shirtsleeves or sweater? How long does Monsieur Convissor plan to speak? Any topics or tangents other than PEAR going on? Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 >From hans not junk at nyphp.com Mon Feb 23 12:46:39 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 589C8A85F5 for ; Mon, 23 Feb 2004 12:46:39 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] February meeting of NYPHP Date: Mon, 23 Feb 2004 09:46:37 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA586A at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] February meeting of NYPHP Thread-Index: AcP6KKHx02mzg9xrTR+SlkjmupusPAAC+Pug From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2004 17:46:39 -0000 > Tomorrow night is this month's meeting, and it will be my=20 > first. I have some > questions about getting there. Looking forward to meeting, Chris. > Looks like the 4-5-6 to 23rd Street? confirm or correct, please! Yeah, that works very well, but keep in mind only the 6 stops at 23rd (the 4-5 is express from 14th to 42ns). The N-R is in the area too (23rd and 5th). > Also, how warm/cold does the meeting space get? ie,=20 > Shirtsleeves or sweater? I've always found it be fairly warm in there. > How long does Monsieur Convissor plan to speak? We generally try to wrap things up by 8:30 - 8:45 > Any topics or tangents other than PEAR going on? We're going to touch on briefly, at the beginning of the meeting, NYPHP's effort to organize itself. The NYPHP-Dev list (http://nyphp.org/lists) has had a lot of this talk, but briefly we're writing a charter, forming departments, organizing current projects, and writing a mission statement. H From Cbielanski at inta.org Mon Feb 23 12:50:40 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Mon, 23 Feb 2004 12:50:40 -0500 Subject: [nycphp-talk] February meeting of NYPHP Message-ID: Thanks, H :) > -----Original Message----- > From: Hans Zaunere [mailto:hans not junk at nyphp.com] > Sent: Monday, February 23, 2004 12:47 PM > To: NYPHP Talk > Subject: RE: [nycphp-talk] February meeting of NYPHP > > > > > Tomorrow night is this month's meeting, and it will be my > > first. I have some > > questions about getting there. > > Looking forward to meeting, Chris. > > > Looks like the 4-5-6 to 23rd Street? confirm or correct, please! > > Yeah, that works very well, but keep in mind only the 6 stops at 23rd > (the 4-5 is express from 14th to 42ns). The N-R is in the area too > (23rd and 5th). > > > Also, how warm/cold does the meeting space get? ie, > > Shirtsleeves or sweater? > > I've always found it be fairly warm in there. > > > How long does Monsieur Convissor plan to speak? > > We generally try to wrap things up by 8:30 - 8:45 > > > Any topics or tangents other than PEAR going on? > > We're going to touch on briefly, at the beginning of the meeting, > NYPHP's effort to organize itself. The NYPHP-Dev list > (http://nyphp.org/lists) has had a lot of this talk, but briefly we're > writing a charter, forming departments, organizing current > projects, and > writing a mission statement. > > H > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From danielc at analysisandsolutions.com Mon Feb 23 12:55:30 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 23 Feb 2004 12:55:30 -0500 Subject: [nycphp-talk] sqlite temp file problems Message-ID: <20040223175530.GA26467@panix.com> Hi Folks: I've got SQLite working fine in PHP from command line scripts. When using it via my webserver (Apache as CGI, Windows 2000) I get the following error: "Warning: sqlite_open(): unable to open a temporary database file for storing temporary tables in" The permissions on my system's temporary directory and the directory where the SQLite file is to be stored are fine. The requested SQLite file even gets created with 0 bytes. Confounded, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jlacey at att.net Mon Feb 23 12:59:06 2004 From: jlacey at att.net (John Lacey) Date: Mon, 23 Feb 2004 10:59:06 -0700 Subject: [nycphp-talk] sqlite temp file problems In-Reply-To: <20040223175530.GA26467@panix.com> References: <20040223175530.GA26467@panix.com> Message-ID: <403A3F6A.8040903@att.net> Daniel Convissor wrote: > > "Warning: sqlite_open(): unable to open a temporary database file for > storing temporary tables in" > > The permissions on my system's temporary directory and the directory where > the SQLite file is to be stored are fine. The requested SQLite file even > gets created with 0 bytes. > what name are you using for the database? From danielc at analysisandsolutions.com Mon Feb 23 13:12:06 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 23 Feb 2004 13:12:06 -0500 Subject: [nycphp-talk] sqlite temp file problems In-Reply-To: <403A3F6A.8040903@att.net> References: <20040223175530.GA26467@panix.com> <403A3F6A.8040903@att.net> Message-ID: <20040223181205.GA27561@panix.com> On Mon, Feb 23, 2004 at 10:59:06AM -0700, John Lacey wrote: > > what name are you using for the database? foo.db or foo --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jlacey at att.net Mon Feb 23 13:26:48 2004 From: jlacey at att.net (John Lacey) Date: Mon, 23 Feb 2004 11:26:48 -0700 Subject: [nycphp-talk] sqlite temp file problems In-Reply-To: <20040223181205.GA27561@panix.com> References: <20040223175530.GA26467@panix.com> <403A3F6A.8040903@att.net> <20040223181205.GA27561@panix.com> Message-ID: <403A45E8.9010001@att.net> Daniel Convissor wrote: > On Mon, Feb 23, 2004 at 10:59:06AM -0700, John Lacey wrote: > >>what name are you using for the database? > > > foo.db or foo > > --Dan ok, what happens with this? $dbh = sqlite_open('foo.db', 0666, &$err_msg); btw, that works on a win2k box John From jlacey at att.net Mon Feb 23 13:44:13 2004 From: jlacey at att.net (John Lacey) Date: Mon, 23 Feb 2004 11:44:13 -0700 Subject: [nycphp-talk] sqlite temp file problems In-Reply-To: <20040223181205.GA27561@panix.com> References: <20040223175530.GA26467@panix.com> <403A3F6A.8040903@att.net> <20040223181205.GA27561@panix.com> Message-ID: <403A49FD.3020609@att.net> Daniel Convissor wrote: > On Mon, Feb 23, 2004 at 10:59:06AM -0700, John Lacey wrote: > >>what name are you using for the database? > > > foo.db or foo > > --Dan ok, what happens with this? $dbh = sqlite_open('foo.db', 0666, &$err_msg); btw, that works on a win2k box John I should have added that I'm *not* running in Apache cgi mode and I'm using XAMPP version 1.3 FWIW From danielc at analysisandsolutions.com Mon Feb 23 14:00:02 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 23 Feb 2004 14:00:02 -0500 Subject: [nycphp-talk] sqlite temp file problems In-Reply-To: <403A45E8.9010001@att.net> References: <20040223175530.GA26467@panix.com> <403A3F6A.8040903@att.net> <20040223181205.GA27561@panix.com> <403A45E8.9010001@att.net> Message-ID: <20040223190001.GA3452@panix.com> On Mon, Feb 23, 2004 at 11:26:48AM -0700, John Lacey wrote: > > $dbh = sqlite_open('foo.db', 0666, &$err_msg); First, I get a call time pass by reference is depricated warning. Taking out the & then takes me back to the original error message I posted. Something else is going on here. I took a look at my security logs and found attempts to create files such as "C:\WINNT\sqlite_5VwP2hmAcOMrUr1." Well, I run Apache as a restricted user, so of course it can't write to that directory! Now, WHY is it trying to write to that directory? How is one supposed to set the temp dir for SQLite in PHP? It's ignoring the system environment variables, that's for sure. Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jlacey at att.net Mon Feb 23 14:13:54 2004 From: jlacey at att.net (John Lacey) Date: Mon, 23 Feb 2004 12:13:54 -0700 Subject: [nycphp-talk] sqlite temp file problems In-Reply-To: <20040223190001.GA3452@panix.com> References: <20040223175530.GA26467@panix.com> <403A3F6A.8040903@att.net> <20040223181205.GA27561@panix.com> <403A45E8.9010001@att.net> <20040223190001.GA3452@panix.com> Message-ID: <403A50F2.6090305@att.net> Daniel Convissor wrote: > On Mon, Feb 23, 2004 at 11:26:48AM -0700, John Lacey wrote: > >>$dbh = sqlite_open('foo.db', 0666, &$err_msg); > > > First, I get a call time pass by reference is depricated warning. probably due to the fact that you're running php5 and I'm running sqlite built against php4 > > Taking out the & then takes me back to the original error message I > posted. > > Something else is going on here. I took a look at my security logs and > found attempts to create files such as "C:\WINNT\sqlite_5VwP2hmAcOMrUr1." > Well, I run Apache as a restricted user, so of course it can't write to > that directory! Now, WHY is it trying to write to that directory? How is > one supposed to set the temp dir for SQLite in PHP? It's ignoring the > system environment variables, that's for sure. > > Thanks, > > --Dan > I have a file in my C:\winnt\temp called sqlite_llkjadjfk (whatever) with a size of 0. dunno exactly what that is used for since I've never had to look for it before J From tgales at tgaconnect.com Mon Feb 23 15:32:56 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 23 Feb 2004 15:32:56 -0500 Subject: [nycphp-talk] sqlite temp file problems In-Reply-To: <20040223190001.GA3452@panix.com> Message-ID: <002a01c3fa4c$38f9f670$e98d3818@oberon1> Daniel Convissor writes: > Something else is going on here. I took a look at my > security logs and found attempts to create files such as > "C:\WINNT\sqlite_5VwP2hmAcOMrUr1." > Well, I run Apache as a restricted user, so of course it > can't write to that directory! Now, WHY is it trying to > write to that directory? How is one supposed to set the temp > dir for SQLite in PHP? It's ignoring the system environment > variables, that's for sure. out of curiosity where does open_basedir point to (if anything)? T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From danielc at analysisandsolutions.com Mon Feb 23 15:55:25 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 23 Feb 2004 15:55:25 -0500 Subject: [nycphp-talk] sqlite temp file problems In-Reply-To: <002a01c3fa4c$38f9f670$e98d3818@oberon1> References: <20040223190001.GA3452@panix.com> <002a01c3fa4c$38f9f670$e98d3818@oberon1> Message-ID: <20040223205524.GA21353@panix.com> On Mon, Feb 23, 2004 at 03:32:56PM -0500, Tim Gales wrote: > > out of curiosity where does open_basedir point to (if anything)? Wasn't set. Tinkered with it to see what happens. Had to add a bunch of paths to make it not produce open_basedir errors for normal operations. Now I'm back to the inital error message about the sqlite_open() temporary files. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From Cbielanski at inta.org Mon Feb 23 15:58:54 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Mon, 23 Feb 2004 15:58:54 -0500 Subject: [nycphp-talk] mysql_num_rows() redux Message-ID: I *know* this has to have been covered before, but when you have ostensibly no data in MySQL (that damn single row full of nulls) what's the proven method forresolveing the count as zero? Obviously, as I'm sure most of you know, you get a result of 1 even if there is no "real" data in a MySQL table. The nerve!! Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 From shiflett at php.net Mon Feb 23 16:34:51 2004 From: shiflett at php.net (Chris Shiflett) Date: Mon, 23 Feb 2004 13:34:51 -0800 (PST) Subject: [nycphp-talk] mysql_num_rows() redux In-Reply-To: Message-ID: <20040223213451.2189.qmail@web14310.mail.yahoo.com> --- Chris Bielanski wrote: > I *know* this has to have been covered before, but when you have > ostensibly no data in MySQL (that damn single row full of nulls) > what's the proven method forresolveing the count as zero? Obviously, > as I'm sure most of you know, you get a result of 1 even if there > is no "real" data in a MySQL table. I assume you mean that mysql_num_rows() will return 1 when there is 1 row, regardless of the data. This is good. Worse would be for the function to be incorrect. If you want to check whether a certain field is null, do it in your SQL statement: select foo from bar where blah is not null Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From Cbielanski at inta.org Mon Feb 23 16:40:42 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Mon, 23 Feb 2004 16:40:42 -0500 Subject: [nycphp-talk] mysql_num_rows() redux Message-ID: > select foo from bar where blah is not null Actually that was my first approach - somehow my result was still 1. Current workaround code is: if(mysql_num_rows($result) >= 2) { // do something } else { $row = mysql_fetch_assoc($result); if(is_null($row['id'])) { // do something else } } probably kludge-tastic but it hasn't bombed in the hour since I put it in... ~C > -----Original Message----- > From: Chris Shiflett [mailto:shiflett at php.net] > Sent: Monday, February 23, 2004 4:35 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] mysql_num_rows() redux > > > --- Chris Bielanski wrote: > > I *know* this has to have been covered before, but when you have > > ostensibly no data in MySQL (that damn single row full of nulls) > > what's the proven method forresolveing the count as zero? Obviously, > > as I'm sure most of you know, you get a result of 1 even if there > > is no "real" data in a MySQL table. > > I assume you mean that mysql_num_rows() will return 1 when > there is 1 row, > regardless of the data. This is good. Worse would be for the > function to > be incorrect. > > If you want to check whether a certain field is null, do it > in your SQL > statement: > > select foo from bar where blah is not null > > Hope that helps. > > Chris > > ===== > Chris Shiflett - http://shiflett.org/ > > PHP Security - O'Reilly > Coming mid-2004 > HTTP Developer's Handbook - Sams > http://httphandbook.org/ > PHP Community Site > http://phpcommunity.org/ > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From mitchy at spacemonkeylabs.com Mon Feb 23 19:01:39 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Mon, 23 Feb 2004 19:01:39 -0500 Subject: [nycphp-talk] Re: [nycphp-dev] LDAP Authentication Against Microshaft's Active Directory In-Reply-To: <6.0.1.1.2.20040223175935.01e13498@mail.optonline.net> References: <6.0.1.1.2.20040223175935.01e13498@mail.optonline.net> Message-ID: <403A9463.5000402@spacemonkeylabs.com> Michael Southwell wrote: > This inquiry should be directed to the NYPHP-talk discussion list. > > At 05:05 PM 2/23/2004, you wrote: > >> Have any of you attempted to authenticate a user against AD using >> LDAP? I am >> developing an application for a school district that will allow >> teachers and >> students to use their existing usernames and passwords. However, we >> have a >> user table in MySQL to authenticate parents. My answer to this is, well, yes and no ;^) I've done it with Zope/Plone, but never from PHP. The one thing that I remember is that there are two ports that an AD server listen to for LDAP, the 'official' one and the other for something like 'data services' or somesuch. It is this second port that your PHP apps will have to bind to, as the 'official' port mangles all transmissions to an almost unusable state. HTH, Mitch From kate_wei at hotmail.com Mon Feb 23 22:58:31 2004 From: kate_wei at hotmail.com (Kate Wei) Date: Mon, 23 Feb 2004 22:58:31 -0500 Subject: [nycphp-talk] MAC development environment Message-ID: Hi all, I am a web designer/developer working on PC mainly but lately I have gotten a lot of client requests for MAC platform testing and compatibility issues. Therefore - I am getting a powerbook even though I have very vague idea about how development environment on the MAC is... the last time I worked on a Mac was probably 5 years ago! Can anyone give me some advise on how to set up a development environment on the Mac and what I should get in terms of hardware/software to do that? I intend to get a powerbook G4 and network with my PC laptop which I do development of PHP/CF/ASP sites currently. Thanks in advance! Kate Wei From: Mitch Pirtle Reply-To: NYPHP Talk To: talk at lists.nyphp.org Subject: [nycphp-talk] Re: [nycphp-dev] LDAP Authentication Against Microshaft's Active Directory Date: Mon, 23 Feb 2004 19:01:39 -0500 Michael Southwell wrote: >This inquiry should be directed to the NYPHP-talk discussion list. > >At 05:05 PM 2/23/2004, you wrote: > >>Have any of you attempted to authenticate a user against AD using LDAP? I >>am >>developing an application for a school district that will allow teachers >>and >>students to use their existing usernames and passwords. However, we have a >>user table in MySQL to authenticate parents. My answer to this is, well, yes and no ;^) I've done it with Zope/Plone, but never from PHP. The one thing that I remember is that there are two ports that an AD server listen to for LDAP, the 'official' one and the other for something like 'data services' or somesuch. It is this second port that your PHP apps will have to bind to, as the 'official' port mangles all transmissions to an almost unusable state. HTH, Mitch _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk _________________________________________________________________ Say ?good-bye? to spam, viruses and pop-ups with MSN Premium -- free trial offer! http://click.atdmt.com/AVE/go/onm00200359ave/direct/01/ From felix at students.poly.edu Sun Feb 22 14:59:15 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Sun, 22 Feb 2004 14:59:15 -0500 Subject: [nycphp-talk] MAC development environment In-Reply-To: References: Message-ID: <20040222145915.59d1abea.felix@students.poly.edu> > > I am a web designer/developer working on PC mainly but lately I have > gotten a lot of client requests for MAC platform testing and > compatibility issues. Therefore - I am getting a powerbook even though > I have very vague idea about how development environment on the MAC > is... the last time I worked on a Mac was probably 5 years ago! Can > anyone give me some advise on how to set up a development environment > on the Mac and what I should get in terms of hardware/software to do > that? I intend to get a powerbook G4 and network with my PC laptop > which I do development of PHP/CF/ASP sites currently. If your Intel laptop remains your dev environment why do you need a dev environment on MAC. Just install IE for mac, Safari and test to see how your web pages look on them. > > Thanks in advance! > > Kate Wei > > > From: Mitch Pirtle > Reply-To: NYPHP Talk > To: talk at lists.nyphp.org > Subject: [nycphp-talk] Re: [nycphp-dev] LDAP Authentication Against > Microshaft's Active Directory > Date: Mon, 23 Feb 2004 19:01:39 -0500 > > Michael Southwell wrote: > > >This inquiry should be directed to the NYPHP-talk discussion list. > > > >At 05:05 PM 2/23/2004, you wrote: > > > >>Have any of you attempted to authenticate a user against AD using > >LDAP? I >am > >>developing an application for a school district that will allow > >teachers >and > >>students to use their existing usernames and passwords. However, we > >have a>user table in MySQL to authenticate parents. > > My answer to this is, well, yes and no ;^) > > I've done it with Zope/Plone, but never from PHP. The one thing that > I remember is that there are two ports that an AD server listen to for > LDAP, the 'official' one and the other for something like 'data > services' or somesuch. It is this second port that your PHP apps will > have to bind to, as the 'official' port mangles all transmissions to > an almost unusable state. > > HTH, > > Mitch > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > _________________________________________________________________ > Say ?good-bye? to spam, viruses and pop-ups with MSN Premium -- free > trial offer! http://click.atdmt.com/AVE/go/onm00200359ave/direct/01/ > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From cmerlo at ncc.edu Mon Feb 23 23:38:02 2004 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 23 Feb 2004 23:38:02 -0500 Subject: [nycphp-talk] MAC development environment In-Reply-To: <20040222145915.59d1abea.felix@students.poly.edu> References: <20040222145915.59d1abea.felix@students.poly.edu> Message-ID: <20040224043802.GA23175@ncc.edu> On 2004-02-22 14:59 -0500, felix zaslavskiy wrote: > If your Intel laptop remains your dev environment why do you need a dev > environment on MAC. Just install IE for mac, Safari and test to see how > your web pages look on them. May I also recommend Camino, http://www.mozilla.org/projects/camino/. Real nice looking browser, native Cocoa interface. I use mostly Linux, but I have a Mac on my desk at work which I fire up when I want to see really pretty things on my desktop, and Camino's one of them. -- cmerlo at ncc.edu http://turing.matcmp.ncc.edu/~cmerlo Q: What do you get when you cross a chicken with a mountain climber? A: You can't do that. A mountain climber is a scalar. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: From mlevy at hypersol.com Mon Feb 23 23:46:58 2004 From: mlevy at hypersol.com (Mauricio Sadicoff) Date: Mon, 23 Feb 2004 23:46:58 -0500 Subject: [nycphp-talk] MAC development environment In-Reply-To: <20040222145915.59d1abea.felix@students.poly.edu> References: <20040222145915.59d1abea.felix@students.poly.edu> Message-ID: <7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> On Feb 22, 2004, at 2:59 PM, felix zaslavskiy wrote: >> I intend to get a powerbook G4 and network with my PC laptop >> which I do development of PHP/CF/ASP sites currently. > > If your Intel laptop remains your dev environment why do you need a dev > environment on MAC. Just install IE for mac, Safari and test to see how > your web pages look on them. Anyway, if you need to develop in the Mac, you should have no problems with PHP or CF. After all, MacOS X is unix, actually BSD and it comes pre-installed with Apache, PHP and mySQL. ColdFusion is a commercial software, so you have to pay for it, but it does have a Mac version. If you need to serve ASP, you can use iASP (http://www.halcyonsoft.com/). IMHO, the Mac is now the best platform for web development, bar none. It runs the standard Unix software, has versions of everything that Wintel has, the colors actually match what you print and it's really beautiful to boot! Then again, I write for a Macintosh magazine in Brazil, so I might be a tiny bit biased ;-) Cheers, Mauricio --- Mauricio L. Sadicoff mlevy at hypersol.com CEO / President HyperSol LLC. http://www.hypersol.com "Peace of mind isn't at all superficial, really," I expound. "It's the whole thing. That which produces it is good maintenance; that which disturbs it is poor maintenance. What we call workability of the machine is just an objectification of this peace of mind. The ultimate test is always your own serenity." - Zen and the Art of Motorcycle Maintenance. From lulu at rolancers.com Mon Feb 23 23:53:08 2004 From: lulu at rolancers.com (Emma Hadome) Date: Tue, 24 Feb 2004 06:53:08 +0200 Subject: [nycphp-talk] MAC development environment References: <20040222145915.59d1abea.felix@students.poly.edu> <7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> Message-ID: <019f01c3fa92$1a9a60c0$7c516150@kappa.ro> ----- Original Message ----- From: "Mauricio Sadicoff" To: "NYPHP Talk" Sent: Tuesday, February 24, 2004 6:46 AM Subject: Re: [nycphp-talk] MAC development environment > On Feb 22, 2004, at 2:59 PM, felix zaslavskiy wrote: > > >> I intend to get a powerbook G4 and network with my PC laptop > >> which I do development of PHP/CF/ASP sites currently. > > > > If your Intel laptop remains your dev environment why do you need a dev > > environment on MAC. Just install IE for mac, Safari and test to see how > > your web pages look on them. > > Anyway, if you need to develop in the Mac, you should have no problems > with PHP or CF. After all, MacOS X is unix, actually BSD and it comes > pre-installed with Apache, PHP and mySQL. ColdFusion is a commercial > software, so you have to pay for it, but it does have a Mac version. If > you need to serve ASP, you can use iASP (http://www.halcyonsoft.com/). > > IMHO, the Mac is now the best platform for web development, bar none. > It runs the standard Unix software, has versions of everything that > Wintel has, the colors actually match what you print and it's really > beautiful to boot! > > Then again, I write for a Macintosh magazine in Brazil, so I might be a > tiny bit biased ;-) > > Cheers, > Mauricio > > --- > Mauricio L. Sadicoff mlevy at hypersol.com > CEO / President > HyperSol LLC. http://www.hypersol.com > > > "Peace of mind isn't at all superficial, really," I expound. "It's the > whole thing. That which produces it is good maintenance; that which > disturbs it is poor maintenance. What we call workability of the > machine is just an objectification of this peace of mind. The ultimate > test is always your own serenity." - Zen and the Art of Motorcycle > Maintenance. > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > From felix at students.poly.edu Sun Feb 22 15:44:36 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Sun, 22 Feb 2004 15:44:36 -0500 Subject: [nycphp-talk] MAC development environment In-Reply-To: <7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> References: <20040222145915.59d1abea.felix@students.poly.edu> <7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> Message-ID: <20040222154436.5446b4a0.felix@students.poly.edu> > IMHO, the Mac is now the best platform for web development, bar none. > It runs the standard Unix software, has versions of everything that > Wintel has, the colors actually match what you print and it's really > beautiful to boot! > Well any Unix based environment is pretty much better then windows in my opinion. I personally use Linux because its free and pretty much anything is supported on the desktop and the server. With Crossover you can even have IE. From lulu at rolancers.com Tue Feb 24 00:15:12 2004 From: lulu at rolancers.com (Emma Hadome) Date: Tue, 24 Feb 2004 07:15:12 +0200 Subject: [nycphp-talk] MAC development environment References: <20040222145915.59d1abea.felix@students.poly.edu><7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> <20040222154436.5446b4a0.felix@students.poly.edu> Message-ID: <01f401c3fa95$2eb52380$7c516150@kappa.ro> Yes I completely agree with you, Linux is more stable as well ~~~~~~~~~~~~~~~~~~~~~~~~ Best Outsourcing Experience http://www.rolancers.com Someone may do your work cheaper than you expected...It's been on the news From csnyder at chxo.com Tue Feb 24 00:17:10 2004 From: csnyder at chxo.com (Chris Snyder) Date: Tue, 24 Feb 2004 00:17:10 -0500 Subject: [nycphp-talk] MAC development environment In-Reply-To: <7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> References: <20040222145915.59d1abea.felix@students.poly.edu> <7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> Message-ID: <403ADE56.3000800@chxo.com> Mauricio Sadicoff wrote: > IMHO, the Mac is now the best platform for web development, bar none. > It runs the standard Unix software, has versions of everything that > Wintel has, the colors actually match what you print and it's really > beautiful to boot! > I second this -- OSX is Unix with a pretty interface. It ships with PHP installed, and it's supposed to be pretty easy to create native apps that call PHP scripts behind the scenes. Setting up a dev environment is going to be different for everyone, but here's a few tips off the top of my head. Install the X11 server from the OSX dvd if it isn't already installed. Install Apple's Developer Tools You can turn on Apache at the Sharing control panel Visit O'Reilly to find out how to turn on the root account + a bunch of other Unix tips Visit fink.sourceforge.net -- fink is an OSX version of Debian's package management system Feel free to ask questions here, particularly as they relate to using/developing on DAMP. csnyder From felix at students.poly.edu Sun Feb 22 16:11:17 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Sun, 22 Feb 2004 16:11:17 -0500 Subject: [nycphp-talk] MAC development environment In-Reply-To: <20040222154436.5446b4a0.felix@students.poly.edu> References: <20040222145915.59d1abea.felix@students.poly.edu> <7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> <20040222154436.5446b4a0.felix@students.poly.edu> Message-ID: <20040222161117.6a7651b3.felix@students.poly.edu> On Sun, 22 Feb 2004 15:44:36 -0500 felix zaslavskiy wrote: > > > IMHO, the Mac is now the best platform for web development, bar > > none. It runs the standard Unix software, has versions of everything > > that Wintel has, the colors actually match what you print and it's > > really beautiful to boot! > > > > Well any Unix based environment is pretty much better then windows in > my opinion. I personally use Linux because its free and pretty much > anything is supported on the desktop and the server. With Crossover > you can even have IE. I know I must sound like total Mr Obvious to most people on this list but consider that not everyone knows of the alternatives at this time especially students in colleges who are handed a laptop with XP preinstalled. But if someone is taking a CS degree and still have not heard that yes Linux/BSD is better then they must be living under a rock. > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From faber at linuxnj.com Tue Feb 24 00:39:35 2004 From: faber at linuxnj.com (Faber Fedor) Date: Tue, 24 Feb 2004 00:39:35 -0500 Subject: [nycphp-talk] MAC development environment In-Reply-To: <20040222161117.6a7651b3.felix@students.poly.edu> References: <20040222145915.59d1abea.felix@students.poly.edu> <7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> <20040222154436.5446b4a0.felix@students.poly.edu> <20040222161117.6a7651b3.felix@students.poly.edu> Message-ID: <20040224053935.GA28733@uranus.faber.nom> On Sun, Feb 22, 2004 at 04:11:17PM -0500, felix zaslavskiy wrote: > I know I must sound like total Mr Obvious to most people on this list > but consider that not everyone knows of the alternatives at this time > especially students in colleges who are handed a laptop with XP > preinstalled. But if someone is taking a CS degree and still have not > heard that yes Linux/BSD is better then they must be living under a > rock. There must be a helluva lot of rocks out there then. The people I know into Linux/BSD went out of their way to find it. Most college students/comp-sci people/humans don't go out of their way for things they're not truly interested in. Hell, most people don't go out of their way, period. Inertia is very powerful; that's what keeps [MAJOR CORPORATION] where they are. -- Regards, Faber Linux New Jersey: Open Source Solutions for New Jersey http://www.linuxnj.com From dyun at blue-iceberg.com Tue Feb 24 10:09:31 2004 From: dyun at blue-iceberg.com (David Yun) Date: Tue, 24 Feb 2004 10:09:31 -0500 Subject: [nycphp-talk] MAC development environment In-Reply-To: Message-ID: Kate, Here's a really great resource for straightforward Mac OSX php and mySQL packages, in addition to other software and tips: http://www.entropy.ch/ Good Luck! Dave ............................................................... David Yun Blue Iceberg LLC Website Development | Strategic Marketing | Business Solutions http://www.blue-iceberg.com Tel: 212.413.9226 Ext.9238 Fax: 212.413.9201 on 2/23/04 10:58 PM, Kate Wei at kate_wei at hotmail.com wrote: > Hi all, > > I am a web designer/developer working on PC mainly but lately I have gotten > a lot of client requests for MAC platform testing and compatibility issues. > Therefore - I am getting a powerbook even though I have very vague idea > about how development environment on the MAC is... the last time I worked on > a Mac was probably 5 years ago! Can anyone give me some advise on how to set > up a development environment on the Mac and what I should get in terms of > hardware/software to do that? I intend to get a powerbook G4 and network > with my PC laptop which I do development of PHP/CF/ASP sites currently. > > Thanks in advance! > > Kate Wei > > > From: Mitch Pirtle > Reply-To: NYPHP Talk > To: talk at lists.nyphp.org > Subject: [nycphp-talk] Re: [nycphp-dev] LDAP Authentication Against > Microshaft's Active Directory > Date: Mon, 23 Feb 2004 19:01:39 -0500 > From keith at keithjr.net Tue Feb 24 11:09:25 2004 From: keith at keithjr.net (keith at keithjr.net) Date: Tue, 24 Feb 2004 08:09:25 -0800 (PST) Subject: [nycphp-talk] Active Directory Authentication using LDAP + PHP In-Reply-To: <019f01c3fa92$1a9a60c0$7c516150@kappa.ro> References: <20040222145915.59d1abea.felix@students.poly.edu><7AB8B0DA-6684-11D8-BEDE-000A95B352F0@hypersol.com> <019f01c3fa92$1a9a60c0$7c516150@kappa.ro> Message-ID: <12257.65.211.92.98.1077638965.squirrel@www.keithjr.net> I noticed someone asking about Active Directory authentication using straight up php - so I figured that I would send this along. This is a snippet of a login script for a calendar scheduling ap that I wrote in PHP for a local intranet. You would make a login form, with post variables of username and password, and it will authenticate them to the AD server. How this works: it connects to the LDAP server with a valid login - which I created the username ldap in active directory, to query the database, since it would not allow anonymous access. You would look up the correct username for that account by querying the smaaccountname field for the username that they entered. If that exists, then get the correct username to bind to the server with, disconnect, and retry to connect with the users proper username and their password. If it connects, you know that it is a valid username. I have used this script in their helpdesk application so that passwords were being checked vs active directory instead of the internal help desk application's passwords. This is just one way of doing it - if anyone else has comments or questions, please feel free to let me now! // connect to LDAP server $ldap = ldap_connect("172.17.1.11") or die("Cannot connect to the ldap server :/"); $oudc = "cn=Users, dc=thompsonhealth, dc=org"; $searchdc = "dc=thompsonhealth, dc=org"; $dn2 = "cn=ldap, ".$oudc; $password = "password"; $auth = false; //look up OU if (!($res = ldap_bind($ldap,$dn2,$password))) { print(ldap_error($ldap) . "
"); die("Could not bind to $dn"); } else { // set search critia for OU $filter = "samaccountname=".$_POST['username']; // search OU $sr = ldap_search($ldap,$searchdc,$filter); if (!$sr) { die("search failed\n"); } else { // get fields from search $info = ldap_get_entries($ldap,$sr); if ($info["count"] == 0) { $auth = false; } else { $auth = true; $user_cn = $info[0]["cn"][0]; } // disconnect from LDAP server ldap_unbind($ldap); } } if ($auth == false) { die("Could not authenticate you to the Active Directory Server."); } $ldap = ldap_connect("172.17.1.11") or die("Cannot connect to AD server :/"); $oudc = "cn=users, dc=thompsonhealth, dc=org"; $dn2 = "cn=".$user_cn.", ".$oudc; $password = $_POST['password']; //look up OU if (!($res = ldap_bind($ldap,$dn2,$password))) { $login = 0; $message = "Invalid Active Directory Password."; } else { $sr = ldap_search($ldap,"dc=thompsonhealth, dc=org","cn=".$user_cn); $info = ldap_get_entries($ldap,$sr); $login = 1; $message = "You have successfully logged in to Active Directory.
  • Email : ".$info[0]['mail'][0]."
  • Phone Number : ".$info[0]['telephonenumber'][0]."
"; } From dmintz at davidmintz.org Tue Feb 24 11:43:48 2004 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 24 Feb 2004 11:43:48 -0500 (EST) Subject: [nycphp-talk] mysql concurrency redux In-Reply-To: References: Message-ID: Still having trouble understanding how to avoid the Lost Update Problem, which was discussed here a couple months ago (http://lists.nyphp.org/pipermail/talk/2003-December/006718.html etc). An HTML form is populated with data from a db, including a field holding my last_modified timestamp so I can compare it with the db before I write the update. How is using a transaction supposed to prevent another client from sneaking in an update after I compare, but before I write? I've read that you should either lock tables or use transactions. My experiment (below) seems to suggest transactions alone is not enough and I have to lock tables as well, or instead. But that doesn't sound right -- I must be confused. I've tried setting the isolation level to "read uncommitted" and it makes no difference. Here's the table. CREATE TABLE test01 ( id smallint(6) NOT NULL auto_increment, string varchar(75) default NULL, lastmod timestamp(14) NOT NULL, PRIMARY KEY (id) ) TYPE=InnoDB; INSERT INTO test01 VALUES (1,'bla bla bla', NOW()); -- Here's the experiment. When I load a copy into each of two windows and submit both so they overlap in time, I expect the first to succeed and the second to abort. Is there something stupid I'm doing wrong here? (btw I am making sure to submit something in the 'string' field that's different from what's in the db to ensure that my timestamp updates) setFetchMode(DB_FETCHMODE_ASSOC); if($_SERVER['REQUEST_METHOD']=='POST') { $db->query("set transaction isolation level READ UNCOMMITTED"); $db->query("start transaction"); // compare our timestamp with db $theirs = $db->getOne("select lastmod from test01 where id=1"); echo "sleeping..."; flush(); sleep(4); if ($theirs != $_POST['lastmod']) { echo "record has been modified by someone else. reloading..."; $db->query("rollback"); } else { $db->query('update test01 set string =' . $db->quote($_POST['string']) . ' where id=1'); $db->query("commit"); echo "ok, $theirs = {$_POST['lastmod']}, updating... "; } } $formData = $db->getRow("select * from test01 where id = 1"); ?> Id
Last Mod
String
FWIW I've tried this with both 4.0.13-standard and 4.0.16-max-nt-log, both with PEAR DB 1.6.0RC6 Many many thanks, --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From shiflett at php.net Tue Feb 24 12:07:55 2004 From: shiflett at php.net (Chris Shiflett) Date: Tue, 24 Feb 2004 09:07:55 -0800 (PST) Subject: [nycphp-talk] mysql concurrency redux In-Reply-To: Message-ID: <20040224170755.66694.qmail@web14306.mail.yahoo.com> --- David Mintz wrote: > How is using a transaction supposed to prevent another client from > sneaking in an update after I compare, but before I write? Transactions are guaranteed to be atomic. So, the database makes sure there is no such thing as "sneaking in an update after I compare, but before I write." Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From tmote at lastmansoftware.com Tue Feb 24 12:38:56 2004 From: tmote at lastmansoftware.com (Ty R. Mote) Date: Tue, 24 Feb 2004 11:38:56 -0600 Subject: [nycphp-talk] *Repost from DEV List* LDAP Authentication Against Microshaft's Active Directory Message-ID: *Repost from DEV List* Have any of you attempted to authenticate a user against AD using LDAP? I am developing an application for a school district that will allow teachers and students to use their existing usernames and passwords. However, we have a user table in MySQL to authenticate parents. Basically what I want to happen is when a user supplies a un/pw combination, it will first attempt to authenticate against AD and then failover to MySQL. It may actually be easier to have them choose what type of user they are, but I wouldn't get to experience the joy of my original idea! I am using a class that was developed for LDAP. I have worked on porting most of the code to work with the nuances of AD. Before I get much further, I would like to know if anyone has found a VERY clean and efficient way of doing it. Here is the setup that I am "working" with: MS Windows Server 2003 IIS 6 w/ PHP 4.3.4 Active Directory MySQL 4.0.16 I have complete access to the box(es) to install any modules, etc. that may (or may not) be needed. -- Ty R. Mote From dmintz at davidmintz.org Tue Feb 24 12:57:54 2004 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 24 Feb 2004 12:57:54 -0500 (EST) Subject: [nycphp-talk] mysql concurrency redux In-Reply-To: <20040224170755.66694.qmail@web14306.mail.yahoo.com> References: <20040224170755.66694.qmail@web14306.mail.yahoo.com> Message-ID: On Tue, 24 Feb 2004, Chris Shiflett wrote: > --- David Mintz wrote: > > How is using a transaction supposed to prevent another client from > > sneaking in an update after I compare, but before I write? > > Transactions are guaranteed to be atomic. So, the database makes sure > there is no such thing as "sneaking in an update after I compare, but > before I write." > > Hope that helps. Thanks -- that's exactly why I don't understand why the test I've created appears to show otherwise. I'm trying to figure out what I'm missing. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From tgales at tgaconnect.com Tue Feb 24 13:04:01 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 24 Feb 2004 13:04:01 -0500 Subject: [nycphp-talk] mysql concurrency redux In-Reply-To: Message-ID: <000701c3fb00$95420710$e98d3818@oberon1> David Mintz writes: " Still having trouble understanding how to avoid the Lost Update Problem" This link will not immediately answer the question you're asking. It is from an outline for a course in operating system structures : http://www.bridgeport.edu/sed/projects/cs503/Spring_2001/kode/os/sync.htm I would suggest you compare 'locks' with 'semaphores' there. Many operating system mechanisms are quite re-usable in applications. I would like to know where you read: "I've read that you should either lock tables or use transactions" I think there are times when you want to lock down a table in part of a transaction -- i.e. do both. When you start locking stuff down in transactions, it is beneficial to have some mechanism in place to avoid 'race' conditions. (see the above link for ideas on that) Hope this helps. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From dmintz at davidmintz.org Tue Feb 24 13:52:23 2004 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 24 Feb 2004 13:52:23 -0500 (EST) Subject: [nycphp-talk] mysql concurrency redux In-Reply-To: <000701c3fb00$95420710$e98d3818@oberon1> References: <000701c3fb00$95420710$e98d3818@oberon1> Message-ID: On Tue, 24 Feb 2004, Tim Gales wrote: > [...] > This link will not immediately answer the > question you're asking.[...] > http://www.bridgeport.edu/sed/projects/cs503/Spring_2001/kode/os/sync.htm > > I would suggest you compare 'locks' with 'semaphores' there. > > Many operating system mechanisms are quite re-usable in applications. > Thanks for tip Tim. I've just read it and plan to re-read it. > I would like to know where you read: > "I've read that you should either lock tables or use transactions" Maybe I oversimplified, and I don't mean to put words in anyone's mouth. But there was this: "Obviously, you need to read the last_update value and have your UPDATE occur with no other updates sneaking in between them. If you're using InnoDB tables, use a transaction, otherwise, lock the table for writing before you read the last_update value and then unlock it after you either write the new data or decide that you can't write because it's changed." in , and there's a discussion in MySQL by Paul Dubois (2nd Ed; Sam's; pp 238 et seq) that seems to imply that one either locks tables or uses transactions. And I have some other books lying around... I'll spare you the rest of the bibliography. > > I think there are times when you want to lock down a table in part > of a transaction -- i.e. do both. > Most respectfully, I agree (-: I believe my scenario is a case in point. > When you start locking stuff down in transactions, it is beneficial to > have some mechanism in place to avoid 'race' conditions. > (see the above link for ideas on that) Thanks again. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From keith at keithjr.net Tue Feb 24 14:03:03 2004 From: keith at keithjr.net (keith at keithjr.net) Date: Tue, 24 Feb 2004 11:03:03 -0800 (PST) Subject: [nycphp-talk] *Repost from DEV List* LDAP Authentication AgainstMicroshaft's Active Directory In-Reply-To: References: Message-ID: <33232.65.211.92.98.1077649383.squirrel@www.keithjr.net> I posted this earlier today - you might want to take a look at it and see if it can help you... ------- I noticed someone asking about Active Directory authentication using straight up php - so I figured that I would send this along. This is a snippet of a login script for a calendar scheduling ap that I wrote in PHP for a local intranet. You would make a login form, with post variables of username and password, and it will authenticate them to the AD server. How this works: it connects to the LDAP server with a valid login - which I created the username ldap in active directory, to query the database, since it would not allow anonymous access. You would look up the correct username for that account by querying the smaaccountname field for the username that they entered. If that exists, then get the correct username to bind to the server with, disconnect, and retry to connect with the users proper username and their password. If it connects, you know that it is a valid username. I have used this script in their helpdesk application so that passwords were being checked vs active directory instead of the internal help desk application's passwords. This is just one way of doing it - if anyone else has comments or questions, please feel free to let me now! // connect to LDAP server $ldap = ldap_connect("172.17.1.11") or die("Cannot connect to the ldap server :/"); $oudc = "cn=Users, dc=thompsonhealth, dc=org"; $searchdc = "dc=thompsonhealth, dc=org"; $dn2 = "cn=ldap, ".$oudc; $password = "password"; $auth = false; //look up OU if (!($res = ldap_bind($ldap,$dn2,$password))) { print(ldap_error($ldap) . "
"); die("Could not bind to $dn"); } else { // set search critia for OU $filter = "samaccountname=".$_POST['username']; // search OU $sr = ldap_search($ldap,$searchdc,$filter); if (!$sr) { die("search failed\n"); } else { // get fields from search $info = ldap_get_entries($ldap,$sr); if ($info["count"] == 0) { $auth = false; } else { $auth = true; $user_cn = $info[0]["cn"][0]; } // disconnect from LDAP server ldap_unbind($ldap); } } if ($auth == false) { die("Could not authenticate you to the Active Directory Server."); } $ldap = ldap_connect("172.17.1.11") or die("Cannot connect to AD server :/"); $oudc = "cn=users, dc=thompsonhealth, dc=org"; $dn2 = "cn=".$user_cn.", ".$oudc; $password = $_POST['password']; //look up OU if (!($res = ldap_bind($ldap,$dn2,$password))) { $login = 0; $message = "Invalid Active Directory Password."; } else { $sr = ldap_search($ldap,"dc=thompsonhealth, dc=org","cn=".$user_cn); $info = ldap_get_entries($ldap,$sr); $login = 1; $message = "You have successfully logged in to Active Directory.
  • Email : ".$info[0]['mail'][0]."
  • Phone Number : ".$info[0]['telephonenumber'][0]."
"; } > *Repost from DEV List* > > Have any of you attempted to authenticate a user against AD using LDAP? I > am > developing an application for a school district that will allow teachers > and > students to use their existing usernames and passwords. However, we have a > user table in MySQL to authenticate parents. > > Basically what I want to happen is when a user supplies a un/pw > combination, > it will first attempt to authenticate against AD and then failover to > MySQL. > It may actually be easier to have them choose what type of user they are, > but I wouldn't get to experience the joy of my original idea! > > I am using a class that was developed for LDAP. I have worked on porting > most of the code to work with the nuances of AD. Before I get much > further, > I would like to know if anyone has found a VERY clean and efficient way of > doing it. > > Here is the setup that I am "working" with: > > MS Windows Server 2003 > IIS 6 w/ PHP 4.3.4 > Active Directory > MySQL 4.0.16 > > I have complete access to the box(es) to install any modules, etc. that > may > (or may not) be needed. > > > -- > Ty R. Mote > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From felix at students.poly.edu Mon Feb 23 04:31:23 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Mon, 23 Feb 2004 04:31:23 -0500 Subject: [nycphp-talk] mysql concurrency redux In-Reply-To: References: Message-ID: <20040223043123.0d1276c2.felix@students.poly.edu> Should not you be doing update of lastmod at the same time you update string ? I think you may have a logical error that is why your script does not work. > > Here's the experiment. When I load a copy into each of two windows and > submit both so they overlap in time, I expect the first to succeed and > the second to abort. Is there something stupid I'm doing wrong here? > (btw I am making sure to submit something in the 'string' field that's > different from what's in the db to ensure that my timestamp updates) > > > require('DB.php'); > $db=DB::connect('mysql://joe_user at localhost/test'); > $db->setFetchMode(DB_FETCHMODE_ASSOC); > > if($_SERVER['REQUEST_METHOD']=='POST') { > > $db->query("set transaction isolation level READ > UNCOMMITTED");$db->query("start transaction"); > // compare our timestamp with db > $theirs = $db->getOne("select lastmod from test01 where > id=1"); echo "sleeping..."; flush(); > sleep(4); > if ($theirs != $_POST['lastmod']) { > echo "record has been modified by someone else. > reloading..."; > $db->query("rollback"); > } else { > $db->query('update test01 set string =' . > $db->quote($_POST['string']) . ' where id=1'); > $db->query("commit"); > echo "ok, $theirs = {$_POST['lastmod']}, updating... > "; > } > } > $formData = $db->getRow("select * from test01 where id = 1"); > ?> > >
> Id value="" />
> Last Mod value="" />
> String value="" />
> > > > FWIW I've tried this with both 4.0.13-standard and 4.0.16-max-nt-log, > both with PEAR DB 1.6.0RC6 > > > Many many thanks, > > > --- > David Mintz > http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- Sopranos 24:17 > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From tmote at lastmansoftware.com Tue Feb 24 14:19:20 2004 From: tmote at lastmansoftware.com (Ty R. Mote) Date: Tue, 24 Feb 2004 13:19:20 -0600 Subject: [nycphp-talk] *Repost from DEV List* LDAP Authentication AgainstMicroshaft's Active Directory In-Reply-To: <33232.65.211.92.98.1077649383.squirrel@www.keithjr.net> Message-ID: Thank you, that helps a lot! I have been working along the same lines with the class that I found. However, it wasn't made specifically for AD. I'm still open and looking for some more suggestions. As soon as I test my method a little more, I will post it for critique. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of keith at keithjr.net Sent: Tuesday, February 24, 2004 1:03 PM To: NYPHP Talk Subject: Re: [nycphp-talk] *Repost from DEV List* LDAP Authentication AgainstMicroshaft's Active Directory I posted this earlier today - you might want to take a look at it and see if it can help you... ------- I noticed someone asking about Active Directory authentication using straight up php - so I figured that I would send this along. This is a snippet of a login script for a calendar scheduling ap that I wrote in PHP for a local intranet. You would make a login form, with post variables of username and password, and it will authenticate them to the AD server. How this works: it connects to the LDAP server with a valid login - which I created the username ldap in active directory, to query the database, since it would not allow anonymous access. You would look up the correct username for that account by querying the smaaccountname field for the username that they entered. If that exists, then get the correct username to bind to the server with, disconnect, and retry to connect with the users proper username and their password. If it connects, you know that it is a valid username. I have used this script in their helpdesk application so that passwords were being checked vs active directory instead of the internal help desk application's passwords. This is just one way of doing it - if anyone else has comments or questions, please feel free to let me now! // connect to LDAP server $ldap = ldap_connect("172.17.1.11") or die("Cannot connect to the ldap server :/"); $oudc = "cn=Users, dc=thompsonhealth, dc=org"; $searchdc = "dc=thompsonhealth, dc=org"; $dn2 = "cn=ldap, ".$oudc; $password = "password"; $auth = false; //look up OU if (!($res = ldap_bind($ldap,$dn2,$password))) { print(ldap_error($ldap) . "
"); die("Could not bind to $dn"); } else { // set search critia for OU $filter = "samaccountname=".$_POST['username']; // search OU $sr = ldap_search($ldap,$searchdc,$filter); if (!$sr) { die("search failed\n"); } else { // get fields from search $info = ldap_get_entries($ldap,$sr); if ($info["count"] == 0) { $auth = false; } else { $auth = true; $user_cn = $info[0]["cn"][0]; } // disconnect from LDAP server ldap_unbind($ldap); } } if ($auth == false) { die("Could not authenticate you to the Active Directory Server."); } $ldap = ldap_connect("172.17.1.11") or die("Cannot connect to AD server :/"); $oudc = "cn=users, dc=thompsonhealth, dc=org"; $dn2 = "cn=".$user_cn.", ".$oudc; $password = $_POST['password']; //look up OU if (!($res = ldap_bind($ldap,$dn2,$password))) { $login = 0; $message = "Invalid Active Directory Password."; } else { $sr = ldap_search($ldap,"dc=thompsonhealth, dc=org","cn=".$user_cn); $info = ldap_get_entries($ldap,$sr); $login = 1; $message = "You have successfully logged in to Active Directory.
  • Email : ".$info[0]['mail'][0]."
  • Phone Number : ".$info[0]['telephonenumber'][0]."
"; } > *Repost from DEV List* > > Have any of you attempted to authenticate a user against AD using LDAP? I > am > developing an application for a school district that will allow teachers > and > students to use their existing usernames and passwords. However, we have a > user table in MySQL to authenticate parents. > > Basically what I want to happen is when a user supplies a un/pw > combination, > it will first attempt to authenticate against AD and then failover to > MySQL. > It may actually be easier to have them choose what type of user they are, > but I wouldn't get to experience the joy of my original idea! > > I am using a class that was developed for LDAP. I have worked on porting > most of the code to work with the nuances of AD. Before I get much > further, > I would like to know if anyone has found a VERY clean and efficient way of > doing it. > > Here is the setup that I am "working" with: > > MS Windows Server 2003 > IIS 6 w/ PHP 4.3.4 > Active Directory > MySQL 4.0.16 > > I have complete access to the box(es) to install any modules, etc. that > may > (or may not) be needed. > > > -- > Ty R. Mote > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From faber at linuxnj.com Tue Feb 24 15:08:33 2004 From: faber at linuxnj.com (Faber Fedor) Date: Tue, 24 Feb 2004 15:08:33 -0500 Subject: [nycphp-talk] shopping cart experiences Message-ID: <20040224200833.GA2267@uranus.faber.nom> Anyone have a recommendation on PHP based shopping carts? I hear osCommerce is great "out of the box" but I'm sure my client isn't going to want to use that layout. Supposedly it's a bear to modify. I'm currently looking at FreeTrade (http://share.whichever.com/index.php?SCREEN=freetrade). A commercial solution will be okay, but only if I get source, can modify it and support is as good as FOSS support. -- Regards, Faber Linux New Jersey: Open Source Solutions for New Jersey http://www.linuxnj.com From felix at students.poly.edu Mon Feb 23 05:36:09 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Mon, 23 Feb 2004 05:36:09 -0500 Subject: [nycphp-talk] shopping cart experiences In-Reply-To: <20040224200833.GA2267@uranus.faber.nom> References: <20040224200833.GA2267@uranus.faber.nom> Message-ID: <20040223053609.10033006.felix@students.poly.edu> On Tue, 24 Feb 2004 15:08:33 -0500 Faber Fedor wrote: > Anyone have a recommendation on PHP based shopping carts? > You call it shopping cart but remember that the cart is only the storefront you have a load of administrative interface to deal with. I think its better to call these e-commerce apps. Have you taken a loot at interchange ? (even though not php looks very good) > I hear osCommerce is great "out of the box" but I'm sure my client > isn't going to want to use that layout. Supposedly it's a bear to > modify. > > I'm currently looking at FreeTrade > (http://share.whichever.com/index.php?SCREEN=freetrade). > > A commercial solution will be okay, but only if I get source, can > modify it and support is as good as FOSS support. > > > -- > > Regards, > > Faber > > Linux New Jersey: Open Source Solutions for New Jersey > http://www.linuxnj.com > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From dmintz at davidmintz.org Tue Feb 24 15:22:36 2004 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 24 Feb 2004 15:22:36 -0500 (EST) Subject: [nycphp-talk] mysql concurrency redux In-Reply-To: <20040223043123.0d1276c2.felix@students.poly.edu> References: <20040223043123.0d1276c2.felix@students.poly.edu> Message-ID: On Mon, 23 Feb 2004, felix zaslavskiy wrote: > Should not you be doing update of lastmod at the same time you update > string ? I think you may have a logical error that is why your script > does not work. Heh. I wish. It's a TIMESTAMP, which "provides a type that you can use to automatically mark INSERT or UPDATE operations with the current date and time" when you're not running in Max-DB mode. (http://www.mysql.com/doc/en/DATETIME.html). You could explicitly set it to now() but you don't have to. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From chubbard at next-online.net Tue Feb 24 16:01:26 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Tue, 24 Feb 2004 13:01:26 -0800 Subject: [nycphp-talk] shopping cart experiences In-Reply-To: <20040224200833.GA2267@uranus.faber.nom> References: <20040224200833.GA2267@uranus.faber.nom> Message-ID: <403BBBA6.6060503@next-online.net> I've played with a couple. I've implemented two vanilla osCommerce sites. I've implemented one highly customized osCommerce (about 1/4 of the app rewritten). osCommerce is a nightmare to customize/modify. The community contributions are mostly dubious. Sometimes the contributions require other contributions to work, I've never seen those dependencies documented. At this point I've written two different ecommerce packages (mostly from scratch, the second based on the first). It's faster to write from scratch than it is to do the kind of tweaks to osCommerce that customer usually request. As a developer, if you can, stay away from osCommerce. As an end user, osCommerce will probably meet your needs (60 - 80%). Chris Faber Fedor wrote: >Anyone have a recommendation on PHP based shopping carts? > >I hear osCommerce is great "out of the box" but I'm sure my client isn't >going to want to use that layout. Supposedly it's a bear to modify. > >I'm currently looking at FreeTrade >(http://share.whichever.com/index.php?SCREEN=freetrade). > >A commercial solution will be okay, but only if I get source, can >modify it and support is as good as FOSS support. > > > > From ejp at well.com Tue Feb 24 16:39:16 2004 From: ejp at well.com (Edward Potter) Date: Tue, 24 Feb 2004 16:39:16 -0500 Subject: [nycphp-talk] shopping cart experiences In-Reply-To: <403BBBA6.6060503@next-online.net> References: <20040224200833.GA2267@uranus.faber.nom> <403BBBA6.6060503@next-online.net> Message-ID: I think OScommerce is great! Implementing my first site now for a large scale art based site. Hitting the road with 1/2 million $ worth of inventory that we have to move. I think to date it's one of the best written PHP applications out there. -ed On Feb 24, 2004, at 4:01 PM, Chris Hubbard wrote: > I've played with a couple. I've implemented two vanilla osCommerce > sites. I've implemented one highly customized osCommerce (about 1/4 > of the app rewritten). osCommerce is a nightmare to customize/modify. > The community contributions are mostly dubious. Sometimes the > contributions require other contributions to work, I've never seen > those dependencies documented. > > At this point I've written two different ecommerce packages (mostly > from scratch, the second based on the first). It's faster to write > from scratch than it is to do the kind of tweaks to osCommerce that > customer usually request. > > As a developer, if you can, stay away from osCommerce. > As an end user, osCommerce will probably meet your needs (60 - 80%). > > Chris > > Faber Fedor wrote: > >> Anyone have a recommendation on PHP based shopping carts? >> >> I hear osCommerce is great "out of the box" but I'm sure my client >> isn't >> going to want to use that layout. Supposedly it's a bear to modify. >> >> I'm currently looking at FreeTrade >> (http://share.whichever.com/index.php?SCREEN=freetrade). >> >> A commercial solution will be okay, but only if I get source, can >> modify it and support is as good as FOSS support. >> >> >> > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > //----------------------------------------- http://mygoo.typepad.com http://mygoo.typepad.com/coder From phillip.powell at adnet-sys.com Tue Feb 24 16:59:28 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Tue, 24 Feb 2004 16:59:28 -0500 Subject: [nycphp-talk] Working with recursive "single-referenced" methods and static variables Message-ID: <403BC940.9090101@adnet-sys.com> [CODE] class DepartmentTree { function &buildTree($id) { static $html; if (!isset($html)) { // DO STUFF HERE TO $html } // DO MORE STUFF if ($condition_is_met) $this->buildTree($newID); $this->html = $html; } } [/CODE] The above (and greatly paraphrased from the 100-line actual class) class and method, in its real form, totally works inasmuch as it successfully always creates an HTML hierarchial tree of departments mapped with child departments. I have no problem with this.. as long as I only use the class once. However, there is a case where I need the entire contents of the departments table dumped out into a resultset, and to do that I figured I would just loop through a query of records that have no parent ID; each id in each row I seed into $tree->buildTree(): [CODE] for ($i = 0; $i < @sizeof($result); $i++) { $tree->buildTree($result[$i]->id); $this->deptArray += $tree->convert_to_array(); $tree->clearTreeHTML(); } [/CODE] The "convert_to_array()" method will convert the contents of $this->html from HTML content to an array, keeping the original hierarchial order; the "clearTreeHTML()" method will set $this->html to NULL or "". Problem is, it does not do that, because apparently "static $html" keeps an instance of it running in the single-referenced instance of "buildTree" method. Based on how best I can explain my problem, and sorry I can't explain it any better w/o dumping the actual code line by line, how have you all figured out the best way to generate multiple, unique instances from a single-referenced method that uses a static local variable? Thanx Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From rich at f1central.net Tue Feb 24 17:19:29 2004 From: rich at f1central.net (Rich Gray) Date: Tue, 24 Feb 2004 23:19:29 +0100 Subject: [nycphp-talk] shopping cart experiences In-Reply-To: Message-ID: > > I think to date it's one of the best written PHP applications out there. you're kidding right...? IMO the code is overblown, messy and obtuse ... I have spent many an hour trying to work out wtf they're doing sometimes with all those tep_* functions and half baked classes ... as an aside has anyone looked at http://www.zen-cart.com ? based on osc apparently but better.... //rich From webmaster at localnotion.com Tue Feb 24 17:30:10 2004 From: webmaster at localnotion.com (Matthew Terenzio) Date: Tue, 24 Feb 2004 17:30:10 -0500 Subject: [nycphp-talk] Working with recursive "single-referenced" methods and static variables In-Reply-To: <403BC940.9090101@adnet-sys.com> References: <403BC940.9090101@adnet-sys.com> Message-ID: <016EA423-6719-11D8-A7C3-0003938BDF32@localnotion.com> I had a similar problem once and never figured it out. I thought it was a deficiency in the object oriented aspects of PHP. Something that would be addressed in PHP 5. On Feb 24, 2004, at 4:59 PM, Phil Powell wrote: > [CODE] > class DepartmentTree { > > function &buildTree($id) { > static $html; > if (!isset($html)) { > // DO STUFF HERE TO $html > } > // DO MORE STUFF > if ($condition_is_met) $this->buildTree($newID); > $this->html = $html; > } > > } > [/CODE] > > The above (and greatly paraphrased from the 100-line actual class) > class and method, in its real form, totally works inasmuch as it > successfully always creates an HTML hierarchial tree of departments > mapped with child departments. I have no problem with this.. as long > as I only use the class once. > > However, there is a case where I need the entire contents of the > departments table dumped out into a resultset, and to do that I > figured I would just loop through a query of records that have no > parent ID; each id in each row I seed into $tree->buildTree(): > > [CODE] > for ($i = 0; $i < @sizeof($result); $i++) { > $tree->buildTree($result[$i]->id); > $this->deptArray += $tree->convert_to_array(); > $tree->clearTreeHTML(); > } > [/CODE] > > The "convert_to_array()" method will convert the contents of > $this->html from HTML content to an array, keeping the original > hierarchial order; the "clearTreeHTML()" method will set $this->html > to NULL or "". > > Problem is, it does not do that, because apparently "static $html" > keeps an instance of it running in the single-referenced instance of > "buildTree" method. > Based on how best I can explain my problem, and sorry I can't explain > it any better w/o dumping the actual code line by line, how have you > all figured out the best way to generate multiple, unique instances > from a single-referenced method that uses a static local variable? > > Thanx > Phil > > -- > Phil Powell > Web Developer > ADNET Systems, Inc. > 11260 Roger Bacon Drive, Suite 403 > Reston, VA 20190-5203 > Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 > EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From chubbard at next-online.net Tue Feb 24 17:44:34 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Tue, 24 Feb 2004 14:44:34 -0800 Subject: [nycphp-talk] shopping cart experiences In-Reply-To: References: Message-ID: <403BD3D2.80304@next-online.net> Rich, I'm betting that he hasn't tried to customize osc. There's at least half a dozen osCommerce knock-offs. As a general rule they don't address the problems with osCommerce. For a while I was tempted to continue my rewrite of osCommerce (then TEP) and create a post-osc project. But that would have been stupid. Much better to start from scratch, and not deal with some of the weird logic sequences within osc. chris Rich Gray wrote: >>I think to date it's one of the best written PHP applications out there. >> >> > >you're kidding right...? IMO the code is overblown, messy and obtuse ... I >have spent many an hour trying to work out wtf they're doing sometimes with >all those tep_* functions and half baked classes ... > >as an aside has anyone looked at http://www.zen-cart.com ? based on osc >apparently but better.... > >//rich > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > From dcech at phpwerx.net Tue Feb 24 18:28:57 2004 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 24 Feb 2004 18:28:57 -0500 Subject: [nycphp-talk] Working with recursive "single-referenced" methods and static variables In-Reply-To: <403BC940.9090101@adnet-sys.com> References: <403BC940.9090101@adnet-sys.com> Message-ID: <403BDE39.8070502@phpwerx.net> Phil Powell wrote: > [CODE] > class DepartmentTree { > > function &buildTree($id) { > static $html; > if (!isset($html)) { > // DO STUFF HERE TO $html > } > // DO MORE STUFF > if ($condition_is_met) $this->buildTree($newID); > $this->html = $html; > } > > } > [/CODE] > > The above (and greatly paraphrased from the 100-line actual class) class > and method, in its real form, totally works inasmuch as it successfully > always creates an HTML hierarchial tree of departments mapped with child > departments. I have no problem with this.. as long as I only use the > class once. > > However, there is a case where I need the entire contents of the > departments table dumped out into a resultset, and to do that I figured > I would just loop through a query of records that have no parent ID; > each id in each row I seed into $tree->buildTree(): > > [CODE] > for ($i = 0; $i < @sizeof($result); $i++) { > $tree->buildTree($result[$i]->id); > $this->deptArray += $tree->convert_to_array(); > $tree->clearTreeHTML(); > } > [/CODE] > > The "convert_to_array()" method will convert the contents of $this->html > from HTML content to an array, keeping the original hierarchial order; > the "clearTreeHTML()" method will set $this->html to NULL or "". > > Problem is, it does not do that, because apparently "static $html" keeps > an instance of it running in the single-referenced instance of > "buildTree" method. > Based on how best I can explain my problem, and sorry I can't explain it > any better w/o dumping the actual code line by line, how have you all > figured out the best way to generate multiple, unique instances from a > single-referenced method that uses a static local variable? If you are always going to use $tree as an object, and not call DepartmentTree::buildTree (), then just remove the 'static $html;' and '$this->html = $html;' lines and replace all instances of '$html' with '$this->html'. This is the normal method for object oriented design, the only reason to use static variables is if you are trying to do something tricky like the singleton class. Your code would then be: class DepartmentTree { var $html; function &buildTree($id) { if (!isset($this->html)) { // DO STUFF HERE TO $this->html } // DO MORE STUFF if ($condition_is_met) { $this->buildTree($newID); } } function clearTreeHTML () { $this->html = NULL; } function convert_to_array () { // PUT YOUR ARRAY CONVERSION HERE return (array) $this->html; } } Which will perform as expected. Dan From phillip.powell at adnet-sys.com Tue Feb 24 18:41:51 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Tue, 24 Feb 2004 18:41:51 -0500 Subject: [nycphp-talk] Working with recursive "single-referenced" methods and static variables References: <403BC940.9090101@adnet-sys.com> <403BDE39.8070502@phpwerx.net> Message-ID: <403BE13F.7020605@adnet-sys.com> Dan Cech wrote: > Phil Powell wrote: > >> [CODE] >> class DepartmentTree { >> >> function &buildTree($id) { >> static $html; >> if (!isset($html)) { >> // DO STUFF HERE TO $html >> } >> // DO MORE STUFF >> if ($condition_is_met) $this->buildTree($newID); >> $this->html = $html; >> } >> >> } >> [/CODE] >> >> The above (and greatly paraphrased from the 100-line actual class) >> class and method, in its real form, totally works inasmuch as it >> successfully always creates an HTML hierarchial tree of departments >> mapped with child departments. I have no problem with this.. as long >> as I only use the class once. >> >> However, there is a case where I need the entire contents of the >> departments table dumped out into a resultset, and to do that I >> figured I would just loop through a query of records that have no >> parent ID; each id in each row I seed into $tree->buildTree(): >> >> [CODE] >> for ($i = 0; $i < @sizeof($result); $i++) { >> $tree->buildTree($result[$i]->id); >> $this->deptArray += $tree->convert_to_array(); >> $tree->clearTreeHTML(); >> } >> [/CODE] >> >> The "convert_to_array()" method will convert the contents of >> $this->html from HTML content to an array, keeping the original >> hierarchial order; the "clearTreeHTML()" method will set $this->html >> to NULL or "". >> >> Problem is, it does not do that, because apparently "static $html" >> keeps an instance of it running in the single-referenced instance of >> "buildTree" method. Based on how best I can explain my problem, and >> sorry I can't explain it any better w/o dumping the actual code line >> by line, how have you all figured out the best way to generate >> multiple, unique instances from a single-referenced method that uses >> a static local variable? > > > If you are always going to use $tree as an object, and not call > DepartmentTree::buildTree (), then just remove the 'static $html;' and > '$this->html = $html;' lines and replace all instances of '$html' with > '$this->html'. > > This is the normal method for object oriented design, the only reason > to use static variables is if you are trying to do something tricky > like the singleton class. > > Your code would then be: > > class DepartmentTree { > > var $html; > > function &buildTree($id) { > if (!isset($this->html)) { > // DO STUFF HERE TO $this->html > } > // DO MORE STUFF > if ($condition_is_met) { > $this->buildTree($newID); > } > } > > function clearTreeHTML () { > $this->html = NULL; > } > > function convert_to_array () { > // PUT YOUR ARRAY CONVERSION HERE > return (array) $this->html; > } > } > > Which will perform as expected. > > Dan > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > Thanx Dan, but that did not fix my problem. I can only do ONE instance of buildTree() method regardless of it being "non-singleton" or "static" or anything. If I call it once with a specific ID then all is fine; if I call with all IDs, then it only gets the first ID it finds and stops dead right there, even with a list of IDS. Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From phillip.powell at adnet-sys.com Tue Feb 24 18:50:16 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Tue, 24 Feb 2004 18:50:16 -0500 Subject: [nycphp-talk] Working with recursive "single-referenced" methods and static variables References: <403BC940.9090101@adnet-sys.com> <403BDE39.8070502@phpwerx.net> Message-ID: <403BE338.5030602@adnet-sys.com> Dan Cech wrote: > Phil Powell wrote: > >> [CODE] >> class DepartmentTree { >> >> function &buildTree($id) { >> static $html; >> if (!isset($html)) { >> // DO STUFF HERE TO $html >> } >> // DO MORE STUFF >> if ($condition_is_met) $this->buildTree($newID); >> $this->html = $html; >> } >> >> } >> [/CODE] >> >> The above (and greatly paraphrased from the 100-line actual class) >> class and method, in its real form, totally works inasmuch as it >> successfully always creates an HTML hierarchial tree of departments >> mapped with child departments. I have no problem with this.. as long >> as I only use the class once. >> >> However, there is a case where I need the entire contents of the >> departments table dumped out into a resultset, and to do that I >> figured I would just loop through a query of records that have no >> parent ID; each id in each row I seed into $tree->buildTree(): >> >> [CODE] >> for ($i = 0; $i < @sizeof($result); $i++) { >> $tree->buildTree($result[$i]->id); >> $this->deptArray += $tree->convert_to_array(); >> $tree->clearTreeHTML(); >> } >> [/CODE] >> >> The "convert_to_array()" method will convert the contents of >> $this->html from HTML content to an array, keeping the original >> hierarchial order; the "clearTreeHTML()" method will set $this->html >> to NULL or "". >> >> Problem is, it does not do that, because apparently "static $html" >> keeps an instance of it running in the single-referenced instance of >> "buildTree" method. Based on how best I can explain my problem, and >> sorry I can't explain it any better w/o dumping the actual code line >> by line, how have you all figured out the best way to generate >> multiple, unique instances from a single-referenced method that uses >> a static local variable? > > > If you are always going to use $tree as an object, and not call > DepartmentTree::buildTree (), then just remove the 'static $html;' and > '$this->html = $html;' lines and replace all instances of '$html' with > '$this->html'. > > This is the normal method for object oriented design, the only reason > to use static variables is if you are trying to do something tricky > like the singleton class. > > Your code would then be: > > class DepartmentTree { > > var $html; > > function &buildTree($id) { > if (!isset($this->html)) { > // DO STUFF HERE TO $this->html > } > // DO MORE STUFF > if ($condition_is_met) { > $this->buildTree($newID); > } > } > > function clearTreeHTML () { > $this->html = NULL; > } > > function convert_to_array () { > // PUT YOUR ARRAY CONVERSION HERE > return (array) $this->html; > } > } > > Which will perform as expected. > > Dan > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > Dan it worked, but as a result of a "kluged" hybrid between your solution and my original setup. I removed "static $html" and set everything to $this->html instead, however, the method "buildTree" has to be "static" and I still have to use "static $dbAP, $kounter" for single-instance DB connection objects and counting integers. It now works for a single DepartmentTree call: $tree =& new DepartmentTree(); $tree->buildTree($result[0]->id); $html = $tree->displayTree(); // OR TO GET ARRAY $deptArray = $tree->convert_to_array(); $tree = null; And works for multiple calls: $sql = 'SELECT id FROM department WHERE department_parent_id IS NULL'; $query =& new MySQLQuery($sql, $dbAP->getDBConn()); $result = $query->getResult(); for ($i =0; $i < @sizeof($result); $i++) { $tree =& new DepartmentTree(); $tree->buildTree($result[$i]->id); $this->deptArray += $tree->convert_to_array(); $tree = null; } ... Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From nyphp at enobrev.com Tue Feb 24 20:59:39 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Tue, 24 Feb 2004 20:59:39 -0500 Subject: [nycphp-talk] shopping cart experiences In-Reply-To: <403BD3D2.80304@next-online.net> Message-ID: > osCommerce (then TEP) and create a post-osc project. But > that would have been stupid. Much better to start from > scratch, and not deal with some of the weird logic sequences > within osc. I've had many a moment when I wanted to rewrite OSC. Give it a template engine, divide the code more, clean things up, etc, etc. There is some great functionality in OSC and from what I recall, there was a really helpful OSC community. The main developers are updating constantly. I've made a few OSC sites, but it's far too much of a headache when keeping a few clients. These days I also sway towards rolling my own, unless a client actaully needs a good deal of the things OSC offers. The intermingling of display and functionality is just far too thick to dig through. They've improved their classes, but overall they still work more as function groupings than actual objects. I can't emphasise enough how much wasted time OSC maintainence can waste. Mark From danielc at analysisandsolutions.com Wed Feb 25 00:51:37 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 25 Feb 2004 00:51:37 -0500 Subject: [nycphp-talk] tonight's slides Message-ID: <20040225055137.GA17263@panix5.panix.com> Howdy: The slides are at http://nyphp.org/content/presentations/db160/ Enjoy, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jonbaer at jonbaer.net Wed Feb 25 06:07:41 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 25 Feb 2004 06:07:41 -0500 Subject: [nycphp-talk] Java problems from Sun themselves ... Message-ID: <009d01c3fb8f$985be440$6400a8c0@thinkpad> is this memo very old? i can't seem to tell, i just found it ... its a good read anyways ... http://www.internalmemos.com/memos/memodetails.php?memo_id=1321 the "HelloWorld" problem is pretty funny (im sure the same applies to PHP as it does to Python). - jon pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 >From hans not junk at nyphp.com Wed Feb 25 07:42:48 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 164C4A86D1 for ; Wed, 25 Feb 2004 07:42:48 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Wed, 25 Feb 2004 04:42:44 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA5DE9 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: PC Hardware Annoyances Needed for New Book Thread-Index: AcP7dROKWmTkQb9NT8uvOEp8t5122gAJ6ONA From: "Hans Zaunere" To: "NYPHP Talk" Subject: [nycphp-talk] FW: PC Hardware Annoyances Needed for New Book X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2004 12:42:48 -0000 More Annoyances from O'Reilly... please contact Marsee directly. Great meeting last night guys. Good to see everyone. H=20 > -----Original Message----- > From: Marsee Henon [mailto:marsee at oreilly.com]=20 > Sent: Tuesday, February 24, 2004 9:06 PM > To: news at nyphp.org > Subject: PC Hardware Annoyances Needed for New Book >=20 > Dear User Group Leader: >=20 > Thanks for the great response to our call, a few weeks ago, for > annoyances, gripes, and complaints about Excel. The email we got was > extremely useful and a lot of your members not only sent=20 > annoyances, but > fixes! So, a thousand thanks for the help. >=20 > As you might guess, we have another book in the wings--this=20 > one focusing > on PC hardware annoyances. We're not just talking about PCs=20 > and laptops > per se--we also talking about all the hardware that's inside=20 > and attached > to your computer, such as memory, motherboards, hard drives, printers, > scanners, home networks, DSL/cable, CD/DVD, and host of other annoying > hardware devices. >=20 >=20 > If any members of your group have PC hardware annoyances=20 > they'd like to > see solved, have them email me (marsee at oreilly.com) with "PC Hardware > Annoyances" in the subject. Just have them note what hardware=20 > is giving=20 > them grief (e.g. Dell Dimension 8100 with 1.3GHz P4; LaserJet 3150;=20 > Verbatim Producer 44 DVD+/-RW; etc.), and any relevant=20 > software that's=20 > involved (such as the OS, a driver, OCR software, etc.). >=20 >=20 > As thanks for sharing, we'll make sure to get copies of "PC Hardware=20 > Annoyances" sent to your group shortly after publication. >=20 > Thanks, >=20 > Marsee >=20 > *** >=20 > An example: >=20 > Hardware Windows Setting Blocks DVD Upgrade >=20 > THE ANNOYANCE: I want to update the firmware for my Sony DRX510UL DVD > burner, and the site said to disable the DMA setting in=20 > Windows XP before > doing so. But it neglects to tell you how. >=20 > THE FIX: The Sony drive is terrificit burns DVD+R and DVD-R discs, and > uses both DVD-RW and DVD+RW rewritable media. But ask Sony=20 > for support, > and it responds with a virtual raspberryits online instructions are > complex and often impossible to understand. Luckily, fiddling with DMA > isn't difficult. Here's how to turn it off: >=20 > Windows XP/2000. Open the System control panel, choose the=20 > Hardware tab, > and click the Device Manager button. Double-click "IDE ATA/ATAPI > controllers" and double-click "Secondary IDE Channel" (your=20 > DVD drive is > most likely located on the secondary channel; if not, choose=20 > "Primary IDE > Channel"). Click the Advanced Settings tab, and under Device=20 > 0 (master) or > Device 1 (slave) (depending on how your drive is set up),=20 > select PIO Only > from the Transfer Mode drop-down menu. Click OK. >=20 > Windows 98/Me. Open the System control panel and choose the=20 > Device Manager > tab. Double-click CD-ROM, then double-click your drive. Select the > Settings tab, uncheck the DMA option, and click OK. Remember=20 > to reverse > the previous steps once your DVD drive's firmware is installed. >=20 > *** >=20 >=20 >=20 >=20 >=20 From tom at supertom.com Wed Feb 25 08:46:05 2004 From: tom at supertom.com (Tom) Date: Wed, 25 Feb 2004 08:46:05 -0500 Subject: [nycphp-talk] Recommend Email POP3 Class or code snippet In-Reply-To: <403BC940.9090101@adnet-sys.com> Message-ID: <0HTN00J9D6Z5BM@mta2.srv.hcvlny.cv.net> Hey folks, Looking for a recommendation for an email class to handle polling a POP3 box. In the past, I've used the POP3 class on phpclasses.org without issue, but I don't believe it handles attachments (I could be wrong, just getting into this now), which is a definite requirement. I found another class there called 'clsImap.php', which I quickly installed and tried the test script with no luck (it handles POP3 in addition to IMAP, despite the name). This one looks promising however, so I will research it further. However, what I am after is a recommendation from someone who has actually done this (with attachments) and can recommend a reliable class (or code sample) that I should go with. Thanks, Tom www.liphp.org From danielc at analysisandsolutions.com Wed Feb 25 09:38:57 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 25 Feb 2004 09:38:57 -0500 Subject: [nycphp-talk] answer to that question... Message-ID: <20040225143856.GA17728@panix.com> Hi Folks: Last night, someone asked what the method name was for the DB method that gets the list of tables, users, etc. I just remembered what it is: getListOf(). http://pear.php.net/manual/en/package.database.db.db-common.getlistof.php --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From emm at scriptdigital.com Wed Feb 25 10:06:10 2004 From: emm at scriptdigital.com (Emmanuel =?iso-8859-1?Q?D=E9carie?=) Date: Wed, 25 Feb 2004 10:06:10 -0500 Subject: [nycphp-talk] PHP 4.3.3 and session_start In-Reply-To: <20040224234225.C0B90A87BA@virtu.nyphp.org> Message-ID: Hi there, I'd like to know why in the world, starting with PHP 4.3.3, PHP need to throw an error (E_NOTICE) when it encounter a second session_start (). I know that I can disable the display or errors. I know that I could test first if $_SESSION exists before calling session_start (). But really, I don't understand the logic behind this change. If the second session_start is to be ignored, why then throw an error? Could session_start work in the same logic as include_once ()? I have some framework that need to be plug sometimes on other frameworks that can contain a session_start OR not. Sorry to vent like this, but I find this change undesired and need to understand why sometimes PHP break compatibility like this between minor versions. Am I missing something here? TIA Cheers -Emmanuel >Note: As of PHP 4.3.3, calling session_start() while the session has >already been started will result in an error of level E_NOTICE. Also, >the second session start will simply be ignored. <> -- Emmanuel D?carie / Programmation pour le Web - Programming for the Web - Blog: - AIM: scriptdigital From ashaw at iifwp.org Wed Feb 25 10:28:31 2004 From: ashaw at iifwp.org (Allen Shaw) Date: Wed, 25 Feb 2004 10:28:31 -0500 Subject: [nycphp-talk] searching archives? Message-ID: <003f01c3fbb4$066d7e70$8101a8c0@iifwp.local> Anybody know if mailman gives us a way to search the nyphp list archives, or do we just have to scan each monthly volume one-by-one? Thanks, Allen -- =========================================================== Allen Shaw ashaw at iifwp.org IIFWP Data and 914.631.1331 x.106 IT Services http://www.iifwp.org From dcech at phpwerx.net Wed Feb 25 10:35:27 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 25 Feb 2004 10:35:27 -0500 Subject: [nycphp-talk] searching archives? In-Reply-To: <003f01c3fbb4$066d7e70$8101a8c0@iifwp.local> References: <003f01c3fbb4$066d7e70$8101a8c0@iifwp.local> Message-ID: <403CC0BF.7050601@phpwerx.net> Allen Shaw wrote: > Anybody know if mailman gives us a way to search the nyphp list archives, or > do we just have to scan each monthly volume one-by-one? Google is your friend, just add 'site:lists.nyphp.org' to the search string and it will search the archives for you. For example: The only problem is that they won't be very up to date...though the more people using it the faster it will update. Dan From csnyder at chxo.com Wed Feb 25 10:35:50 2004 From: csnyder at chxo.com (Chris Snyder) Date: Wed, 25 Feb 2004 10:35:50 -0500 Subject: [nycphp-talk] searching archives? In-Reply-To: <003f01c3fbb4$066d7e70$8101a8c0@iifwp.local> References: <003f01c3fbb4$066d7e70$8101a8c0@iifwp.local> Message-ID: <403CC0D6.4040702@chxo.com> Allen Shaw wrote: >Anybody know if mailman gives us a way to search the nyphp list archives, or >do we just have to scan each monthly volume one-by-one? > > > I usually Google site:lists.nyphp.org +keyword From jsiegel1 at optonline.net Wed Feb 25 10:50:30 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Wed, 25 Feb 2004 10:50:30 -0500 Subject: [nycphp-talk] searching archives? In-Reply-To: <003f01c3fbb4$066d7e70$8101a8c0@iifwp.local> References: <003f01c3fbb4$066d7e70$8101a8c0@iifwp.local> Message-ID: <403CC446.4010604@optonline.net> You can Google the mailing list. http://nyphp.org/google.php Jeff Siegel Allen Shaw wrote: > Anybody know if mailman gives us a way to search the nyphp list archives, or > do we just have to scan each monthly volume one-by-one? > > Thanks, > Allen > > -- > =========================================================== > Allen Shaw ashaw at iifwp.org > IIFWP Data and 914.631.1331 x.106 > IT Services http://www.iifwp.org > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From ashaw at iifwp.org Wed Feb 25 11:03:52 2004 From: ashaw at iifwp.org (Allen Shaw) Date: Wed, 25 Feb 2004 11:03:52 -0500 Subject: [nycphp-talk] searching archives? References: <003f01c3fbb4$066d7e70$8101a8c0@iifwp.local> <403CC446.4010604@optonline.net> Message-ID: <007301c3fbb8$f6f0b430$8101a8c0@iifwp.local> Doh. Thanks. ----- Original Message ----- > You can Google the mailing list. > http://nyphp.org/google.php > > Jeff Siegel > -- =========================================================== Allen Shaw ashaw at iifwp.org IIFWP Data and 914.631.1331 x.106 IT Services http://www.iifwp.org From nyphp at enobrev.com Wed Feb 25 11:28:28 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Wed, 25 Feb 2004 11:28:28 -0500 Subject: [nycphp-talk] searching archives? In-Reply-To: <403CC446.4010604@optonline.net> Message-ID: Added this to my PHP pane on ie a lil while back. javascript:void(f=prompt('Search Term:',''));if(f)location.href='http://www.google.com/search?q=site%3Alists. nyphp.org+'+escape(f) Which will open a box and search the nyphp list from wherever. Mark From shiflett at php.net Wed Feb 25 12:30:30 2004 From: shiflett at php.net (Chris Shiflett) Date: Wed, 25 Feb 2004 09:30:30 -0800 (PST) Subject: [nycphp-talk] PHP 4.3.3 and session_start In-Reply-To: Message-ID: <20040225173030.69707.qmail@web14310.mail.yahoo.com> --- Emmanuel D?carie wrote: > I'd like to know why in the world, starting with PHP 4.3.3, PHP need > to throw an error (E_NOTICE) when it encounter a second session_start This seems like the right thing for PHP to do, in my opinion. > But really, I don't understand the logic behind this change. If the > second session_start is to be ignored, why then throw an error? I hate to sound unsympathetic, but a warning seems appropriate. PHP will still do what you're wanting, but there's no reason to have multiple session_start() calls, so it's just letting you know. It seems like you have your error reporting set very strict, but you want your code to be sloppy. You have to pick one or the other. If you don't care whether your code is sloppy, set your error reporting differently. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From phillip.powell at adnet-sys.com Wed Feb 25 12:34:48 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Wed, 25 Feb 2004 12:34:48 -0500 Subject: [nycphp-talk] return, isset and is this a PHP 4.3.2 bug? Message-ID: <403CDCB8.3060800@adnet-sys.com> [PHP] class MyClass { var $isSQLFieldArray = array(); function MyClass() {} function getISSQLFieldArray($field) { if ($field) return $this->isSQLFieldArray[$field]; } } [/PHP] If I use this exact class and method in my script, the page that calls it locks up. Even using [PHP]error_reporting(E_ALL);[/PHP] not only produces NOT ONE ERROR/WARNING/ANYTHING, the page STILL locks up cold!! You can't click onto a link or press a form button and go ANYWHERE AT ALL... However, if I do this: [PHP] class MyClass { var $isSQLFieldArray = array(); function MyClass() {} function getIsSQLFieldArray($field) { if ($field && isset($this->isSQLFieldArray[$field])) return $this->isSQLFieldArray[$field]; } } [/PHP] Everything works just fine and STILL no errors reported by [PHP]error_reporting(E_ALL);[/PHP] What do you all make of this one? The following URLs provided me no information: http://us4.php.net/isset http://us4.php.net/return Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From felix at students.poly.edu Mon Feb 23 23:34:47 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Mon, 23 Feb 2004 23:34:47 -0500 Subject: [nycphp-talk] Java problems from Sun themselves ... In-Reply-To: <009d01c3fb8f$985be440$6400a8c0@thinkpad> References: <009d01c3fb8f$985be440$6400a8c0@thinkpad> Message-ID: <20040223233447.5209c7b9.felix@students.poly.edu> On Wed, 25 Feb 2004 06:07:41 -0500 "jon baer" wrote: > is this memo very old? i can't seem to tell, i just found it ... its > a good read anyways ... > > http://www.internalmemos.com/memos/memodetails.php?memo_id=1321 > I belive this was slashdoted last year. There was debate weather this is even real. > the "HelloWorld" problem is pretty funny (im sure the same applies to > PHP as it does to Python). > > - jon > > pgp key: http://www.jonbaer.net/jonbaer.asc > fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From felix at students.poly.edu Tue Feb 24 01:47:20 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Tue, 24 Feb 2004 01:47:20 -0500 Subject: [nycphp-talk] shopping cart experiences In-Reply-To: References: Message-ID: <20040224014720.4ceb7b2a.felix@students.poly.edu> > > > > I think to date it's one of the best written PHP applications out > > there. > > you're kidding right...? IMO the code is overblown, messy and obtuse > ... I have spent many an hour trying to work out wtf they're doing > sometimes with all those tep_* functions and half baked classes ... > > as an aside has anyone looked at http://www.zen-cart.com ? based on > osc apparently but better.... > I just installed zen-cart to give it a try. Here is my observations: 1. It seems to be a fork of osCommerce 2. It is still beta so I came across and unstable install scrip, one may need to install manually. 3. Its administration seems to be well organized and though out. I have not idea how its codebase differs or if its easier to maintain. From danielc at analysisandsolutions.com Wed Feb 25 23:50:32 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 25 Feb 2004 23:50:32 -0500 Subject: [nycphp-talk] summary of SecurityFocus Newsletter #237 Message-ID: <20040226045032.GA17063@panix.com> JelSoft VBulletin Search.PHP Cross-Site Scripting Vulnerabil... http://www.securityfocus.com/bid/9656 Voice Of Web AllMyPHP Remote File Include Vulnerabilities http://www.securityfocus.com/bid/9664 Ecommerce Corporation Online Store Kit More.PHP Multiple Vul... http://www.securityfocus.com/bid/9676 Ecommerce Corporation Online Store Kit Multiple SQL Injectio... http://www.securityfocus.com/bid/9687 Owl's Workshop Multiple Remote File Disclosure Vulnerabiliti... http://www.securityfocus.com/bid/9689 -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From shiflett at php.net Thu Feb 26 00:13:01 2004 From: shiflett at php.net (Chris Shiflett) Date: Wed, 25 Feb 2004 21:13:01 -0800 (PST) Subject: [nycphp-talk] summary of SecurityFocus Newsletter #237 In-Reply-To: <20040226045032.GA17063@panix.com> Message-ID: <20040226051301.3248.qmail@web14305.mail.yahoo.com> --- Daniel Convissor wrote: > JelSoft VBulletin Search.PHP Cross-Site Scripting Vulnerabil... > http://www.securityfocus.com/bid/9656 > > Voice Of Web AllMyPHP Remote File Include Vulnerabilities > http://www.securityfocus.com/bid/9664 > > Ecommerce Corporation Online Store Kit More.PHP Multiple Vul... > http://www.securityfocus.com/bid/9676 > > Ecommerce Corporation Online Store Kit Multiple SQL Injectio... > http://www.securityfocus.com/bid/9687 > > Owl's Workshop Multiple Remote File Disclosure Vulnerabiliti... > http://www.securityfocus.com/bid/9689 Wait, no phpBB, PostNuke, or PHP-Nuke? You must have made an error, Dan. :-) Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From mjdewitt at alexcommgrp.com Thu Feb 26 10:17:48 2004 From: mjdewitt at alexcommgrp.com (DeWitt, Michael) Date: Thu, 26 Feb 2004 10:17:48 -0500 Subject: [nycphp-talk] The audio and pictures of the February meeting are now available Message-ID: You can find the links to the presentation and audio at http://nyphp.org/content/presentations/index.php The pictures are here: http://nyphp.org/content/gallery/ Mike From agfische at email.smith.edu Thu Feb 26 10:22:03 2004 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 26 Feb 2004 10:22:03 -0500 Subject: [nycphp-talk] The audio and pictures of the February meeting are now available In-Reply-To: References: Message-ID: <87B42DFC-686F-11D8-9BA4-0003930D07F2@email.smith.edu> Very nice Mike, I almost feel like I was there. Thanks! -Aaron On Feb 26, 2004, at 10:17 AM, DeWitt, Michael wrote: > You can find the links to the presentation and audio at > > http://nyphp.org/content/presentations/index.php > > The pictures are here: http://nyphp.org/content/gallery/ > > Mike From emm at scriptdigital.com Thu Feb 26 23:55:17 2004 From: emm at scriptdigital.com (Emmanuel =?iso-8859-1?Q?D=E9carie?=) Date: Thu, 26 Feb 2004 23:55:17 -0500 Subject: Subject: Re: [nycphp-talk] PHP 4.3.3 and session_start In-Reply-To: <20040226170004.902E1A87CA@virtu.nyphp.org> Message-ID: From: Chris Shiflett >--- Emmanuel D?carie wrote: >> I'd like to know why in the world, starting with PHP 4.3.3, PHP need >> to throw an error (E_NOTICE) when it encounter a second session_start > >This seems like the right thing for PHP to do, in my opinion. > >> But really, I don't understand the logic behind this change. If the >> second session_start is to be ignored, why then throw an error? > >I hate to sound unsympathetic, but a warning seems appropriate. PHP will >still do what you're wanting, but there's no reason to have multiple >session_start() calls, so it's just letting you know. >It seems like you have your error reporting set very strict, but you want >your code to be sloppy. You have to pick one or the other. If you don't >care whether your code is sloppy, set your error reporting differently. Thanks for the answer Chris. But I disagree with you. I could be wrong though and willing to learn why. Here's my scenario. I work for a learning institution that produce on-line courses. They asked me to plug on the already existing courses an access control framework. The control access framework is easy to plug on top of these courses, it?s just two includes in the pages to be protected. Some of these courses are starting a session and some not. Since the access framework need to start a session and is called first, PHP will throw an error when it will encounter a session_start in the courses that need a session. Because these courses where produced by different programmers working for different shops, I need to ask them to modify their code and check first if a session already exists before calling session_start. This is not fun. I can understand the point that for now on, I should always in my code check first if a session exists. But what about existing code base like in my scenario? Maybe my line of reasoning is wrong but I never heard that there was a penalty when PHP encountered a second session_start (). What I know is that PHP will disregard the second session_start, doing something similar I guess to include_once when it encounter a file that was already included. If there is no penalty calling multiple times session_start, why PHP should throw an error when this behavior might break compatibilities with existing code? Cheers -Emmanuel -- Emmanuel D?carie / Programmation pour le Web - Programming for the Web - Blog: - AIM: scriptdigital From dcech at phpwerx.net Fri Feb 27 09:02:29 2004 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 27 Feb 2004 09:02:29 -0500 Subject: Subject: Re: [nycphp-talk] PHP 4.3.3 and session_start In-Reply-To: References: Message-ID: <403F4DF5.1070207@phpwerx.net> Emmanuel D?carie wrote: > From: Chris Shiflett >>--- Emmanuel D?carie wrote: >> >>>I'd like to know why in the world, starting with PHP 4.3.3, PHP need >>>to throw an error (E_NOTICE) when it encounter a second session_start >> >>This seems like the right thing for PHP to do, in my opinion. This is absolutely correct, errors of level E_NOTICE are: Run-time notices. Indicate that the script encountered something that could indicate an error, but could also happen in the normal course of running a script. From: Trying to open a second session when one already exists falls squarely into this category. >>>But really, I don't understand the logic behind this change. If the >>>second session_start is to be ignored, why then throw an error? >> >>I hate to sound unsympathetic, but a warning seems appropriate. PHP will >>still do what you're wanting, but there's no reason to have multiple >>session_start() calls, so it's just letting you know. Exactly, now if it was throwing an E_WARNING or E_ERROR there might be a case for arguing against it, but a notice is just there to let you know that you have some code which may be sloppy. >>It seems like you have your error reporting set very strict, but you want >>your code to be sloppy. You have to pick one or the other. If you don't >>care whether your code is sloppy, set your error reporting differently. I am surprised myself, I have never heard of anyone running a production server with error_reporting set to E_ALL, and definitely not without some form of custom error handling routine. > Here's my scenario. I work for a learning institution that produce on-line > courses. They asked me to plug on the already existing courses an access control > framework. The control access framework is easy to plug on top of these courses, > it?s just two includes in the pages to be protected. > > Some of these courses are starting a session and some not. Since the access > framework need to start a session and is called first, PHP will throw an error > when it will encounter a session_start in the courses that need a session. > > Because these courses where produced by different programmers working for > different shops, I need to ask them to modify their code and check first if a > session already exists before calling session_start. This is not fun. > > I can understand the point that for now on, I should always in my code check > first if a session exists. But what about existing code base like in my > scenario? Working around existing code can be tough, but it is also not a problem you are alone in facing. There are many ways to avoid the problem, some of which are: - Modify your error reporting level to something like: error_reporting(E_ALL ^ E_NOTICE); - Write a custom error handler. > Maybe my line of reasoning is wrong but I never heard that there was a penalty > when PHP encountered a second session_start (). What I know is that PHP will > disregard the second session_start, doing something similar I guess to > include_once when it encounter a file that was already included. > > If there is no penalty calling multiple times session_start, why PHP should > throw an error when this behavior might break compatibilities with existing > code? Just to be clear, the error is there as a notice to let you know you might be doing something silly, which is absolutely correct because in the vast majority of cases having multiple session_start calls is an indication of bad programming. On a side note, if you are already editing these files to add include() calls for your password protection scheme, why not remove the session_start calls at the same time? I hope this has helped to clear up the situation, Dan From phillip.powell at adnet-sys.com Fri Feb 27 09:31:45 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 27 Feb 2004 09:31:45 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor Message-ID: <403F54D1.6020906@adnet-sys.com> Has anyone here ever worked with PHPDocumentor? Your thoughts, etc.? Thanx Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From tgales at tgaconnect.com Fri Feb 27 09:40:11 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 27 Feb 2004 09:40:11 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor In-Reply-To: <403F54D1.6020906@adnet-sys.com> Message-ID: <000b01c3fd3f$9bb01100$e98d3818@oberon1> Phil Powell writes: "Has anyone here ever worked with PHPDocumentor? Your thoughts, etc.?" Have you seen the documentation at http://paragon.nyphp.org/docs/ It might interest you to click on 'Graphical Class Hierarchy' there and then maybe click on a box like 'clewMessage" T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From phillip.powell at adnet-sys.com Fri Feb 27 10:42:01 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 27 Feb 2004 10:42:01 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor References: <000b01c3fd3f$9bb01100$e98d3818@oberon1> Message-ID: <403F6549.8080907@adnet-sys.com> Tim Gales wrote: >Phil Powell writes: >"Has anyone here ever worked with PHPDocumentor? Your thoughts, etc.?" > >Have you seen the documentation at >http://paragon.nyphp.org/docs/ > >It might interest you to click on >'Graphical Class Hierarchy' there >and then maybe click on a box >like 'clewMessage" > >T. Gales & Associates >'Helping People Connect with Technology' > >http://www.tgaconnect.com > > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > > Sorry but that tells me little-to-nothing. You haven't told me about ease of use, code manipulation to make it work for documenting, all I see is the results of using Doxygen. I'd like to know how easy it was for YOU to use it, implement it, examples of *HOW* you used it in a case of like a flat script here or a class method there, anything. I am struggling with PHPDocumentor because it seems, at best, impossible to use. Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From tgales at tgaconnect.com Fri Feb 27 10:55:43 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 27 Feb 2004 10:55:43 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor In-Reply-To: <403F6549.8080907@adnet-sys.com> Message-ID: <001001c3fd4a$28183c30$e98d3818@oberon1> You asked for thoughts etc. My thought is basically that doxygen can do a better job of generating documentation. If you want to know how to use it I would suggest the following: www.doxygen.com In terms of what's easier to use PHPDocumentor or Doxygen I think it is matter of personal preference as to which one is easier to use. If you feel "PHPDocumentor seems, at best, impossible to use...". maybe Doxygen will seem easier to you. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Phil Powell > Sent: Friday, February 27, 2004 10:42 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Your experiences with PHPDocumentor > > > Tim Gales wrote: > > >Phil Powell writes: > >"Has anyone here ever worked with PHPDocumentor? Your > thoughts, etc.?" > > > >Have you seen the documentation at > >http://paragon.nyphp.org/docs/ > > > >It might interest you to click on > >'Graphical Class Hierarchy' there > >and then maybe click on a box > >like 'clewMessage" > > > >T. Gales & Associates > >'Helping People Connect with Technology' > > > >http://www.tgaconnect.com > > > > > >_______________________________________________ > >talk mailing list > >talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk > > > > > > > Sorry but that tells me little-to-nothing. You haven't told me about > ease of use, code manipulation to make it work for documenting, all I > see is the results of using Doxygen. I'd like to know how > easy it was > for YOU to use it, implement it, examples of *HOW* you used > it in a case > of like a flat script here or a class method there, anything. > > I am struggling with PHPDocumentor because it seems, at best, > impossible > to use. > > Phil > > -- > Phil Powell > Web Developer > ADNET Systems, Inc. > 11260 Roger Bacon Drive, Suite 403 > Reston, VA 20190-5203 > Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: > (703) 709-7219 > EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude > > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk > From danielc at analysisandsolutions.com Fri Feb 27 11:02:37 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 27 Feb 2004 11:02:37 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor In-Reply-To: <001001c3fd4a$28183c30$e98d3818@oberon1> References: <403F6549.8080907@adnet-sys.com> <001001c3fd4a$28183c30$e98d3818@oberon1> Message-ID: <20040227160236.GA9417@panix.com> On Fri, Feb 27, 2004 at 10:55:43AM -0500, Tim Gales wrote: > www.doxygen.com That's .org. ... snip [what's so hard about hitting the delete key, I don't know] ... --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From tgales at tgaconnect.com Fri Feb 27 11:07:33 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 27 Feb 2004 11:07:33 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor In-Reply-To: <20040227160236.GA9417@panix.com> Message-ID: <001101c3fd4b$cff09190$e98d3818@oberon1> > That's .org. > ... snip [what's so hard about hitting the delete key, I > don't know] ... Sorry Dan, you're right on both points. From phillip.powell at adnet-sys.com Fri Feb 27 11:11:30 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 27 Feb 2004 11:11:30 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor References: <403F6549.8080907@adnet-sys.com> <001001c3fd4a$28183c30$e98d3818@oberon1> <20040227160236.GA9417@panix.com> Message-ID: <403F6C32.7030608@adnet-sys.com> Daniel Convissor wrote: >On Fri, Feb 27, 2004 at 10:55:43AM -0500, Tim Gales wrote: > > > >>www.doxygen.com >> >> > >That's .org. > >... snip [what's so hard about hitting the delete key, I don't know] ... > >--Dan > > > You're of French descent, aren't you? Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From emm at scriptdigital.com Fri Feb 27 11:24:42 2004 From: emm at scriptdigital.com (Emmanuel =?iso-8859-1?Q?D=E9carie?=) Date: Fri, 27 Feb 2004 11:24:42 -0500 Subject: [nycphp-talk] PHP 4.3.3 and session_start In-Reply-To: <20040226170004.902E1A87CA@virtu.nyphp.org> Message-ID: Thanks Dan for the reply. Were progressing. >Dan Cech wrote: >Exactly, now if it was throwing an E_WARNING or E_ERROR there might be a >case for arguing against it, but a notice is just there to let you know >that you have some code which may be sloppy. Which is definitely not the case in my scenario. It?s not my code that is sloppy since the access framework is called first and will start the session, it?s the existing code base made by different programmers in different shops that is sloppy because their application didn't implemented some defensive coding against the case that they should check that a session already existed before calling session_start (). >I am surprised myself, I have never heard of anyone running a production >server with error_reporting set to E_ALL, and definitely not without >some form of custom error handling routine. Why are you assuming that this on a production server? And why are you assuming that there is no custom error handling routine? >Just to be clear, the error is there as a notice to let you know you >might be doing something silly, which is absolutely correct because in >the vast majority of cases having multiple session_start calls is an >indication of bad programming. I think you are wrong here. What I'm talking about is modularity and autonomy. Some courses have a high level of abstraction and can be plugged in other frameworks. That's why they need some level of autonomy and can assume that in some scenario they will be called without a prior session existing. What I understand now is to tell these programmers to always check if a session already exists before calling session_start (). These programmers works on legacy code that was done 1 to 2 years ago. Now, I must confess that I'm totally taken off-guard by this and didn't know that there was such a strong consensus on the question that multiple calls to session_start () were a bad thing. I'll go reread the PHP books I have and check the web. But I still don't have an answer to my questions. What's the penalty for a second call to session_start ()? Is PHP running faster with defensive coding checking if a session already exists and no call to session_start () is made? Is a second call to session_start () waste resources and make PHP slower? Cheers -Emmanuel -- Emmanuel D?carie / Programmation pour le Web - Programming for the Web - Blog: - AIM: scriptdigital From jonbaer at jonbaer.net Fri Feb 27 11:23:29 2004 From: jonbaer at jonbaer.net (jon baer) Date: Fri, 27 Feb 2004 11:23:29 -0500 Subject: [nycphp-talk] XML vs. DB (best approach) Message-ID: <00e701c3fd4e$0926ccc0$6400a8c0@thinkpad> greetings, ive recently designed + coded a complete site for our hockey league (www.brooklynhockey.com) ... there are ~63 tables (between calendar,phpbb,ai stuff, and my stuff) ... i started it out on my own but some parents what to update some material and im thinking to transform some tables back into XML simply because there are < ~80 kids per league ... but i dont want to do it 1/2 and 1/2 ... is there anytype of drop-back approach that i could use? for example if i grab team stats + take it from the db can i make a backup XML file for the data? does this exist or would i have to plug in the logic myself? - jon pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 From Cbielanski at inta.org Fri Feb 27 11:39:36 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Fri, 27 Feb 2004 11:39:36 -0500 Subject: [nycphp-talk] moving MySQL Tables Message-ID: slightly OT but I know I can get the answer here! I'm stumped on getting a MySQL table moved from one server to another. I was under the (possibly false) impression that it's pretty much a straight copy. Am I incorrect? I copied over the data folder and all the files contained therein, bounced mysql on the new machine (both are W2K). I'm missing something, and I can't sort out exactly what. Didn't want to try to go through the hassle of dump and rebuild, either. Thanks in advance, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 From danielc at analysisandsolutions.com Fri Feb 27 11:43:34 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 27 Feb 2004 11:43:34 -0500 Subject: [nycphp-talk] XML vs. DB (best approach) In-Reply-To: <00e701c3fd4e$0926ccc0$6400a8c0@thinkpad> References: <00e701c3fd4e$0926ccc0$6400a8c0@thinkpad> Message-ID: <20040227164334.GA13155@panix.com> On Fri, Feb 27, 2004 at 11:23:29AM -0500, jon baer wrote: > > ive recently designed + coded a complete site for our hockey league > (www.brooklynhockey.com) ... there are ~63 tables (between calendar,phpbb,ai > stuff, and my stuff) Hmmm... 63 tables sounds like a lot for your situation. Sounds like you may have created multiple tables with the same kind of information rather than having one table with a column identifying the kind of information (and a second table defining the identification). > for example if i grab team stats + take it from the db can i make a backup > XML file for the data? does this exist or would i have to plug in the logic > myself? There are classes out there that'll dump database query results into XML. I know my SQL Solution does that. There have got to be others, probably even in PEAR. BUT, what's the point? Databases are for handling data. I see XML's role as being a means of transferring data between parties. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Fri Feb 27 11:46:49 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 27 Feb 2004 11:46:49 -0500 Subject: [nycphp-talk] moving MySQL Tables In-Reply-To: References: Message-ID: <20040227164649.GB13155@panix.com> Hi Chris: On Fri, Feb 27, 2004 at 11:39:36AM -0500, Chris Bielanski wrote: > > I'm stumped on getting a MySQL table moved from one server to another. I was > under the (possibly false) impression that it's pretty much a straight copy. > Am I incorrect? I copied over the data folder and all the files contained > therein, bounced mysql on the new machine (both are W2K). Were both servers off when you did the move? Are they both the same version of MySQL? Regardless, it seems safer to me to use mysqldump rather than doing file copies. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From shiflett at php.net Fri Feb 27 11:56:46 2004 From: shiflett at php.net (Chris Shiflett) Date: Fri, 27 Feb 2004 08:56:46 -0800 (PST) Subject: [nycphp-talk] PHP 4.3.3 and session_start In-Reply-To: Message-ID: <20040227165646.29001.qmail@web14308.mail.yahoo.com> --- Emmanuel D?carie wrote: > > Just to be clear, the error is there as a notice to let you know you > > might be doing something silly, which is absolutely correct because > > in the vast majority of cases having multiple session_start calls is > > an indication of bad programming. > > I think you are wrong here. What I'm talking about is modularity and > autonomy. I don't see how you can justify multiple attempts to start a session with modularity. If your application is truly modular, your session module should take care of session stuff, and it should be trivial to make sure this module only gets called once. It sounds to me like the exact opposite is happening, as if session stuff is buried within other, unrelated code. In this case, in fact, it sounds like session stuff is buried in two different files with unrelated code, both of which must be called. Of course, I admit to not really understanding why this is an issue, so perhaps I'm making some erroneous assumptions. > But I still don't have an answer to my questions. What's the penalty > for a second call to session_start ()? You haven't received an answer, because: 1. You already know the answer, I think. There is no real penalty, because PHP's session mechanism checks whether a session already exists. In fact, this is when it lets you know of a potential problem. You're telling it to start a session, it runs off to do so, and then it comes back saying, "Uhhh, it looks like you already started one a while back. Did you mean to do that?" 2. Your question is irrelevant. It sounds as if you are arguing that a notice should not be given when "no harm is done." If this were true, there would be no reason for different level types. In fact, if this is your opinion, you should turn your error_reporting level way down. Why should the PHP engine not grant developers fine-grained control over their error reporting just because some people: 1. Don't want to receive notices. 2. Don't want to bother turning their error reporting down to reflect their preference. I think your options are: 1. Turn error reporting way down, and worry no more about it. 2. Modularize your code better, so that your session mechanism is in its own module, and you can include it only when you need to. 3. Check whether a session exists before telling PHP to start a session. Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From dsmith7 at dsmith7.com Fri Feb 27 12:02:33 2004 From: dsmith7 at dsmith7.com (Daniel Schutzsmith) Date: Fri, 27 Feb 2004 12:02:33 -0500 Subject: [nycphp-talk] moving MySQL Tables Message-ID: > I copied over the data folder I didn't know such a folder existed. Where could this be found on Unix? \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ daniel schutzsmith new media designer & developer dsmith7 at dsmith7.com http://www.dsmith7.com 914.629.1404 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ From Cbielanski at inta.org Fri Feb 27 12:04:10 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Fri, 27 Feb 2004 12:04:10 -0500 Subject: [nycphp-talk] moving MySQL Tables Message-ID: These are W2K installations all around - I mentioned the issue to my boss and I got the "I don't care, dump and rebuild" response. So I will be doing that! :) > -----Original Message----- > From: Daniel Schutzsmith [mailto:dsmith7 at dsmith7.com] > Sent: Friday, February 27, 2004 12:03 PM > To: NYPHP Talk > Subject: [nycphp-talk] moving MySQL Tables > > > > I copied over the data folder > I didn't know such a folder existed. Where could this be > found on Unix? > > > > \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ > daniel schutzsmith > new media designer & developer > dsmith7 at dsmith7.com > http://www.dsmith7.com > 914.629.1404 > \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From phillip.powell at adnet-sys.com Fri Feb 27 12:21:58 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 27 Feb 2004 12:21:58 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor References: <001001c3fd4a$28183c30$e98d3818@oberon1> Message-ID: <403F7CB6.4010307@adnet-sys.com> Tim Gales wrote: >You asked for thoughts etc. > >My thought is basically that >doxygen can do a better job of >generating documentation. > >If you want to know how to use it >I would suggest the following: >www.doxygen.com > >In terms of what's easier to use >PHPDocumentor or Doxygen >I think it is matter of personal >preference as to which one is easier >to use. > >If you feel "PHPDocumentor seems, at best, >impossible to use...". maybe Doxygen >will seem easier to you. > >T. Gales & Associates >'Helping People Connect with Technology' > >http://www.tgaconnect.com > > > > >>-----Original Message----- >>From: talk-bounces at lists.nyphp.org >>[mailto:talk-bounces at lists.nyphp.org] On Behalf Of Phil Powell >>Sent: Friday, February 27, 2004 10:42 AM >>To: NYPHP Talk >>Subject: Re: [nycphp-talk] Your experiences with PHPDocumentor >> >> >>Tim Gales wrote: >> >> >> >>>Phil Powell writes: >>>"Has anyone here ever worked with PHPDocumentor? Your >>> >>> >>thoughts, etc.?" >> >> >>>Have you seen the documentation at >>>http://paragon.nyphp.org/docs/ >>> >>>It might interest you to click on >>>'Graphical Class Hierarchy' there >>>and then maybe click on a box >>>like 'clewMessage" >>> >>>T. Gales & Associates >>>'Helping People Connect with Technology' >>> >>>http://www.tgaconnect.com >>> >>> >>>_______________________________________________ >>>talk mailing list >>>talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk >>> >>> >>> >>> >>> >>Sorry but that tells me little-to-nothing. You haven't told me about >>ease of use, code manipulation to make it work for documenting, all I >>see is the results of using Doxygen. I'd like to know how >>easy it was >>for YOU to use it, implement it, examples of *HOW* you used >>it in a case >>of like a flat script here or a class method there, anything. >> >>I am struggling with PHPDocumentor because it seems, at best, >>impossible >>to use. >> >>Phil >> >>-- >>Phil Powell >>Web Developer >> ADNET Systems, Inc. >> 11260 Roger Bacon Drive, Suite 403 >> Reston, VA 20190-5203 >>Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: >>(703) 709-7219 >>EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude >> >> >> >> >> >>_______________________________________________ >>talk mailing list >>talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk >> >> >> > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > > Very VERY hard to use, even moreso than PHPDocumentor.. I can't figure out the tutorial online to understand how to find the configuration file, use the Doxywizard, basically, do anything with this tool whatsoever. Could you perhaps tell me an example, a real-life "This is how I did it" story for a very simple PHP script using Doxygen? Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From cahoyos at us.ibm.com Fri Feb 27 12:15:30 2004 From: cahoyos at us.ibm.com (Carlos A Hoyos) Date: Fri, 27 Feb 2004 12:15:30 -0500 Subject: [nycphp-talk] moving MySQL Tables In-Reply-To: Message-ID: I do that for some test servers both as backup and to keep them in sync. Midnight crons tar (for backup) and move the data folder between servers with no problem. The only catch I can remember: mysql has to be stopped before copying the files. Attempting to copy data directory with mysql running gives corrupt files. This is done both linux -> linux and linux -> w2000, all servers running the same mysql version. Carlos >>>>>>> I'm stumped on getting a MySQL table moved from one server to another. I was under the (possibly false) impression that it's pretty much a straight copy. Am I incorrect? I copied over the data folder and all the files contained therein, bounced mysql on the new machine (both are W2K). From dcallaghan at linuxmail.org Fri Feb 27 12:32:50 2004 From: dcallaghan at linuxmail.org (Dave Callaghan) Date: Fri, 27 Feb 2004 12:32:50 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor Message-ID: <20040227173250.7482457C003@ws5-4.us4.outblaze.com> > >Phil Powell writes: > Sorry but that tells me little-to-nothing. You haven't told me about > ease of use, code manipulation to make it work for documenting, all I > see is the results of using Doxygen. I'd like to know how easy it was > for YOU to use it, implement it, examples of *HOW* you used it in a case > of like a flat script here or a class method there, anything. > > I am struggling with PHPDocumentor because it seems, at best, impossible > to use. I use phpDocumentor in all of my OOP projects and I document the code with phpDocumentor in much the same way as I use JavaDoc. I found the concept familiar, the syntax simple and the need clear so your statement that 'PHPDocumentor because it seems, at best, impossible to use' tells me little-to-nothing. First, in order to use phpDocumentor, you need to read the 'phpDocumentor Guide to Creating Fantastic Documentation' at http://phpdoc.org/docs/HTMLSmartyConverter/default/phpDocumentor/tutorial_phpDocumentor.pkg.html In all honesty, if you read it an it didn't help you, read it again. Not suprisingly, the documentation for phpDocumentor is done very well. If you aren't familiar with structured code documentation (and many, many experienced programmers are not) you may have just skimmed the text because you trivialized the task. Good documentation is hard. For another point of view on this type of code documentation, or 'literate programming' as people who need to call things something call this thing, read the 'The Design of Distributed Hyperlinked Programming Documentation' at ftp://ftp.java.sun.com/docs/javadoc-paper/iwhd.pdf This will give you a perspective on what the developers of Javadoc, and thus by extension phpDocumentor, are trying to do. I only document OPP code because I only write OOP code because that's the coding methodology that my projects are usually best served by. If you are a proceduraral programmer, I imagine phpDocumentor will still help by I can't speak from experience. Remember, since this is heavily inspired by JavaDoc, it natually lends itself to OOP. Alway fully document each object with author, version, date tags, etc. (An example of etc might be copyright) For each class, provide scope and variable type tags as well as short and long description. A short description is one sentence followed by a period and a line break. Document methods like classes except provide parameter information. For each variable, provide scope and variable type tags. If you just go this far, you will be able to produce suprisingly helpful documentation. Unless you are working for a company that already has existing documentation standards in place, you should be fine. Better than fine, actually. The last step is to actually produce the phpDocumentor document. The command-line tool is very powerful. Use the web tool anyway. The docbuilder interface can be accessed via index.html in the install directory of phpDocumentor, or the docbuilder subdirectory. Its slick, easy and will do the job right the first time. You can save the command-line for those cold winter nights. Once you have your code documented to this point, you have reached a milestone. Now you can explore more of the functionality of phpDocumentor. I recommend learning how to use templates for no ther reason than the typical reason one uses templates: less work = more gooder. Not that it isn't great fun copying the same scope and variable documentation on type of fifteen class-level variables, but templates are a good thing to learn. The same goes for packages. I'm still not sure why, but the @package tag usage does seem to cause some confusion. The same is true of the @see tag. But once you get these tags, you'll love them Its a good idea now to look at ALL of the tags offerend by phpDocumentor. I'm a big fan of the @todo tag. Include the @version $Revision$ tag and udate it with CVS version. Finally, experiment with outputting you phpDocumentor into different formats. I'm now a big fan of outputting my documentation into a PEAR template, but that's because I'm a big PEAR fan. If you prefer DocBook, that also makes perfect sense. If you like more than one, now it may be time to learn the command-line interface and write a script. There are many, many tags in phpDocumentor and you will probably like some of them and want to include them. -- ______________________________________________ Check out the latest SMS services @ http://www.linuxmail.org This allows you to send and receive SMS through your mailbox. Powered by Outblaze From danielk at us.ibm.com Fri Feb 27 12:34:29 2004 From: danielk at us.ibm.com (Daniel Krook) Date: Fri, 27 Feb 2004 12:34:29 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor In-Reply-To: <403F6C32.7030608@adnet-sys.com> Message-ID: Tim, Thanks for info on Doxygen, I like what it does to show the inner working of clew in an easier way than I believe that phpDocumentor would. Phil, We used phpDocumentor last year on a large scale project that needed to have its source transitioned from active development by a single hacker to a globally dispersed team of several developers. The effort to document the code kind of petered out, but it did force us to write better documented code. I chose phpDocumentor over other tools because it had better features at the time, but I later found it was recommended for PEAR development (http://pear.php.net/manual/en/standards.comments.php and http://pear.php.net/package/PhpDocumentor) which solidified our choice. It's a good tool, and it's "endorsement" by its use by and availability at PEAR makes it worth learning and using. If you have any experience with javadoc or browsing Java APIs, you'll find yourself at home. Conversely, it will enforce your ability to understand OOP and work with javadoc if the need ever arises. Implementing it requires you to extract it somewhere accessible by your web browser, enter in a few options, and submit a form. As for the code you want to document, it needs to have comments added in a specific format to be parsed correctly. To end up with acceptable documentation, you'll be adding the comments to your code, running the documentor, viewing the results, and adding more comments to your code as necessary. You'll go through a few cycles of this before you get it right. Please take some time to read the tutorial http://phpdoc.org/docs/HTMLSmartyConverter/default/phpDocumentor/tutorial_phpDocumentor.pkg.html Daniel Krook, Application Developer, Production Services, ibm.com 1133 Westchester Avenue, White Plains, NY 10604 Tel: (914) 642-4474, Tieline 224-4474 danielk at us.ibm.com Personal: http://info.krook.org/ Persona: http://w3.ibm.com/persona/users/9/0/x/90MC212-P.html From danielk at us.ibm.com Fri Feb 27 12:48:16 2004 From: danielk at us.ibm.com (Daniel Krook) Date: Fri, 27 Feb 2004 12:48:16 -0500 Subject: [nycphp-talk] moving MySQL Tables In-Reply-To: Message-ID: The solution I use for this is to have a cron job run bin/mysqldump nightly or on demand to write the data and structure to an SQL file, transfer the file, then run "source c:\data.sql" from the second machine's mysql command line client. It's not much of a hassle to do a dump and rebuild this way. Admittedly, the SQL file I dump is only in the range of half a MB, but this technique is good for grabbing the latest data on my Solaris 4.0.15 and using it on my Windows 2000 workstation running 3.23 or Mac OS X machine running 4.0.17. Carlos' solution is much better for larger, server to server migrations. Using mysqldump is better for getting a latest copy and bringing it to your workstation quickly. Daniel Krook, Application Developer, Production Services, ibm.com 1133 Westchester Avenue, White Plains, NY 10604 Tel: (914) 642-4474, Tieline 224-4474 danielk at us.ibm.com Personal: http://info.krook.org/ Persona: http://w3.ibm.com/persona/users/9/0/x/90MC212-P.html From phillip.powell at adnet-sys.com Fri Feb 27 12:59:16 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 27 Feb 2004 12:59:16 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor References: <20040227173250.7482457C003@ws5-4.us4.outblaze.com> Message-ID: <403F8574.3080508@adnet-sys.com> Dave Callaghan wrote: >>>Phil Powell writes: >>> >>> >>Sorry but that tells me little-to-nothing. You haven't told me about >>ease of use, code manipulation to make it work for documenting, all I >>see is the results of using Doxygen. I'd like to know how easy it was >>for YOU to use it, implement it, examples of *HOW* you used it in a case >>of like a flat script here or a class method there, anything. >> >>I am struggling with PHPDocumentor because it seems, at best, impossible >>to use. >> >> >I use phpDocumentor in all of my OOP projects and I document the code with phpDocumentor in much the same way as I use JavaDoc. I found the concept familiar, the syntax simple and the need clear so your statement that 'PHPDocumentor because it seems, at best, impossible to use' tells me little-to-nothing. > >First, in order to use phpDocumentor, you need to read the 'phpDocumentor Guide to Creating Fantastic Documentation' at http://phpdoc.org/docs/HTMLSmartyConverter/default/phpDocumentor/tutorial_phpDocumentor.pkg.html >In all honesty, if you read it an it didn't help you, read it again. Not suprisingly, the documentation for phpDocumentor is done very well. If you aren't familiar with structured code documentation (and many, many experienced programmers are not) you may have just skimmed the text because you trivialized the task. Good documentation is hard. > Thanx.. I'm at that page now and trying to figure it out is like trying to learn Mongolian in an hour. I am not fathoming most of it, though I understand some of the tags like @accept, @param and @return, easy ones. @global throws warnings and @package just plain chokes the phpdocumentor tool. > >For another point of view on this type of code documentation, or 'literate programming' as people who need to call things something call this thing, read the 'The Design of Distributed Hyperlinked Programming Documentation' at >ftp://ftp.java.sun.com/docs/javadoc-paper/iwhd.pdf This will give you a perspective on what the developers of Javadoc, and thus by extension phpDocumentor, are trying to do. > >I only document OPP code because I only write OOP code because that's the coding methodology that my projects are usually best served by. If you are a proceduraral programmer, I imagine phpDocumentor will still help by I can't speak from experience. Remember, since this is heavily inspired by JavaDoc, it natually lends itself to OOP. > I am not sure what I am. The bastard child of OO and procedural code. I create PHP scripts that are flat-procedure ("index.php") that require ".inc.php" library scripts that contain a boatload of classes and subclasses. My programming style which I don't think there is a category for. I have a limited understanding of "javadoc" albeit new but way WAY easier than this! > >Alway fully document each object with author, version, date tags, etc. (An example of etc might be copyright) For each class, provide scope and variable type tags as well as short and long description. A short description is one sentence followed by a period and a line break. Document methods like classes except provide parameter information. For each variable, provide scope and variable type tags. > > each object, why? I have one file containing 15 - 20 classes each, each class averaging about 5 methods per class, each method averaging 4 globals and 10 - 15 local variables. And about 5 files structured like that per project per client. So why do each object, should I not just have one DocBlock with author, version and package and then each method I document vars, params and optional returns? >If you just go this far, you will be able to produce suprisingly helpful documentation. Unless you are working for a company that already has existing documentation standards in place, you should be fine. Better than fine, actually. > >The last step is to actually produce the phpDocumentor document. The command-line tool is very powerful. Use the web tool anyway. The docbuilder interface can be accessed via index.html in the install directory of phpDocumentor, or the docbuilder subdirectory. Its slick, easy and will do the job right the first time. You can save the command-line for those cold winter nights. > > Just my luck my HTML interface throws PHP code all over the place along with HTML. Hard to read but I'm muddling through here. >Once you have your code documented to this point, you have reached a milestone. Now you can explore more of the functionality of phpDocumentor. I recommend learning how to use templates for no ther reason than the typical reason one uses templates: less work = more gooder. Not that it isn't great fun copying the same scope and variable documentation on type of fifteen class-level variables, but templates are a good thing to learn. The same goes for packages. I'm still not sure why, but the @package tag usage does seem to cause some confusion. The same is true of the @see tag. But once you get these tags, you'll love them > >Its a good idea now to look at ALL of the tags offerend by phpDocumentor. I'm a big fan of the @todo tag. Include the @version $Revision$ tag and udate it with CVS version. > > [blank stare altogether] >Finally, experiment with outputting you phpDocumentor into different formats. I'm now a big fan of outputting my documentation into a PEAR template, but that's because I'm a big PEAR fan. If you prefer DocBook, that also makes perfect sense. If you like more than one, now it may be time to learn the command-line interface and write a script. There are many, many tags in phpDocumentor and you will probably like some of them and want to include them. > > > > > > > > thanx for the detailed tips.. this will take more than one day to be able to use just for one file, which I'm experimenting with. I gave up on DOxygen, it's even harder for me to use than PHPDocumentor. Phil > > > > > -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From dmintz at davidmintz.org Fri Feb 27 13:05:32 2004 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 27 Feb 2004 13:05:32 -0500 (EST) Subject: [nycphp-talk] parse_ini_file() wants full path... ? In-Reply-To: References: Message-ID: On my development machine -- RH Linux 9/Apache 1.3.27/PHP 4.3.3 -- I get a 'cannot open file.ini for reading' error from parse_ini_file unless I give it the full path. I want to be able to say parse_ini_file('./file.ini') for the convenience of inter-server portability. (The caller and the ini file do live in the same directory.) I ~can~ do this on the production box (FreeBSD 4.8/PHP 4.3.4/Apache 1.3.29) and all the relevant php.ini and file permission settings are the same or similar, AFAICT. I'm grateful for any clues. Thanks. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From patkins at killinglyschools.org Fri Feb 27 13:25:59 2004 From: patkins at killinglyschools.org (patkins) Date: Fri, 27 Feb 2004 13:25:59 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor Message-ID: <20040227182605.B9C0BA863E@virtu.nyphp.org> All, I'm trying this for the first time today. I downloaded and setup PHPDocumentor in under an hour. I commented a couple of classes, ran the web GUI and "Bing" there it was as beautiful as can be. I am very impressed and motivated to clean up and comment all my projects. I also tried the "DOxygen" and "PHPDocumentor" was by far better. Cheers, Peter -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Phil Powell Sent: Friday, February 27, 2004 12:59 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Your experiences with PHPDocumentor Dave Callaghan wrote: >>>Phil Powell writes: >>> >>> >>Sorry but that tells me little-to-nothing. You haven't told me about >>ease of use, code manipulation to make it work for documenting, all I >>see is the results of using Doxygen. I'd like to know how easy it was >>for YOU to use it, implement it, examples of *HOW* you used it in a case >>of like a flat script here or a class method there, anything. >> >>I am struggling with PHPDocumentor because it seems, at best, >>impossible >>to use. >> >> >I use phpDocumentor in all of my OOP projects and I document the code >with phpDocumentor in much the same way as I use JavaDoc. I found the >concept familiar, the syntax simple and the need clear so your >statement that 'PHPDocumentor because it seems, at best, impossible to >use' tells me little-to-nothing. > >First, in order to use phpDocumentor, you need to read the >'phpDocumentor Guide to Creating Fantastic Documentation' at http://phpdoc.org/docs/HTMLSmartyConverter/default/phpDocumentor/tutorial_phpDocumentor.pkg.html >In all honesty, if you read it an it didn't help you, read it again. Not suprisingly, the documentation for phpDocumentor is done very well. If you aren't familiar with structured code documentation (and many, many experienced programmers are not) you may have just skimmed the text because you trivialized the task. Good documentation is hard. > Thanx.. I'm at that page now and trying to figure it out is like trying to learn Mongolian in an hour. I am not fathoming most of it, though I understand some of the tags like @accept, @param and @return, easy ones. @global throws warnings and @package just plain chokes the phpdocumentor tool. > >For another point of view on this type of code documentation, or >'literate programming' as people who need to call things something call this thing, read the 'The Design of Distributed Hyperlinked Programming Documentation' at >ftp://ftp.java.sun.com/docs/javadoc-paper/iwhd.pdf This will give you a perspective on what the developers of Javadoc, and thus by extension phpDocumentor, are trying to do. > >I only document OPP code because I only write OOP code because that's >the coding methodology that my projects are usually best served by. If >you are a proceduraral programmer, I imagine phpDocumentor will still >help by I can't speak from experience. Remember, since this is heavily >inspired by JavaDoc, it natually lends itself to OOP. > I am not sure what I am. The bastard child of OO and procedural code. I create PHP scripts that are flat-procedure ("index.php") that require ".inc.php" library scripts that contain a boatload of classes and subclasses. My programming style which I don't think there is a category for. I have a limited understanding of "javadoc" albeit new but way WAY easier than this! > >Alway fully document each object with author, version, date tags, etc. >(An example of etc might be copyright) For each class, provide scope and variable type tags as well as short and long description. A short description is one sentence followed by a period and a line break. Document methods like classes except provide parameter information. For each variable, provide scope and variable type tags. > > each object, why? I have one file containing 15 - 20 classes each, each class averaging about 5 methods per class, each method averaging 4 globals and 10 - 15 local variables. And about 5 files structured like that per project per client. So why do each object, should I not just have one DocBlock with author, version and package and then each method I document vars, params and optional returns? >If you just go this far, you will be able to produce suprisingly >helpful documentation. Unless you are working for a company that >already has existing documentation standards in place, you should be >fine. Better than fine, actually. > >The last step is to actually produce the phpDocumentor document. The >command-line tool is very powerful. Use the web tool anyway. The docbuilder interface can be accessed via index.html in the install directory of phpDocumentor, or the docbuilder subdirectory. Its slick, easy and will do the job right the first time. You can save the command-line for those cold winter nights. > > Just my luck my HTML interface throws PHP code all over the place along with HTML. Hard to read but I'm muddling through here. >Once you have your code documented to this point, you have reached a >milestone. Now you can explore more of the functionality of >phpDocumentor. I recommend learning how to use templates for no ther >reason than the typical reason one uses templates: less work = more >gooder. Not that it isn't great fun copying the same scope and variable >documentation on type of fifteen class-level variables, but templates >are a good thing to learn. The same goes for packages. I'm still not >sure why, but the @package tag usage does seem to cause some confusion. >The same is true of the @see tag. But once you get these tags, you'll >love them > >Its a good idea now to look at ALL of the tags offerend by >phpDocumentor. I'm a big fan of the @todo tag. Include the @version $Revision$ tag and udate it with CVS version. > > [blank stare altogether] >Finally, experiment with outputting you phpDocumentor into different >formats. I'm now a big fan of outputting my documentation into a PEAR template, but that's because I'm a big PEAR fan. If you prefer DocBook, that also makes perfect sense. If you like more than one, now it may be time to learn the command-line interface and write a script. There are many, many tags in phpDocumentor and you will probably like some of them and want to include them. > > > > > > > > thanx for the detailed tips.. this will take more than one day to be able to use just for one file, which I'm experimenting with. I gave up on DOxygen, it's even harder for me to use than PHPDocumentor. Phil > > > > > -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From dcallaghan at linuxmail.org Fri Feb 27 13:26:14 2004 From: dcallaghan at linuxmail.org (Dave Callaghan) Date: Fri, 27 Feb 2004 13:26:14 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor Message-ID: <20040227182614.2288D57C003@ws5-4.us4.outblaze.com> > >>>general response to all Phil Powell responses, top-posted for stand-alone convenience: This is actually why I recommend taking phpDocumentor one step at a time: its very full featured! You can get pretty good results from just a very basic initial implementation. If something chokes, dump it until you get a clean output. Bad documentation is worse than no documentation. If you don't understand something, its probably because you don't need it right now. And later, as you get used to it, you'll start asking yourself 'why can't it ....'. Then you'll probably find out that it does. I had that [blank stare altogether] feeling many times with this tool (still do). But luckily, the advanced tags just aren't necessary right away, if ever. Even if you had good result with Doxygen, which appears to be a fine tool, I would still recommend you stick it out with phpDocumentor, if for no other reason then its positioned to become something of a standard. If for no other reason than PEAR uses it. One final thing. Most people find that their coding style changes once they start structured documentation. I make people in my team write out all the classes with all the documentation BEFORE they start coding. The end result is that we get good code complete faster. Good luck! > Dave Callaghan wrote: > > >>>Phil Powell writes: > >>> > >>> > >>Sorry but that tells me little-to-nothing. You haven't told me about > >>ease of use, code manipulation to make it work for documenting, all I > >>see is the results of using Doxygen. I'd like to know how easy it was > >>for YOU to use it, implement it, examples of *HOW* you used it in a case > >>of like a flat script here or a class method there, anything. > >> > >>I am struggling with PHPDocumentor because it seems, at best, impossible > >>to use. > >> > >> > >I use phpDocumentor in all of my OOP projects and I document the code with phpDocumentor in much the same way as I use JavaDoc. I found the concept familiar, the syntax simple and the need clear so your statement that 'PHPDocumentor because it seems, at best, impossible to use' tells me little-to-nothing. > > > >First, in order to use phpDocumentor, you need to read the 'phpDocumentor Guide to Creating Fantastic Documentation' at http://phpdoc.org/docs/HTMLSmartyConverter/default/phpDocumentor/tutorial_phpDocumentor.pkg.html > >In all honesty, if you read it an it didn't help you, read it again. Not suprisingly, the documentation for phpDocumentor is done very well. If you aren't familiar with structured code documentation (and many, many experienced programmers are not) you may have just skimmed the text because you trivialized the task. Good documentation is hard. > > > > Thanx.. I'm at that page now and trying to figure it out is like trying > to learn Mongolian in an hour. I am not fathoming most of it, though I > understand some of the tags like @accept, @param and @return, easy ones. > @global throws warnings and @package just plain chokes the > phpdocumentor tool. > > > > >For another point of view on this type of code documentation, or 'literate programming' as people who need to call things something call this thing, read the 'The Design of Distributed Hyperlinked Programming Documentation' at > >ftp://ftp.java.sun.com/docs/javadoc-paper/iwhd.pdf This will give you a perspective on what the developers of Javadoc, and thus by extension phpDocumentor, are trying to do. > > > >I only document OPP code because I only write OOP code because that's the coding methodology that my projects are usually best served by. If you are a proceduraral programmer, I imagine phpDocumentor will still help by I can't speak from experience. Remember, since this is heavily inspired by JavaDoc, it natually lends itself to OOP. > > > > I am not sure what I am. The bastard child of OO and procedural code. I > create PHP scripts that are flat-procedure ("index.php") that require > ".inc.php" library scripts that contain a boatload of classes and > subclasses. My programming style which I don't think there is a > category for. > > I have a limited understanding of "javadoc" albeit new but way WAY > easier than this! > > > > >Alway fully document each object with author, version, date tags, etc. (An example of etc might be copyright) For each class, provide scope and variable type tags as well as short and long description. A short description is one sentence followed by a period and a line break. Document methods like classes except provide parameter information. For each variable, provide scope and variable type tags. > > > > > each object, why? I have one file containing 15 - 20 classes each, each > class averaging about 5 methods per class, each method averaging 4 > globals and 10 - 15 local variables. And about 5 files structured like > that per project per client. So why do each object, should I not just > have one DocBlock with author, version and package and then each method > I document vars, params and optional returns? > > >If you just go this far, you will be able to produce suprisingly helpful documentation. Unless you are working for a company that already has existing documentation standards in place, you should be fine. Better than fine, actually. > > > >The last step is to actually produce the phpDocumentor document. The command-line tool is very powerful. Use the web tool anyway. The docbuilder interface can be accessed via index.html in the install directory of phpDocumentor, or the docbuilder subdirectory. Its slick, easy and will do the job right the first time. You can save the command-line for those cold winter nights. > > > > > > Just my luck my HTML interface throws PHP code all over the place along > with HTML. Hard to read but I'm muddling through here. > > >Once you have your code documented to this point, you have reached a milestone. Now you can explore more of the functionality of phpDocumentor. I recommend learning how to use templates for no ther reason than the typical reason one uses templates: less work = more gooder. Not that it isn't great fun copying the same scope and variable documentation on type of fifteen class-level variables, but templates are a good thing to learn. The same goes for packages. I'm still not sure why, but the @package tag usage does seem to cause some confusion. The same is true of the @see tag. But once you get these tags, you'll love them > > > >Its a good idea now to look at ALL of the tags offerend by phpDocumentor. I'm a big fan of the @todo tag. Include the @version $Revision$ tag and udate it with CVS version. > > > > > > [blank stare altogether] > > >Finally, experiment with outputting you phpDocumentor into different formats. I'm now a big fan of outputting my documentation into a PEAR template, but that's because I'm a big PEAR fan. If you prefer DocBook, that also makes perfect sense. If you like more than one, now it may be time to learn the command-line interface and write a script. There are many, many tags in phpDocumentor and you will probably like some of them and want to include them. > > > > > > > > > > > > > > > > > > thanx for the detailed tips.. this will take more than one day to be > able to use just for one file, which I'm experimenting with. I gave up > on DOxygen, it's even harder for me to use than PHPDocumentor. > > Phil > > > > > > > > > > > > > > -- > Phil Powell > Web Developer > ADNET Systems, Inc. > 11260 Roger Bacon Drive, Suite 403 > Reston, VA 20190-5203 > Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 > EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude > > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk -- ______________________________________________ Check out the latest SMS services @ http://www.linuxmail.org This allows you to send and receive SMS through your mailbox. Powered by Outblaze From erank at isthmus.com Fri Feb 27 13:29:06 2004 From: erank at isthmus.com (Eric Rank) Date: Fri, 27 Feb 2004 12:29:06 -0600 Subject: [nycphp-talk] parse_ini_file() wants full path... ? References: Message-ID: <008301c3fd5f$95506420$8b01a8c0@DB> A work around might be to use the realpath() function. $path = realpath('./file.ini'); parse_ini_file($path); cheers! Eric ----- Original Message ----- From: "David Mintz" To: "NYPHP Talk" Sent: Friday, February 27, 2004 12:05 PM Subject: [nycphp-talk] parse_ini_file() wants full path... ? > > On my development machine -- RH Linux 9/Apache 1.3.27/PHP 4.3.3 -- I get a > 'cannot open file.ini for reading' error from parse_ini_file unless I give > it the full path. I want to be able to say parse_ini_file('./file.ini') > for the convenience of inter-server portability. (The caller and the ini > file do live in the same directory.) > > I ~can~ do this on the production box (FreeBSD 4.8/PHP 4.3.4/Apache > 1.3.29) and all the relevant php.ini and file permission settings are the > same or similar, AFAICT. > > I'm grateful for any clues. Thanks. > > --- > David Mintz > http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- Sopranos 24:17 > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From phillip.powell at adnet-sys.com Fri Feb 27 13:32:43 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Fri, 27 Feb 2004 13:32:43 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor References: <20040227182605.B9C0BA863E@virtu.nyphp.org> Message-ID: <403F8D4B.40401@adnet-sys.com> patkins wrote: >All, > >I'm trying this for the first time today. I downloaded and setup PHPDocumentor in under an hour. I commented a couple of classes, ran the web GUI and "Bing" there it was as beautiful as can be. > >I am very impressed and motivated to clean up and comment all my projects. I also tried the "DOxygen" and "PHPDocumentor" was by far better. > >Cheers, >Peter > >-----Original Message----- >From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Phil Powell >Sent: Friday, February 27, 2004 12:59 PM >To: NYPHP Talk >Subject: Re: [nycphp-talk] Your experiences with PHPDocumentor > >Dave Callaghan wrote: > > > >>>>Phil Powell writes: >>>> >>>> >>>> >>>> >>>Sorry but that tells me little-to-nothing. You haven't told me about >>>ease of use, code manipulation to make it work for documenting, all I >>>see is the results of using Doxygen. I'd like to know how easy it was >>>for YOU to use it, implement it, examples of *HOW* you used it in a case >>>of like a flat script here or a class method there, anything. >>> >>>I am struggling with PHPDocumentor because it seems, at best, >>>impossible >>>to use. >>> >>> >>> >>> >>I use phpDocumentor in all of my OOP projects and I document the code >>with phpDocumentor in much the same way as I use JavaDoc. I found the >>concept familiar, the syntax simple and the need clear so your >>statement that 'PHPDocumentor because it seems, at best, impossible to >>use' tells me little-to-nothing. >> >>First, in order to use phpDocumentor, you need to read the >>'phpDocumentor Guide to Creating Fantastic Documentation' at http://phpdoc.org/docs/HTMLSmartyConverter/default/phpDocumentor/tutorial_phpDocumentor.pkg.html >>In all honesty, if you read it an it didn't help you, read it again. Not suprisingly, the documentation for phpDocumentor is done very well. If you aren't familiar with structured code documentation (and many, many experienced programmers are not) you may have just skimmed the text because you trivialized the task. Good documentation is hard. >> >> >> > >Thanx.. I'm at that page now and trying to figure it out is like trying >to learn Mongolian in an hour. I am not fathoming most of it, though I >understand some of the tags like @accept, @param and @return, easy ones. > @global throws warnings and @package just plain chokes the >phpdocumentor tool. > > > >>For another point of view on this type of code documentation, or >>'literate programming' as people who need to call things something call this thing, read the 'The Design of Distributed Hyperlinked Programming Documentation' at >>ftp://ftp.java.sun.com/docs/javadoc-paper/iwhd.pdf This will give you a perspective on what the developers of Javadoc, and thus by extension phpDocumentor, are trying to do. >> >>I only document OPP code because I only write OOP code because that's >>the coding methodology that my projects are usually best served by. If >>you are a proceduraral programmer, I imagine phpDocumentor will still >>help by I can't speak from experience. Remember, since this is heavily >>inspired by JavaDoc, it natually lends itself to OOP. >> >> >> > >I am not sure what I am. The bastard child of OO and procedural code. I >create PHP scripts that are flat-procedure ("index.php") that require >".inc.php" library scripts that contain a boatload of classes and >subclasses. My programming style which I don't think there is a >category for. > >I have a limited understanding of "javadoc" albeit new but way WAY >easier than this! > > > >>Alway fully document each object with author, version, date tags, etc. >>(An example of etc might be copyright) For each class, provide scope and variable type tags as well as short and long description. A short description is one sentence followed by a period and a line break. Document methods like classes except provide parameter information. For each variable, provide scope and variable type tags. >> >> >> >> >each object, why? I have one file containing 15 - 20 classes each, each >class averaging about 5 methods per class, each method averaging 4 >globals and 10 - 15 local variables. And about 5 files structured like >that per project per client. So why do each object, should I not just >have one DocBlock with author, version and package and then each method >I document vars, params and optional returns? > > > >>If you just go this far, you will be able to produce suprisingly >>helpful documentation. Unless you are working for a company that >>already has existing documentation standards in place, you should be >>fine. Better than fine, actually. >> >>The last step is to actually produce the phpDocumentor document. The >>command-line tool is very powerful. Use the web tool anyway. The docbuilder interface can be accessed via index.html in the install directory of phpDocumentor, or the docbuilder subdirectory. Its slick, easy and will do the job right the first time. You can save the command-line for those cold winter nights. >> >> >> >> > >Just my luck my HTML interface throws PHP code all over the place along >with HTML. Hard to read but I'm muddling through here. > > > >>Once you have your code documented to this point, you have reached a >>milestone. Now you can explore more of the functionality of >>phpDocumentor. I recommend learning how to use templates for no ther >>reason than the typical reason one uses templates: less work = more >>gooder. Not that it isn't great fun copying the same scope and variable >>documentation on type of fifteen class-level variables, but templates >>are a good thing to learn. The same goes for packages. I'm still not >>sure why, but the @package tag usage does seem to cause some confusion. >>The same is true of the @see tag. But once you get these tags, you'll >>love them >> >>Its a good idea now to look at ALL of the tags offerend by >>phpDocumentor. I'm a big fan of the @todo tag. Include the @version $Revision$ tag and udate it with CVS version. >> >> >> >> > >[blank stare altogether] > > > >>Finally, experiment with outputting you phpDocumentor into different >>formats. I'm now a big fan of outputting my documentation into a PEAR template, but that's because I'm a big PEAR fan. If you prefer DocBook, that also makes perfect sense. If you like more than one, now it may be time to learn the command-line interface and write a script. There are many, many tags in phpDocumentor and you will probably like some of them and want to include them. >> >> >> >> >> >> >> >> >> >> > >thanx for the detailed tips.. this will take more than one day to be >able to use just for one file, which I'm experimenting with. I gave up >on DOxygen, it's even harder for me to use than PHPDocumentor. > >Phil > > > >> >> >> >> >> > > > > Cool, help me then, I'm stuck! Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From Cbielanski at inta.org Fri Feb 27 13:42:13 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Fri, 27 Feb 2004 13:42:13 -0500 Subject: [nycphp-talk] moving MySQL Tables Message-ID: yeah, I got friendly with the mysqldump manpage on the website :) I got my purpose served! > -----Original Message----- > From: Daniel Krook [mailto:danielk at us.ibm.com] > Sent: Friday, February 27, 2004 12:48 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] moving MySQL Tables > > > > > > > The solution I use for this is to have a cron job run > bin/mysqldump nightly > or on demand to write the data and structure to an SQL file, > transfer the > file, then run "source c:\data.sql" from the second machine's > mysql command > line client. It's not much of a hassle to do a dump and > rebuild this way. > > Admittedly, the SQL file I dump is only in the range of half > a MB, but this > technique is good for grabbing the latest data on my Solaris > 4.0.15 and > using it on my Windows 2000 workstation running 3.23 or Mac > OS X machine > running 4.0.17. > > Carlos' solution is much better for larger, server to server > migrations. > Using mysqldump is better for getting a latest copy and > bringing it to your > workstation quickly. > > > > Daniel Krook, Application Developer, Production Services, ibm.com > 1133 Westchester Avenue, White Plains, NY 10604 > Tel: (914) 642-4474, Tieline 224-4474 > danielk at us.ibm.com > > Personal: http://info.krook.org/ > Persona: http://w3.ibm.com/persona/users/9/0/x/90MC212-P.html > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From danielc at analysisandsolutions.com Fri Feb 27 13:40:14 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 27 Feb 2004 13:40:14 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor In-Reply-To: <403F8D4B.40401@adnet-sys.com> References: <20040227182605.B9C0BA863E@virtu.nyphp.org> <403F8D4B.40401@adnet-sys.com> Message-ID: <20040227184014.GA2288@panix.com> On Fri, Feb 27, 2004 at 01:32:43PM -0500, Phil Powell wrote: > Cool, help me then, I'm stuck! Patkins, save your fingers and your time. Run while you still can. As you can see from the nature of Phil's questions and his leaving in over 200 lines of stuff just to say "help me," he needs more help than you, or anyone on this list, can provide. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From dan at cain.sh Fri Feb 27 14:01:46 2004 From: dan at cain.sh (Daniel J Cain Jr.) Date: Fri, 27 Feb 2004 13:01:46 -0600 Subject: [nycphp-talk] Magic is Illusion?!? Message-ID: <1077908506.17018.32.camel@gigabeast.home.cain.sh> Odd question, possibly OT but the answer should determine that. Anyone out there run into files like these? -rwxr-xr-x 1 nobody wheel 582254592 Jan 19 13:09 magicp8vAAg -rwxr-xr-x 1 nobody wheel 582254592 Jan 19 13:09 magicwcYIKc Found these bad boys on /var/tmp/ on a FreeBSD box. Not sure they are a PHP (or an extensions) tmp file or what. Google, PHP source, and log files haven't shed any light on this as of yet. Could this indicate an attack of some kind? Any thoughts are welcome. -dan From leam at reuel.net Fri Feb 27 14:10:32 2004 From: leam at reuel.net (leam) Date: Fri, 27 Feb 2004 13:10:32 -0600 Subject: [nycphp-talk] Magic is Illusion?!? Message-ID: Don't have access to any BSD boxes at the moment, but here's my thoughts. Big files, and i think "nobody" is the default user for nfs shared filesystems. Is the box an nfs server? /var/tmp is usually used for various applications to store stuff, but usually they clean up afterthemselves. Did the box have any problems around the date/time? Maybe a core dump? I wouldn't think it's an attack, more a miscreant application or system burp. I must confess to not being the most knowledgeable on such things though. Two avenues to investigation. Run "strings" on the files and see what comes up. Or look for other files of that same size on the machine. ciao! leam > Odd question, possibly OT but the answer should determine that. > > Anyone out there run into files like these? > > -rwxr-xr-x 1 nobody wheel 582254592 Jan 19 13:09 magicp8vAAg > -rwxr-xr-x 1 nobody wheel 582254592 Jan 19 13:09 magicwcYIKc > > Found these bad boys on /var/tmp/ on a FreeBSD box. Not sure they are a > PHP (or an extensions) tmp file or what. Google, PHP source, and log > files haven't shed any light on this as of yet. > > Could this indicate an attack of some kind? Any thoughts are welcome. > > -dan > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > -- From felix at students.poly.edu Fri Feb 27 10:09:29 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Fri, 27 Feb 2004 10:09:29 -0500 Subject: Subject: Re: [nycphp-talk] PHP 4.3.3 and session_start In-Reply-To: References: <20040226170004.902E1A87CA@virtu.nyphp.org> Message-ID: <20040227100929.1a29160a.felix@students.poly.edu> > Because these courses where produced by different programmers working > for different shops, I need to ask them to modify their code and check > first if a session already exists before calling session_start. This > is not fun. > You can check for session existance manually if(isset($_COOKIE[session_name()]) || isset($_GET[session_name()] )) This does still miss one case where sid can be part of url http://host/sessesion_name-session_id/... What you got to realize is that these checks are the first thing done by session_start() before it sets php internal session status to on or off. There shoudl be no reason to write this session check code when it is already done by php. Also it does not make sence to use isset($_SESSION) before session_start() is called. What php really needs is an additional session_exists() function. Code like this: if(!session_exists()){ session_start(); } would not be useful because that is already what session_start() does. Although this would be useful: if(!session_exists()){ //do something without starting session }else{ session_start(); //do normal session stuff } -- felix[at]bebinary.com http://www.zaslavskiy.net/ From dan at cain.sh Fri Feb 27 14:23:21 2004 From: dan at cain.sh (Daniel J Cain Jr.) Date: Fri, 27 Feb 2004 13:23:21 -0600 Subject: [nycphp-talk] Magic is Illusion?!? In-Reply-To: References: Message-ID: <1077909801.17018.44.camel@gigabeast.home.cain.sh> On Fri, 2004-02-27 at 13:10, leam wrote: > Big files, and i think "nobody" is the default user for nfs shared > filesystems. Is the box an nfs server? YES. It has ended up that way out of necessity more than design. As I understand it FreeBSD (can't speak to the other BSD's) are a poor choice to serve NFS. > /var/tmp is usually used for various applications to store stuff, but > usually they clean up afterthemselves. Did the box have any problems > around the date/time? Maybe a core dump? /var filled up, and I had thought due to those files. No .core files on the filesystem including NFS clients. > I wouldn't think it's an attack, more a miscreant application or system > burp. I must confess to not being the most knowledgeable on such things > though. Knowing their origin (or at least a clue) makes me feel a little better. > Two avenues to investigation. Run "strings" on the files and see what > comes up. Or look for other files of that same size on the machine. Thanks leam! > ciao! > > leam > > > Odd question, possibly OT but the answer should determine that. > > > > Anyone out there run into files like these? > > > > -rwxr-xr-x 1 nobody wheel 582254592 Jan 19 13:09 magicp8vAAg > > -rwxr-xr-x 1 nobody wheel 582254592 Jan 19 13:09 magicwcYIKc > > > > Found these bad boys on /var/tmp/ on a FreeBSD box. Not sure they are > a > > PHP (or an extensions) tmp file or what. Google, PHP source, and log > > files haven't shed any light on this as of yet. > > > > Could this indicate an attack of some kind? Any thoughts are welcome. > > > > -dan > > > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk > > > > From danielc at analysisandsolutions.com Fri Feb 27 14:20:12 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 27 Feb 2004 14:20:12 -0500 Subject: [nycphp-talk] Magic is Illusion?!? In-Reply-To: <1077908506.17018.32.camel@gigabeast.home.cain.sh> References: <1077908506.17018.32.camel@gigabeast.home.cain.sh> Message-ID: <20040227192012.GA13349@panix.com> On Fri, Feb 27, 2004 at 01:01:46PM -0600, Daniel J Cain Jr. wrote: > > -rwxr-xr-x 1 nobody wheel 582254592 Jan 19 13:09 magicp8vAAg ImageMagick? --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From csnyder at chxo.com Fri Feb 27 14:34:59 2004 From: csnyder at chxo.com (Chris Snyder) Date: Fri, 27 Feb 2004 14:34:59 -0500 Subject: [nycphp-talk] Your experiences with PHPDocumentor In-Reply-To: <20040227182605.B9C0BA863E@virtu.nyphp.org> References: <20040227182605.B9C0BA863E@virtu.nyphp.org> Message-ID: <403F9BE3.3090504@chxo.com> patkins wrote: >I am very impressed and motivated to clean up and comment all my projects. I also tried the "DOxygen" and "PHPDocumentor" was by far better. > > This is a matter of preference, obviously, and perhaps I have an outdated notion of PHPDocumentor, but one of the things that I really like about Doxygen is that it links you right into the actual code. It also strikes me as being more flexible -- you can use any or all of several different commenting styles, although this also seems to result in a configuration process that is relatively complex. The impending introduction of PHP5 will change the auto-documentation landscape somewhat, as you'll be expressing a lot of important notions ( public vs private, parameter typing ) in the code rather in comments. It will be interesting to see which packages take the lead in this case. From mitchy at spacemonkeylabs.com Fri Feb 27 14:36:24 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Fri, 27 Feb 2004 14:36:24 -0500 Subject: [nycphp-talk] XML vs. DB (best approach) In-Reply-To: <00e701c3fd4e$0926ccc0$6400a8c0@thinkpad> References: <00e701c3fd4e$0926ccc0$6400a8c0@thinkpad> Message-ID: <403F9C38.2000306@spacemonkeylabs.com> If you'd like to have the data model reviewed I'd be happy to take a look for you. That does sound like a lot of tables for not that much data. I definitely agree with Dan about XML being used for the sharing of data, and a RDBMS for storage/retrieval. -- Mitch From csnyder at chxo.com Fri Feb 27 14:39:18 2004 From: csnyder at chxo.com (Chris Snyder) Date: Fri, 27 Feb 2004 14:39:18 -0500 Subject: [nycphp-talk] Magic is Illusion?!? In-Reply-To: <20040227192012.GA13349@panix.com> References: <1077908506.17018.32.camel@gigabeast.home.cain.sh> <20040227192012.GA13349@panix.com> Message-ID: <403F9CE6.90602@chxo.com> Daniel Convissor wrote: >ImageMagick? > > My first thought was mime magic. Whatever the case, it would seem that 555MB is the magic number that causes whatever process this was to orphan the files. You might search for other files on the box with the same size to see if that sheds any light on what they could be. From dcech at phpwerx.net Fri Feb 27 14:45:37 2004 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 27 Feb 2004 14:45:37 -0500 Subject: [nycphp-talk] XML vs. DB (best approach) In-Reply-To: <403F9C38.2000306@spacemonkeylabs.com> References: <00e701c3fd4e$0926ccc0$6400a8c0@thinkpad> <403F9C38.2000306@spacemonkeylabs.com> Message-ID: <403F9E61.4040708@phpwerx.net> Mitch Pirtle wrote: > If you'd like to have the data model reviewed I'd be happy to take a > look for you. That does sound like a lot of tables for not that much > data. I definitely agree with Dan about XML being used for the sharing > of data, and a RDBMS for storage/retrieval. I'll second that, and again if you don't have any problems posting your database schema I'm sure you will find plenty of people more than happy to have a stab at helping you to streamline it. Dan From adam at trachtenberg.com Fri Feb 27 15:01:18 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Fri, 27 Feb 2004 15:01:18 -0500 (EST) Subject: [nycphp-talk] Your experiences with PHPDocumentor In-Reply-To: <403F9BE3.3090504@chxo.com> References: <20040227182605.B9C0BA863E@virtu.nyphp.org> <403F9BE3.3090504@chxo.com> Message-ID: On Fri, 27 Feb 2004, Chris Snyder wrote: > The impending introduction of PHP5 will change the auto-documentation > landscape somewhat, as you'll be expressing a lot of important notions ( > public vs private, parameter typing ) in the code rather in comments. It > will be interesting to see which packages take the lead in this case. PHP 5 also offers a complete set of reflection classes: http://sitten-polizei.de/php/reflection_api/docs/language.reflection.html This makes it much easier to write documentation programs because you can ask PHP to describe the classes for you in far greater detail than in PHP 4. If you're interested in see these in action, check out the PHP 5 version of PHPUnit. I haven't spent too much time looking at its source, but I know it uses reflection to simplify how to examine classes so it can run unit tests. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From dmintz at davidmintz.org Fri Feb 27 15:14:00 2004 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 27 Feb 2004 15:14:00 -0500 (EST) Subject: [nycphp-talk] parse_ini_file() wants full path... ? In-Reply-To: <008301c3fd5f$95506420$8b01a8c0@DB> References: <008301c3fd5f$95506420$8b01a8c0@DB> Message-ID: I'll give that a shot. In the meantime I just got bored with the struggle and decided to require('./config.php') instead and let config.php do the configuring. TMTOWTDI! Thanks (-: On Fri, 27 Feb 2004, Eric Rank wrote: > A work around might be to use the realpath() function. > > $path = realpath('./file.ini'); > parse_ini_file($path); > > cheers! > > Eric > > > On my development machine -- RH Linux 9/Apache 1.3.27/PHP 4.3.3 -- I get a > > 'cannot open file.ini for reading' error from parse_ini_file unless I give > > it the full path. I want to be able to say parse_ini_file('./file.ini') > > for the convenience of inter-server portability. (The caller and the ini > > file do live in the same directory.) [snip] --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From andrew at digitalpulp.com Fri Feb 27 15:42:34 2004 From: andrew at digitalpulp.com (Andrew Yochum) Date: Fri, 27 Feb 2004 15:42:34 -0500 Subject: [nycphp-talk] Magic is Illusion?!? In-Reply-To: <403F9CE6.90602@chxo.com> References: <1077908506.17018.32.camel@gigabeast.home.cain.sh> <20040227192012.GA13349@panix.com> <403F9CE6.90602@chxo.com> Message-ID: <20040227204234.GL1191@thighmaster.digitalpulp.com> On Fri, Feb 27, 2004 at 02:39:18PM -0500, Chris Snyder wrote: > Daniel Convissor wrote: > > >ImageMagick? > > > > > My first thought was mime magic. Whatever the case, it would seem that > 555MB is the magic number that causes whatever process this was to > orphan the files. > > You might search for other files on the box with the same size to see if > that sheds any light on what they could be. You can also try running the "file" command on the files. It does a pretty good job of determining the type of file you feed it. -- Andrew Yochum Digital Pulp, Inc. 212.679.0676x255 andrew at digitalpulp.com From dan at cain.sh Fri Feb 27 16:38:50 2004 From: dan at cain.sh (Daniel J Cain Jr.) Date: Fri, 27 Feb 2004 15:38:50 -0600 Subject: [nycphp-talk] Magic is Illusion?!? In-Reply-To: <20040227204234.GL1191@thighmaster.digitalpulp.com> References: <1077908506.17018.32.camel@gigabeast.home.cain.sh> <20040227192012.GA13349@panix.com> <403F9CE6.90602@chxo.com> <20040227204234.GL1191@thighmaster.digitalpulp.com> Message-ID: <1077917930.17018.48.camel@gigabeast.home.cain.sh> On Fri, 2004-02-27 at 14:42, Andrew Yochum wrote: > You can also try running the "file" command on the files. It does a pretty > good job of determining the type of file you feed it. Tried that one, just got back "data". This was paged last night so I don't have the files any longer and strings took way too long to go through that big file. Seeing they looked to be owned by the web server setup I was concerned it was malicious in nature. From tgales at tgaconnect.com Fri Feb 27 16:45:09 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 27 Feb 2004 16:45:09 -0500 Subject: [nycphp-talk] (no subject) Message-ID: <000001c3fd7a$f9099ca0$e98d3818@oberon1> Yesterday I was experimenting with PHP installed on a drive logically partitioned as 'L:' I wanted to setup pear so I ran go-pear.bat. At the end of the batch script I got: PEAR_Config: bad data in L:\php\pear.ini that seemed to be coming from config.php when calling something named version_compare. I didn't worry about it to much at the time. But today I want to run PHP 4.3.3 pear and it was acting weird. I decided to run go-pear.bat on the j: drive where the 4.3.3 pear stuff is. Here is an excerpt: 1. Installation prefix : J:\php 2. Binaries directory : $prefix 3. PHP code directory ($php_dir) : $prefix\pear 4. Documentation base directory : $php_dir\docs 5. Data base directory : $php_dir\data 6. Tests base directory : $php_dir\tests 7. php.exe path : J:\php\php.exe PEAR_Config: bad data in J:\php\pear.ini came up again. I ran PEAR_ENV.reg which has the following: REGEDIT4 [HKEY_CURRENT_USER\Environment] "PHP_PEAR_SYSCONF_DIR"="J:\\php" "PHP_PEAR_INSTALL_DIR"="J:\\php\\pear" "PHP_PEAR_DOC_DIR"="J:\\php\\pear\\docs" "PHP_PEAR_BIN_DIR"="J:\\php" "PHP_PEAR_DATA_DIR"="J:\\php\\pear\\data" "PHP_PEAR_PHP_BIN"="J:\\php\\php.exe" "PHP_PEAR_TEST_DIR"="J:\\php\\pear\\tests" Do I have to erase this J:\php\pear directory and reinstall (if that's the answer so be it) But is there an easier/quicker way? Thanks in advance for anything on this T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com >From hans not junk at nyphp.com Fri Feb 27 17:04:59 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 7B9FFA86CD for ; Fri, 27 Feb 2004 17:04:59 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 27 Feb 2004 14:04:57 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA665D at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: CSV Regex Thread-Index: AcP9ffL7mv2wULxtQrin+3biO7vdGA== From: "Hans Zaunere" To: "NYPHP Talk" Subject: [nycphp-talk] CSV Regex X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2004 22:04:59 -0000 Hi all, I'm looking to parse a CSV file and figured there must be a smooth regex for the job. I'm of course getting the data line by line. Google seems to think this is everyone's favorite regex for the job: ,(?=3D([^"]*"[^"]*")*(?![^"]*")) And, I must say, it works pretty good, using, for instance, the following command: $columns =3D preg_split('/,(?=3D([^"]*"[^"]*")*(?![^"]*"))/',fgets($fp)); The only issue is it returns the double quotes with each column. So, if a column contains: "D" I get "D" back. I'd prefer just D Any tips? Thanks, H From shiflett at php.net Fri Feb 27 17:11:38 2004 From: shiflett at php.net (Chris Shiflett) Date: Fri, 27 Feb 2004 14:11:38 -0800 (PST) Subject: [nycphp-talk] CSV Regex In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87AA665D@ehost011-1.exch011.intermedia.net> Message-ID: <20040227221138.48891.qmail@web14301.mail.yahoo.com> --- Hans Zaunere wrote: > I'm looking to parse a CSV file and figured there must be a smooth > regex for the job. Any reason why fgetcsv() doesn't work for you? http://www.php.net/fgetcsv I've always found it to do a fine job, plus it's very fast. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From adam at digitalpulp.com Fri Feb 27 17:17:58 2004 From: adam at digitalpulp.com (Adam Fields) Date: Fri, 27 Feb 2004 17:17:58 -0500 Subject: [nycphp-talk] CSV Regex In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87AA665D@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F87AA665D@ehost011-1.exch011.intermedia.net> Message-ID: <403FC216.4010902@digitalpulp.com> Hans Zaunere wrote: > Hi all, > > I'm looking to parse a CSV file and figured there must be a smooth regex > for the job. I'm of course getting the data line by line. Google seems > to think this is everyone's favorite regex for the job: > > ,(?=([^"]*"[^"]*")*(?![^"]*")) > > And, I must say, it works pretty good, using, for instance, the > following command: > > $columns = > preg_split('/,(?=([^"]*"[^"]*")*(?![^"]*"))/',fgets($fp)); > > The only issue is it returns the double quotes with each column. So, if > a column contains: > > "D" > > I get "D" back. I'd prefer just D > > Any tips? Thanks, You could just strip off the quotes afterwards, of course, but that's maybe not what you were looking for. Dealing with quotes in CSV is sort of a disaster waiting to happen. Remember that there may be quotes embedded inside fields, which are themselves quoted, and newlines inside fields may or may not be supported. There's discussion of this in The Art of Unix Programming: http://www.faqs.org/docs/artu/ch05s02.html#id2901882 From dan at mx2pro.com Fri Feb 27 17:38:47 2004 From: dan at mx2pro.com (Dan Horning) Date: Fri, 27 Feb 2004 17:38:47 -0500 Subject: [nycphp-talk] test Message-ID: <200402272238.i1RMcoEj002968@ms-smtp-02.nyroc.rr.com> test Dan Horning - Technical Systems Administration http://www.mx2pro.com/ http://dan.mx2pro.com/ http://www.dsoundmn.com/ 1-866-284-3150 (Office/Home) From adam at digitalpulp.com Fri Feb 27 17:40:02 2004 From: adam at digitalpulp.com (Adam Fields) Date: Fri, 27 Feb 2004 17:40:02 -0500 Subject: [nycphp-talk] Please don't use vacation autoresponders. Message-ID: <403FC742.6000804@digitalpulp.com> -------- Original Message -------- Subject: Out of Office AutoReply: [nycphp-talk] CSV Regex Date: Fri, 27 Feb 2004 17:20:59 -0500 From: Larry Chuon To: Adam Fields I'm currently out of the office. I will return to work on Tue March 2nd. Have a blastful day! From adam at trachtenberg.com Fri Feb 27 17:40:22 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Fri, 27 Feb 2004 17:40:22 -0500 (EST) Subject: [nycphp-talk] CSV Regex In-Reply-To: <20040227221138.48891.qmail@web14301.mail.yahoo.com> References: <20040227221138.48891.qmail@web14301.mail.yahoo.com> Message-ID: On Fri, 27 Feb 2004, Chris Shiflett wrote: > --- Hans Zaunere wrote: > > I'm looking to parse a CSV file and figured there must be a smooth > > regex for the job. > > Any reason why fgetcsv() doesn't work for you? > > http://www.php.net/fgetcsv > > I've always found it to do a fine job, plus it's very fast. What Chris said, but if you really want a regex, I suggest the one from Jeff Friedl's "Mastering Regular Expressions." The code examples are available online at: http://www.regex.info/listing.cgi?ps=213&pe=220 -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From adam at digitalpulp.com Fri Feb 27 17:40:23 2004 From: adam at digitalpulp.com (Adam Fields) Date: Fri, 27 Feb 2004 17:40:23 -0500 Subject: [nycphp-talk] No, really, please don't use vacation autoresponders. Message-ID: <403FC757.5000408@digitalpulp.com> -------- Original Message -------- Subject: Out of Office AutoReply: [nycphp-talk] CSV Regex Date: Fri, 27 Feb 2004 15:18:09 -0700 From: Nunez, Eddy To: Adam Fields Away from the office until March 8th. Any dire emergencies, send me a short text message at "ean at vtext.com" or call 718-614-7033, otherwise send inquiries to "System operations web team". Be Well! :) ************************************************************** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ************************************************************** From jonbaer at jonbaer.net Fri Feb 27 17:51:24 2004 From: jonbaer at jonbaer.net (jon baer) Date: Fri, 27 Feb 2004 17:51:24 -0500 Subject: [nycphp-talk] XML vs. DB (best approach) References: <00e701c3fd4e$0926ccc0$6400a8c0@thinkpad> <403F9C38.2000306@spacemonkeylabs.com> Message-ID: <00be01c3fd84$39f8c160$6400a8c0@thinkpad> Well the 60 tables are a collaboration of packages ... (oscommerce, phpbb, calendar, ai, etc) so much of it is reasonable, one is bh_player, which is approx ~100 players per leagues, 5 leagues @ the moment: CREATE TABLE bh_player ( id int(11) NOT NULL auto_increment, team int(11) default NULL, first varchar(50), last varchar(50), jersey int(2) NOT NULL default '0', number1 varchar(10) default NULL, number2 varchar(10) default NULL, email varchar(50), zipcode varchar(5) NOT NULL default '00000', position int(1) default NULL, captain tinyint(1) default '0', sponsor varchar(50) default NULL, PRIMARY KEY (id) ) TYPE=MyISAM; ... ----- Original Message ----- From: "Mitch Pirtle" To: "NYPHP Talk" Sent: Friday, February 27, 2004 2:36 PM Subject: Re: [nycphp-talk] XML vs. DB (best approach) > If you'd like to have the data model reviewed I'd be happy to take a > look for you. That does sound like a lot of tables for not that much > data. I definitely agree with Dan about XML being used for the sharing > of data, and a RDBMS for storage/retrieval. > From danielc at analysisandsolutions.com Fri Feb 27 18:04:41 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 27 Feb 2004 18:04:41 -0500 Subject: [nycphp-talk] No, really, please don't use vacation autoresponders. In-Reply-To: <403FC757.5000408@digitalpulp.com> References: <403FC757.5000408@digitalpulp.com> Message-ID: <20040227230441.GA20349@panix.com> On Fri, Feb 27, 2004 at 05:40:23PM -0500, Adam Fields wrote: > From: Nunez, Eddy > > Away from the office until March 8th. And this charming individual has done this before and I asked him not to do it again. So much for my being omnipotent... Anyway boys and girls, there are several ways to avoid this situation: 1) Set up your auto-responder to not send responses to mailing lists you're on. 2) Unsubscribe from mailing lists while you're gone. 3) Don't use auto-responders. Thank you, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From leam at reuel.net Fri Feb 27 18:06:51 2004 From: leam at reuel.net (leam) Date: Fri, 27 Feb 2004 18:06:51 -0500 Subject: [nycphp-talk] test In-Reply-To: <200402272238.i1RMcoEj002968@ms-smtp-02.nyroc.rr.com> References: <200402272238.i1RMcoEj002968@ms-smtp-02.nyroc.rr.com> Message-ID: <403FCD8B.8060400@reuel.net> Dan Horning wrote: > test 56%. Try again. :) ciao! leam From tgales at tgaconnect.com Fri Feb 27 18:27:50 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 27 Feb 2004 18:27:50 -0500 Subject: [nycphp-talk] (no subject) In-Reply-To: <000001c3fd7a$f9099ca0$e98d3818@oberon1> Message-ID: <000201c3fd89$50fef960$e98d3818@oberon1> > But is there an easier/quicker way? > It turns out Windows XP was making daily snapshots of the system after restoring a snap from 3 days ago everything seems to have been set straight (it looks like it even restored some files from the 'recycled bin') I think the next time I try an experiment, I'll create a manual snapshot just before. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From shiflett at php.net Fri Feb 27 18:35:16 2004 From: shiflett at php.net (Chris Shiflett) Date: Fri, 27 Feb 2004 15:35:16 -0800 (PST) Subject: [nycphp-talk] No, really, please don't use vacation autoresponders. In-Reply-To: <20040227230441.GA20349@panix.com> Message-ID: <20040227233516.88428.qmail@web14303.mail.yahoo.com> --- Daniel Convissor wrote: > Anyway boys and girls, there are several ways to avoid this situation: > > 1) Set up your auto-responder to not send responses to mailing lists > you're on. > > 2) Unsubscribe from mailing lists while you're gone. > > 3) Don't use auto-responders. 4) Get the list administrator to not mangle the Reply-To header. Sorry Hans, I couldn't pass up the opportunity. :-) Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From dan at mx2pro.com Fri Feb 27 22:04:48 2004 From: dan at mx2pro.com (Dan Horning) Date: Fri, 27 Feb 2004 22:04:48 -0500 Subject: [nycphp-talk] soon to be father Message-ID: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> hey everyone I'm going to be a father!!!! the due date is in october Dan Horning - Technical Systems Administration http://www.mx2pro.com/ http://dan.mx2pro.com/ http://www.dsoundmn.com/ 1-866-284-3150 (Office/Home) From jwilhelm at summit7solutions.com Fri Feb 27 22:12:44 2004 From: jwilhelm at summit7solutions.com (Jeff Wilhelm) Date: Fri, 27 Feb 2004 22:12:44 -0500 Subject: [nycphp-talk] soon to be father In-Reply-To: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> Message-ID: <022b01c3fda8$bc0a98d0$0a01a8c0@zion> Congrats again!! :-P * J E F F R E Y M. W I L H E L M * | e: jeff at jeffwilhelm.com w: www.jeffwilhelm.com e: jeff at summit7solutions.com w: www.summit7solutions.com p: 401-874-3118 // 401-481-5991 f: 419-735-8865 // 208-979-7205 Dan Horning wrote: > hey everyone > > I'm going to be a father!!!! > the due date is in october > > Dan Horning - Technical Systems Administration http://www.mx2pro.com/ > http://dan.mx2pro.com/ > http://www.dsoundmn.com/ > 1-866-284-3150 (Office/Home) > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From danielk at us.ibm.com Fri Feb 27 22:33:22 2004 From: danielk at us.ibm.com (Daniel Krook) Date: Fri, 27 Feb 2004 22:33:22 -0500 Subject: [nycphp-talk] soon to be father In-Reply-To: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> Message-ID: Congrats, I hope Earl (URL) and Dorothy (Dot) aren't among the names in you're considering. Maybe Philip or Phoebe or Phineas or Phyllis though.... : ) Daniel Krook, Application Developer, Production Services, ibm.com 1133 Westchester Avenue, White Plains, NY 10604 Tel: (914) 642-4474, Tieline 224-4474 danielk at us.ibm.com Personal: http://info.krook.org/ Persona: http://w3.ibm.com/persona/users/9/0/x/90MC212-P.html From pl at eskimo.com Fri Feb 27 22:39:02 2004 From: pl at eskimo.com (Peter) Date: Fri, 27 Feb 2004 22:39:02 -0500 Subject: [nycphp-talk] soon to be father References: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> Message-ID: <002301c3fdac$6a78a6c0$242c0242@default> Congrats. Maybe I will share a birthday with your child. i was born oct. 12. peter ----- Original Message ----- From: "Dan Horning" To: "'NYPHP Talk'" Sent: Friday, February 27, 2004 10:04 PM Subject: [nycphp-talk] soon to be father > hey everyone > > I'm going to be a father!!!! > the due date is in october > > Dan Horning - Technical Systems Administration > http://www.mx2pro.com/ > http://dan.mx2pro.com/ > http://www.dsoundmn.com/ > 1-866-284-3150 (Office/Home) > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From jonbaer at jonbaer.net Fri Feb 27 23:15:38 2004 From: jonbaer at jonbaer.net (jon baer) Date: Fri, 27 Feb 2004 23:15:38 -0500 Subject: [nycphp-talk] soon to be father References: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> Message-ID: <007101c3fdb1$85899190$6400a8c0@thinkpad> i don't know you but a big congrats and best wishes! - jon ----- Original Message ----- From: "Dan Horning" To: "'NYPHP Talk'" Sent: Friday, February 27, 2004 10:04 PM Subject: [nycphp-talk] soon to be father > hey everyone > > I'm going to be a father!!!! > the due date is in october From mitchy at spacemonkeylabs.com Fri Feb 27 23:33:55 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Fri, 27 Feb 2004 23:33:55 -0500 Subject: [nycphp-talk] soon to be father In-Reply-To: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> References: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> Message-ID: <40401A33.2080208@spacemonkeylabs.com> Dan Horning wrote: > hey everyone > > I'm going to be a father!!!! > the due date is in october Congratulations, you are about to start an incredible journey. Prepare yourself, you are about to be buried in free advice, such as mine ;) -- Mitch From leam at reuel.net Fri Feb 27 23:56:19 2004 From: leam at reuel.net (leam) Date: Fri, 27 Feb 2004 23:56:19 -0500 Subject: [nycphp-talk] Getting array in $_POST Message-ID: <40401F73.3050005@reuel.net> Okay, I'll try to make this understandable before I fall asleep. I'm setting a bunch of check boxes where each is a member of an array. So the first line is: echo " References: <40401F73.3050005@reuel.net> Message-ID: <40402471.7060509@reuel.net> leam wrote: > Okay, I'll try to make this understandable before I fall asleep. I'm > setting a bunch of check boxes where each is a member of an array. So > the first line is: > > echo " value=\"$skill_data[skillID] \" \n "; > > $skill_data[skillID] was previously pulled from the database and is a > unique identifier for each skill. Each checkbox has the skill name > beside it so the user can check what skills they have and then submit > the form. > > However, php script calls another to load the database and I'm not sure > how to get the data from a $_POST[] variable. Can I? I don't want to > have to manually name each variable because there's a couple hundred of > them all told. > > Hope that's enough info to make sense. If not I can just post my code, > though it is so ugly most sensible people avoid it. :) > > ciao! > > leam Code should be visible at http://68.85.52.250/php/post_array.html Appreciate any help. ciao! leam From jsiegel1 at optonline.net Sat Feb 28 00:23:55 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Sat, 28 Feb 2004 00:23:55 -0500 Subject: [nycphp-talk] Getting array in $_POST In-Reply-To: <40401F73.3050005@reuel.net> References: <40401F73.3050005@reuel.net> Message-ID: <404025EB.4070808@optonline.net> Doing it this way you've got the problem, no doubt, where the Post var "Skill" is an array that starts with zero and has no relation to the skill itself. > echo " value=\"$skill_data[skillID] \" \n "; However, nothing stops you from altering the "index" of the Skill array...so...instead of leaving it as 3.2CL Jeff leam wrote: > Okay, I'll try to make this understandable before I fall asleep. I'm > setting a bunch of check boxes where each is a member of an array. So > the first line is: > > echo " value=\"$skill_data[skillID] \" \n "; > > $skill_data[skillID] was previously pulled from the database and is a > unique identifier for each skill. Each checkbox has the skill name > beside it so the user can check what skills they have and then submit > the form. > > However, php script calls another to load the database and I'm not sure > how to get the data from a $_POST[] variable. Can I? I don't want to > have to manually name each variable because there's a couple hundred of > them all told. > > Hope that's enough info to make sense. If not I can just post my code, > though it is so ugly most sensible people avoid it. :) > > ciao! > > leam > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > >From hans not junk at nyphp.com Sat Feb 28 00:33:31 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id BCEEEA85F0 for ; Sat, 28 Feb 2004 00:33:30 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Java problems from Sun themselves ... Date: Fri, 27 Feb 2004 21:33:24 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA66F4 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Java problems from Sun themselves ... Thread-Index: AcP7xcoxDoZ0U/sAThCEJ9bszJJ+pgB9mg4Q From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2004 05:33:31 -0000 > > is this memo very old? i can't seem to tell, i just found it ... = its > > a good read anyways ... > >=20 > > http://www.internalmemos.com/memos/memodetails.php?memo_id=3D1321 > >=20 > I belive this was slashdoted last year. There was debate=20 > weather this is even real.=20 Hmm... good question. > > the "HelloWorld" problem is pretty funny (im sure the same applies = to > > PHP as it does to Python). "2. The JRE is very large." ... "Hello World 9M" Now *that* is OOP :) H >From hans not junk at nyphp.com Sat Feb 28 00:39:03 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 99A58A85F0 for ; Sat, 28 Feb 2004 00:39:03 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C3FDBD.2C2D23A9" Subject: RE: [nycphp-talk] Recommend Email POP3 Class or code snippet Date: Fri, 27 Feb 2004 21:39:00 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA66F5 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Recommend Email POP3 Class or code snippet Thread-Index: AcP7IZUS+F3LBqvtT9KX4ajlyC1kQgAgzqOgAIXtwtA= From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2004 05:39:04 -0000 This is a multi-part message in MIME format. ------_=_NextPart_001_01C3FDBD.2C2D23A9 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hey Tom, > Looking for a recommendation for an email class to handle polling a = POP3 > box. In the past, I've used the POP3 class on phpclasses.org without = issue, > but I don't believe it handles attachments (I could be wrong, just = getting Speaking POP (or any email protocol) isn't really related to = attachments. You could, for example, send HTTP packets over email if = you really wanted to. In fact, you could send IP packets if you have = nothing to do. > into this now), which is a definite requirement. I found another = class > there called 'clsImap.php', which I quickly installed and tried the = test > script with no luck (it handles POP3 in addition to IMAP, despite the = name). > This one looks promising however, so I will research it further. >=20 > However, what I am after is a recommendation from someone who has = actually > done this (with attachments) and can recommend a reliable class (or = code > sample) that I should go with. For IMAP there's of course: http://us2.php.net/imap And for pop, phpclasses.org probably has you covered. I haven't had to = speak POP myself, so I'm lucky. I have, however, had to parse email messages a lot, and this means MIME. = So much so, I wrote my own parser, which is actually generic to MIME = (http/email/etc). It's attached and I'd be happy for any feedback. I'm = using it in production and all has been happy, but I'm always ready for = patches, etc. H ------_=_NextPart_001_01C3FDBD.2C2D23A9 Content-Type: application/octet-stream; name="pmime.inc" Content-Transfer-Encoding: base64 Content-Description: pmime.inc Content-Disposition: attachment; filename="pmime.inc" PD9waHAKLyoKCiAgIHBNSU1FCiAgIENvcHlyaWdodCAoYykgMjAwMyBOZXcgWW9yayBQSFAuICBB bGwgcmlnaHRzIHJlc2VydmVkLgogICBUaGlzIGZpbGUgaXMgc3ViamVjdCB0byB0aGUgbGljZW5z ZSBmb3VuZCBhdCBodHRwOi8vbnlwaHAub3JnL2xpY2Vuc2UudHh0CiAgIG9yIHVwb24gcmVxdWVz dCBieSBjb250YWN0aW5nIGNvbnRhY3RAbnlwaHAub3JnCgoqLwoKCi8qKioKCiAgIHBNSU1FCiAg IHBNSU1FLmluYyB2MC42CgoqKiovCgoKLyoqKgoKICAgTm90ZSB0aGF0IHNvbWUgb2YgdGhlIGZ1 bmN0aW9ucyBhbmQgZnVuY3Rpb25hbGl0eSBoZXJlIGlzIG5vdCByZWxhdGVkIHN0cmljdGx5IHRv CiAgIE1JTUUuICBTb21lIHRoaW5nIHNob3VsZCBwcm9iYWJseSBiZSBwdWxsZWQgaW50byBhIG1h aWwtb25seSBwYWNrYWdlLgoKICAgUkZDMjgyMl8qIGZ1bmN0aW9ucyBzaG91bGQgYmUgZnVsbHkg Y29tcGxpYW50IHdpdGggUkZDMjgyMiBwZWRhbnRpY3MgQUZBSUsgCiAgIFNvbWUgc3RyaW5nIGZ1 bmN0aW9ucywgbGlrZSBzdHJpcG9zIHdpdGggYSByYW5nZSBvZiBzdGFydC9zdG9wLCBjb3VsZCBw cm9iYWJseSBzcGVlZCB1cAogICBhbmQgc21vb3RoIG91dCBzb21lIG9mIHRoZSBSRkMyODIyXyBm dW5jdGlvbnMuCgogICBGTEFXUzoKICAgICAgcE1JTUUtPkluY29taW5nKCkgb25seSBleHBlY3Rz IHRoZSBsYXN0IGZvdW5kIGJvdW5kYXJ5CiAgICAgIGV4dHJhY3RfZW1haWwoKSBpcyB3ZWFrIGFu ZCBub3QgbmVhcmx5IFJGQzI4MjIgY29tcGxpYW50CiAgICAgIHBhcnNlRmllbGQgbG9va3MgYnJv a2VuCgoqKiovCgoKZGVmaW5lKCdCT0RZJywgMCk7CmRlZmluZSgnRklMRScsIDEpOwoKZGVmaW5l KCdMT0NBTCcsICAgIDApOwpkZWZpbmUoJ0RPTUFJTicsICAgMSk7CmRlZmluZSgnRElTUE5BTUUn LCAyKTsKCmRlZmluZSgnSEVBREVSJywgICAwKTsKZGVmaW5lKCdQUkVBTUJMRScsIDEpOwpkZWZp bmUoJ0VOVElUWScsICAgMik7CmRlZmluZSgnRVBJTE9HVUUnLCAzKTsKCmRlZmluZSgnVFlQRScs IDApOwpkZWZpbmUoJ1NQT1NJJywgMSk7CmRlZmluZSgnRVBPU0knLCAyKTsKCgogICAvLyBpbnRl cmltIHNvbHV0aW9uIGZvciBhIHJlYWwgc3RyaXBvcygpICh3aGljaCBhcHBlYXJzIGluIFBIUCA1 KQppZiggIWZ1bmN0aW9uX2V4aXN0cygnc3RyaXBvcycpICkgewoKICAgZnVuY3Rpb24gc3RyaXBv cyggJGhheXN0YWNrLCRuZWVkbGUsJG9mZnNldCA9IDAgKSB7CiAgICAgIHJldHVybiBzdHJwb3Mo c3RydG9sb3dlcigkaGF5c3RhY2spLHN0cnRvbG93ZXIoJG5lZWRsZSksJG9mZnNldCk7CiAgIH0K fQoKCiAgIC8vIHRoaXMgaXMgdGhlIHNhbWUgcmFuZ2Ugb2YgY2hhcnMgZG90YXRvbSB1c2VzCmZ1 bmN0aW9uIFJGQzI4MjJfaXNhdG9tY2hhciggJGMgKSB7CgogICBpZiggc3RybGVuKCRjKSAhPT0g MSApCiAgICAgIHJldHVybiBGQUxTRTsKCiAgICRvcmQgPSBvcmQoJGMpOwoKICAgaWYoICRvcmQg PD0gMzIgKQogICAgICByZXR1cm4gRkFMU0U7CgogICBzd2l0Y2goICRvcmQgKSB7CiAgICAgIGNh c2UgMzQ6ICAgICAgY2FzZSA0MDogICAgICBjYXNlIDQxOiAgICAgIGNhc2UgNDQ6ICAgICAgY2Fz ZSA1ODoKICAgICAgY2FzZSA1OTogICAgICBjYXNlIDYwOiAgICAgIGNhc2UgNjE6ICAgICAgY2Fz ZSA2MjogICAgICBjYXNlIDY0OgogICAgICBjYXNlIDkxOiAgICAgIGNhc2UgOTI6ICAgICAgY2Fz ZSA5MzoKICAgICAgICAgcmV0dXJuIEZBTFNFOwogICB9CgogICByZXR1cm4gVFJVRTsKfQoKCiAg IC8vIHF1b3RlZC1zdHJpbmcgaW5jbHVkaW5nIHF1b3RlZC1wYWlyCmZ1bmN0aW9uIFJGQzI4MjJf cXN0cmluZyggJGJ1Ziwkb2Zmc2V0ID0gMCApIHsKCiAgICRsZW4gPSBzdHJsZW4oJGJ1Zik7CiAg IGZvciggJGkgPSAkb2Zmc2V0OyAoJGkgPCAkbGVuKSAmJiAoJGJ1ZnskaX0gIT09ICciJyk7ICsr JGkgKTsKICAgaWYoICRpID09PSAkbGVuICkKICAgICAgcmV0dXJuIE5VTEw7CgogICArKyRpOwog ICAkc3RyID0gTlVMTDsKCiAgIHdoaWxlKCAkaSA8IHN0cmxlbigkYnVmKSApIHsKICAgICAgaWYo ICgkYnVmeyRpfSA9PT0gIlxuIikgfHwgKCRidWZ7JGl9ID09PSAiXHIiKSApCiAgICAgICAgIHJl dHVybiAkc3RyOwoKICAgICAgaWYoICRidWZ7JGl9ID09PSAnXFwnICkgewogICAgICAgICBpZigg KCRidWZ7KyskaX0gPT09ICJcdCIpIHx8ICgkYnVmeyRpfSA9PT0gJyAnKSB8fCAoJGJ1ZnskaX0g PT09ICciJykgKQogICAgICAgICAgICAkc3RyIC49ICRidWZ7JGkrK307CiAgICAgICAgIGVsc2UK ICAgICAgICAgICAgJHN0ciAuPSAnXFwnOwogICAgICB9IGVsc2UgaWYoICgkYnVmeyRpfSA9PT0g Ilx0IikgfHwgKCRidWZ7JGl9ID09PSAnICcpIHx8ICgkYnVmeyRpfSA9PT0gJyInKSApIHsKICAg ICAgICAgcmV0dXJuICRzdHI7CiAgICAgIH0gZWxzZQogICAgICAgICAkc3RyIC49ICRidWZ7JGkr K307CiAgIH0KCiAgIHJldHVybiAkc3RyOwp9CgoKICAgLy8gcXVvdGVkLXN0cmluZyBpbmNsdWRp bmcgcXVvdGVkLXBhaXIgaW4gcmV2ZXJzZQpmdW5jdGlvbiBSRkMyODIyX3Jxc3RyaW5nKCAkYnVm LCRvZmZzZXQgPSAwICkgewoKICAgZm9yKCAkaSA9ICRvZmZzZXQ7ICRpICYmICgkYnVmeyRpfSAh PT0gJyInKTsgLS0kaSApOwogICBpZiggISRpICkKICAgICAgcmV0dXJuIE5VTEw7CgogICAtLSRp OwoKICAgZm9yKCAkc3RyID0gTlVMTDsgJGkgPj0gMDsgLS0kaSApIHsKICAgICAgaWYoICgkYnVm eyRpfSA9PT0gIlxuIikgfHwgKCRidWZ7JGl9ID09PSAiXHIiKSApCiAgICAgICAgIHJldHVybiBz dHJyZXYoJHN0cik7CgogICAgICBpZiggKCRidWZ7JGl9ID09PSAiXHQiKSB8fCAoJGJ1ZnskaX0g PT09ICcgJykgfHwgKCRidWZ7JGl9ID09PSAnIicpICkgewogICAgICAgICBpZiggJGJ1ZnstLSRp fSA9PT0gJ1xcJyApICAvLyB0aGlzIHRocm93cyAtMSBzb21ldGltZXM/CiAgICAgICAgICAgICRz dHIgLj0gJGJ1ZnskaSsxfTsKICAgICAgICAgZWxzZQogICAgICAgICAgICByZXR1cm4gc3RycmV2 KCRzdHIpOwogICAgICB9IGVsc2UKICAgICAgICAgJHN0ciAuPSAkYnVmeyRpfTsKICAgfQoKICAg cmV0dXJuIHN0cnJldigkc3RyKTsKfQoKCiAgIC8vIGRvdC1hdG9tICh1c2VkIGZvciBhdG9tIGFz IHdlbGwsIGJ1dCBhbGxvd3MgJy4nOyBhbHNvIHVzZWQgZm9yICJ0b2tlbnMiKQpmdW5jdGlvbiBS RkMyODIyX2RvdGF0b20oICRidWYsJG9mZnNldCA9IDAgKSB7CgogICBmb3IoICRpID0gJG9mZnNl dCwkc3RyID0gTlVMTDsgJGkgPCBzdHJsZW4oJGJ1Zik7ICsrJGkgKSB7CiAgICAgICRvcmQgPSBv cmQoJGJ1ZnskaX0pOwoKICAgICAgaWYoICAoJG9yZCA8PSAzMikgfHwgKCRvcmQgPT09IDM0KSB8 fCAoJG9yZCA9PT0gNDApIHx8ICgkb3JkID09PSA0MSkgfHwgKCRvcmQgPT09IDQ0KSB8fAogICAg ICAgICAgKCRvcmQgPT09IDU4KSB8fCAoJG9yZCA9PT0gNTkpIHx8ICgkb3JkID09PSA2MCkgfHwg KCRvcmQgPT09IDYxKSB8fCAoJG9yZCA9PT0gNjIpIHx8CiAgICAgICAgICAoJG9yZCA9PT0gNjQp IHx8ICgkb3JkID09PSA5MSkgfHwgKCRvcmQgPT09IDkyKSB8fCAoJG9yZCA9PT0gOTMpICkKICAg ICAgICAgcmV0dXJuICRzdHI7CgogICAgICAkc3RyIC49ICRidWZ7JGl9OwogICB9CgogICByZXR1 cm4gJHN0cjsKfQoKCiAgIC8vIGRvdC1hdG9tIGluIHJldmVyc2UgKHVzZWQgZm9yIGF0b20gYXMg d2VsbCwgYnV0IGFsbG93cyAnLic7IGFsc28gdXNlZCBmb3IgInRva2VucyIpCmZ1bmN0aW9uIFJG QzI4MjJfcmRvdGF0b20oICRidWYsJG9mZnNldCA9IDAgKSB7CgogICBmb3IoICRpID0gJG9mZnNl dCwkc3RyID0gTlVMTDsgJGkgPj0gMDsgLS0kaSApIHsKICAgICAgJG9yZCA9IG9yZCgkYnVmeyRp fSk7CgogICAgICBpZiggICgkb3JkIDw9IDMyKSB8fCAoJG9yZCA9PT0gMzQpIHx8ICgkb3JkID09 PSA0MCkgfHwgKCRvcmQgPT09IDQxKSB8fCAoJG9yZCA9PT0gNDQpIHx8CiAgICAgICAgICAoJG9y ZCA9PT0gNTgpIHx8ICgkb3JkID09PSA1OSkgfHwgKCRvcmQgPT09IDYwKSB8fCAoJG9yZCA9PT0g NjEpIHx8ICgkb3JkID09PSA2MikgfHwKICAgICAgICAgICgkb3JkID09PSA2NCkgfHwgKCRvcmQg PT09IDkxKSB8fCAoJG9yZCA9PT0gOTIpIHx8ICgkb3JkID09PSA5MykgKQogICAgICAgICByZXR1 cm4gc3RycmV2KCRzdHIpOwoKICAgICAgJHN0ciAuPSAkYnVmeyRpfTsKICAgfQoKICAgcmV0dXJu IHN0cnJldigkc3RyKTsKfQoKCgogICAvKioqCiAgICAgIGV4dHJhY3QgZmlyc3QgZW1haWwgYWRk cmVzcyB3ZSBmaW5kIGluIHBhc3NlZCAkYnVmLgogICAgICB3ZSBkb24ndCBoYW5kbGUgbXVsdGlw bGUgYWRkcmVzc2VzLCBjb21tYSBzZXBlcmF0aW9uLCBldGMKICAgICAgYW5kIERJU1BOQU1FIGlz bid0IDEwMCUKICAgICAgVGhpcyBOZWVkcyBXb3JrcyAoYW5kIHNob3VsZCBiZSBhbiBSRkMyODIy XyBmYW1pbHkgZnVuY3Rpb24pCiAgICoqKi8KCmZ1bmN0aW9uIGV4dHJhY3RfZW1haWwoICRidWYg KSB7CgogICAkZW1haWwgPSBhcnJheShOVUxMLE5VTEwsTlVMTCk7CgogICBpZiggISgkcG9zaSA9 IHN0cnBvcygkYnVmLCdAJykpICkKICAgICAgcmV0dXJuIE5VTEw7CgogICBpZiggJGJ1ZnskcG9z aS0xfSA9PT0gJyInICkKICAgICAgJGVtYWlsW0xPQ0FMXSA9IFJGQzI4MjJfcnFzdHJpbmcoJGJ1 ZiwkcG9zaS0xKTsKICAgZWxzZQogICAgICAkZW1haWxbTE9DQUxdID0gUkZDMjgyMl9yZG90YXRv bSgkYnVmLCRwb3NpLTEpOwoKICAgICAgLy8gY2xvc2UgZW5vdWdoIGZvciBkb21haW4tbGl0ZXJh bCBidWxsc2hpdAogICBpZiggJGJ1ZnskcG9zaSsxfSA9PT0gJyInICkKICAgICAgJGVtYWlsW0RP TUFJTl0gPSBSRkMyODIyX3FzdHJpbmcoJGJ1ZiwkcG9zaSsxKTsKICAgZWxzZQogICAgICAkZW1h aWxbRE9NQUlOXSA9IFJGQzI4MjJfZG90YXRvbSgkYnVmLCRwb3NpKzEpOwoKICAgJHBvc2kgPSAk cG9zaSAtIHN0cmxlbigkZW1haWxbTE9DQUxdKSAtIDE7CgogICBpZiggKCRwb3NpID4gMCkgJiYg KCRidWZbJHBvc2ldID09PSAnPCcpICkKICAgICAgJGVtYWlsW0RJU1BOQU1FXSA9IHN1YnN0cigk YnVmLDAsJHBvc2ktMSk7CgogICByZXR1cm4gJGVtYWlsOwp9CgoKCgpjbGFzcyBwTUlNRQp7CiAg IHZhciAkbUJ1ZiAgICAgICAgICAgICAgICAgICAgID0gTlVMTDsKICAgdmFyICRtU3RydWN0ICAg ICAgICAgICAgICAgICAgPSBOVUxMOwogICB2YXIgJG1TdHJ1Y3RMZW4gICAgICAgICAgICAgICA9 IDA7CgogICB2YXIgJEhlYWRlclBhcnQgICAgICAgICAgICAgICA9IE5VTEw7CiAgIHZhciAkSGVh ZGVyUGFydExlbiAgICAgICAgICAgID0gMDsKCiAgIHZhciAkQm9keVBhcnQgICAgICAgICAgICAg ICAgID0gTlVMTDsKICAgdmFyICRCb2R5UGFydExlbiAgICAgICAgICAgICAgPSAwOwoKICAgdmFy ICRGaWVsZCAgICAgICAgICAgICAgICAgICAgPSBOVUxMOwogICB2YXIgJEZpZWxkTGVuICAgICAg ICAgICAgICAgICA9IDA7CgoKICAgZnVuY3Rpb24gcE1JTUUoKSB7CgogICAgICBpZiggKChmbG9h dCkgUEhQX1ZFUlNJT04pIDwgNC4zICkKICAgICAgICAgdHJpZ2dlcl9lcnJvcigncE1JTUUgUmVx dWlyZXMgUEhQIFZlcnNpb24gNC4zIG9yIGdyZWF0ZXIgLSBzb21lIHRoaW5ncyBtYXkgbm90IHdv cmsuJyk7CgogICAgICBpbmlfc2V0KCdhdXRvX2RldGVjdF9saW5lX2VuZGluZ3MnLCBUUlVFKTsK ICAgfQoKICAgZnVuY3Rpb24gX2ltcGx5aGVhZGVycGFydCggJHBhcnQsJGZ1bmMgKSB7CgogICAg ICBpZiggJHBhcnQgIT09IE5VTEwgKSB7CiAgICAgICAgIGlmKCAhJHRoaXMtPnNldEhlYWRlclBh cnQoJHBhcnQsJGZ1bmMpICkKICAgICAgICAgICAgcmV0dXJuIEZBTFNFOwogICAgICB9IGVsc2Ug aWYoICEkdGhpcy0+SGVhZGVyUGFydCApCiAgICAgICAgIHJldHVybiBGQUxTRTsKCiAgICAgIHJl dHVybiBUUlVFOwogICB9CgogICAgICAvLyB1c2VkIGluICR0aGlzLT5tRHVtcCBvbmx5IGZvciBk ZWJ1Z2dpbmcKICAgZnVuY3Rpb24gX3R5cGUydGV4dCggJHR5cGUgKSB7CgogICAgICBpZiggJHR5 cGUgPT09IEhFQURFUiApCiAgICAgICAgIHJldHVybiAnSEVBREVSJzsKICAgICAgZWxzZSBpZigg JHR5cGUgPT09IFBSRUFNQkxFICkKICAgICAgICAgcmV0dXJuICdQUkVBTUJMRSc7CiAgICAgIGVs c2UgaWYoICR0eXBlID09PSBFTlRJVFkgKQogICAgICAgICByZXR1cm4gJ0VOVElUWSc7CiAgICAg IGVsc2UgaWYoICR0eXBlID09PSBFUElMT0dVRSApCiAgICAgICAgIHJldHVybiAnRVBJTE9HVUUn OwogICAgICBlbHNlCiAgICAgICAgIHJldHVybiAnVU5LTk9XTic7CiAgIH0KCgogICBmdW5jdGlv biBJbmNvbWluZyggJGluY29taW5nID0gTlVMTCApIHsKCiAgICAgICR0aGlzLT5tQnVmID0gTlVM TDsKCiAgICAgICRQQVJUID0gMDsKICAgICAgJHRoaXMtPm1TdHJ1Y3QgPSBhcnJheSgkUEFSVD0+ YXJyYXkoVFlQRT0+SEVBREVSLFNQT1NJPT4wLEVQT1NJPT4wKSk7CgogICAgICAkQk9VTkRBUlkg PSAwOwogICAgICAkYm91bmRhcmllcyA9IGFycmF5KCRCT1VOREFSWT0+TlVMTCk7CgogICAgICAk TkVYVFRZUEUgPSBFTlRJVFk7CgogICAgICAkdG1wX2J1ZiA9IE5VTEw7CiAgICAgICR0bXBfYnVm X2xlbiA9IDA7CiAgICAgICR0bXBfYnVmMSA9IE5VTEw7CiAgICAgICR0bXBfYnVmMV9sZW4gPSAw OwoKICAgICAgJHNvbF9wb3NpID0gMDsKICAgICAgJGVvbF9wb3NpID0gMDsKCiAgICAgICRwYXJ0 X3Nwb3NpID0gMDsKICAgICAgJHBhcnRfZXBvc2kgPSAwOwoKICAgICAgICAgLy8gdGhlIGFiaWxp dHkgdG8gcHJvY2VzcyBhIHN0cmluZywgYW5kIHNvbWUgYmV0dGVyIGNoZWNraW5nLCBzaG91bGQg YmUgYWRkZWQKICAgICAgICAgLy8gd2UgYWxzbyB3b3VsZCBuZWVkIHRvIGhhbmRsZSBhIHN0cmlu ZyBiZWNhdXNlIG9mIHJlY3Vyc2l2ZSBiZWhhdmlvcgogICAgICBpZiggIWlzX3Jlc291cmNlKCRp bmNvbWluZykgKQogICAgICAgICBpZiggISgkaW5jb21pbmcgPSBmb3BlbigncGhwOi8vc3RkaW4n LCAncicpKSApCiAgICAgICAgICAgIGV4aXQoJ1VuYWJsZSB0byBvcGVuIHN0ZGluJyk7CgogICAg ICB3aGlsZSggMSApIHsKCiAgICAgICAgICR0bXBfYnVmID0gZmdldHMoJGluY29taW5nKTsKCiAg ICAgICAgIGlmKCAkdGhpcy0+bVN0cnVjdFskUEFSVF1bVFlQRV0gPT09IEhFQURFUiApIHsKCiAg ICAgICAgICAgIGlmKCAoJHRtcF9idWZ7MH0gPT09ICcgJykgfHwgKCR0bXBfYnVmezB9ID09PSAi XHQiKSApIHsKCiAgICAgICAgICAgICAgICR0bXBfYnVmMSA9IHJ0cmltKCR0bXBfYnVmMSkuJyAn Lmx0cmltKCR0bXBfYnVmKTsKCiAgICAgICAgICAgIH0gZWxzZSB7CgogICAgICAgICAgICAgICAk dG1wX2J1ZjFfbGVuID0gc3RybGVuKCR0bXBfYnVmMSk7CiAgICAgICAgICAgICAgICRzb2xfcG9z aSA9ICRlb2xfcG9zaTsKICAgICAgICAgICAgICAgJGVvbF9wb3NpID0gJHNvbF9wb3NpICsgJHRt cF9idWYxX2xlbjsKCiAgICAgICAgICAgICAgICR0aGlzLT5tQnVmIC49ICR0bXBfYnVmMTsKCiAg ICAgICAgICAgICAgIGlmKCAoJHBvc2kgPSBzdHJpcG9zKCR0bXBfYnVmMSwnYm91bmRhcnknKSkg JiYgKCRwb3NpID0gc3RycG9zKCR0bXBfYnVmMSwnPScsJHBvc2kpKSApIHsKCiAgICAgICAgICAg ICAgICAgICsrJHBvc2k7CgogICAgICAgICAgICAgICAgICBpZiggUkZDMjgyMl9pc2F0b21jaGFy KCR0bXBfYnVmMXskcG9zaX0pICkKICAgICAgICAgICAgICAgICAgICAgJGJvdW5kYXJpZXNbKysk Qk9VTkRBUlldID0gUkZDMjgyMl9kb3RhdG9tKCR0bXBfYnVmMSwkcG9zaSk7CiAgICAgICAgICAg ICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgJGJvdW5kYXJpZXNbKyskQk9VTkRBUlld ID0gUkZDMjgyMl9xc3RyaW5nKCR0bXBfYnVmMSwkcG9zaSk7CgogICAgICAgICAgICAgICAgICBp ZiggJGJvdW5kYXJpZXNbJEJPVU5EQVJZXSApCiAgICAgICAgICAgICAgICAgICAgICRORVhUVFlQ RSA9IFBSRUFNQkxFOwogICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAg IHRyaWdnZXJfZXJyb3IoIkVtcHR5IG9yIGludmFsaWQgYm91bmRhcnk6ICckdG1wX2J1ZjEnIik7 CiAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgIGlmKCAoJHRtcF9idWZ7MH0gPT09ICJc ciIpIHx8ICgkdG1wX2J1ZnswfSA9PT0gIlxuIikgKSB7CgogICAgICAgICAgICAgICAgICAkdG1w X2J1Zl9sZW4gPSBzdHJsZW4oJHRtcF9idWYpOwogICAgICAgICAgICAgICAgICAkc29sX3Bvc2kg PSAkZW9sX3Bvc2k7CiAgICAgICAgICAgICAgICAgICRlb2xfcG9zaSA9ICRzb2xfcG9zaSArICR0 bXBfYnVmX2xlbjsKCiAgICAgICAgICAgICAgICAgICR0aGlzLT5tQnVmIC49ICR0bXBfYnVmOwoK ICAgICAgICAgICAgICAgICAgJHRoaXMtPm1TdHJ1Y3RbJFBBUlRdW0VQT1NJXSA9ICRzb2xfcG9z aTsKCiAgICAgICAgICAgICAgICAgICR0aGlzLT5tU3RydWN0WysrJFBBUlRdID0gYXJyYXkoVFlQ RT0+JE5FWFRUWVBFLFNQT1NJPT4kZW9sX3Bvc2ksRVBPU0k9PiRlb2xfcG9zaSk7CgogICAgICAg ICAgICAgICAgICAkTkVYVFRZUEUgPSBFTlRJVFk7CgogICAgICAgICAgICAgICB9IGVsc2UKICAg ICAgICAgICAgICAgICAgJHRtcF9idWYxID0gJHRtcF9idWY7CiAgICAgICAgICAgIH0KCiAgICAg ICAgIH0gZWxzZSB7CgogICAgICAgICAgICAkdG1wX2J1Zl9sZW4gPSBzdHJsZW4oJHRtcF9idWYp OwogICAgICAgICAgICAkc29sX3Bvc2kgPSAkZW9sX3Bvc2k7CiAgICAgICAgICAgICRlb2xfcG9z aSA9ICRzb2xfcG9zaSArICR0bXBfYnVmX2xlbjsKCiAgICAgICAgICAgICR0aGlzLT5tQnVmIC49 ICR0bXBfYnVmOwoKICAgICAgICAgICAgaWYoICRCT1VOREFSWSAmJiAoc3RycG9zKCR0bXBfYnVm LCItLXskYm91bmRhcmllc1skQk9VTkRBUlldfSIpID09PSAwKSApIHsKCiAgICAgICAgICAgICAg IGlmKCAkdG1wX2J1ZnskdG1wX2J1Zl9sZW4tMn0gPT09ICJcciIgKQogICAgICAgICAgICAgICAg ICAkc29sX3Bvc2kgLT0gMjsKICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAt LSRzb2xfcG9zaTsKCiAgICAgICAgICAgICAgICR0aGlzLT5tU3RydWN0WyRQQVJUXVtFUE9TSV0g PSAkc29sX3Bvc2k7CgogICAgICAgICAgICAgICBpZiggc3RycG9zKCR0bXBfYnVmLCctLScsc3Ry bGVuKCRib3VuZGFyaWVzWyRCT1VOREFSWV0pKzIpICE9PSBGQUxTRSApIHsKICAgICAgICAgICAg ICAgICAgJHRoaXMtPm1TdHJ1Y3RbKyskUEFSVF0gPSBhcnJheShUWVBFPT5FUElMT0dVRSxTUE9T ST0+JGVvbF9wb3NpLEVQT1NJPT4kZW9sX3Bvc2kpOwogICAgICAgICAgICAgICAgICAtLSRCT1VO REFSWTsKICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgJHRoaXMtPm1T dHJ1Y3RbKyskUEFSVF0gPSBhcnJheShUWVBFPT5IRUFERVIsU1BPU0k9PiRlb2xfcG9zaSxFUE9T ST0+JGVvbF9wb3NpKTsKICAgICAgICAgICAgICAgICAgJHRtcF9idWYxID0gTlVMTDsKICAgICAg ICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgIH0KCiAgICAgICAgIGlmKCBmZW9mKCRp bmNvbWluZykgKSB7CiAgICAgICAgICAgICR0aGlzLT5tU3RydWN0WyRQQVJUXVtFUE9TSV0gPSAk c29sX3Bvc2k7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAgICAgIH0KCiAgICAgIGZj bG9zZSgkaW5jb21pbmcpOwoKICAgICAgJHRoaXMtPm1TdHJ1Y3RMZW4gPSBjb3VudCgkdGhpcy0+ bVN0cnVjdCk7CiAgIH0KCgogICBmdW5jdGlvbiBtRHVtcCggJHNlbmR0byA9IE5VTEwgKSB7Cgog ICAgICBvYl9zdGFydCgpOwogICAgICBmb3IoICRpID0gMDsgJGkgPCAkdGhpcy0+bVN0cnVjdExl bjsgKyskaSApIHsKICAgICAgICAgJGxlbiA9ICR0aGlzLT5tU3RydWN0WyRpXVtFUE9TSV0gLSAk dGhpcy0+bVN0cnVjdFskaV1bU1BPU0ldOwogICAgICAgICBlY2hvICJcblxuWyRpXSIuJHRoaXMt Pl90eXBlMnRleHQoJHRoaXMtPm1TdHJ1Y3RbJGldW1RZUEVdKS4iIFt7JHRoaXMtPm1TdHJ1Y3Rb JGldW1RZUEVdfV1beyR0aGlzLT5tU3RydWN0WyRpXVtTUE9TSV19XVt7JHRoaXMtPm1TdHJ1Y3Rb JGldW0VQT1NJXX1dW3skbGVufV0iOwogICAgICAgICBlY2hvICJcbj09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT0+XG4iOwogICAgICAgICBlY2hvICR0aGlzLT5nZXRQYXJ0KCRp KTsKICAgICAgICAgZWNobyAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT5c biI7CiAgICAgIH0KCiAgICAgIGlmKCAkc2VuZHRvICkgewogICAgICAgICAkbm93dHMgPSB0aW1l KCk7CiAgICAgICAgIG1haWwoJHNlbmR0bywibUR1bXAgbVN0cnVjdCgkbm93dHMpIixvYl9nZXRf Y2xlYW4oKSk7CiAgICAgICAgIG1haWwoJHNlbmR0bywibUR1bXAgbUJ1Zigkbm93dHMpIiwkdGhp cy0+bUJ1Zik7CiAgICAgIH0gZWxzZQogICAgICAgICByZXR1cm4gb2JfZ2V0X2NsZWFuKCk7CiAg IH0KCiAgIGZ1bmN0aW9uIGlzUGFydCggJHBhcnQsJHR5cGUgPSBOVUxMICkgewoKICAgICAgaWYo IGlzc2V0KCR0aGlzLT5tU3RydWN0WyRwYXJ0XSkgKSB7CiAgICAgICAgIGlmKCAoJHR5cGUgPT09 IE5VTEwpIHx8ICgkdGhpcy0+bVN0cnVjdFskcGFydF1bVFlQRV0gPT09ICR0eXBlKSApCiAgICAg ICAgICAgIHJldHVybiAkdGhpcy0+bVN0cnVjdFskcGFydF1bU1BPU0ldOwogICAgICB9CgogICAg ICByZXR1cm4gTlVMTDsKICAgfQoKICAgZnVuY3Rpb24gZ2V0UGFydCggJHBhcnQsJGZ1bmMgPSBO VUxMICkgewoKICAgICAgaWYoICRmdW5jICYmIGlzX2Z1bmN0aW9uKCRmdW5jKSApCiAgICAgICAg IHJldHVybiAkZnVuYyhzdWJzdHIoJHRoaXMtPm1CdWYsJHRoaXMtPm1TdHJ1Y3RbJHBhcnRdW1NQ T1NJXSwkdGhpcy0+bVN0cnVjdFskcGFydF1bRVBPU0ldLSR0aGlzLT5tU3RydWN0WyRwYXJ0XVtT UE9TSV0pKTsKICAgICAgZWxzZQogICAgICAgICByZXR1cm4gc3Vic3RyKCR0aGlzLT5tQnVmLCR0 aGlzLT5tU3RydWN0WyRwYXJ0XVtTUE9TSV0sJHRoaXMtPm1TdHJ1Y3RbJHBhcnRdW0VQT1NJXS0k dGhpcy0+bVN0cnVjdFskcGFydF1bU1BPU0ldKTsKICAgfQoKICAgZnVuY3Rpb24gc2V0SGVhZGVy UGFydCggJHBhcnQsJGZ1bmMgPSBOVUxMICkgewoKICAgICAgaWYoICR0aGlzLT5pc1BhcnQoJHBh cnQsSEVBREVSKSA9PT0gTlVMTCApCiAgICAgICAgIHJldHVybiBGQUxTRTsKCiAgICAgIGlmKCAh KCR0aGlzLT5IZWFkZXJQYXJ0ID0gJHRoaXMtPmdldFBhcnQoJHBhcnQsJGZ1bmMpKSApCiAgICAg ICAgIHJldHVybiBGQUxTRTsKCiAgICAgICR0aGlzLT5IZWFkZXJQYXJ0TGVuID0gc3RybGVuKCR0 aGlzLT5IZWFkZXJQYXJ0KTsKCiAgICAgIHJldHVybiBUUlVFOwogICB9CgogICBmdW5jdGlvbiBz ZXRCb2R5UGFydCggJHBhcnQsJGZ1bmMgPSBOVUxMICkgewoKICAgICAgaWYoICR0aGlzLT5pc1Bh cnQoJHBhcnQsRU5USVRZKSA9PT0gTlVMTCApCiAgICAgICAgIHJldHVybiBGQUxTRTsKCiAgICAg IGlmKCAhKCR0aGlzLT5Cb2R5UGFydCA9ICR0aGlzLT5nZXRQYXJ0KCRwYXJ0LCRmdW5jKSkgKQog ICAgICAgICByZXR1cm4gRkFMU0U7CgogICAgICAkdGhpcy0+Qm9keVBhcnRMZW4gPSBzdHJsZW4o JHRoaXMtPkJvZHlQYXJ0KTsKCiAgICAgIHJldHVybiBUUlVFOwogICB9CgogICBmdW5jdGlvbiBp c0ZpZWxkKCAkZmllbGQsJHBhcnQgPSBOVUxMLCRmdW5jID0gTlVMTCApIHsKCiAgICAgIGlmKCAh JHRoaXMtPl9pbXBseWhlYWRlcnBhcnQoJHBhcnQsJGZ1bmMpICkKICAgICAgICAgcmV0dXJuIE5V TEw7CgogICAgICBmb3IoICRwb3NpID0gMDsgKCRwb3NpID0gc3RyaXBvcygkdGhpcy0+SGVhZGVy UGFydCwiJGZpZWxkOiIsJHBvc2kpKSAhPT0gRkFMU0U7ICsrJHBvc2kgKQogICAgICAgICBpZigg KCR0aGlzLT5IZWFkZXJQYXJ0eyRwb3NpLTF9ID09PSAiXG4iKSB8fCAoJHRoaXMtPkhlYWRlclBh cnR7JHBvc2ktMX0gPT09ICJcciIpICkKICAgICAgICAgICAgcmV0dXJuICRwb3NpOwoKICAgICAg cmV0dXJuIE5VTEw7CiAgIH0KCiAgIGZ1bmN0aW9uIGdldEZpZWxkKCAkZmllbGQsJHBhcnQgPSBO VUxMLCRmdW5jID0gTlVMTCApIHsKCiAgICAgIGlmKCAoJHN0YXJ0X3Bvc2kgPSAkdGhpcy0+aXNG aWVsZCgkZmllbGQsJHBhcnQsJGZ1bmMpKSA9PT0gTlVMTCApCiAgICAgICAgIHJldHVybiBOVUxM OwoKICAgICAgJHN0YXJ0X3Bvc2kgKz0gc3RybGVuKCRmaWVsZCkgKyAxOwogICAgICBpZiggISgk ZW5kX3Bvc2kgPSBzdHJwb3MoJHRoaXMtPkhlYWRlclBhcnQsIlxyIiwkc3RhcnRfcG9zaSkpICYm ICEoJGVuZF9wb3NpID0gc3RycG9zKCR0aGlzLT5IZWFkZXJQYXJ0LCJcbiIsJHN0YXJ0X3Bvc2kp KSApCiAgICAgICAgIHJldHVybiBOVUxMOwoKICAgICAgcmV0dXJuIHRyaW0oc3Vic3RyKCR0aGlz LT5IZWFkZXJQYXJ0LCRzdGFydF9wb3NpLCRlbmRfcG9zaS0kc3RhcnRfcG9zaSkpOwogICB9Cgog ICBmdW5jdGlvbiBfaW1wbHlmaWVsZCggJGZpZWxkLCRwYXJ0LCRmdW5jICkgewoKICAgICAgaWYo ICRmaWVsZCAhPT0gTlVMTCApIHsKICAgICAgICAgaWYoICEkdGhpcy0+c2V0RmllbGQoJGZpZWxk LCRwYXJ0LCRmdW5jKSApCiAgICAgICAgICAgIHJldHVybiBGQUxTRTsKICAgICAgfSBlbHNlIGlm KCAhJHRoaXMtPkZpZWxkICkKICAgICAgICAgcmV0dXJuIEZBTFNFOwoKICAgICAgcmV0dXJuIFRS VUU7CiAgIH0KCiAgIGZ1bmN0aW9uIHNldEZpZWxkKCAkZmllbGQsJHBhcnQgPSBOVUxMLCRmdW5j ID0gTlVMTCApIHsKCiAgICAgIGlmKCAkdGhpcy0+RmllbGQgPSAkdGhpcy0+Z2V0RmllbGQoJGZp ZWxkLCRwYXJ0LCRmdW5jKSApCiAgICAgICAgIHJldHVybiBUUlVFOwoKICAgICAgcmV0dXJuIFRS VUU7CiAgIH0KLyoKICAgZnVuY3Rpb24gcGFyc2VGaWVsZCggJGZpZWxkLCRwYXJ0ID0gTlVMTCwk ZnVuYyApIHsKCiAgICAgIGlmKCAhJHRoaXMtPl9pbXBseWZpZWxkKCRmaWVsZCwkcGFydCwkZnVu YykgKQogICAgICAgICByZXR1cm4gRkFMU0U7CgogICAgICBpZiggKCRzZW1pcG9zaSA9IHN0cnBv cygkdGhpcy0+RmllbGQsJzsnKSkgPT09IEZBTFNFICkKICAgICAgICAgcmV0dXJuIE5VTEw7Cgog ICAgICAkZmllbGRfYnVmID0gJHRoaXMtPkZpZWxkOwogICAgICAkdGhpcy0+RmllbGQgPSBhcnJh eSgpOwoKICAgICAgIGFycmF5KHN1YnN0cigkZmllbGRfYnVmLDAsJHBvc2kpKTsKCgoKCiAgICAg ICAgIGlmKCAhKCRwb3NpID0gc3RycG9zKCR0aGlzLT5GaWVsZCwnPScsJHBvc2kpKSApIHsKICAg ICAgICAgICAgJHRoaXMtPkZpZWxkID0gJHRtcDsKICAgICAgICAgICAgcmV0dXJuIEZBTFNFOwog ICAgICAgICB9CgogICAgICAgICBkbyB7CiAgICAgICAgICAgIGlmKCAkdGhpcy0+RmllbGR7JHBv c2krMX0gPT09ICciJyApCiAgICAgICAgICAgICAgICR0bXBbUkZDMjgyMl9yZG90YXRvbSgkdGhp cy0+RmllbGQsJHBvc2ktMSldID0gUkZDMjgyMl9xc3RyaW5nKCR0aGlzLT5GaWVsZCwkcG9zaSsx KTsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAkdG1wW1JGQzI4MjJfcmRvdGF0b20o JHRoaXMtPkZpZWxkLCRwb3NpLTEpXSA9IFJGQzI4MjJfZG90YXRvbSgkdGhpcy0+RmllbGQsJHBv c2krMSk7CiAgICAgICAgIH0gd2hpbGUoICgkcG9zaSA9IHN0cnBvcygkdGhpcy0+RmllbGQsJz0n LCRwb3NpK3N0cmxlbihlbmQoJHRtcCkpKSkgKTsKCiAgICAgICAgICR0aGlzLT5GaWVsZCA9ICR0 bXA7CgogICAgICAgICByZXR1cm4gVFJVRTsKICAgICAgfQogICB9CiovCgp9CgoK ------_=_NextPart_001_01C3FDBD.2C2D23A9-- From adam at trachtenberg.com Sat Feb 28 00:42:29 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Sat, 28 Feb 2004 00:42:29 -0500 (EST) Subject: [nycphp-talk] Recommend Email POP3 Class or code snippet In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87AA66F5@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F87AA66F5@ehost011-1.exch011.intermedia.net> Message-ID: > Looking for a recommendation for an email class to handle polling a > POP3 box. In the past, I've used the POP3 class on phpclasses.org > without issue, but I don't believe it handles attachments (I could > be wrong, just getting There's now a C extension: http://pecl.php.net/POP3 -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! >From hans not junk at nyphp.com Sat Feb 28 00:50:25 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id F011FA85F0 for ; Sat, 28 Feb 2004 00:50:24 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] moving MySQL Tables Date: Fri, 27 Feb 2004 21:50:22 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA66F6 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] moving MySQL Tables Thread-Index: AcP9Uy+yuldDbieiTz6ZuaMH5TSYOgAaxy3A From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2004 05:50:25 -0000 > > I copied over the data folder > I didn't know such a folder existed. Where could this be=20 > found on Unix? It depends on the flavor of Unix and possibly the distribution. Give me = these details and I can point you to a couple possible locations. All this said: dump mysql data to an ascii format (mysqldump), use the = binary log, or do it across the network by way of LOAD DATA FROM MASTER = (if they're recent versions and I remember that as the correct name). = Copying raw binary data =3D Bad (endianess/disk caches/mysql = caches/binary representations/etc). H >From hans not junk at nyphp.com Sat Feb 28 00:58:22 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 1E54BA85F0 for ; Sat, 28 Feb 2004 00:58:22 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Magic is Illusion?!? Date: Fri, 27 Feb 2004 21:58:19 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA66F7 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Magic is Illusion?!? Thread-Index: AcP9Zz4kk9TXJhL1QCOJPvsNcwExTwAWF2wg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2004 05:58:22 -0000 > > Big files, and i think "nobody" is the default user for nfs shared > > filesystems. Is the box an nfs server? >=20 > YES. It has ended up that way out of necessity more than design. As = I > understand it FreeBSD (can't speak to the other BSD's) are a poor = choice > to serve NFS. Does anything make a good NFS server? :) They seem familiar, but I can't place them: maybe truss or ktrace can = help. And to plug NYPHP's evil twin: http://nycbug.org H >From hans not junk at nyphp.com Sat Feb 28 01:01:12 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id B4CD5A85F0 for ; Sat, 28 Feb 2004 01:01:11 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] CSV Regex Date: Fri, 27 Feb 2004 22:01:09 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA66F8 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] CSV Regex Thread-Index: AcP9grMaivCcqDqfSjyecZwD+71EngAPU2ng From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2004 06:01:12 -0000 > > --- Hans Zaunere wrote: > > > I'm looking to parse a CSV file and figured there must be a smooth > > > regex for the job. > > > > Any reason why fgetcsv() doesn't work for you? Yeah... didn't even realize it existed :) PHP is too easy sometime. > > http://www.php.net/fgetcsv > > > > I've always found it to do a fine job, plus it's very fast. The CSV data is pretty nasty, so I'll see how fgetcsv() fares. It's = MCSE certified generated CSV :) > What Chris said, but if you really want a regex, I suggest the one > from Jeff Friedl's "Mastering Regular Expressions." The code examples > are available online at: >=20 > http://www.regex.info/listing.cgi?ps=3D213&pe=3D220 Thanks Adam, I'll check this too. H >From hans not junk at nyphp.com Sat Feb 28 01:03:07 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 1DC94A8627 for ; Sat, 28 Feb 2004 01:03:07 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] No, really, please don't use vacation autoresponders. Date: Fri, 27 Feb 2004 22:03:04 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA66FA at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] No, really, please don't use vacation autoresponders. Thread-Index: AcP9il+oM8jH3ireSFGk4DKTobSgAgANfTaA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2004 06:03:07 -0000 =20 > -----Original Message----- > From: talk-bounces at lists.nyphp.org=20 > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Chris Shiflett > Sent: Friday, February 27, 2004 6:35 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] No, really, please don't use=20 > vacation autoresponders. >=20 > --- Daniel Convissor wrote: > > Anyway boys and girls, there are several ways to avoid this=20 > situation: > >=20 > > 1) Set up your auto-responder to not send responses to=20 > mailing lists=20 > > you're on. > >=20 > > 2) Unsubscribe from mailing lists while you're gone. > >=20 > > 3) Don't use auto-responders. >=20 > 4) Get the list administrator to not mangle the Reply-To header. >=20 > Sorry Hans, I couldn't pass up the opportunity. :-) That's ok... it'd have no effect in this case since the replies are = going to the individual, and not the list :) H >From hans not junk at nyphp.com Sat Feb 28 01:04:40 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 79939A85F0 for ; Sat, 28 Feb 2004 01:04:40 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] soon to be father Date: Fri, 27 Feb 2004 22:04:37 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA66FB at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] soon to be father Thread-Index: AcP9p5/vd7N9HKH2Q0uodXNwouV8SgAGPzZQ From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2004 06:04:40 -0000 > hey everyone >=20 > I'm going to be a father!!!! > the due date is in october Congrats Dan! Best wishes. Hans "how-many-list-replies-in-10-minutes" Zaunere H From nyphp at enobrev.com Sat Feb 28 01:05:11 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Sat, 28 Feb 2004 01:05:11 -0500 Subject: [nycphp-talk] Xampp is good. Message-ID: <20040228060533.E39B3A85F0@virtu.nyphp.org> I had to make a trip to SF and Chicago (And I just couldn't keep away from here). I left in a hurry and needed to get php running on my laptop so I could get way more work done than I'd like to while away. Apachefriends xampp: http://www.apachefriends.org/index-en.html Someone else pointed it out here couple weeks ago. Simple setup and worked instantly. I'm thoroughly impressed. So, hello from San Francisco. Mark. From dmintz at davidmintz.org Sat Feb 28 01:28:04 2004 From: dmintz at davidmintz.org (David Mintz) Date: Sat, 28 Feb 2004 01:28:04 -0500 (EST) Subject: [nycphp-talk] soon to be father In-Reply-To: <40401A33.2080208@spacemonkeylabs.com> References: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> <40401A33.2080208@spacemonkeylabs.com> Message-ID: HI FIVE MY FRIEND! I'm totally happy for you -- must be interpaternal/PHPistic solidarity or something. I never fully comprehended how trippy it would be until we deployed our unit on May 16. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >From hans not junk at nyphp.com Sat Feb 28 01:28:56 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id E7952A8627 for ; Sat, 28 Feb 2004 01:28:55 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] soon to be father Date: Fri, 27 Feb 2004 22:28:53 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87AA66FC at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] soon to be father Thread-Index: AcP9xAlbw2g7HPHBQS+NfO0eJjRbPAAAA3Vg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2004 06:28:56 -0000 > I never fully comprehended how trippy it would be until we deployed = our > unit on May 16. May 16th? That's my favorite date, too :) H From cmerlo at ncc.edu Sat Feb 28 02:14:30 2004 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Sat, 28 Feb 2004 02:14:30 -0500 Subject: [nycphp-talk] soon to be father In-Reply-To: References: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> <40401A33.2080208@spacemonkeylabs.com> Message-ID: <20040228071430.GA14128@ncc.edu> On 2004-02-28 01:28 -0500, David Mintz wrote: > I never fully comprehended how trippy it would be until we deployed our > unit on May 16. You know you're a geek when, as a grad school classmate of mine does, you refer to your child as the leaf node. Congrats, Dan. -c -- cmerlo at ncc.edu http://turing.matcmp.ncc.edu/~cmerlo Windows: You'll wish we were kidding. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: From leam at reuel.net Sat Feb 28 07:26:26 2004 From: leam at reuel.net (leam) Date: Sat, 28 Feb 2004 07:26:26 -0500 Subject: [nycphp-talk] Getting array in $_POST In-Reply-To: <404025EB.4070808@optonline.net> References: <40401F73.3050005@reuel.net> <404025EB.4070808@optonline.net> Message-ID: <404088F2.4070709@reuel.net> That did it, thanks! leam Jeff Siegel wrote: > Doing it this way you've got the problem, no doubt, where the Post var > "Skill" is an array that starts with zero and has no relation to the > skill itself. > > > echo " > value=\"$skill_data[skillID] \" \n "; > > However, nothing stops you from altering the "index" of the Skill > array...so...instead of leaving it as you could do something along the lines of > > For an obviously different programming project, I needed check box > corresponding to different car models. Look at the item below. You'll > see that the index of the model_array is identical to the value. So...if > the user clicks on the checkbox...I know that they have selected the > model 3.2CL (an Integra, btw). > 3.2CL > > Jeff > > > leam wrote: > >> Okay, I'll try to make this understandable before I fall asleep. I'm >> setting a bunch of check boxes where each is a member of an array. So >> the first line is: >> >> echo "> value=\"$skill_data[skillID] \" \n "; >> >> $skill_data[skillID] was previously pulled from the database and is a >> unique identifier for each skill. Each checkbox has the skill name >> beside it so the user can check what skills they have and then submit >> the form. From jsiegel1 at optonline.net Sat Feb 28 07:37:00 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Sat, 28 Feb 2004 07:37:00 -0500 Subject: [nycphp-talk] Getting array in $_POST In-Reply-To: <404088F2.4070709@reuel.net> References: <40401F73.3050005@reuel.net> <404025EB.4070808@optonline.net> <404088F2.4070709@reuel.net> Message-ID: <40408B6C.9090100@optonline.net> You're quite welcome. Jeff --------- leam wrote: > That did it, thanks! > > leam > > Jeff Siegel wrote: > >> Doing it this way you've got the problem, no doubt, where the Post var >> "Skill" is an array that starts with zero and has no relation to the >> skill itself. >> >> > echo "> > value=\"$skill_data[skillID] \" \n "; >> >> However, nothing stops you from altering the "index" of the Skill >> array...so...instead of leaving it as > you could do something along the lines of >> > >> For an obviously different programming project, I needed check box >> corresponding to different car models. Look at the item below. You'll >> see that the index of the model_array is identical to the value. >> So...if the user clicks on the checkbox...I know that they have >> selected the model 3.2CL (an Integra, btw). >> 3.2CL >> >> Jeff >> >> >> leam wrote: >> >>> Okay, I'll try to make this understandable before I fall asleep. I'm >>> setting a bunch of check boxes where each is a member of an array. So >>> the first line is: >>> >>> echo ">> value=\"$skill_data[skillID] \" \n "; >>> >>> $skill_data[skillID] was previously pulled from the database and is a >>> unique identifier for each skill. Each checkbox has the skill name >>> beside it so the user can check what skills they have and then submit >>> the form. > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From dan at cain.sh Sat Feb 28 15:04:45 2004 From: dan at cain.sh (Daniel J Cain Jr.) Date: Sat, 28 Feb 2004 14:04:45 -0600 Subject: [nycphp-talk] moving MySQL Tables In-Reply-To: References: Message-ID: <1077998685.17018.94.camel@gigabeast.home.cain.sh> On Fri, 2004-02-27 at 11:15, Carlos A Hoyos wrote: > . The only catch I can remember: mysql has to be stopped > before copying the files. Attempting to copy data directory with mysql > running gives corrupt files. This is kinda OT from the original question of 'moving' the files. Even though this is a backup solution it should be a short hop to a moving mechanism. A solution I have found that works very well for backing up LIVE MySQL databases without having to take the DB offline is as follows. -Take the list of DB's you want backed up/migrated. -For each table within each DB -- Lock that table -- Flush that table -- rsync that table to your backup location (filesystem|server) -- UnLock that table -Next Table -Next DB You lock the table to make sure it doesn't change during your backup. You flush the table to make sure the table on the file system is complete and doesn't have some parts of it only in memory(otherwise you end up backing a corrupted table file). Use rsync to copy only the file deltas (live vs. last backup copy) to minimize the time the table must be locked. The other option is to copy over the whole file, but for a lot of my tables this takes way too long and is redundant in my opinion. The first rsync you won't see a speed boost, without the destination file everything must be moved. But the subsequent ones have the potential to be MUCH faster. I believe MySQL data files cannot be copied from one platform to another, like Windows to UNIX without possible file corruption. Something to do with the format of the files on one system vs another. But from box 1:OS A to box 2:OS A you should not have a problem. At the time I implemented this backup scheme I could not find a free utility to backup a live MySQL DB WITHOUT having to copy the entire file every time. See below as to why it was necessary to find a better method. To give you an idea of the performance boost you can get. A full copy of the DBs and all their tables was taking approximately 45 minutes to complete. It was also locking everything in the beginning and unlocking everything at the end. Which made the site useless during that time, which sucked a lot because site traffic is pretty constant and very large. The new solution takes less than 2 minutes almost all the time (never more than 4 minutes in my case). Hope this helps some folks out there in their travels through cyberspace :) -dan From rinaudom at tiscali.it Sun Feb 29 10:35:30 2004 From: rinaudom at tiscali.it (rinaudom at tiscali.it) Date: Sun, 29 Feb 2004 16:35:30 +0100 (CET) Subject: [nycphp-talk] soon to be father In-Reply-To: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> References: <200402280304.i1S34v0v021064@ms-smtp-01.nyroc.rr.com> Message-ID: I don't know you, Dan, but I say: Best wishes, Dan!!!
Matt
In-Reply-To: <002e01c3f02a$b44b1ce0$f1a0d718@Vaio> References: <002e01c3f02a$b44b1ce0$f1a0d718@Vaio> Message-ID: <402A40E0.50601@netzero.com> Shawn Lawyer wrote: > I agree with Aaron! > If you just put this /> > in place of the null fields it'll solve your problem. No! Why create all of those extra requests when the solution is part of the HTML standard. You don't need any hacks or work around you just need to set up your table properly. From w3.org (http://www.w3.org/TR/1998/REC-html40-19980424/struct/tables.html#adef-rules) rules = none|groups|rows|cols|all [CI] This attribute specifies which rules will appear between cells within a table. The rendering of rules is user agent dependent. Possible values: * none: No rules. This is the default value. * groups: Rules will appear between row groups (see THEAD, TFOOT, and TBODY) and column groups (see COLGROUP and COL) only. * rows: Rules will appear between rows only. * cols: Rules will appear between columns only. * all: Rules will appear between all rows and columns. Scott Mattocks From joel at tagword.com Wed Feb 11 10:50:49 2004 From: joel at tagword.com (Joel De Gan) Date: Wed, 11 Feb 2004 10:50:49 -0500 Subject: [nycphp-talk] NEW PHundamentals Question In-Reply-To: <007b01c3f064$98308ba0$6400a8c0@thinkpad> References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> <011f01c3efab$f9401b40$6400a8c0@thinkpad><4028C839.5000004@phpwerx.net> <1076454852.7591.49.camel@bezel> <1076478212.7609.67.camel@bezel> <007b01c3f064$98308ba0$6400a8c0@thinkpad> Message-ID: <1076514649.7591.78.camel@bezel> On Wed, 2004-02-11 at 01:02, jon baer wrote: > is there any truth to the fact that e-voting systems are attempting to use > captchas? does anyone know? ive come across a few articles that label > captcha-like technology really being used as a legal (by law) type of > digital signature, this would be interesting ... > > - jon Jon, As far as I have heard, no. There is no intention of using captcha's. Mostly it is using a unique key sent to each person (much like a key for a video game or software registration). If you want some excellent articles and opionions from an expert, I would suggest looking through the Crypto-gram reprints (available here: http://www.schneier.com./crypto-gram.html ) It is a good newletter and has the latest info on e-voting just about every month. And, Bruce is a cool guy who can drink a lot of beer and still chat you up about crypto (defcon 5 experience there..) -Joel De Gan -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From greg at click3x.com Wed Feb 11 11:24:37 2004 From: greg at click3x.com (Greg Faber) Date: Wed, 11 Feb 2004 11:24:37 -0500 Subject: [nycphp-talk] EZ Session Question... Message-ID: Hi all, I just joined this list and just began writing php. I have a problem with my session variable and I have no doubt it's something dumb so you should be able to help me out pretty quickly. And I thank you all for your aid. Here's the situation: I have a login script, a registration script and a "members only"-type script. Let's start at the login page: if you are a member you enter your username and password and you are logged in and get a message like "logged in as George". If you aren't a member you must register. Once you register successfully, you can go to the members only page [here's my problem] but it says "logged in as " and then nothing. My session variable is obviously registered because the script gets a true result from session_is_registered() but the session variable contains nothing. I think the issue might be in the check_valid_user() function... thanks, Greg Here's some script excerpts: // registered.php require_once("images_fns.php"); session_start(); $username = $_POST["username"]; $password = $_POST["passwd"]; $valid_user = $_SESSION["valid_user"]; if ($username && $password) // they have just tried logging in { if (login($username, $password)) { // if they are in the database register the user id $valid_user = $username; session_register("valid_user"); } else { // unsuccessful login do_html_header("Problem:"); echo "You could not be logged in. You must be logged in to view this page."; do_html_url("login.php", "Login"); do_html_footer(); exit; } } do_html_header("Home"); check_valid_user(); ------------------------------------------------------------------------ -------- //part of register_new.php $reg_result = register($username, $email, $passwd); if ($reg_result == "true") { // register session variable session_register('valid_user'); $valid_user = $username; // provide link to members page do_html_header("Registration successful"); echo "Your registration was successful. Go to the users page to start uploading your files!"; do_HTML_URL("registered.php", "Go to users page"); } ------------------------------------------------------------------------ ----- // check_valid_user() function used in the registered.php script function check_valid_user() // see if somebody is logged in and notify them if not { global $valid_user; if (session_is_registered("valid_user")) { echo "Logged in as $valid_user"; echo "
"; } else { // they are not logged in do_html_heading("Problem:"); echo "You are not logged in.
"; do_html_url("login.php", "Login"); do_html_footer(); exit; } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2917 bytes Desc: not available URL: From chubbard at next-online.net Wed Feb 11 11:56:40 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Wed, 11 Feb 2004 08:56:40 -0800 Subject: [nycphp-talk] EZ Session Question... In-Reply-To: References: Message-ID: <402A5EC8.2070802@next-online.net> Greg, Couple things. make sure session_start(); or ob_start(); is at the top of your file, either right after the "; Rather than having a "valid_user" type: If the user is not valid, don't add the username to the session. It's easier than juggling multiple variables that contain similar information. I also recommend that you turn on error reporting while you code: error_reporting("E_ALL"); Chris Greg Faber wrote: > Hi all, > > I just joined this list and just began writing php. I have a problem > with my session variable and I have no doubt it's something dumb so > you should be able to help me out pretty quickly. And I thank you all > for your aid. > > Here's the situation: > I have a login script, a registration script and a "members only"-type > script. > Let's start at the login page: if you are a member you enter your > username and password and you are logged in and get a message like > "logged in as George". > If you aren't a member you must register. Once you register > successfully, you can go to the members only page [here's my problem] > but it says "logged in as " and then nothing. My session variable is > obviously registered because the script gets a true result from > session_is_registered() but the session variable contains nothing. I > think the issue might be in the check_valid_user() function... > > thanks, Greg > > Here's some script excerpts: > > // registered.php > > require_once("images_fns.php"); > session_start(); > $username = $_POST["username"]; > $password = $_POST["passwd"]; > $valid_user = $_SESSION["valid_user"]; > if ($username && $password) > // they have just tried logging in > { > if (login($username, $password)) > { > // if they are in the database register the user id > $valid_user = $username; > session_register("valid_user"); > } > else > { > // unsuccessful login > do_html_header("Problem:"); > echo "You could not be logged in. > You must be logged in to view this page."; > do_html_url("login.php", "Login"); > do_html_footer(); > exit; > } > } > > do_html_header("Home"); > check_valid_user(); > -------------------------------------------------------------------------------- > > //part of register_new.php > > $reg_result = register($username, $email, $passwd); > if ($reg_result == "true") > { > // register session variable > > > session_register('valid_user'); > $valid_user = $username; > > > // provide link to members page > do_html_header("Registration successful"); > echo "Your registration was successful. Go to the users page to start > uploading your files!"; > do_HTML_URL("registered.php", "Go to users page"); > } > ----------------------------------------------------------------------------- > > > // check_valid_user() function used in the registered.php script > function check_valid_user() > // see if somebody is logged in and notify them if not > { > > > global $valid_user; > > > if (session_is_registered("valid_user")) > { > echo "Logged in as $valid_user"; > echo "
"; > } > else > { > // they are not logged in > do_html_heading("Problem:"); > echo "You are not logged in.
"; > do_html_url("login.php", "Login"); > do_html_footer(); > exit; > } > } > >------------------------------------------------------------------------ > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > From Cbielanski at inta.org Wed Feb 11 12:03:38 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Wed, 11 Feb 2004 12:03:38 -0500 Subject: OT RE: [nycphp-talk] EZ Session Question... Message-ID: Chris Hubbard said (with Bielanski editing for humor)... >either right after the file... >(you have comments right?) Best giggle I've had today :) ~C > -----Original Message----- > From: Chris Hubbard [mailto:chubbard at next-online.net] > Sent: Wednesday, February 11, 2004 11:57 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] EZ Session Question... > > > Greg, > Couple things. > make sure session_start(); or ob_start(); is at the top of your file, > either right after the top of the > file (you have comments right?). > Depending on the version of PHP you've got installed and how > you've got > it configured there are multiple answers to your problem. > I'm going assume you've got a recent version of PHP and you've got it > configured the "right" way. > > at the top of every page, start with: > sesssion_start(); > > If you want to put some data into a session do this: > $_SESSION["key"] = "some value"; or > $_SESSION["key"] = $value; > > In your case looks like you want to have: > $_SESSION["key"] = $username; > (that's assuming you've cleaned and validated $username ( - which you > haven't in your code..)). > > Then when you want to display the username: > echo "Logged in as: ". $_SESSION["username"] ."
"; > > Rather than having a "valid_user" type: If the user is not > valid, don't > add the username to the session. It's easier than juggling multiple > variables that contain similar information. > > I also recommend that you turn on error reporting while you code: > error_reporting("E_ALL"); > > Chris > > Greg Faber wrote: > > > Hi all, > > > > I just joined this list and just began writing php. I have > a problem > > with my session variable and I have no doubt it's something dumb so > > you should be able to help me out pretty quickly. And I > thank you all > > for your aid. > > > > Here's the situation: > > I have a login script, a registration script and a "members > only"-type > > script. > > Let's start at the login page: if you are a member you enter your > > username and password and you are logged in and get a message like > > "logged in as George". > > If you aren't a member you must register. Once you register > > successfully, you can go to the members only page [here's > my problem] > > but it says "logged in as " and then nothing. My session > variable is > > obviously registered because the script gets a true result from > > session_is_registered() but the session variable contains > nothing. I > > think the issue might be in the check_valid_user() function... > > > > thanks, Greg > > > > Here's some script excerpts: > > > > // registered.php > > > > require_once("images_fns.php"); > > session_start(); > > $username = $_POST["username"]; > > $password = $_POST["passwd"]; > > $valid_user = $_SESSION["valid_user"]; > > if ($username && $password) > > // they have just tried logging in > > { > > if (login($username, $password)) > > { > > // if they are in the database register the user id > > $valid_user = $username; > > session_register("valid_user"); > > } > > else > > { > > // unsuccessful login > > do_html_header("Problem:"); > > echo "You could not be logged in. > > You must be logged in to view this page."; > > do_html_url("login.php", "Login"); > > do_html_footer(); > > exit; > > } > > } > > > > do_html_header("Home"); > > check_valid_user(); > > > -------------------------------------------------------------- > ------------------ > > > > //part of register_new.php > > > > $reg_result = register($username, $email, $passwd); > > if ($reg_result == "true") > > { > > // register session variable > > > > > > session_register('valid_user'); > > $valid_user = $username; > > > > > > // provide link to members page > > do_html_header("Registration successful"); > > echo "Your registration was successful. Go to the users > page to start > > uploading your files!"; > > do_HTML_URL("registered.php", "Go to users page"); > > } > > > -------------------------------------------------------------- > --------------- > > > > > > // check_valid_user() function used in the registered.php script > > function check_valid_user() > > // see if somebody is logged in and notify them if not > > { > > > > > > global $valid_user; > > > > > > if (session_is_registered("valid_user")) > > { > > echo "Logged in as $valid_user"; > > echo "
"; > > } > > else > > { > > // they are not logged in > > do_html_heading("Problem:"); > > echo "You are not logged in.
"; > > do_html_url("login.php", "Login"); > > do_html_footer(); > > exit; > > } > > } > > > >------------------------------------------------------------- > ----------- > > > >_______________________________________________ > >talk mailing list > >talk at lists.nyphp.org > >http://lists.nyphp.org/mailman/listinfo/talk > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From crisscott at netzero.com Wed Feb 11 12:35:37 2004 From: crisscott at netzero.com (Scott Mattocks) Date: Wed, 11 Feb 2004 12:35:37 -0500 Subject: [nycphp-talk] Presentations Message-ID: <402A67E9.9060706@netzero.com> Are the slides from the meeting presentations available anywhere for download so that I can take it with me when I am not connected to the internet? The specific one that I wanted was Parsing, Validating and Saving Data from Complex XML Streams. Thanks, Scott Mattocks From danielc at analysisandsolutions.com Wed Feb 11 12:39:13 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 11 Feb 2004 12:39:13 -0500 Subject: [nycphp-talk] Presentations In-Reply-To: <402A67E9.9060706@netzero.com> References: <402A67E9.9060706@netzero.com> Message-ID: <20040211173913.GA29949@panix.com> Hi Scott: On Wed, Feb 11, 2004 at 12:35:37PM -0500, Scott Mattocks wrote: > Are the slides from the meeting presentations available anywhere for > download so that I can take it with me when I am not connected to the > internet? Not per se, that I know of. You can, of course, download each of the pages before going off line -- they're all just plain old HTML pages. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From sklar at sklar.com Wed Feb 11 13:00:21 2004 From: sklar at sklar.com (David Sklar) Date: Wed, 11 Feb 2004 10:00:21 -0800 Subject: [nycphp-talk] using unpack in form reading In-Reply-To: <004e01c3f08b$0692f300$6400a8c0@thinkpad> Message-ID: > i have not seen it but can unpack be used to prevent sql injections? > > i tend to have strict fixed length for my stuff and have noticed if i > do an unpack on an incoming variable it seems safe: > > $id = array_shift(unpack("A2id", $_POST['id'])); > > is this overkill? Yes. unpack() doesn't buy you anything here that substr() doesn't. If $_POST['id'] is "'" or ";'" then $id becomes "'" or ";'" -- there's no encoding of special SQL chars. David From crisscott at netzero.com Wed Feb 11 13:02:11 2004 From: crisscott at netzero.com (Scott Mattocks) Date: Wed, 11 Feb 2004 13:02:11 -0500 Subject: [nycphp-talk] Presentations In-Reply-To: <20040211173913.GA29949@panix.com> References: <402A67E9.9060706@netzero.com> <20040211173913.GA29949@panix.com> Message-ID: <402A6E23.9070909@netzero.com> Daniel Convissor wrote: > You can, of course, download each of the > pages before going off line -- they're all just plain old HTML pages. > > --Dan > Thanks. I just want to make sure I wasn't missing something before I tried that. Scott Mattocks From erank at isthmus.com Wed Feb 11 13:22:36 2004 From: erank at isthmus.com (Eric Rank) Date: Wed, 11 Feb 2004 12:22:36 -0600 Subject: [nycphp-talk] Translating XML to SQL Message-ID: <00d001c3f0cc$06229470$8b01a8c0@DB> I'm working on a PHP app that will translate XML to SQL based on a configuration file with rules, and as I'm getting to the end of this project, all the quirks and airbubbles (yes, ok, they're BUGS) are getting squeezed out. And man, it's no fun. So now I'm looking for solutions that may have been created before me. Specifically, the xml contains information from articles in a newspaper. Author, issue, volumne, section, category, headline, story, etc. This xml we get from an export from QuarkXPress (which is its own nightmare) I'm trying to take this xml structure that contains NO database specific information and place it into a MySQL database with about a dozen related tables. The trick is that in going through an xml file, there are a lot of contigencies to cover before finally reaching the database. For example, some INSERT statements require the inserted id of a previous insert statement in order to make the records relational (eg. we need to insert the 'story' info into the 'article' table to get the inserted id for the article, which then gets inserted into the 'photos' table in the 'articleID' column.). Some insert statements might not need to happen because the information already exists (eg. an author that already exists in the database). You get the idea. Anyone have experience doing this? Is there an open source project out there that's working on this? Third party software even? Thanks for your help, Eric Rank -------------- next part -------------- An HTML attachment was scrubbed... URL: From pete at npgroup.net Wed Feb 11 13:36:37 2004 From: pete at npgroup.net (Pete Czech - New Possibilities Group, LLC) Date: Wed, 11 Feb 2004 13:36:37 -0500 Subject: [nycphp-talk] Amazing New Framework! Message-ID: <006201c3f0cd$fba96350$0200a8c0@DELLXPS> Me and some associates were sick of upper management talking acronyms and being unaware of what they mean (ASP, XML, .NET, etc) so we have created a "fake" framework for you to fool them with. Check it out and send it to any "upper management" that may be unaware of what the hell they are talking about... http://www.dot-x.org Cheers, Pete Czech New Possibilities Group, LLC www.npgroup.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cbielanski at inta.org Wed Feb 11 13:42:35 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Wed, 11 Feb 2004 13:42:35 -0500 Subject: [nycphp-talk] crazy uses for header() Message-ID: Hey List, There is a curiosity about the use of the header() function that the documentation cannot satisfy. I'm trying to find out if there is any way to trick the func into redirecting to a page a la: header("Location: xyz.php?arg1=foo&arg2=bar"); But all my fiddling around seems to be fruitless. If header will not work for this operation - simple redirect with GET args - then what have you guys found to work for this? A 300-series response, maybe? My next immediate thought was to output a META tag to redirect. But this is not as universal as I had thought. Thanks, Chris Bielanski - [CBielanski at inta.org] Web Programmer, International Trademark Association - [www.inta.org] 1133 Ave. of the Americas - Manhattan p - 212/642-1745 From northcloud2000 at yahoo.com Wed Feb 11 13:41:28 2004 From: northcloud2000 at yahoo.com (Cloud N.) Date: Wed, 11 Feb 2004 10:41:28 -0800 (PST) Subject: [nycphp-talk] Session question Message-ID: <20040211184128.45090.qmail@web42001.mail.yahoo.com> Hello, everyone, I am working on some pages to create an image dynamically. I need pass information among different pages. so I use session strategy. But I get wrong data from some sessions at last page. Most data are correct, only few are wrong. Like, I define an array of color. $color = array(0=>"Black", 1=>"White", 2=>"Tan"); A text color id should be less than 2, but i get its id as 16777215, so I can't get text color name from above array according to the id. But I use same way to define the background color, it works well. I am using Windows XP OS. Does anybody know what's wrong with it? Thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html From shiflett at php.net Wed Feb 11 13:45:42 2004 From: shiflett at php.net (Chris Shiflett) Date: Wed, 11 Feb 2004 10:45:42 -0800 (PST) Subject: [nycphp-talk] crazy uses for header() In-Reply-To: Message-ID: <20040211184542.43726.qmail@web14308.mail.yahoo.com> --- Chris Bielanski wrote: > There is a curiosity about the use of the header() function that the > documentation cannot satisfy. I'm trying to find out if there is any > way to trick the func into redirecting to a page a la: > > header("Location: xyz.php?arg1=foo&arg2=bar"); Trick the function? The function simply sends a header to the Web client. There is no trickery. It's up to you to make sure the header is formatted correctly, so that the Web client will interpret it as you desire. An an example, the Location header requires an absolute URL, so your example is improper. > But all my fiddling around seems to be fruitless. If header will not > work for this operation - simple redirect with GET args These "GET args" are simply part of the URL. The Location header only requires an absolute URL - any valid one will do. Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From amiller at hollywood101.com Wed Feb 11 13:45:47 2004 From: amiller at hollywood101.com (Alan T. Miller) Date: Wed, 11 Feb 2004 11:45:47 -0700 Subject: [nycphp-talk] Amazing New Framework! References: <006201c3f0cd$fba96350$0200a8c0@DELLXPS> Message-ID: <021601c3f0cf$43734470$640a0a0a@webdev> I love it! Alan ----- Original Message ----- From: "Pete Czech - New Possibilities Group, LLC" To: Sent: Wednesday, February 11, 2004 11:36 AM Subject: [nycphp-talk] Amazing New Framework! Me and some associates were sick of upper management talking acronyms and being unaware of what they mean (ASP, XML, .NET, etc) so we have created a "fake" framework for you to fool them with. Check it out and send it to any "upper management" that may be unaware of what the hell they are talking about... http://www.dot-x.org Cheers, Pete Czech New Possibilities Group, LLC www.npgroup.net ---------------------------------------------------------------------------- ---- > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From tgales at tgaconnect.com Wed Feb 11 13:49:31 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 11 Feb 2004 13:49:31 -0500 Subject: [nycphp-talk] Amazing New Framework! In-Reply-To: <006201c3f0cd$fba96350$0200a8c0@DELLXPS> Message-ID: <001e01c3f0cf$c9813310$e98d3818@oberon1> Pete Czech: 'a "fake" framework' It's hilarious. T. Gales & Associates Helping People Connect with Technology http://www.tgaconnect.com From danielk at us.ibm.com Wed Feb 11 13:56:33 2004 From: danielk at us.ibm.com (Daniel Krook) Date: Wed, 11 Feb 2004 13:56:33 -0500 Subject: [nycphp-talk] Amazing New Framework! In-Reply-To: <021601c3f0cf$43734470$640a0a0a@webdev> Message-ID: Sweet, I got my download from the surprisingly snappy Pyongyang mirror. This rocks. : ) Love that .dx file extension too. Daniel Krook, Application Developer, Production Services, ibm.com 1133 Westchester Avenue, White Plains, NY 10604 Tel: (914) 642-4474, Tieline 224-4474 danielk at us.ibm.com Personal: http://info.krook.org/ Persona: http://w3.ibm.com/persona/users/9/0/x/90MC212-P.html From bill at ilovett.com Wed Feb 11 14:01:09 2004 From: bill at ilovett.com (Bill Lovett) Date: Wed, 11 Feb 2004 14:01:09 -0500 Subject: [nycphp-talk] looking for qa procedures Message-ID: <20040211190109.GA3987@ilovett.com> I'm close to finishing an overhaul of a large application and will soon need to start up the testing, bug fixing, and "oops I forgot about that" phase. In the past, testing and qa have been handled pretty informally. They've also been pretty ineffective. Does anyone have suggestions or how-to stories for how to come up with test plans and procedures without having the luxury of a dedicated QA department? I'm not so much looking at things like unit testing as I am more user-related issues, like making sure an error message appears when it should or confirming that when a user deletes a database record, it really gets deleted. -bill From dcech at phpwerx.net Wed Feb 11 14:13:07 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 11 Feb 2004 14:13:07 -0500 Subject: [nycphp-talk] Translating XML to SQL In-Reply-To: <00d001c3f0cc$06229470$8b01a8c0@DB> References: <00d001c3f0cc$06229470$8b01a8c0@DB> Message-ID: <402A7EC3.30401@phpwerx.net> From the work I've done on adodb-xmlschema, I would advise an object oriented approach, it really helps to break up the logic. I would create a class to hold the methods for parsing a document, etc, and another class to represent an article. Once you have a class for the article you can build up all the article details from the xml, and finally generate and run the SQL to insert all the required records. You could also use the class for accessing the data once it is in the database.... You may also want to create classes for author, etc which could handle the logic for updating/inserting the relevant details into those tables. Anyway, it appears you are looking at a procedural solution right now, which will work too....honestly I'd have to have more details about the specific issues you are working around in order to give you any concrete advice. Dan Eric Rank wrote: > I'm working on a PHP app that will translate XML to SQL based on a > configuration file with rules, and as I'm getting to the end of this > project, all the quirks and airbubbles (yes, ok, they're BUGS) are > getting squeezed out. And man, it's no fun. So now I'm looking for > solutions that may have been created before me. > > Specifically, the xml contains information from articles in a newspaper. > Author, issue, volumne, section, category, headline, story, etc. This > xml we get from an export from QuarkXPress (which is its own nightmare) > > I'm trying to take this xml structure that contains NO database > specific information and place it into a MySQL database with about a > dozen related tables. The trick is that in going through an xml file, > there are a lot of contigencies to cover before finally reaching the > database. For example, some INSERT statements require the inserted id of > a previous insert statement in order to make the records relational (eg. > we need to insert the 'story' info into the 'article' table to get the > inserted id for the article, which then gets inserted into the 'photos' > table in the 'articleID' column.). Some insert statements might not need > to happen because the information already exists (eg. an author that > already exists in the database). You get the idea. > > Anyone have experience doing this? Is there an open source project out > there that's working on this? Third party software even? > > Thanks for your help, > > Eric Rank From csnyder at chxo.com Wed Feb 11 14:14:16 2004 From: csnyder at chxo.com (Chris Snyder) Date: Wed, 11 Feb 2004 14:14:16 -0500 Subject: [nycphp-talk] Amazing New Framework! In-Reply-To: <006201c3f0cd$fba96350$0200a8c0@DELLXPS> References: <006201c3f0cd$fba96350$0200a8c0@DELLXPS> Message-ID: <402A7F08.3070108@chxo.com> Pete Czech - New Possibilities Group, LLC wrote: > http://www.dot-x.org > Holy cow, I downloaded the source code, and it turns out I've already implemented this framework, but just didn't know what to call it before! Where can I sign up for a .XCE certification exam? From danielc at analysisandsolutions.com Wed Feb 11 14:24:38 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 11 Feb 2004 14:24:38 -0500 Subject: [nycphp-talk] they keep on coming... Message-ID: <20040211192436.GA14887@panix.com> PHP stuff in SecurityFocus Newsletter #235 PhpGedView Editconfig_gedcom.php Directory Traversal Vulnera... http://www.securityfocus.com/bid/9529 PhpGedView [GED_File]_conf.php Remote File Include Vulnerabi... http://www.securityfocus.com/bid/9531 JBrowser Browser.PHP Directory Traversal Vulnerability http://www.securityfocus.com/bid/9535 JBrowser Unauthorized Admin Access Vulnerability http://www.securityfocus.com/bid/9537 Laurent Adda Les Commentaires PHP Script Multiple Module Fil... http://www.securityfocus.com/bid/9536 Aprox Portal File Disclosure Vulnerability http://www.securityfocus.com/bid/9540 BugPort Unauthorized Configuration File Viewing Vulnerabilit... http://www.securityfocus.com/bid/9542 PHP-Nuke Multiple Module SQL Injection Vulnerabilities http://www.securityfocus.com/bid/9544 All Enthusiast Photopost PHP Pro SQL Injection Vulnerability http://www.securityfocus.com/bid/9557 PHP-Nuke GBook Module HTML Injection Vulnerability http://www.securityfocus.com/bid/9559 Qualiteam X-Cart Remote Command Execution Vulnerability http://www.securityfocus.com/bid/9560 phpMyAdmin Export.PHP File Disclosure Vulnerability http://www.securityfocus.com/bid/9564 PHPX Multiple Vulnerabilities http://www.securityfocus.com/bid/9569 All Enthusiast ReviewPost PHP Pro Multiple SQL Injection Vul... http://www.securityfocus.com/bid/9574 Crossday Discuz! Cross Site Scripting Vulnerability http://www.securityfocus.com/bid/9584 --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Wed Feb 11 14:26:36 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 11 Feb 2004 14:26:36 -0500 Subject: [nycphp-talk] Translating XML to SQL In-Reply-To: <00d001c3f0cc$06229470$8b01a8c0@DB> References: <00d001c3f0cc$06229470$8b01a8c0@DB> Message-ID: <20040211192636.GB14887@panix.com> Hi Eric: Two leads: http://www.analysisandsolutions.com/code/phpxml.htm http://nyphp.org/content/presentations/pvsxml/ --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From chendry at nyc.rr.com Wed Feb 11 17:21:00 2004 From: chendry at nyc.rr.com (Christopher Hendry) Date: Wed, 11 Feb 2004 17:21:00 -0500 Subject: [nycphp-talk] isset or not In-Reply-To: <402A7F08.3070108@chxo.com> Message-ID: I find myself testing arrays for certain values all the time (of course) - but sometimes the element may not be set, so to avoid the Notice that the index does not exist, I often wrap the test in an isset. This seems a little silly to me, and I wonder if anyone has a more elegant approach to handling this (besides better code :) or if there is some simple PHP function I'm just not using... C From erank at isthmus.com Wed Feb 11 17:39:41 2004 From: erank at isthmus.com (Eric Rank) Date: Wed, 11 Feb 2004 16:39:41 -0600 Subject: [nycphp-talk] Translating XML to SQL References: <00d001c3f0cc$06229470$8b01a8c0@DB> <402A7EC3.30401@phpwerx.net> Message-ID: <017201c3f0ef$f0116e30$8b01a8c0@DB> Thanks for your suggestions Dan (other Dan too). I should apologize for being a little vague in my previous post about the details of the project I'm working on. I mainly wanted to see if any of y'all had faced similar XML->SQL challenges and if there might be packaged solution was out there to solve it. Parsing the XML and encapsulating it into objects is the easy part in this project. It's trying to unpack it all that gets a little screwy. My solution is to do the following: 1. First parse the XML content into a multidimensional array that reflects the xml structure (After thinking about it, this should probably be a more structured object) 2. Create a database object to encapsulate the database structure 3. parse an xml formatted ruleset file into an object that will determine how to execute sql statements. This ruleset object is the key to making the whole thing come together. Essentially, it does the same thing as a stored procedure would. The likeness is obvious now that you bring up the topic. I hadn't thought of that before. Basically, this creates a 'rule' for each table, and contigencies for the columns and tables as needed. This also serves as a place to map out the relationship between an xml file and a database structure. The cool thing is that I should be able to take just about any database & XML pair, create a ruleset file defining the relationships & contigencies, and it should all work. Although a new xml parser would need to be created for the xml file holding the data in order to create the multidimensional struct the translator object expects. Right now, I'm to the point where: 1. I'm looping through the list of tables from the database object 1.1 checking the rules for that table 1.1.1 if the rule passes, the insert query happens and returns success 1.1.2 if the rule does NOT pass, i need to look at a different table so i go through the process recursively. checking table rules, inserting where possible until all records have been saved, or, at this point, ad infinitum I can insert data, and to a certain degree it gets inserted correctly, but I'm winding up with some corruption of data, which I'm trying to pin down. Infinite loops are happening right now... Recursion is cool when it works. I kind of feel like I'm working magic when it happens, but until that magical point, it's fairly hair raising. ----- Original Message ----- From: "Dan Cech" To: "NYPHP Talk" Sent: Wednesday, February 11, 2004 1:13 PM Subject: Re: [nycphp-talk] Translating XML to SQL > From the work I've done on adodb-xmlschema, I would advise an object > oriented approach, it really helps to break up the logic. > > I would create a class to hold the methods for parsing a document, etc, > and another class to represent an article. > > Once you have a class for the article you can build up all the article > details from the xml, and finally generate and run the SQL to insert all > the required records. You could also use the class for accessing the > data once it is in the database.... > > You may also want to create classes for author, etc which could handle > the logic for updating/inserting the relevant details into those tables. > > Anyway, it appears you are looking at a procedural solution right now, > which will work too....honestly I'd have to have more details about the > specific issues you are working around in order to give you any concrete > advice. > > Dan > > Eric Rank wrote: > > I'm working on a PHP app that will translate XML to SQL based on a > > configuration file with rules, and as I'm getting to the end of this > > project, all the quirks and airbubbles (yes, ok, they're BUGS) are > > getting squeezed out. And man, it's no fun. So now I'm looking for > > solutions that may have been created before me. > > > > Specifically, the xml contains information from articles in a newspaper. > > Author, issue, volumne, section, category, headline, story, etc. This > > xml we get from an export from QuarkXPress (which is its own nightmare) > > > > I'm trying to take this xml structure that contains NO database > > specific information and place it into a MySQL database with about a > > dozen related tables. The trick is that in going through an xml file, > > there are a lot of contigencies to cover before finally reaching the > > database. For example, some INSERT statements require the inserted id of > > a previous insert statement in order to make the records relational (eg. > > we need to insert the 'story' info into the 'article' table to get the > > inserted id for the article, which then gets inserted into the 'photos' > > table in the 'articleID' column.). Some insert statements might not need > > to happen because the information already exists (eg. an author that > > already exists in the database). You get the idea. > > > > Anyone have experience doing this? Is there an open source project out > > there that's working on this? Third party software even? > > > > Thanks for your help, > > > > Eric Rank > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From dmintz at davidmintz.org Wed Feb 11 17:49:21 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 11 Feb 2004 17:49:21 -0500 (EST) Subject: [nycphp-talk] NEW PHundamentals Question (digression) In-Reply-To: <1076478212.7609.67.camel@bezel> References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> <011f01c3efab$f9401b40$6400a8c0@thinkpad> <4028C839.5000004@phpwerx.net> <1076454852.7591.49.camel@bezel> <1076478212.7609.67.camel@bezel> Message-ID: On Wed, 11 Feb 2004, Joel De Gan wrote: > > I just finished a project for bypassing one of our partners captchas so > we could automate using curl to snag some pages we needed.. So you say > "captcha?" and you got that... :) Maybe they oughta save you the trouble by exposing the data you need as a web service, or something sexy like that? --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >From hans not junk at nyphp.com Wed Feb 11 17:53:44 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 15E17A85E9 for ; Wed, 11 Feb 2004 17:53:44 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Session question Date: Wed, 11 Feb 2004 14:53:43 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F877729AD at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Session question Thread-Index: AcPwzq5x6a/3phSuT/aKgWFULw/7CAAIw8xw From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2004 22:53:44 -0000 > I am working on some pages to create an image > dynamically. I need pass information among different > pages. so I use session strategy.=20 > But I get wrong data from some sessions at last page. > Most data are correct, only few are wrong.=20 > Like, I define an array of color.=20 > $color =3D array(0=3D>"Black", 1=3D>"White", 2=3D>"Tan"); > A text color id should be less than 2, but i get its > id as 16777215, so I can't get text color name from 16777215 is 2^24, so somewhere your going out of range most likely. > above array according to the id. But I use same way to > define the background color, it works well. >=20 > I am using Windows XP OS. How are you passing the session data around? Maybe a couple lines of = code would help... H >From hans not junk at nyphp.com Wed Feb 11 17:57:19 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 250DCA85E9 for ; Wed, 11 Feb 2004 17:57:19 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] looking for qa procedures Date: Wed, 11 Feb 2004 14:57:18 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F877729AF at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] looking for qa procedures Thread-Index: AcPw0W6sEsn1yTGqSNGz+1b1qB9/mAAII7fg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2004 22:57:19 -0000 > I'm close to finishing an overhaul of a large application and will = soon > need to start up the testing, bug fixing, and "oops I forgot about = that" > phase. In the past, testing and qa have been handled pretty = informally. > They've also been pretty ineffective. Does anyone have suggestions or > how-to stories for how to come up with test plans and procedures = without > having the luxury of a dedicated QA department? I'm not so much = looking > at things like unit testing as I am more user-related issues, like > making sure an error message appears when it should or confirming that > when a user deletes a database record, it really gets deleted. This might sound silly, even demeaning, but have the users use it. = Seriously though, go through a beta phase, where real users can begin to = use it. For instance, when Yahoo! roles something new out, there's = always a link on the old page to the effect of "Test Drive Our New = Version." Sure, it's good as a developer to go through the entire site, watching = log files, and ensuring everything is up to par. But really... you = wrote it, and will never find the errors like someone who is just using = it (ironic as it sounds). H From dmintz at davidmintz.org Wed Feb 11 17:59:16 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 11 Feb 2004 17:59:16 -0500 (EST) Subject: [nycphp-talk] Amazing New Framework! In-Reply-To: <402A7F08.3070108@chxo.com> References: <006201c3f0cd$fba96350$0200a8c0@DELLXPS> <402A7F08.3070108@chxo.com> Message-ID: Sounds like they should partner up with Vernon T. Bludgeon Consulting -- http://vernontbludgeon.com/ --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >From hans not junk at nyphp.com Wed Feb 11 18:00:50 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 1737AA85E9 for ; Wed, 11 Feb 2004 18:00:50 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Translating XML to SQL Date: Wed, 11 Feb 2004 15:00:48 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F877729B1 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Translating XML to SQL Thread-Index: AcPw8E+a+kWaU0GsShqcTEbQnh0hVgAAmhOA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2004 23:00:50 -0000 This is interesting, Eric. If you write your emails anywhere as = complete as you'd write an article, this might make a good Advanced = PHundamentals :) H=20 > -----Original Message----- > From: talk-bounces at lists.nyphp.org=20 > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Eric Rank > Sent: Wednesday, February 11, 2004 5:40 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Translating XML to SQL >=20 > Thanks for your suggestions Dan (other Dan too). I should=20 > apologize for > being a little vague in my previous post about the details of=20 > the project > I'm working on. I mainly wanted to see if any of y'all had=20 > faced similar > XML->SQL challenges and if there might be packaged solution=20 > was out there to > solve it. >=20 > Parsing the XML and encapsulating it into objects is the easy=20 > part in this > project. It's trying to unpack it all that gets a little screwy. >=20 > My solution is to do the following: >=20 > 1. First parse the XML content into a multidimensional array=20 > that reflects > the xml structure (After thinking about it, this should=20 > probably be a more > structured object) > 2. Create a database object to encapsulate the database structure > 3. parse an xml formatted ruleset file into an object that=20 > will determine > how to execute sql statements. >=20 > This ruleset object is the key to making the whole thing come=20 > together. > Essentially, it does the same thing as a stored procedure would. The > likeness is obvious now that you bring up the topic. I hadn't=20 > thought of > that before. Basically, this creates a 'rule' for each table, and > contigencies for the columns and tables as needed. This also=20 > serves as a > place to map out the relationship between an xml file and a database > structure. The cool thing is that I should be able to take=20 > just about any > database & XML pair, create a ruleset file defining the=20 > relationships & > contigencies, and it should all work. Although a new xml=20 > parser would need > to be created for the xml file holding the data in order to create the > multidimensional struct the translator object expects. >=20 > Right now, I'm to the point where: > 1. I'm looping through the list of tables from the database object > 1.1 checking the rules for that table > 1.1.1 if the rule passes, the insert query happens and returns > success > 1.1.2 if the rule does NOT pass, i need to look at a=20 > different table > so i go through the process recursively.=20 > checking table > rules, > inserting where possible until all records=20 > have been saved, > or, at this point, ad infinitum >=20 > I can insert data, and to a certain degree it gets inserted=20 > correctly, but > I'm winding up with some corruption of data, which I'm trying=20 > to pin down. > Infinite loops are happening right now... Recursion is cool=20 > when it works. I > kind of feel like I'm working magic when it happens, but=20 > until that magical > point, it's fairly hair raising. >=20 >=20 >=20 >=20 > ----- Original Message -----=20 > From: "Dan Cech" > To: "NYPHP Talk" > Sent: Wednesday, February 11, 2004 1:13 PM > Subject: Re: [nycphp-talk] Translating XML to SQL >=20 >=20 > > From the work I've done on adodb-xmlschema, I would advise an object > > oriented approach, it really helps to break up the logic. > > > > I would create a class to hold the methods for parsing a=20 > document, etc, > > and another class to represent an article. > > > > Once you have a class for the article you can build up all=20 > the article > > details from the xml, and finally generate and run the SQL=20 > to insert all > > the required records. You could also use the class for=20 > accessing the > > data once it is in the database.... > > > > You may also want to create classes for author, etc which=20 > could handle > > the logic for updating/inserting the relevant details into=20 > those tables. > > > > Anyway, it appears you are looking at a procedural solution=20 > right now, > > which will work too....honestly I'd have to have more=20 > details about the > > specific issues you are working around in order to give you=20 > any concrete > > advice. > > > > Dan > > > > Eric Rank wrote: > > > I'm working on a PHP app that will translate XML to SQL based on a > > > configuration file with rules, and as I'm getting to the=20 > end of this > > > project, all the quirks and airbubbles (yes, ok, they're BUGS) are > > > getting squeezed out. And man, it's no fun. So now I'm looking for > > > solutions that may have been created before me. > > > > > > Specifically, the xml contains information from articles=20 > in a newspaper. > > > Author, issue, volumne, section, category, headline,=20 > story, etc. This > > > xml we get from an export from QuarkXPress (which is its=20 > own nightmare) > > > > > > I'm trying to take this xml structure that contains NO database > > > specific information and place it into a MySQL database=20 > with about a > > > dozen related tables. The trick is that in going through=20 > an xml file, > > > there are a lot of contigencies to cover before finally=20 > reaching the > > > database. For example, some INSERT statements require the=20 > inserted id of > > > a previous insert statement in order to make the records=20 > relational (eg. > > > we need to insert the 'story' info into the 'article'=20 > table to get the > > > inserted id for the article, which then gets inserted=20 > into the 'photos' > > > table in the 'articleID' column.). Some insert statements=20 > might not need > > > to happen because the information already exists (eg. an=20 > author that > > > already exists in the database). You get the idea. > > > > > > Anyone have experience doing this? Is there an open=20 > source project out > > > there that's working on this? Third party software even? > > > > > > Thanks for your help, > > > > > > Eric Rank > > > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk >=20 > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk >=20 >=20 From dmintz at davidmintz.org Wed Feb 11 18:02:33 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 11 Feb 2004 18:02:33 -0500 (EST) Subject: [nycphp-talk] isset or not In-Reply-To: References: Message-ID: Elegant it isn't, but I suppose you could adjust error_reporting for the duration of that block and set it back when you're done. On Wed, 11 Feb 2004, Christopher Hendry wrote: > I find myself testing arrays for certain values all the time (of course) - > but sometimes the element may not be set, so to avoid the Notice that the > index does not exist, I often wrap the test in an isset. This seems a > little silly to me, and I wonder if anyone has a more elegant approach to > handling this (besides better code :) or if there is some simple PHP > function I'm just not using... > > C > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From joel at tagword.com Wed Feb 11 18:03:18 2004 From: joel at tagword.com (Joel De Gan) Date: Wed, 11 Feb 2004 18:03:18 -0500 Subject: [nycphp-talk] NEW PHundamentals Question (digression) In-Reply-To: References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> <011f01c3efab$f9401b40$6400a8c0@thinkpad> <4028C839.5000004@phpwerx.net> <1076454852.7591.49.camel@bezel> <1076478212.7609.67.camel@bezel> Message-ID: <1076540598.7593.93.camel@bezel> On Wed, 2004-02-11 at 17:49, David Mintz wrote: > > I just finished a project for bypassing one of our partners captchas so > > we could automate using curl to snag some pages we needed.. So you say > > "captcha?" and you got that... :) > > Maybe they oughta save you the trouble by exposing the data you need as a > web service, or something sexy like that? > That would have been nice, but they declined to offer us that or to provide it due to some policy about that particular data. So in response we just automated going through their captcha. :) -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net >From hans not junk at nyphp.com Wed Feb 11 18:03:43 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 2D570A85E9 for ; Wed, 11 Feb 2004 18:03:43 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] isset or not Date: Wed, 11 Feb 2004 15:03:41 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F877729B3 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] isset or not Thread-Index: AcPw7V9akDU/CHbtQiKC0Yt26yYnQAABaELA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2004 23:03:43 -0000 > I find myself testing arrays for certain values all the time (of = course) - > but sometimes the element may not be set, so to avoid the Notice that = the > index does not exist, I often wrap the test in an isset. This seems a Good man. Also: http://phundamentals.nyphp.org/PH_variableevaluation.php > little silly to me, and I wonder if anyone has a more elegant approach = to > handling this (besides better code :) or if there is some simple PHP > function I'm just not using... Some simple function? isset() :) That's the way to do it. H From dmintz at davidmintz.org Wed Feb 11 18:08:33 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 11 Feb 2004 18:08:33 -0500 (EST) Subject: [nycphp-talk] NEW PHundamentals Question (digression) In-Reply-To: <1076540598.7593.93.camel@bezel> References: <20040210071932.40602.qmail@web14308.mail.yahoo.com> <011f01c3efab$f9401b40$6400a8c0@thinkpad> <4028C839.5000004@phpwerx.net> <1076454852.7591.49.camel@bezel> <1076478212.7609.67.camel@bezel> <1076540598.7593.93.camel@bezel> Message-ID: On Wed, 11 Feb 2004, Joel De Gan wrote: > On Wed, 2004-02-11 at 17:49, David Mintz wrote: > > > I just finished a project for bypassing one of our partners captchas so > > > we could automate using curl to snag some pages we needed.. So you say > > > "captcha?" and you got that... :) > > > > Maybe they oughta save you the trouble by exposing the data you need as a > > web service, or something sexy like that? > > > > That would have been nice, but they declined to offer us that or to > provide it due to some policy about that particular data. So in response > we just automated going through their captcha. :) HA! Kind of proves the point that they might as well change their policy... but then where'd the fun and the challenge be for you? --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From jsiegel1 at optonline.net Wed Feb 11 19:27:50 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Wed, 11 Feb 2004 19:27:50 -0500 Subject: [nycphp-talk] Failure to write session data Message-ID: <402AC886.1040908@optonline.net> I had encountered an intermittent bug where it seems PHP suddenly is unable to write session files. (I had posted this issue in the past...here's one of the early postings: http://lists.nyphp.org/pipermail/talk/2003-November/006397.html) As an FYI to all, I found the following bug report concerning this issue. See: http://bugs.php.net/bug.php?id=19022 It turns out, based on what others have posted, that it's a combination of factors and sequences of events with no seemingly consistent pattern thereby making the bug difficult to consistently reproduce. Just wondering if anyone else encountered this issue or do I remain part of the "lucky few." ;) Jeff Siegel From jonbaer at jonbaer.net Wed Feb 11 23:42:16 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 11 Feb 2004 23:42:16 -0500 Subject: [nycphp-talk] Fw: MySQL Administrator Available for Download Message-ID: <000501c3f122$975a1070$6400a8c0@thinkpad> ----- Original Message ----- From: "MySQL Webmaster" To: Sent: Wednesday, February 11, 2004 11:20 PM Subject: MySQL Administrator Available for Download > Thank you for signing up to be notified when MySQL Administrator is > available for download. MySQL Administrator is a powerful new visual > administration console that lets you easily administer your MySQL > environment and gain better visibility into how your databases are > operating. > > This is the first alpha release. The source code and binaries for > Linux and Microsoft Windows XP/2000/NT can be downloaded from: > > http://www.mysql.com/downloads/administrator.html > > Please read the installation instructions and general FAQ prior to > installing the software. You can find these at: > > http://www.mysql.com/products/administrator/faq.html > > Also, please join us at the MySQL Users Conference and Expo, April > 14-16th in Orlando, Florida where you can get detailed information on > MySQL, MySQL Administrator, and other upcoming new product releases. > Learn more at: > > http://www.mysql.com/uc2004 > > Enjoy MySQL Administrator, and we'll see you in Orlando! > > Regards, > > The MySQL Team > > -- > MySQL AB, www.mysql.com > > Meet the MySQL Team at User Conference 2004! > http://www.mysql.com/uc2004 > From northcloud2000 at yahoo.com Wed Feb 11 23:55:42 2004 From: northcloud2000 at yahoo.com (Cloud N.) Date: Wed, 11 Feb 2004 20:55:42 -0800 (PST) Subject: [nycphp-talk] Session question In-Reply-To: <41EE526EC2D3C74286415780D3BA9F877729AD@ehost011-1.exch011.intermedia.net> Message-ID: <20040212045542.80883.qmail@web42005.mail.yahoo.com> Hello, Hans Zaunere, Thank you very much for reply my message. Let me tell you more detail about my pages. In my main page called dealerorder.php, there is a link to createTireImage.php (Click here to create your own cover

). In createTireImg.php, code like following: -------

backgroud color:     
Text color:     
Back To Main Page ------- In img_text_config.inc.php, I defined an array: $color = array(0=>"Black", 1=>"White", 2=>"Tan"); After create an image, (it will show up in dealerorder.php page), I need to describe the new image's content including background color and text color. You can see it in the code, i use same way to set these two colors; $_SESSION['t_color'] = $_POST['t_color']; $_SESSION['tt_color'] = $_POST['tt_color']; In dealerorder.php, i have code like below: $message = "Image Detail:\n"; $message .= "Backgroud color:".$color[$_SESSION['t_color']]."\n"; $message .= "Text color:".$color[$_SESSION['tt_color']]."\n"; The error happens here. $_SESSION['t_color'] is right (always between 0 and 2), but $_SESSION['tt_color'] is wrong. $_SESSION['tt_color'] shows 16777215. I have looked at $_SESSION['tt_color']'s value in createTireImg.php before I go back to dealerOrder.php, it was right there. After i click the click in createTireImg.php, it changed. Can you figure out what's wrong with it? Thanks again. --- Hans Zaunere wrote: > > > I am working on some pages to create an image > > dynamically. I need pass information among > different > > pages. so I use session strategy. > > But I get wrong data from some sessions at last > page. > > Most data are correct, only few are wrong. > > Like, I define an array of color. > > $color = array(0=>"Black", 1=>"White", 2=>"Tan"); > > A text color id should be less than 2, but i get > its > > id as 16777215, so I can't get text color name > from > > 16777215 is 2^24, so somewhere your going out of > range most likely. > > > above array according to the id. But I use same > way to > > define the background color, it works well. > > > > I am using Windows XP OS. > > How are you passing the session data around? Maybe > a couple lines of code would help... > > H > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html From pete at npgroup.net Thu Feb 12 08:13:54 2004 From: pete at npgroup.net (Pete Czech - New Possibilities Group, LLC) Date: Thu, 12 Feb 2004 08:13:54 -0500 Subject: [nycphp-talk] Amazing New Framework! References: Message-ID: <005c01c3f16a$10d640d0$0200a8c0@DELLXPS> Ahh, thanks. I think its picking up a cult following already... --PJC www.peteczech.com ----- Original Message ----- From: "Daniel Krook" To: "NYPHP Talk" Sent: Wednesday, February 11, 2004 1:56 PM Subject: Re: [nycphp-talk] Amazing New Framework! > > > > > > Sweet, I got my download from the surprisingly snappy Pyongyang mirror. > This rocks. : ) > > Love that .dx file extension too. > > > > > > > Daniel Krook, Application Developer, Production Services, ibm.com > 1133 Westchester Avenue, White Plains, NY 10604 > Tel: (914) 642-4474, Tieline 224-4474 > danielk at us.ibm.com > > Personal: http://info.krook.org/ > Persona: http://w3.ibm.com/persona/users/9/0/x/90MC212-P.html > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From erank at isthmus.com Thu Feb 12 10:34:59 2004 From: erank at isthmus.com (Eric Rank) Date: Thu, 12 Feb 2004 09:34:59 -0600 Subject: [nycphp-talk] Translating XML to SQL References: <41EE526EC2D3C74286415780D3BA9F877729B1@ehost011-1.exch011.intermedia.net> Message-ID: <001f01c3f17d$c620cbf0$8b01a8c0@DB> After I went home last night my wheels were still spinning about this idea, and I started re-thinking the design from the ground up, using what I've learned from this project so far. Currently the use of rulesets makes the design a little bit too complex. The ruleset itself consists of a list of tables in the database, within it are children tags containing and tags. Within those condition tags are statements that would need to occur to get the value for a specific column. This gets extremely messy and confusing. Not only do you have to figure out what column relies on the inserted id from another, but you also have to know what kind of SQL statements to make. Confused? yeah, me too. After thinking about it, all this ruleset is, is a combination of XML-to-table.column mappings and primary key-foreign key pairs. Combining them gets sloppy, but seperating them seems the way to go. It's much easier to write 2 seperate files. 1. an xml file with Primary key - Foreign key pairs and 2. an xml-to-table.column map xml file. I can also say that it'd be much easier to write a parser for those files. Right now, parsing through a ruleset xml file with pseudo logic embedded is ugly. Parsing this psuedo-logic xml is half the battle. Once it has been incorporated into the rule object, that rule object has to follow that logic. Yuck. So, since I was off the clock, I cracked open a beer and started putting together a new design for this project (beer, I find, is the only way to really justify thinking about work stuff when I'm at home). A rough UML diagram is here: http://lo-fi.net/~eric/default.gif All the objects are there, all the methods and properties are not. The idea is this, the xml translator has a database property which holds regular database stuff, but also an xml-to-table.column map and a primary key to foreign key map. The tables hold record objects. the record objects are created when the data file gets parsed by the data xml parser. When the parser gets to an element that holds data, it looks at the xml-db map on the database object, and knows what table to create a record for. After the data has all been parsed into record objects for the tables, it's time to insert the records. At that point, the translator goes through all the tables, making inserts for records that have not yet been saved, ignoring those that already exist. If an incomplete record is found during this process, where an id is needed from a different record insertion, the translator->database object knows where look by virtue of it's Primary Key - Foreign Key map. If the id that we need is there, great, grab it and put it in the record. If not, try to insert the record (or SELECT the record ID if it already exists, eg. an authors name) for the table that we need the id from. Then you can go back and save the first record. This process would need to be a recursive one. What kind of problems do you think I might run into using a design like this? Is anything missing? I'll consider the article idea. At this point, I've done enough head scratching that I think it'd be nice to save anyone else the grief. I'll work on collecting and writing up my experiences. Eric Rank ----- Original Message ----- From: "Hans Zaunere" To: "NYPHP Talk" Sent: Wednesday, February 11, 2004 5:00 PM Subject: RE: [nycphp-talk] Translating XML to SQL > > This is interesting, Eric. If you write your emails anywhere as complete as you'd write an article, this might make a good Advanced PHundamentals :) > > H > > > -----Original Message----- > > From: talk-bounces at lists.nyphp.org > > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Eric Rank > > Sent: Wednesday, February 11, 2004 5:40 PM > > To: NYPHP Talk > > Subject: Re: [nycphp-talk] Translating XML to SQL > > > > Thanks for your suggestions Dan (other Dan too). I should > > apologize for > > being a little vague in my previous post about the details of > > the project > > I'm working on. I mainly wanted to see if any of y'all had > > faced similar > > XML->SQL challenges and if there might be packaged solution > > was out there to > > solve it. > > > > Parsing the XML and encapsulating it into objects is the easy > > part in this > > project. It's trying to unpack it all that gets a little screwy. > > > > My solution is to do the following: > > > > 1. First parse the XML content into a multidimensional array > > that reflects > > the xml structure (After thinking about it, this should > > probably be a more > > structured object) > > 2. Create a database object to encapsulate the database structure > > 3. parse an xml formatted ruleset file into an object that > > will determine > > how to execute sql statements. > > > > This ruleset object is the key to making the whole thing come > > together. > > Essentially, it does the same thing as a stored procedure would. The > > likeness is obvious now that you bring up the topic. I hadn't > > thought of > > that before. Basically, this creates a 'rule' for each table, and > > contigencies for the columns and tables as needed. This also > > serves as a > > place to map out the relationship between an xml file and a database > > structure. The cool thing is that I should be able to take > > just about any > > database & XML pair, create a ruleset file defining the > > relationships & > > contigencies, and it should all work. Although a new xml > > parser would need > > to be created for the xml file holding the data in order to create the > > multidimensional struct the translator object expects. > > > > Right now, I'm to the point where: > > 1. I'm looping through the list of tables from the database object > > 1.1 checking the rules for that table > > 1.1.1 if the rule passes, the insert query happens and returns > > success > > 1.1.2 if the rule does NOT pass, i need to look at a > > different table > > so i go through the process recursively. > > checking table > > rules, > > inserting where possible until all records > > have been saved, > > or, at this point, ad infinitum > > > > I can insert data, and to a certain degree it gets inserted > > correctly, but > > I'm winding up with some corruption of data, which I'm trying > > to pin down. > > Infinite loops are happening right now... Recursion is cool > > when it works. I > > kind of feel like I'm working magic when it happens, but > > until that magical > > point, it's fairly hair raising. > > > > > > > > > > ----- Original Message ----- > > From: "Dan Cech" > > To: "NYPHP Talk" > > Sent: Wednesday, February 11, 2004 1:13 PM > > Subject: Re: [nycphp-talk] Translating XML to SQL > > > > > > > From the work I've done on adodb-xmlschema, I would advise an object > > > oriented approach, it really helps to break up the logic. > > > > > > I would create a class to hold the methods for parsing a > > document, etc, > > > and another class to represent an article. > > > > > > Once you have a class for the article you can build up all > > the article > > > details from the xml, and finally generate and run the SQL > > to insert all > > > the required records. You could also use the class for > > accessing the > > > data once it is in the database.... > > > > > > You may also want to create classes for author, etc which > > could handle > > > the logic for updating/inserting the relevant details into > > those tables. > > > > > > Anyway, it appears you are looking at a procedural solution > > right now, > > > which will work too....honestly I'd have to have more > > details about the > > > specific issues you are working around in order to give you > > any concrete > > > advice. > > > > > > Dan > > > > > > Eric Rank wrote: > > > > I'm working on a PHP app that will translate XML to SQL based on a > > > > configuration file with rules, and as I'm getting to the > > end of this > > > > project, all the quirks and airbubbles (yes, ok, they're BUGS) are > > > > getting squeezed out. And man, it's no fun. So now I'm looking for > > > > solutions that may have been created before me. > > > > > > > > Specifically, the xml contains information from articles > > in a newspaper. > > > > Author, issue, volumne, section, category, headline, > > story, etc. This > > > > xml we get from an export from QuarkXPress (which is its > > own nightmare) > > > > > > > > I'm trying to take this xml structure that contains NO database > > > > specific information and place it into a MySQL database > > with about a > > > > dozen related tables. The trick is that in going through > > an xml file, > > > > there are a lot of contigencies to cover before finally > > reaching the > > > > database. For example, some INSERT statements require the > > inserted id of > > > > a previous insert statement in order to make the records > > relational (eg. > > > > we need to insert the 'story' info into the 'article' > > table to get the > > > > inserted id for the article, which then gets inserted > > into the 'photos' > > > > table in the 'articleID' column.). Some insert statements > > might not need > > > > to happen because the information already exists (eg. an > > author that > > > > already exists in the database). You get the idea. > > > > > > > > Anyone have experience doing this? Is there an open > > source project out > > > > there that's working on this? Third party software even? > > > > > > > > Thanks for your help, > > > > > > > > Eric Rank > > > > > > _______________________________________________ > > > talk mailing list > > > talk at lists.nyphp.org > > > http://lists.nyphp.org/mailman/listinfo/talk > > > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk >From hans not junk at nyphp.com Thu Feb 12 10:38:33 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 0F13EA8628 for ; Thu, 12 Feb 2004 10:38:33 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Session question Date: Thu, 12 Feb 2004 07:38:30 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87772AAD at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Session question Thread-Index: AcPxJHy9pDAV8hSzTQe+pOowrTE7iwAWaxUQ From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2004 15:38:33 -0000 > In createTireImg.php, code like following: > ------- > include ("img_text_config.inc.php"); > include ("tbContent.php"); > session_start( ); > ?> Are you also doing a session_start(); in the other pages? session_start() has to be called at every page, or in a file that is included by all your pages. Also.. > Text color:      >
Name *: $errorMessage[username]
 
I am submitting ... if isset($_POST[lyricstype]) { } else { }

UPLOADFORM; } // End function printForm() -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm From keith at keithjr.net Tue Feb 17 08:34:58 2004 From: keith at keithjr.net (keith at keithjr.net) Date: Tue, 17 Feb 2004 05:34:58 -0800 (PST) Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> Message-ID: <4662.65.211.92.98.1077024898.squirrel@www.keithjr.net> One way that I would do it is break out of the print statement, and then execute the if statement, print the appropriate menu, and then go back into the heredoc. Or you could execute a switch statement before hand, that handles the $_POST variables, and then have a varaible of say $selectstatement set to the appropriate select code that prints out in the heredoc.. so it would be like I am submitting ... $selectstatement
instead of that whole if statement. > Hello, > I wanted to use a heredoc, because it was easy to send out formatted text. > So, I was using this function I created to print out an HTML form and > reuse it on postback. I know that in a heredoc, simple variables can be > resolved. But I ran into a situation where I need to display a different > dropdown depending on the value of this dropdown on postback (or if the > $_POST doesn't exist). > > The example below is what I was trying to do. Instead, PHP displayed the > if statement as text. > > Does anybody have suggestions? I could try to check the dropdown value > outside this function and fill a variable with an HTML string and then > insert in the heredoc. > > Thanks, > Stephen > > ---------------------------- > > function printForm() > { > global $errorMessage; > > echo <<< UPLOADFORM >

* denotes a required field.

> >
enctype="multipart/form-data"> > > > > > > > > > > >
Name *: size="30" value="$_POST[username]" /> $errorMessage[username]
?
> I am submitting ... > if isset($_POST[lyricstype]) > { > > } > else > { > > } >
>
>
> UPLOADFORM; > } // End function printForm() > -- > ___________________________________________________________ > Sign-up for Ads Free at Mail.com > http://promo.mail.com/adsfreejump.htm > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > >From hans not junk at nyphp.com Tue Feb 17 08:38:16 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 27A4AA85E9 for ; Tue, 17 Feb 2004 08:38:16 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Can code be executed in a heredoc? Date: Tue, 17 Feb 2004 05:38:13 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87937411 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Can code be executed in a heredoc? Thread-Index: AcP1FIcAkzkDaI+OQx6RQYP3dK2x8QARmFIQ From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 13:38:16 -0000 > function printForm() > { > global $errorMessage; > =09 > echo <<< UPLOADFORM >

* denotes a required field.

> =09 >
enctype=3D"multipart/form-data"> Personally, I wouldn't use a heredoc for this purpose. Instead, break = out of PHP mode, like so... function printForm() { global $errorMessage; ?>

*denotes a required field.

" method=3D"post" = enctype=3D"multipart/form-data"> .... References: Message-ID: <7147.65.211.92.98.1077025824.squirrel@www.keithjr.net> I am writting my own site management system that sticks all files except for index.php not in the public_html directory, and giving browser-based access to edit files/sections/etc without having to give out ftp access or anything (site with lots of content contributors) - but this is on a dedicated server with multiple sites that use different method of includes... If I would use this method instead of using a global variable for the "content root" would I just do a ini_set("include_path","/home/blahblah/content/"); for each of the sites that is loaded in one of the global include files? or would it be better to have a variable... > On Sat, 14 Feb 2004, Mark Armendariz wrote: > >> But with this set, I can just >> >> include('config.files.php'); >> >> on every page without worrying about where things are so much. > > All hail include_path! This is my personal favorite solution. > > -adam From nyphp at websapp.com Tue Feb 17 09:05:19 2004 From: nyphp at websapp.com (Daniel Kushner) Date: Tue, 17 Feb 2004 09:05:19 -0500 Subject: [nycphp-talk] PHP 4.3.5RC3 has been released for testing Message-ID: <200402171405.i1HE5JqZ004700@ns5.oddcast.com> This will be the last release candidate prior to the final release! http://qa.php.net/ Best, Daniel Kushner From dmintz at davidmintz.org Tue Feb 17 09:52:18 2004 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 17 Feb 2004 09:52:18 -0500 (EST) Subject: [nycphp-talk] 2 more php5 questions ... In-Reply-To: References: <006701c3f480$e3c38a20$6400a8c0@thinkpad> Message-ID: This is one of the Best Damn Threads we've had all month, and we always have good ones. Yahooo. On Mon, 16 Feb 2004, Adam Maccabee Trachtenberg wrote: > > It's tough to create a balance where people who are really into OO can > go object-wild while "regular programmers" can just program and not > worry about all the extra baggage they don't care about. It's wildly ambitious in my humble quasi-lay opinion, and I wish them all the luck in the world. PHP5 looks so Java-like that I sometimes think of it as JHP. OTOH if we can have all that stuff if we want it, and ~still~ write a Hello World in one line (so unlike Java), halleluyah. It's like the best of Perl and Java brought together and optimized to the max for web applications. Yum. (No offense to the Java-haters and Perl-haters intended.) --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From tgales at tgaconnect.com Tue Feb 17 10:10:20 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 17 Feb 2004 10:10:20 -0500 Subject: [nycphp-talk] 2 more php5 questions ... In-Reply-To: Message-ID: <000b01c3f568$29226630$e98d3818@oberon1> If you're into Java this might interest you. "Unfortunately, the current specification has been found to be hard to understand and has subtle, often unintended, implications. Certain synchronization idioms sometimes recommended in books and articles are invalid according to the existing specification..." excerpted from "Memory Model and Thread Specification Revision" http://jcp.org/en/jsr/detail?id=133 T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From mitchy at spacemonkeylabs.com Tue Feb 17 10:32:39 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Tue, 17 Feb 2004 10:32:39 -0500 Subject: [nycphp-talk] 2 more php5 questions ... In-Reply-To: References: <006701c3f480$e3c38a20$6400a8c0@thinkpad> Message-ID: <40323417.9000205@spacemonkeylabs.com> David Mintz wrote: > It's wildly ambitious in my humble quasi-lay opinion, and I wish them all > the luck in the world. PHP5 looks so Java-like that I sometimes think of > it as JHP. OTOH if we can have all that stuff if we want it, and ~still~ > write a Hello World in one line (so unlike Java), halleluyah. It's like > the best of Perl and Java brought together and optimized to the max for > web applications. Yum. (No offense to the Java-haters and Perl-haters > intended.) Oh, that would be python ;^P -- Mitch >From hans not junk at nyphp.com Tue Feb 17 10:42:17 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 9F6D5A85E9 for ; Tue, 17 Feb 2004 10:42:17 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 17 Feb 2004 07:42:15 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87937452 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: PHP 5 WAS: 2 more php5 questions ... Thread-Index: AcP1Zagqq1iDBVrJQTevyFx6YgnJIQABp8EA From: "Hans Zaunere" To: "NYPHP Talk" Subject: [nycphp-talk] PHP 5 WAS: 2 more php5 questions ... X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:42:18 -0000 > This is one of the Best Damn Threads we've had all=20 > month, and we always have good ones. Yahooo. >=20 >=20 > On Mon, 16 Feb 2004, Adam Maccabee Trachtenberg wrote: >=20 > > > > It's tough to create a balance where people who are really into OO can > > go object-wild while "regular programmers" can just program and not > > worry about all the extra baggage they don't care about. >=20 > It's wildly ambitious in my humble quasi-lay opinion, and I=20 > wish them all > the luck in the world. PHP5 looks so Java-like that I=20 > sometimes think of > it as JHP. OTOH if we can have all that stuff if we want it,=20 > and ~still~ > write a Hello World in one line (so unlike Java), halleluyah.=20 I'll just chime in that, at least as far as I understand, this is exactly PHP 5. All the write-a-program-in-5-seconds-and-it-runs-perfectly-because-its-procedura l benefits are still there - and in fact, refined and running better than they did in the past. On the other hand, more intricate OO features are available. I'm for this, too, since it certainly has its place. I'm excited about PHP 5, and frankly, wish I had more time to really play with it (my code over the last 6 months has been PHP 5 "ready" but doesn't take advantage of it). H >From hans not junk at nyphp.com Tue Feb 17 10:45:21 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id E8928A85E9 for ; Tue, 17 Feb 2004 10:45:20 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Include file questions Date: Tue, 17 Feb 2004 07:45:18 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F87937455 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Include file questions Thread-Index: AcP1XPvMw1gUklJZS5OAaNkXv6Ld2gAD/MMg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:45:21 -0000 > I am writting my own site management system that sticks all files except > for index.php not in the public_html directory, and giving browser-based > access to edit files/sections/etc without having to give out ftp access or > anything (site with lots of content contributors) - but this is on a > dedicated server with multiple sites that use different method of > includes... If I would use this method instead of using a global variable > for the "content root" would I just do a > ini_set("include_path","/home/blahblah/content/"); for each of the sites > that is loaded in one of the global include files? or would it be better > to have a variable... I'm heavily in favor or setting the include_path - that's what it's for! Another neat trick, especially if this is a dedicated server, is to use .htaccess to set the include path, on a per directory basis. Of course, I'm a big fan of leveraging Apache to set core aspects of my PHP environment, and use .htaccess, , and directives considerably for this purpose. H From webapprentice at mail.com Tue Feb 17 10:51:06 2004 From: webapprentice at mail.com (webapprentice at mail.com) Date: Tue, 17 Feb 2004 10:51:06 -0500 Subject: Breaking out of PHP mode RE: [nycphp-talk] Can code be executed in a heredoc? Message-ID: <20040217155107.AB71223310@ws1-1.us4.outblaze.com> Just to clarify, if I do this... // HTML HERE Then, the stuff between the PHP blocks is considered part of the function and will only execute when the function is called. Is that correct? If that's the case, then thanks for the tips. I can rewrite this function using these tips. -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm >From hans not junk at nyphp.com Tue Feb 17 10:57:00 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id C59EBA85E9 for ; Tue, 17 Feb 2004 10:56:59 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Breaking out of PHP mode RE: [nycphp-talk] Can code be executed ina heredoc? Date: Tue, 17 Feb 2004 07:56:57 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F8793745C at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Breaking out of PHP mode RE: [nycphp-talk] Can code be executed ina heredoc? Thread-Index: AcP1blhlDbAkYcouQYWluaT4bpp0XAAAEUng From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:57:00 -0000 > Just to clarify, if I do this... >=20 > function printForm() > { >=20 > // CODE > ?> >=20 > // HTML HERE >=20 > =20 > } // end function >=20 > ?> >=20 > Then, the stuff between the PHP blocks is considered part of=20 > the function and will only execute when the function is=20 > called. Is that correct? Correct. Remember, though, that the function is not returning anything... it's going directly out to the browser or output buffer. This has a subtle, but possibly pertinent effect, ie: and H From adam at trachtenberg.com Tue Feb 17 12:01:02 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 17 Feb 2004 12:01:02 -0500 (EST) Subject: [nycphp-talk] 2 more php5 questions ... In-Reply-To: References: <006701c3f480$e3c38a20$6400a8c0@thinkpad> Message-ID: On Tue, 17 Feb 2004, David Mintz wrote: > It's wildly ambitious in my humble quasi-lay opinion, and I wish them all > the luck in the world. PHP5 looks so Java-like that I sometimes think of > it as JHP. OTOH if we can have all that stuff if we want it, and ~still~ > write a Hello World in one line (so unlike Java), halleluyah. We'll see how it turns out. I'm worried that this will create a chasm between first-time developers who are just starting out and the code that's available online that's written by experienced programmers. People will download stuff and have no idea where to even begin to attack it. My biggest problem with PHP 5 is that nobody is really using it. (I don't have any hard numbers on this, just a gut instinct.) In many ways, PHP 4 is "good enough," so people (like Hans) haven't felt the need to switch their codebase over. It'll only be once the community starts writing real applications that we'll see how everything holds together. I suspect it'll take a PHP 5.1 for all the extensions to get onboard and to give us an opportunity to refine the new feature semantics. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From bpang at bpang.com Tue Feb 17 12:08:42 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Tue, 17 Feb 2004 12:08:42 -0500 (EST) Subject: [nycphp-talk] php install, libphp4.so? Message-ID: <.38.117.145.89.1077037722.squirrel@www.bpang.com> I'm having some trouble getting php to install properly on a new system (debian installed via knoppix). This is my first forray into the debian world (former RH user). Using current stable releases of httpd and php and installing as indicated in the manual http://www.php.net/manual/en/install.apache.php with a few extra configure options... full configure statement: ./configure --with-mysql=/usr/local/mysql --with-axps=/www/bin/apxs --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir --with-ttf --with-freetype-dir=/usr/lib --with-t1lib --enable-ftp --enable-exif It's not putting libphp4.so in /www/libexec or anywhere for that matter. So I can't update httpd.conf to AddModule... :( ideas? am I missing something? this worked on a RH system just a few weeks ago thanks, Brian From dmintz at davidmintz.org Tue Feb 17 12:25:07 2004 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 17 Feb 2004 12:25:07 -0500 (EST) Subject: [nycphp-talk] constants vs globals In-Reply-To: <41EE526EC2D3C74286415780D3BA9F87937452@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F87937452@ehost011-1.exch011.intermedia.net> Message-ID: At the PHP conference in New York last spring I remember someone asked Rasmus a question: which is more expensive, accessing a global or defining a constant? He said without hesitation "defining a constant." There was silence for a couple beats, then on to the next question. I've since wondered if that was exactly the right question. For one tihng, the guy who asked didn't specify if he meant "...accessing a global from inside a function." If it's cheaper to access globals PERIOD, then what do we need constants for? OTOH if it's faster/cheaper to *access* a constant than a global, should we use constants *whenever* you have a variable that ain't gonna change and that you want to be globally visible? If *defining* a constant is indeed more expensive than *reading* a global, where's the break-even point (in other words how many times do you need to read the constant to make it more efficient than using a global)? Or is it such a close call that it's mostly a matter of taste and style? My specific case here is, I want to stick some parameterized SQL statements into an included file and avoid hard-coding table/column names all over the place, and pull in the file and use prepare/execute when needed. So once again, I'm thinking, should I say $THIS_SQL = 'select * from foo where boink = ?'; or define('THIS_SQL', 'select * from foo where boink = ?'); "When To Define A Constant" might make a nice Phundies topic. Many TIA, --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From shiflett at php.net Tue Feb 17 12:35:50 2004 From: shiflett at php.net (Chris Shiflett) Date: Tue, 17 Feb 2004 09:35:50 -0800 (PST) Subject: [nycphp-talk] constants vs globals In-Reply-To: Message-ID: <20040217173550.14608.qmail@web14307.mail.yahoo.com> --- David Mintz wrote: > "When To Define A Constant" might make a nice Phundies topic. Or perhaps a different format altogether. It's pretty trivial to write some simple benchmarking code for these types of questions, and people would much rather reference ours (and our results) than write their own. This is similar to what these guys do here: http://www.blueshoes.org/en/developer/php_bench/ I'm not sure what the answer is to your question, by the way. :-) I'm just rambling. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From erank at isthmus.com Tue Feb 17 12:39:21 2004 From: erank at isthmus.com (Eric Rank) Date: Tue, 17 Feb 2004 11:39:21 -0600 Subject: [nycphp-talk] php install, libphp4.so? on debian References: <.38.117.145.89.1077037722.squirrel@www.bpang.com> Message-ID: <009401c3f57c$fa3a2410$8b01a8c0@DB> Hi Brian, I had some trouble building and installing PHP on debian maybe a month and a half ago. I'm fairly new to debian as well (and linux too for that matter), but its starting to warm up on me. Eventually, I did get php to build and install from the source. However, I built it with a new build of apache2 (also from source) and I think this is how it worked: When building apache2 I had to make sure to use the debian installed libtool (/usr/bin/libtool), not the one that came with the new apache2. This was something I had to do in the configuration of the build of apache2. After that, the build and install went just fine. Although, I did find that I had to do a LOT of library installations in order to get the features from php that I wanted. Woody is quite stable, but has a bunch of older libs that the current PHP needed... That was the difficult solution. Here's the easy one: put this line in your /etc/apt/sources.list file. This site has a package of the current version of PHP. deb http://debian.moolfreet.com ./ then do an # apt-get upgrade I think that's all you need to do. Restart apache and you should be set. But keep in mind this advice is coming from a total linux nooobee. It worked for me though. This let me upgrade to PHP 4.3.4 from the 4.1 that installed with the general stable install about a week and a half ago. Check out aptget.org for more non-standard packages you might want. Eric Rank ----- Original Message ----- From: To: Sent: Tuesday, February 17, 2004 11:08 AM Subject: [nycphp-talk] php install, libphp4.so? > I'm having some trouble getting php to install properly on a new system > (debian installed via knoppix). > This is my first forray into the debian world (former RH user). > > Using current stable releases of httpd and php and installing as indicated > in the manual > http://www.php.net/manual/en/install.apache.php > with a few extra configure options... > full configure statement: > ./configure --with-mysql=/usr/local/mysql --with-axps=/www/bin/apxs > --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir > --with-ttf --with-freetype-dir=/usr/lib --with-t1lib --enable-ftp > --enable-exif > > It's not putting libphp4.so in /www/libexec or anywhere for that matter. > > So I can't update httpd.conf to AddModule... :( > > ideas? am I missing something? > this worked on a RH system just a few weeks ago > > thanks, > > Brian > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From bpang at bpang.com Tue Feb 17 13:54:16 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Tue, 17 Feb 2004 13:54:16 -0500 (EST) Subject: [nycphp-talk] php install, libphp4.so? on debian In-Reply-To: <009401c3f57c$fa3a2410$8b01a8c0@DB> References: <.38.117.145.89.1077037722.squirrel@www.bpang.com> <009401c3f57c$fa3a2410$8b01a8c0@DB> Message-ID: <.38.117.145.89.1077044056.squirrel@www.bpang.com> Thanks. I should have specified that I am installing with apache 1.3.29 I also should have noted that I apt-get removed apache, php and mysql from the knoppix dist. I sorta prefer to do a manual install than to install a package. This way I can be sure to get the features that I want (or have no success installing it!!!) :) How did you specify using the debian installed libtool? I haven't been able to see any documentation regarding that. > I had some trouble building and installing PHP on debian maybe a month and > a > half ago. I'm fairly new to debian as well (and linux too for that > matter), > but its starting to warm up on me. Eventually, I did get php to build and > install from the source. However, I built it with a new build of apache2 > (also from source) and I think this is how it worked: > > When building apache2 I had to make sure to use the debian installed > libtool > (/usr/bin/libtool), not the one that came with the new apache2. This was > something I had to do in the configuration of the build of apache2. After > that, the build and install went just fine. Although, I did find that I > > > ----- Original Message ----- >> Using current stable releases of httpd and php and installing as >> indicated >> in the manual >> http://www.php.net/manual/en/install.apache.php >> with a few extra configure options... >> full configure statement: >> ./configure --with-mysql=/usr/local/mysql --with-axps=/www/bin/apxs >> --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir >> --with-ttf --with-freetype-dir=/usr/lib --with-t1lib --enable-ftp >> --enable-exif >> >> It's not putting libphp4.so in /www/libexec or anywhere for that matter. >> >> So I can't update httpd.conf to AddModule... :( From webapprentice at mail.com Tue Feb 17 13:42:33 2004 From: webapprentice at mail.com (webapprentice at mail.com) Date: Tue, 17 Feb 2004 13:42:33 -0500 Subject: [nycphp-talk] RE: Breaking out of PHP mode? (Can code be executed in heredoc?) Message-ID: <20040217184234.C95C81E6C65@ws1-4.us4.outblaze.com> Hi Hans, Thanks for the tip. I am aware of this, so I do have another part of this PHP page that will call this function. I just wanted to make sure that as the PHP is loading, that this code between the PHP blocks doesn't automatically sent to the output stream until I call it. --Stephen > Message: 6 > Date: Tue, 17 Feb 2004 07:56:57 -0800 > From: "Hans Zaunere" > Subject: RE: Breaking out of PHP mode RE: [nycphp-talk] Can code be > executed ina heredoc? > To: "NYPHP Talk" > Message-ID: > <41EE526EC2D3C74286415780D3BA9F8793745C at ehost011-1.exch011.intermedia.net> > > Content-Type: text/plain; charset="us-ascii" > > > > Just to clarify, if I do this... > > > > > function printForm() > > { > > > > // CODE > > ?> > > > > // HTML HERE > > > > > > > } // end function > > > > ?> > > > > Then, the stuff between the PHP blocks is considered part of > > the function and will only execute when the function is > > called. Is that correct? > > Correct. > > Remember, though, that the function is not returning anything... it's > going directly out to the browser or output buffer. This has a subtle, > but possibly pertinent effect, ie: > > > > and > > -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm From erank at isthmus.com Tue Feb 17 14:44:40 2004 From: erank at isthmus.com (Eric Rank) Date: Tue, 17 Feb 2004 13:44:40 -0600 Subject: [nycphp-talk] php install, libphp4.so? on debian References: <.38.117.145.89.1077037722.squirrel@www.bpang.com> <009401c3f57c$fa3a2410$8b01a8c0@DB> <.38.117.145.89.1077044056.squirrel@www.bpang.com> Message-ID: <00fb01c3f58e$7bc2c8f0$8b01a8c0@DB> Shoot, I was afraid you were going to make me remember what the details were... I just took a look at the configuration log files and I can't find anything helpful. So instead here's what I remember. It was a sunday afternoon, and there were many ./configure , make, makeinstall commands typed at the console. I kept getting errors at the 'make install' of php4 relating to the apxs of apache. I googled the error and searched the mailing list postings that resulted. Eventually, I remember finding something related to libtool. I also remember choosing to use the /usr/bin/libtool instead of the apache2 version, but I can't remember at what point, what for, or where I made the configuration change. Nothing I have gives me any indication of what I did. I should have been taking notes! Now *I* want to know. Sorry this isn't more help. That's all I got. If I remember, I'll get back to you. Eric. ----- Original Message ----- From: To: "NYPHP Talk" Sent: Tuesday, February 17, 2004 12:54 PM Subject: Re: [nycphp-talk] php install, libphp4.so? on debian > Thanks. > I should have specified that I am installing with apache 1.3.29 > I also should have noted that I apt-get removed apache, php and mysql from > the knoppix dist. > > I sorta prefer to do a manual install than to install a package. This way > I can be sure to get the features that I want (or have no success > installing it!!!) :) > > How did you specify using the debian installed libtool? I haven't been > able to see any documentation regarding that. > > > > > I had some trouble building and installing PHP on debian maybe a month and > > a > > half ago. I'm fairly new to debian as well (and linux too for that > > matter), > > but its starting to warm up on me. Eventually, I did get php to build and > > install from the source. However, I built it with a new build of apache2 > > (also from source) and I think this is how it worked: > > > > When building apache2 I had to make sure to use the debian installed > > libtool > > (/usr/bin/libtool), not the one that came with the new apache2. This was > > something I had to do in the configuration of the build of apache2. After > > that, the build and install went just fine. Although, I did find that I > > > > > > ----- Original Message ----- > >> Using current stable releases of httpd and php and installing as > >> indicated > >> in the manual > >> http://www.php.net/manual/en/install.apache.php > >> with a few extra configure options... > >> full configure statement: > >> ./configure --with-mysql=/usr/local/mysql --with-axps=/www/bin/apxs > >> --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir > >> --with-ttf --with-freetype-dir=/usr/lib --with-t1lib --enable-ftp > >> --enable-exif > >> > >> It's not putting libphp4.so in /www/libexec or anywhere for that matter. > >> > >> So I can't update httpd.conf to AddModule... :( > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From bpang at bpang.com Tue Feb 17 14:54:00 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Tue, 17 Feb 2004 14:54:00 -0500 (EST) Subject: [nycphp-talk] php install, libphp4.so? on debian In-Reply-To: <00fb01c3f58e$7bc2c8f0$8b01a8c0@DB> References: <.38.117.145.89.1077037722.squirrel@www.bpang.com><009401c3f57c$fa3a24 10$8b01a8c0@DB><.38.117.145.89.1077044056.squirrel@www.bpang.com> <00fb01c3f58e$7bc2c8f0$8b01a8c0@DB> Message-ID: <.38.117.145.89.1077047640.squirrel@www.bpang.com> haha... I know what you mean. Half the time I figure stuff out, I forget to write it down,,, or I think I've finally learned something and it's so important, how could I possibly allow myself to forget it! I installed using apt-get, partly to see what the ./configure options are via phpinfo(). I don't necessarily like it as it's full of crap I don't particularly need... also there are some weirdnesses in it.. like --with-apxs=/usr/bin/apxs but apxs is not in /usr/bin also not showing mysql info in phpinfo(), but, I didn't install mysql via apt-get.. is that a no-no when using apt-get? maybe I'll trash the whole thing and try XAMPP instead, but I really would like to install the old-fashioned way. > Shoot, I was afraid you were going to make me remember what the details > were... > > I should have been taking notes! Now *I* want to know. > From nyphp at websapp.com Tue Feb 17 14:58:10 2004 From: nyphp at websapp.com (Daniel Kushner) Date: Tue, 17 Feb 2004 14:58:10 -0500 Subject: [nycphp-talk] Zend Survey Message-ID: <200402171958.i1HJwAqZ022019@ns5.oddcast.com> Hey NYPHP, Zend is doing a survey and giving out 3 free Zend Studios.... http://www.zoomerang.com/survey.zgi?L223827SZ7CVWWRPNEGX9JPM --Daniel From erank at isthmus.com Tue Feb 17 15:14:03 2004 From: erank at isthmus.com (Eric Rank) Date: Tue, 17 Feb 2004 14:14:03 -0600 Subject: [nycphp-talk] php install, libphp4.so? on debian References: <.38.117.145.89.1077037722.squirrel@www.bpang.com><009401c3f57c$fa3a2410$8b01a8c0@DB><.38.117.145.89.1077044056.squirrel@www.bpang.com> <00fb01c3f58e$7bc2c8f0$8b01a8c0@DB> <.38.117.145.89.1077047640.squirrel@www.bpang.com> Message-ID: <011101c3f592$96925a70$8b01a8c0@DB> Yeah, apt-get is, eh hem, smart enough to install mysql support only if it sees that it installed mysql too. > > also not showing mysql info in phpinfo(), but, I didn't install mysql via > apt-get.. is that a no-no when using apt-get? > > maybe I'll trash the whole thing and try XAMPP instead, but I really would > like to install the old-fashioned way. > > > > > Shoot, I was afraid you were going to make me remember what the details > > were... > > > > I should have been taking notes! Now *I* want to know. > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From jonbaer at jonbaer.net Tue Feb 17 18:34:10 2004 From: jonbaer at jonbaer.net (jon baer) Date: Tue, 17 Feb 2004 18:34:10 -0500 Subject: [nycphp-talk] 2 more php5 questions ... References: <006701c3f480$e3c38a20$6400a8c0@thinkpad> Message-ID: <011b01c3f5ae$8b335e60$6400a8c0@thinkpad> > My biggest problem with PHP 5 is that nobody is really using it. (I > don't have any hard numbers on this, just a gut instinct.) In many > ways, PHP 4 is "good enough," so people (like Hans) haven't felt the > need to switch their codebase over. i highly doubt that ... im sure when a final PHP 5.0 is available people will flock and install it, its when you have a change log a mile long with each release that people get worried, in fact JSP was pretty much like that, the spec stayed inside Sun for sooooooooo long and people were eager to use the new features ... plus Im sure nyphp.org will be the first site to showcase cool stuff w/ PHP5 ;-) - jon From adam at trachtenberg.com Tue Feb 17 19:02:58 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 17 Feb 2004 19:02:58 -0500 (EST) Subject: [nycphp-talk] 2 more php5 questions ... In-Reply-To: <011b01c3f5ae$8b335e60$6400a8c0@thinkpad> References: <006701c3f480$e3c38a20$6400a8c0@thinkpad> <011b01c3f5ae$8b335e60$6400a8c0@thinkpad> Message-ID: On Tue, 17 Feb 2004, jon baer wrote: > > My biggest problem with PHP 5 is that nobody is really using it. (I > > don't have any hard numbers on this, just a gut instinct.) In many > > ways, PHP 4 is "good enough," so people (like Hans) haven't felt the > > need to switch their codebase over. > > i highly doubt that ... im sure when a final PHP 5.0 is available people > will flock and install it, its when you have a change log a mile long with > each release that people get worried, in fact JSP was pretty much like that, > the spec stayed inside Sun for sooooooooo long and people were eager to use > the new features ... plus Im sure nyphp.org will be the first site to > showcase cool stuff w/ PHP5 ;-) This is exactly my point. There are a lot of changes in PHP 5, but they're not getting any real-life field testing before PHP 5 goes final. This worries me because the time to find the big mistakes is during the Beta period. (Or earlier, of course.) IMHO, this is the biggest change to PHP since Ramsus combined PHP and FI to create PHP/FI (aka PHP 2.). PHP 3 was pretty much PHP 2 with a better parser and the ability to more easily write extensions (and minor psuedo-object support). PHP 4 was PHP 3 with a better parser. PHP 5 is PHP 4 + Real Objects + Exceptions + Interfaces + Rewritten MySQL extension + All new XML extensions. In other words, this is the first version of the language that adds lots of language-level features instead of just concentrating on behind-the-scenes improvements. (Well, except for PHP 3 changing the string concatenation operator to "." from "+".) There's a lot of new stuff and all of the changes materially affect your code. For instance, do you know that you: 1) Can't run PHP 4 and PHP 5 on the same web server? 2) Need to port all your DOM and XSLT code to use it in PHP 5? 3a) Can *only* use the new MySQL extension, mysqli, with MySQL >= 4.1? 3b) Can *only* use the old MySQL extenion, mysql, with MySQL <= 4.0? 3c) The mysqli extension eliminates (and changes) some functions from mysql, so porting code isn't just s/mysql/mysqli/g? 3d) Neither set of MySQL libraries are bundled anymore with PHP, so you need to install these yourself? PHP 5 has lots of cool new toys, but the transition process will mean that you can't necessarily download some PHP 4 (or even PHP 5) code and start using it because, for example, you're still running MySQL 4.0 and haven't yet upgraded because you don't want to modify your PHP code. (And don't want to run two databases and two web servers.) I don't want to sound negative because I think PHP 5 is really cool. It's just that I wish more people were out there because I want the new features to get some heavy duty stress testing. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From ksmith at centricle.com Tue Feb 17 22:08:39 2004 From: ksmith at centricle.com (kevin c smith) Date: Tue, 17 Feb 2004 22:08:39 -0500 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> Message-ID: On 2004-02-17 @ 12:11 AM -0500, webapprentice at mail.com wrote: > The example below is what I was trying to do. Instead, PHP > displayed the if statement as text. Weird. The following gives me a parse error, not the literal text: ...but, this displays the contents of $PHP_SELF: Aside from personal preference, is there a compelling reason to kick back out to HTML, as Hans suggests? -- kevin c smith http://centricle.com From bpang at bpang.com Tue Feb 17 23:28:51 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Tue, 17 Feb 2004 23:28:51 -0500 (EST) Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> Message-ID: <.38.117.145.89.1077078531.squirrel@www.bpang.com> not having to escape all your quotes in echos? echo "Link text"; > Aside from personal preference, is there a compelling reason to kick > back out to HTML, as Hans suggests? From dan at cain.sh Tue Feb 17 23:52:49 2004 From: dan at cain.sh (Daniel J Cain Jr.) Date: Tue, 17 Feb 2004 22:52:49 -0600 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <.38.117.145.89.1077078531.squirrel@www.bpang.com> References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> <.38.117.145.89.1077078531.squirrel@www.bpang.com> Message-ID: <1077079968.85995.17.camel@gigabeast.home.cain.sh> Is it bad form to use the format below? Instead of escaping all double quotes to use single quotes for the tag attributes. echo "Link Test"; On Tue, 2004-02-17 at 22:28, wrote: > not having to escape all your quotes in echos? > > echo "Link text"; > > > > Aside from personal preference, is there a compelling reason to kick > > back out to HTML, as Hans suggests? > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From adam at trachtenberg.com Tue Feb 17 23:58:48 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Tue, 17 Feb 2004 23:58:48 -0500 (EST) Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <1077079968.85995.17.camel@gigabeast.home.cain.sh> References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> <.38.117.145.89.1077078531.squirrel@www.bpang.com> <1077079968.85995.17.camel@gigabeast.home.cain.sh> Message-ID: On Tue, 17 Feb 2004, Daniel J Cain Jr. wrote: > Is it bad form to use the format below? Instead of escaping all double > quotes to use single quotes for the tag attributes. > > echo "Link Test"; While that is technically legal HTML, until someone can prove it to me otherwise, I've never trusted that some stupid browser won't barf on it. For XML, I'm willing to do this, since I usually have control over the parser and I'm willing to trust (for some reason) that XML parsers get this right. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From dcech at phpwerx.net Wed Feb 18 00:27:46 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 18 Feb 2004 00:27:46 -0500 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> <.38.117.145.89.1077078531.squirrel@www.bpang.com> <1077079968.85995.17.camel@gigabeast.home.cain.sh> Message-ID: <4032F7D2.20403@phpwerx.net> Adam Maccabee Trachtenberg wrote: > On Tue, 17 Feb 2004, Daniel J Cain Jr. wrote: > >>Is it bad form to use the format below? Instead of escaping all double >>quotes to use single quotes for the tag attributes. >> >>echo "Link Test"; > > While that is technically legal HTML, until someone can prove it to me > otherwise, I've never trusted that some stupid browser won't barf on > it. The term 'technically legal HTML' is about as broad as you can get, but yes it is more or less acceptable. However the convention is to use double-quotes to enclose attribute values in html/xhtml/xml. Personally I prefer to use either a string concatenation or a sprintf method rather than embedding variables in double quoted strings in php, as to my mind it makes it much more apparent where the variables are. For the example above, compare: $link = 'http://www.nyphp.org'; echo "Link Test"; echo 'Link Test'; printf ('Link Test', $link); Usually I use the second syntax, occasionally the third (especially if I were doing a loop), and almost never the first. > For XML, I'm willing to do this, since I usually have control over the > parser and I'm willing to trust (for some reason) that XML parsers get > this right. I can't really comment on how xml parsers would handle this, the w3c specs (at first glance) don't seem to specify the exact quoting method which is 'valid', but here again the generally accepted norm seems to be double-quotes. Dan From bpang at bpang.com Wed Feb 18 00:36:48 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Wed, 18 Feb 2004 00:36:48 -0500 (EST) Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <1077079968.85995.17.camel@gigabeast.home.cain.sh> References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com><.38.117.145.89.1077078531.squ irrel@www.bpang.com> <1077079968.85995.17.camel@gigabeast.home.cain.sh> Message-ID: <.38.117.145.89.1077082608.squirrel@www.bpang.com> I think it's acceptable... or at least it does work. but when you encounter an img alt tag with an apostrophe you will have to escape that... echo "brian\"; > Is it bad form to use the format below? Instead of escaping all double > quotes to use single quotes for the tag attributes. > > echo "Link Test"; > > On Tue, 2004-02-17 at 22:28, wrote: >> not having to escape all your quotes in echos? >> >> echo "Link text"; >> >> >> > Aside from personal preference, is there a compelling reason to kick >> > back out to HTML, as Hans suggests? >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From adam at trachtenberg.com Wed Feb 18 01:25:19 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Wed, 18 Feb 2004 01:25:19 -0500 (EST) Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <4032F7D2.20403@phpwerx.net> References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> <.38.117.145.89.1077078531.squirrel@www.bpang.com> <1077079968.85995.17.camel@gigabeast.home.cain.sh> <4032F7D2.20403@phpwerx.net> Message-ID: On Wed, 18 Feb 2004, Dan Cech wrote: > Adam Maccabee Trachtenberg wrote: > > On Tue, 17 Feb 2004, Daniel J Cain Jr. wrote: > > > >>Is it bad form to use the format below? Instead of escaping all double > >>quotes to use single quotes for the tag attributes. > >> > >>echo "Link Test"; > > > > While that is technically legal HTML, until someone can prove it to me > > otherwise, I've never trusted that some stupid browser won't barf on > > it. > > The term 'technically legal HTML' is about as broad as you can get, but > yes it is more or less acceptable. However the convention is to use > double-quotes to enclose attribute values in html/xhtml/xml. Define "more or less acceptable." All I'm saying that the specification allows it (hell, it even allows you to omit quotation marks of any sort in some cases), but that I don't trust that UAs correctly implement the spec. http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2 Whether the convention is to use double quotes or single quotes is a different issue. > > For XML, I'm willing to do this, since I usually have control over the > > parser and I'm willing to trust (for some reason) that XML parsers get > > this right. > > I can't really comment on how xml parsers would handle this, the w3c > specs (at first glance) don't seem to specify the exact quoting method > which is 'valid', but here again the generally accepted norm seems to be > double-quotes. Huh? It's pretty clear (or as clear as W3C specs get): http://www.w3.org/TR/2004/REC-xml-20040204/ Literal data is any quoted string not containing the quotation mark used as a delimiter for that string. Literals are used for specifying the content of internal entities (EntityValue), the values of attributes (AttValue), and external identifiers (SystemLiteral). Note that a SystemLiteral can be parsed without scanning for markup. Literals [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' | "'" ([^%&'] | PEReference | Reference)* "'" [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] Like I said, if you squint you can see that you can use single or double quotes. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From csnyder at chxo.com Wed Feb 18 02:12:26 2004 From: csnyder at chxo.com (Chris Snyder) Date: Wed, 18 Feb 2004 02:12:26 -0500 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> <.38.117.145.89.1077078531.squirrel@www.bpang.com> <1077079968.85995.17.camel@gigabeast.home.cain.sh> <4032F7D2.20403@phpwerx.net> Message-ID: <4033105A.6050102@chxo.com> Adam Maccabee Trachtenberg wrote: >Like I said, if you squint you can see that you can use single or >double quotes. > > And let's face it, single quotes are easier to type. From adam at trachtenberg.com Wed Feb 18 02:23:05 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Wed, 18 Feb 2004 02:23:05 -0500 (EST) Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <4033105A.6050102@chxo.com> References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> <.38.117.145.89.1077078531.squirrel@www.bpang.com> <1077079968.85995.17.camel@gigabeast.home.cain.sh> <4032F7D2.20403@phpwerx.net> <4033105A.6050102@chxo.com> Message-ID: On Wed, 18 Feb 2004, Chris Snyder wrote: > Adam Maccabee Trachtenberg wrote: > > >Like I said, if you squint you can see that you can use single or > >double quotes. > > > > And let's face it, single quotes are easier to type. Right. Half as much work. Unless, of course, you're using Unicode. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From danielc at analysisandsolutions.com Wed Feb 18 03:03:30 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 18 Feb 2004 03:03:30 -0500 Subject: [nycphp-talk] installing mysql 4.1 (windows) Message-ID: <20040218080330.GA20276@panix.com> Hi Folks: My Win2k test box is currently running MySQL 4.0.x. I also want to be able to run MySQL 4.1.x at the same time, though solely for testing purposes. I'm making progress. Got the server installed. Some important points were: 1) editing my.cnf to utilize the new mysqld- section syntax and altering the relevant settings there... [mysqld-4.0] port=3306 basedir=c:/progra~1/mysql/ ... etc ... [mysqld-4.1] port=3307 basedir=c:/progra~1/mysql41/ ... snip ... 2) Installing the service under a different name: mysqld-max-nt --install mysql41 Okay, now the trick is getting it to work with PHP. I've got a recent snapshot of PHP 5. Seems the mysqli extension isn't built in (though the mysql extension is). So, am I going to have to compile PHP from scratch to get this functionality? Saw the PHP docs for mysqli say Note: The mysqli extension is designed to work with the version 4.1.2 or above of MySQL. For previous versions, please see the MySQL extension documentation. Is that right? 4.1.2 isn't out. I just tried connecting to 4.1.1 using mysql_connect(). In order to get it to work,[1] I had to update the Password column in the user table to "old_password(Password)." Well, this is well and good, but I really need to be testing the mysqli extension. Any leads to getting mysqli working are welcome. Thanks, --Dan [1] The initial attempts to connect via mysql_connect() failed: "Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jonbaer at jonbaer.net Wed Feb 18 03:15:21 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 18 Feb 2004 03:15:21 -0500 Subject: [nycphp-talk] installing mysql 4.1 (windows) References: <20040218080330.GA20276@panix.com> Message-ID: <025b01c3f5f7$5a6d36e0$6400a8c0@thinkpad> did u try to grab the snap here: http://snaps.php.net/~edink/php_mysqli.dll i got this but haven't tried it out yet, maybe u will have better luck. - jon ----- Original Message ----- From: "Daniel Convissor" To: "NYPHP Talk" Sent: Wednesday, February 18, 2004 3:03 AM Subject: [nycphp-talk] installing mysql 4.1 (windows) > Hi Folks: > > My Win2k test box is currently running MySQL 4.0.x. I also want to be > able to run MySQL 4.1.x at the same time, though solely for testing > purposes. From adam at trachtenberg.com Wed Feb 18 03:27:06 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Wed, 18 Feb 2004 03:27:06 -0500 (EST) Subject: [nycphp-talk] installing mysql 4.1 (windows) In-Reply-To: <20040218080330.GA20276@panix.com> References: <20040218080330.GA20276@panix.com> Message-ID: On Wed, 18 Feb 2004, Daniel Convissor wrote: > Okay, now the trick is getting it to work with PHP. I've got a recent > snapshot of PHP 5. Seems the mysqli extension isn't built in (though the > mysql extension is). So, am I going to have to compile PHP from scratch > to get this functionality? As of MySQL 4.1, the MySQL client libaries are GPLed, so it is *illegal* for PHP to bundle them due to license issues. (PHP is not GPLed.) For all I know right now, due to MySQL's super loose interpretation of the GPL, even using MySQL 4.1 in your PHP application makes it GPLed. (I will let others field that, see http://www.omniti.com/~jesus/scriptures/archives/000111.html#more for one view.) Anyway, it does mean you need link PHP and MySQL yourself. On Unix (at least Mac OS X), this requires downloading MySQL and doing something like this: --with-mysqli=/usr/local/mysql/bin/mysql_config Note that this is different than what you'd need to pass to use the mysql extension. I believe mysql_config may be new to MySQL 4.1. Since I never use Windows, you're on your own to determine whether this means you need to rebuild PHP, but I'm guessing the answer is yes. Hopefully, Wez's super-kool build system will know how to do this. :) I am also interested in learning if this means that it is illegal for people to distribute PHP binaries with build-in MySQL support and packaged AMP installers, either for Windows or Unix. I think the answer may be yes. If so, I think MySQL is really shooting themselves in the foot with the GPL. Must talk to Zak. > Saw the PHP docs for mysqli say > > Note: The mysqli extension is designed to work with the version 4.1.2 > or above of MySQL. For previous versions, please see the MySQL > extension documentation. > > Is that right? 4.1.2 isn't out. I just tried connecting to 4.1.1 using > mysql_connect(). In order to get it to work,[1] I had to update the > Password column in the user table to "old_password(Password)." Well, this > is well and good, but I really need to be testing the mysqli extension. 4.1.2 is correct. According to the MySQL folks, you should be using the latest bit keeper! (Yes, that's right, they don't use CVS.) I am currently avoiding problem by downloading snapshots from http://downloads.mysql.com/snapshots.php. (Don't want to install bit keeper or upgrade auto tools / bison.) Note that you cannot (currently) use MySQL 5.0 because not all of the MySQL 4.1.x changes have been merged into that trunk. This was as of last week, at least, when I last e-mailed by Georg; however, he said that Monty promised to merge these changes "soon." > Any leads to getting mysqli working are welcome. Good luck. :) > [1] The initial attempts to connect via mysql_connect() failed: > "Client does not support authentication protocol > requested by server. Consider upgrading MySQL client" Gah! No you **MUST** use mysqli to talk to MySQL 4.1 databases if you want to use any of the special features like bound parameters. You CANNOT use mysql with MySQL >= 4.1.2 and CANNOT use mysqli with MySQL <= 4.0.x. (And you cannot use MySQL 4.1.0 and 4.1.1 at all with PHP.) I don't know if your old_password() trick works completely, but it will probably bork other unknown things. I would guess that the MySQL folks would consider this a nasty hack. Of course, if it does work 100%, I will be pleasantly happy and will want to know about this. :) -adam PS: Please let me know if bound output parameters work correctly with integers. Right now it is busted on my machine, but I don't know if this is a fault with my set up or the extension. PPS: This is what I mean by the fact that nobody is using PHP 5. :) -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From adam at trachtenberg.com Wed Feb 18 03:34:00 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Wed, 18 Feb 2004 03:34:00 -0500 (EST) Subject: [nycphp-talk] installing mysql 4.1 (windows) In-Reply-To: <025b01c3f5f7$5a6d36e0$6400a8c0@thinkpad> References: <20040218080330.GA20276@panix.com> <025b01c3f5f7$5a6d36e0$6400a8c0@thinkpad> Message-ID: On Wed, 18 Feb 2004, jon baer wrote: > did u try to grab the snap here: > > http://snaps.php.net/~edink/php_mysqli.dll > > i got this but haven't tried it out yet, maybe u will have better luck. This may work, but I honestly don't know if it's legal to distribute this. I'm not a GPL guru, but I think this would contain linked in MySQL headers and other files that are GPLed, making this GPLed. The separation between this and just bundling the DLL with PHP seems small. I will try and discover the answer. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From danielc at analysisandsolutions.com Wed Feb 18 03:40:15 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 18 Feb 2004 03:40:15 -0500 Subject: [nycphp-talk] installing mysql 4.1 (windows) In-Reply-To: References: <20040218080330.GA20276@panix.com> Message-ID: <20040218084015.GA23358@panix.com> Howdy Adam: Thanks for the loads of good info. On Wed, Feb 18, 2004 at 03:27:06AM -0500, Adam Maccabee Trachtenberg wrote: > > As of MySQL 4.1, the MySQL client libaries are GPLed, so it is > *illegal* for PHP to bundle them due to license issues. Yeah. Familliar with that whole rigamarole. Good point, though. Fortuantely for Windows PHP users, the mysql extension comes ready to roll in PHP 5. > Hopefully, Wez's super-kool build system will know how to do > this. :) Unfortunately, haven't been able to get it to work for me. > http://downloads.mysql.com/snapshots.php Oh, that's handy! > Gah! No you **MUST** use mysqli to talk to MySQL 4.1 databases if you > want to use any of the special features like bound parameters. Yeah. I'm not worried about that at this point, though. > You CANNOT use mysql with MySQL >= 4.1.2 and CANNOT use mysqli with > MySQL <= 4.0.x. (And you cannot use MySQL 4.1.0 and 4.1.1 at all with PHP.) > > I don't know if your old_password() trick works completely, but it > will probably bork other unknown things. I would guess that the MySQL > folks would consider this a nasty hack. Of course, if it does work > 100%, I will be pleasantly happy and will want to know about this. :) Well, I can't say 100%, but at least it passes the PEAR DB test suite -- barring the PHP 5 object bugs we were discussing the other day. Enjoy, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Wed Feb 18 03:54:57 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 18 Feb 2004 03:54:57 -0500 Subject: [nycphp-talk] installing mysql 4.1 (windows) In-Reply-To: <025b01c3f5f7$5a6d36e0$6400a8c0@thinkpad> References: <20040218080330.GA20276@panix.com> <025b01c3f5f7$5a6d36e0$6400a8c0@thinkpad> Message-ID: <20040218085457.GA24257@panix.com> Hi Jon: On Wed, Feb 18, 2004 at 03:15:21AM -0500, jon baer wrote: > > http://snaps.php.net/~edink/php_mysqli.dll Nice! Doesn't work though. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From adam at trachtenberg.com Wed Feb 18 03:58:10 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Wed, 18 Feb 2004 03:58:10 -0500 (EST) Subject: [nycphp-talk] installing mysql 4.1 (windows) In-Reply-To: <20040218084015.GA23358@panix.com> References: <20040218080330.GA20276@panix.com> <20040218084015.GA23358@panix.com> Message-ID: On Wed, 18 Feb 2004, Daniel Convissor wrote: > On Wed, Feb 18, 2004 at 03:27:06AM -0500, Adam Maccabee Trachtenberg wrote: > > > > As of MySQL 4.1, the MySQL client libaries are GPLed, so it is > > *illegal* for PHP to bundle them due to license issues. > > Yeah. Familliar with that whole rigamarole. Good point, though. > Fortuantely for Windows PHP users, the mysql extension comes ready to roll > in PHP 5. The mysql extension should still be okay, since it's not GPLed. I just e-mailed Zak to try and learn more about the mysqli extension. I don't think that can be bundled with PHP 5, nor is it legal to provide a pre-built binary. (I think this is why they have the LGPL.) However, I am not a GPL guru, so if others are, I'm open to learning more. (Note GPL *gurus only* need reply.) > > You CANNOT use mysql with MySQL >= 4.1.2 and CANNOT use mysqli with > > MySQL <= 4.0.x. (And you cannot use MySQL 4.1.0 and 4.1.1 at all with PHP.) > > > > I don't know if your old_password() trick works completely, but it > > will probably bork other unknown things. I would guess that the MySQL > > folks would consider this a nasty hack. Of course, if it does work > > 100%, I will be pleasantly happy and will want to know about this. :) > > Well, I can't say 100%, but at least it passes the PEAR DB test suite -- > barring the PHP 5 object bugs we were discussing the other day. But doing this would proclude me from using a MySQL 4.1 client with that account, right? Because now the passwords won't match. Still, it would be a way for people to migrate off of MySQL 3.x/4.0 to 4.1/5.0 without porting from mysql to mysqli. You'd just make a second account for the mysqli connection. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From danielc at analysisandsolutions.com Wed Feb 18 04:04:44 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 18 Feb 2004 04:04:44 -0500 Subject: [nycphp-talk] installing mysql 4.1 (windows) In-Reply-To: References: <20040218080330.GA20276@panix.com> <20040218084015.GA23358@panix.com> Message-ID: <20040218090444.GA24734@panix.com> Hola Senor: On Wed, Feb 18, 2004 at 03:58:10AM -0500, Adam Maccabee Trachtenberg wrote: > > would be a way for people to migrate off of MySQL 3.x/4.0 to 4.1/5.0 > without porting from mysql to mysqli. You'd just make a second account > for the mysqli connection. Exactly. Not sure about other versions, but I can say is it works with 4.1.1a-alpha. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From tgales at tgaconnect.com Wed Feb 18 06:02:35 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 18 Feb 2004 06:02:35 -0500 Subject: [nycphp-talk] installing mysql 4.1 (windows) In-Reply-To: Message-ID: <000601c3f60e$b70e5250$e98d3818@oberon1> Adam Trachtenberg writes: " But doing this would proclude me from using a MySQL 4.1 client with that account, right?" It seems to me that 4.1 is able to understand the shorter passwords. It looks like the asterisk in the password plays an important part here. (I haven't verified this by looking at any code) I think that the 4.1 client will take a look at the first character of the password and if it sees an asterisk, it knows it is going to be working with the new (41 byte) password otherwise it uses the old (16 byte) style password. I have a 4.1.1 alpha MySQL database for testing. (running on Windows XP) If I login from the command line, I can use a username with a short password or a username with a long password and see the (same) data in my tables. In terms of migrating from 3.x.x I got the impression that you are supposed to use '--old-passwords' instead of making different accounts. This is because if the 3.x.x account user changes his password it will be unreadable (being 41 bytes long). T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From dcech at phpwerx.net Wed Feb 18 08:49:49 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 18 Feb 2004 08:49:49 -0500 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> <.38.117.145.89.1077078531.squirrel@www.bpang.com> <1077079968.85995.17.camel@gigabeast.home.cain.sh> <4032F7D2.20403@phpwerx.net> Message-ID: <40336D7D.5070701@phpwerx.net> Adam Maccabee Trachtenberg wrote: > On Wed, 18 Feb 2004, Dan Cech wrote: > >>Adam Maccabee Trachtenberg wrote: >> >>>On Tue, 17 Feb 2004, Daniel J Cain Jr. wrote: >>> >>>>Is it bad form to use the format below? Instead of escaping all double >>>>quotes to use single quotes for the tag attributes. >>>> >>>>echo "Link Test"; >>> >>>While that is technically legal HTML, until someone can prove it to me >>>otherwise, I've never trusted that some stupid browser won't barf on >>>it. >> >>The term 'technically legal HTML' is about as broad as you can get, but >>yes it is more or less acceptable. However the convention is to use >>double-quotes to enclose attribute values in html/xhtml/xml. > > Define "more or less acceptable." > > All I'm saying that the specification allows it (hell, it even allows > you to omit quotation marks of any sort in some cases), but that I > don't trust that UAs correctly implement the spec. > > http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2 > > Whether the convention is to use double quotes or single quotes is a > different issue. Indeed, you are correct in that specification allows it, my point was that depending on whether you interpret 'HTML' as HTML 3.2, 4.0, 4.01, XHTML 1.0, or any of the flavours thereof, what is 'technically legal' can vary quite widely. What I meant by 'more or less acceptable' is that while the (HTML 4.01) specs do allow it, but the convention seems to be to use double-quotes, and as you pointed out this has the greatest chance of being interpreted correctly by the majority of browsers. The other thing I wanted to mention was that whatever style of quotes are used, they should be used consistently. Mixing different quoting styles in your documents isn't as nasty as mixing upper and lower-case tags in HTML, but it's close. >>>For XML, I'm willing to do this, since I usually have control over the >>>parser and I'm willing to trust (for some reason) that XML parsers get >>>this right. >> >>I can't really comment on how xml parsers would handle this, the w3c >>specs (at first glance) don't seem to specify the exact quoting method >>which is 'valid', but here again the generally accepted norm seems to be >>double-quotes. > > Huh? It's pretty clear (or as clear as W3C specs get): > > http://www.w3.org/TR/2004/REC-xml-20040204/ > > Literal data is any quoted string not containing the quotation mark > used as a delimiter for that string. Literals are used for specifying > the content of internal entities (EntityValue), the values of > attributes (AttValue), and external identifiers (SystemLiteral). Note > that a SystemLiteral can be parsed without scanning for markup. > > Literals > [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' > | "'" ([^%&'] | PEReference | Reference)* "'" > [10] AttValue ::= '"' ([^<&"] | Reference)* '"' > | "'" ([^<&'] | Reference)* "'" > [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") > [12] PubidLiteral ::= '"' PubidChar* '"' > | "'" (PubidChar - "'")* "'" > [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] > > Like I said, if you squint you can see that you can use single or > double quotes. Thanks for digging up the specs, I made an attempt but it was too late at night for me. Dan From ksmith at centricle.com Wed Feb 18 08:56:46 2004 From: ksmith at centricle.com (kevin c smith) Date: Wed, 18 Feb 2004 08:56:46 -0500 (EST) Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <.38.117.145.89.1077078531.squirrel@www.bpang.com> References: <20040217051131.B67454BA73@ws1-3.us4.outblaze.com> <.38.117.145.89.1077078531.squirrel@www.bpang.com> Message-ID: <49251.204.253.34.40.1077112606.squirrel@webmail.calathus.com> >> Aside from personal preference, is there a compelling reason to kick >> back out to HTML, as Hans suggests? > not having to escape all your quotes in echos? > > echo "Link text"; Right, but in the context of a heredoc, that's moot. -- kevin c smith http://centricle.com From ashaw at iifwp.org Wed Feb 18 10:52:02 2004 From: ashaw at iifwp.org (Allen Shaw) Date: Wed, 18 Feb 2004 10:52:02 -0500 Subject: [nycphp-talk] your IDE? (was "Zend Survey") References: <200402171958.i1HJwAqZ022019@ns5.oddcast.com> Message-ID: <004001c3f637$271b7190$8201a8c0@iifwp.local> Daniel's message makes me wonder what others think of Zend Studios. I have not used it but am considering. I was disappointed with the only other IDE I tried (Maguma Studio) about a year ago -- can't recall why, maybe I just couldn't get used to a new thing, but I felt like the program kept inserting itself between me and my code, and, perhaps too much a neophyte, I just went back to banging out code in TextPad. Recently, though, my fingers and my clock are telling me it's time to move on to a decent IDE. Anybody want to tell us what you're using to write your PHP code, and why you prefer that over other things you've tried? - Allen > Hey NYPHP, > > Zend is doing a survey and giving out 3 free Zend Studios.... > http://www.zoomerang.com/survey.zgi?L223827SZ7CVWWRPNEGX9JPM > > --Daniel -- =========================================================== Allen Shaw ashaw at iifwp.org IIFWP Data and 914.631.1331 x.106 IT Services http://www.iifwp.org From james at surgam.net Wed Feb 18 11:04:31 2004 From: james at surgam.net (James Wetterau) Date: Wed, 18 Feb 2004 11:04:31 -0500 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: Message from Adam Maccabee Trachtenberg of "Tue, 17 Feb 2004 23:58:48 EST." Message-ID: <200402181604.i1IG4XW06419@panix1.panix.com> Adam Maccabee Trachtenberg says: > On Tue, 17 Feb 2004, Daniel J Cain Jr. wrote: > > > Is it bad form to use the format below? Instead of escaping all double > > quotes to use single quotes for the tag attributes. > > > > echo "Link Test"; > > While that is technically legal HTML, until someone can prove it to me > otherwise, I've never trusted that some stupid browser won't barf on > it. I've used single quotes for precisely this reason off and on since about 1995. It never even occurred to me to worry about it. I've never once seen a problem with doing this, but then I've only had nine years of sporadic experience with it so far. From amiller at hollywood101.com Wed Feb 18 11:08:52 2004 From: amiller at hollywood101.com (Alan T. Miller) Date: Wed, 18 Feb 2004 09:08:52 -0700 Subject: [nycphp-talk] your IDE? (was "Zend Survey") References: <200402171958.i1HJwAqZ022019@ns5.oddcast.com> <004001c3f637$271b7190$8201a8c0@iifwp.local> Message-ID: <017001c3f639$846b7730$640a0a0a@webdev> I prefer Edit Plus myself :) http://www.editplus.com/. Very fast and can open huge files when needed. Has php syntax highlighting and code completion of most PHP functions. Of course it is not what you would call an IDE, but my favorite text editor. Alan ----- Original Message ----- From: "Allen Shaw" To: "NYPHP Talk" Sent: Wednesday, February 18, 2004 8:52 AM Subject: [nycphp-talk] your IDE? (was "Zend Survey") > Daniel's message makes me wonder what others think of Zend Studios. I have > not used it but am considering. > > I was disappointed with the only other IDE I tried (Maguma Studio) about a > year ago -- can't recall why, maybe I just couldn't get used to a new thing, > but I felt like the program kept inserting itself between me and my code, > and, perhaps too much a neophyte, I just went back to banging out code in > TextPad. Recently, though, my fingers and my clock are telling me it's time > to move on to a decent IDE. > > Anybody want to tell us what you're using to write your PHP code, and why > you prefer that over other things you've tried? > > - Allen > > > Hey NYPHP, > > > > Zend is doing a survey and giving out 3 free Zend Studios.... > > http://www.zoomerang.com/survey.zgi?L223827SZ7CVWWRPNEGX9JPM > > > > --Daniel > > > > -- > =========================================================== > Allen Shaw ashaw at iifwp.org > IIFWP Data and 914.631.1331 x.106 > IT Services http://www.iifwp.org > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From james at surgam.net Wed Feb 18 11:22:48 2004 From: james at surgam.net (James Wetterau) Date: Wed, 18 Feb 2004 11:22:48 -0500 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: Message from Dan Cech of "Wed, 18 Feb 2004 08:49:49 EST." <40336D7D.5070701@phpwerx.net> Message-ID: <200402181622.i1IGMoD13764@panix1.panix.com> Dan Cech says: ... > Indeed, you are correct in that specification allows it, my point was > that depending on whether you interpret 'HTML' as HTML 3.2, 4.0, 4.01, > XHTML 1.0, or any of the flavours thereof, what is 'technically legal' > can vary quite widely. I believe, but am not certain, that either single or double quotes have been acceptable continuously since HTML 1.0. As I mentioned, I've used single quotes widely since about 1995 and never noticed trouble. It never even occurred to me to give it a second thought until this day. I probably first learned the formal description of HTML by looking at the HTML draft RFC from June 1993. That RFC describes an attribute as being included either between single quotes or double quotes. Therefore, it seems that from day one of HTML single quotes have been permitted, and were actually the first listed option. I would be tremendously surprised to learn that some intermediate version of HTML had broken backward compatability on this issue. http://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt Hypertext Markup Language (HTML) Tim Berners-Lee, CERN Internet Draft Daniel Connolly, Atrium IIIR Working Group June 1993 Hypertext Markup Language (HTML) ... Attributes In a start tag, whitespace and attributes are allowed between the element name and the closing delimiter. An attribute consists of a name, an equal sign, and a value. Whitespace is allowed around the equal sign. The value is specified in a string surrounded by single quotes or a string surrounded by double quotes. (See: other tolerated forms @@) ... From jonbaer at jonbaer.net Wed Feb 18 11:22:43 2004 From: jonbaer at jonbaer.net (jon baer) Date: Wed, 18 Feb 2004 11:22:43 -0500 Subject: [nycphp-talk] your IDE? (was "Zend Survey") References: <200402171958.i1HJwAqZ022019@ns5.oddcast.com> <004001c3f637$271b7190$8201a8c0@iifwp.local> Message-ID: <038b01c3f63b$700cb450$6400a8c0@thinkpad> > Anybody want to tell us what you're using to write your PHP code, and why > you prefer that over other things you've tried? I use Modelworks JPadPro (www.modelworks.com) ... first and foremost because it is so extremely flexible and worth the price because the guy that writes it Chet Murphy literally responds to every email/request/bug/question about the IDE. I tend to like it better than having a forum to go through or a company ... On Linux it seems to be Bluefish (http://bluefish.openoffice.nl/) which kinda offers the same thing ... The one part about the Zend studio which is good is the variable tracking it offers (albeit you need to install the server to get the functionality), so stepping into functions is pretty clear and nice ... What Id really like to find is an IDE that can play nicely with MySQL/Smarty in a visual way :-\ - jon >From hans not junk at nyphp.com Wed Feb 18 11:28:39 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id EF34FA863B for ; Wed, 18 Feb 2004 11:28:38 -0500 (EST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] your IDE? (was "Zend Survey") X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Date: Wed, 18 Feb 2004 08:28:36 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F879376E5 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] your IDE? (was "Zend Survey") Thread-Index: AcP2N3t07wDGt4quSJ+XfuqbkRav/wABLz5Q From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 16:28:39 -0000 > Anybody want to tell us what you're using to write your PHP=20 > code, and why you prefer that over other things you've tried? This question comes up at least monthly (and that's fine; it's an important issue). But I bring this up because it might be time to start getting things written. An article that's just an archive of mail message? A full article? A PHundamentals even? H From ashaw at iifwp.org Wed Feb 18 11:36:14 2004 From: ashaw at iifwp.org (Allen Shaw) Date: Wed, 18 Feb 2004 11:36:14 -0500 Subject: [nycphp-talk] your IDE? (was "Zend Survey") References: <41EE526EC2D3C74286415780D3BA9F879376E5@ehost011-1.exch011.intermedia.net> Message-ID: <005001c3f63d$536016b0$8201a8c0@iifwp.local> >This question comes up at least monthly Oops. New guy, should have check the archives... ----- Original Message ----- From: "Hans Zaunere" To: "NYPHP Talk" Sent: Wednesday, February 18, 2004 11:28 AM Subject: RE: [nycphp-talk] your IDE? (was "Zend Survey") > Anybody want to tell us what you're using to write your PHP > code, and why you prefer that over other things you've tried? This question comes up at least monthly (and that's fine; it's an important issue). But I bring this up because it might be time to start getting things written. An article that's just an archive of mail message? A full article? A PHundamentals even? H _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk >From hans not junk at nyphp.com Wed Feb 18 11:45:06 2004 Return-Path: Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 97683A863B for ; Wed, 18 Feb 2004 11:45:06 -0500 (EST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] your IDE? (was "Zend Survey") X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Date: Wed, 18 Feb 2004 08:45:03 -0800 Message-ID: <41EE526EC2D3C74286415780D3BA9F879376F6 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] your IDE? (was "Zend Survey") Thread-Index: AcP2PaZFjMZG9xHfSl+sd9ZR12Q4OgAAPb7w From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 16:45:07 -0000 > >This question comes up at least monthly >=20 > Oops. New guy, should have check the archives... No no... no harm done. I was just throwing out there that it's a hot topic, and maybe something we should organize some material on. By the way... nice to meet you :) H From adam at digitalpulp.com Wed Feb 18 11:45:32 2004 From: adam at digitalpulp.com (Adam Fields) Date: Wed, 18 Feb 2004 11:45:32 -0500 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <200402181604.i1IG4XW06419@panix1.panix.com> References: <200402181604.i1IG4XW06419@panix1.panix.com> Message-ID: <403396AC.10108@digitalpulp.com> James Wetterau wrote: > Adam Maccabee Trachtenberg says: > >>On Tue, 17 Feb 2004, Daniel J Cain Jr. wrote: >> >> >>>Is it bad form to use the format below? Instead of escaping all double >>>quotes to use single quotes for the tag attributes. >>> >>>echo "Link Test"; >> >>While that is technically legal HTML, until someone can prove it to me >>otherwise, I've never trusted that some stupid browser won't barf on >>it. > > > I've used single quotes for precisely this reason off and on since > about 1995. It never even occurred to me to worry about it. I've > never once seen a problem with doing this, but then I've only had nine > years of sporadic experience with it so far. However, there is a slight PHP performance issue with this. Single quotes are MUCH faster for the interpreter to process, as there's no interpolation. As a general rule, I understand that you should use single quotes to delimit PHP strings whereever you can, to cue the interpreter that no interpolation is necessary. I'm pretty sure that there's a speed difference between this: echo 'Link Test'; and this: echo "Link Test"; But it should be easy enough to test. More particularly, there should also be a performance difference between this: $someurl = 'http://www.nyphp.org'; echo 'Link Test'; and this: $someurl = 'http://www.nyphp.org'; echo "Link Test"; From dmintz at davidmintz.org Wed Feb 18 11:51:40 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 18 Feb 2004 11:51:40 -0500 (EST) Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: <41EE526EC2D3C74286415780D3BA9F879376F6@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F879376F6@ehost011-1.exch011.intermedia.net> Message-ID: I can tell you this much about Zend. It's got features I love, and, um, characteristics I detest, and if I had it to do over, I'd try exhausting my other free/inexpensive options before springing the $$$$ for this. But we're together now so I'm trying hard to make it work. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From ashaw at iifwp.org Wed Feb 18 12:11:19 2004 From: ashaw at iifwp.org (Allen Shaw) Date: Wed, 18 Feb 2004 12:11:19 -0500 Subject: [nycphp-talk] your IDE? (was "Zend Survey") References: <41EE526EC2D3C74286415780D3BA9F879376F6@ehost011-1.exch011.intermedia.net> Message-ID: <006b01c3f642$3a52b880$8201a8c0@iifwp.local> >It's got features I love, and, um, > characteristics I detest, ... Care to elaborate? -Allen ----- Original Message ----- From: "David Mintz" To: "NYPHP Talk" Sent: Wednesday, February 18, 2004 11:51 AM Subject: RE: [nycphp-talk] your IDE? (was "Zend Survey") > > > I can tell you this much about Zend. It's got features I love, and, um, > characteristics I detest, and if I had it to do over, I'd try exhausting > my other free/inexpensive options before springing the $$$$ for this. But > we're together now so I'm trying hard to make it work. > > > --- > David Mintz > http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- Sopranos 24:17 > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From Cbielanski at inta.org Wed Feb 18 12:19:47 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Wed, 18 Feb 2004 12:19:47 -0500 Subject: [nycphp-talk] your IDE? (was "Zend Survey") Message-ID: I can elaborate on a couple - Block Indent/Unindent has a nasty bug in it. Once they get that pinned down and dead, then Zend's major difficulty is that (being Java-based running in Windoze) it likes to freeze and not repaint, but that honestly happens maybe once a week, tops... The debugger is /par excellence/ and I really enjoy having it there to use. > -----Original Message----- > From: Allen Shaw [mailto:ashaw at iifwp.org] > Sent: Wednesday, February 18, 2004 12:11 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] your IDE? (was "Zend Survey") > > > >It's got features I love, and, um, > > characteristics I detest, ... > > Care to elaborate? > > -Allen > > ----- Original Message ----- > From: "David Mintz" > To: "NYPHP Talk" > Sent: Wednesday, February 18, 2004 11:51 AM > Subject: RE: [nycphp-talk] your IDE? (was "Zend Survey") > > > > > > > > I can tell you this much about Zend. It's got features I > love, and, um, > > characteristics I detest, and if I had it to do over, I'd > try exhausting > > my other free/inexpensive options before springing the $$$$ > for this. But > > we're together now so I'm trying hard to make it work. > > > > > > --- > > David Mintz > > http://davidmintz.org/ > > > > "Anybody else got a problem with Webistics?" -- > Sopranos 24:17 > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From mitchy at spacemonkeylabs.com Wed Feb 18 12:35:52 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Wed, 18 Feb 2004 12:35:52 -0500 Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: <004001c3f637$271b7190$8201a8c0@iifwp.local> References: <200402171958.i1HJwAqZ022019@ns5.oddcast.com> <004001c3f637$271b7190$8201a8c0@iifwp.local> Message-ID: <4033A278.2000606@spacemonkeylabs.com> Allen Shaw wrote: >Anybody want to tell us what you're using to write your PHP code, and why >you prefer that over other things you've tried? > > When in Windows, Macromedia Studio (Dreamweaver for the PHP stuff) When in Linux, a mix of vi/bluefish/quanta I used to live exclusively in linuxland, but the needs to provide flash animation and quick layouts made it impossible to avoid Macromedia. These tools are quick, solid, and to the point - just how I like 'em! The code editor in Dreamweaver (from MX on, at least) has excellent indentation features, and the only thing I miss is code folding. Other than that, thumbs up for me. When in Linux now, the only stuff I am looking at is raw code, and usually on the server side, so vi does the trick. When in X, I'll use what I can find, typically bluefish or quanta. Not a big fan of commercial IDE's as I fear there are too many chefs in the kitchen to get what I need with reasonable performance and stability... Hans, is this a subject for an article? PHundamentals could work too, but it would be excellent to have a 'Top 20' list with a brief description of each, just like Fyodor's 'Top 75' of security tools at: http://www.insecure.org/tools.html -- Mitch From bpang at bpang.com Wed Feb 18 12:38:02 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Wed, 18 Feb 2004 12:38:02 -0500 (EST) Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: <41EE526EC2D3C74286415780D3BA9F879376E5@ehost011-1.exch011.intermedia. net> References: <41EE526EC2D3C74286415780D3BA9F879376E5@ehost011-1.exch011.intermedia. net> Message-ID: <.65.126.132.102.1077125882.squirrel@www.bpang.com> vi(m) same as last month and the month before.... why? because as long as I can access the server, my I'm using the same app from any terminal. plus, it took me a long time to train myself to use it. Now so ingrained that I tend to hit "i" everytime I start typing. > >> Anybody want to tell us what you're using to write your PHP >> code, and why you prefer that over other things you've tried? > > This question comes up at least monthly (and that's fine; it's an > important issue). > > But I bring this up because it might be time to start getting things > written. An article that's just an archive of mail message? A full > article? A PHundamentals even? > > H > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From dan at mx2pro.com Wed Feb 18 12:40:16 2004 From: dan at mx2pro.com (Dan Horning) Date: Wed, 18 Feb 2004 12:40:16 -0500 Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: <.65.126.132.102.1077125882.squirrel@www.bpang.com> Message-ID: <20040218174028.656CAA85E9@virtu.nyphp.org> :qa! gahh .. if I hear this thread ... sorry guys you can find a multitude of editors/tools out there it all boils down to the one all time simple answer you ready for it here it comes "Preference!" were you surprised?. hope not.. Dan Horning - Technical Systems Administration http://www.mx2pro.com/ http://dan.mx2pro.com/ http://www.dsoundmn.com/ 1-866-284-3150 (Office/Home) > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of bpang at bpang.com > Sent: Wednesday, February 18, 2004 12:38 PM > To: NYPHP Talk > Subject: RE: [nycphp-talk] your IDE? (was "Zend Survey") > > vi(m) > > same as last month and the month before.... > > why? because as long as I can access the server, my I'm using > the same app > from any terminal. > plus, it took me a long time to train myself to use it. Now > so ingrained > that I tend to hit "i" everytime I start typing. > > > > > > >> Anybody want to tell us what you're using to write your PHP > >> code, and why you prefer that over other things you've tried? > > > > This question comes up at least monthly (and that's fine; it's an > > important issue). > > > > But I bring this up because it might be time to start getting things > > written. An article that's just an archive of mail message? A full > > article? A PHundamentals even? > > > > H > > > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From dcech at phpwerx.net Wed Feb 18 12:41:21 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 18 Feb 2004 12:41:21 -0500 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <200402181622.i1IGMoD13764@panix1.panix.com> References: <200402181622.i1IGMoD13764@panix1.panix.com> Message-ID: <4033A3C1.3070308@phpwerx.net> James Wetterau wrote: > Dan Cech says: >>Indeed, you are correct in that specification allows it, my point was >>that depending on whether you interpret 'HTML' as HTML 3.2, 4.0, 4.01, >>XHTML 1.0, or any of the flavours thereof, what is 'technically legal' >>can vary quite widely. > > I believe, but am not certain, that either single or double quotes > have been acceptable continuously since HTML 1.0. As I mentioned, > I've used single quotes widely since about 1995 and never noticed > trouble. It never even occurred to me to give it a second thought > until this day. Yes, in both HTML and XML single and double quotes have both been allowed since the dawn of time (basically because both are allowed in SGML). My comment was meant in a broader sense in that it is not as simple as saying the a particular thing is 'valid HTML' as the language has evolved and what was valid HTML 3.2 may not be valid HTML 4.0, etc. > I probably first learned the formal description of HTML by looking at > the HTML draft RFC from June 1993. That RFC describes an attribute as > being included either between single quotes or double quotes. > Therefore, it seems that from day one of HTML single quotes have been > permitted, and were actually the first listed option. > > I would be tremendously surprised to learn that some intermediate > version of HTML had broken backward compatability on this issue. Indeed, on this particular issue as long as you use a form of quoting you should be safe in terms of adhering to the standard. The major reason I tend to use double-quotes is that it makes it easier to include quotes within attributes. In XML you can use the ' entity reference to include a literal single-quote (apostrophe) within a single-quoted string, however I cannot find any reference to this character being supported in any flavour of HTML, so you have to use ' to ensure that it is interpreted correctly by all browsers. In contrast the " entity reference has been included in both HTML and XML specs since at least HTML 2.0 ( Section 9.7.1). This is supported by all known browsers and thus if double-quotes are used as the quote characters you can use a literal single-quote (apostrophe) or the " entity reference to represent any required quotes in a somewhat readable manner. I don't want to start a holy war over this, and agree that both notations are equally valid, I just think that this has turned into a rather interesting discussion. Dan From schlij at alum.rpi.edu Wed Feb 18 12:49:12 2004 From: schlij at alum.rpi.edu (Joseph Schliffer) Date: Wed, 18 Feb 2004 09:49:12 -0800 Subject: [nycphp-talk] your IDE? (was "Zend Survey") Message-ID: <1a65401c3f647$84ae9250$0a02010a@mail2world.com> I'll second Dreamweaver MX. I use it for all my web development (ColdFusion and PHP) and it works great. I only have used the database stuff (query builder etc) with CF/ODBC but I'm pretty sure you can get it all set up perfectly with PHP/mySQL. It has a great text editor, function completion and best of all... a spell checker! Joe <-----Original Message-----> From: Mitch Pirtle Sent: 2/18/2004 12:39:52 PM To: talk at lists.nyphp.org Subject: Re: [nycphp-talk] your IDE? (was "Zend Survey") Allen Shaw wrote: >Anybody want to tell us what you're using to write your PHP code, and why >you prefer that over other things you've tried? > > When in Windows, Macromedia Studio (Dreamweaver for the PHP stuff) When in Linux, a mix of vi/bluefish/quanta I used to live exclusively in linuxland, but the needs to provide flash animation and quick layouts made it impossible to avoid Macromedia. These tools are quick, solid, and to the point - just how I like 'em! The code editor in Dreamweaver (from MX on, at least) has excellent indentation features, and the only thing I miss is code folding. Other than that, thumbs up for me. When in Linux now, the only stuff I am looking at is raw code, and usually on the server side, so vi does the trick. When in X, I'll use what I can find, typically bluefish or quanta. Not a big fan of commercial IDE's as I fear there are too many chefs in the kitchen to get what I need with reasonable performance and stability... Hans, is this a subject for an article? PHundamentals could work too, but it would be excellent to have a 'Top 20' list with a brief description of each, just like Fyodor's 'Top 75' of security tools at: http://www.insecure.org/tools.html -- Mitch _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk . -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Wed Feb 18 12:54:36 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 18 Feb 2004 12:54:36 -0500 Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: <004001c3f637$271b7190$8201a8c0@iifwp.local> References: <200402171958.i1HJwAqZ022019@ns5.oddcast.com> <004001c3f637$271b7190$8201a8c0@iifwp.local> Message-ID: <20040218175436.GA845@panix.com> Hi: I have mixed feelings about Zend Studio. It's great in concept, but needs some work -- at least on the Windows platform. The user interface colors are messed up, using a combination of user defined system colors and hard coded colors. The debugger much needed, but it causes PHP to segfault sometimes and one can't call command line scripts directly. The code analyzer is quite cool. Enjoy, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From chubbard at next-online.net Wed Feb 18 13:17:46 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Wed, 18 Feb 2004 10:17:46 -0800 Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: References: <41EE526EC2D3C74286415780D3BA9F879376F6@ehost011-1.exch011.intermedia.net> Message-ID: <4033AC4A.1090207@next-online.net> Things I like about Zend: paren and brace matching function autocomplete, function argument prompting integrated debugging runs fine on a mac (dual G5 1GB RAM) block comment/uncomment Things I don't like about Zend: it's contantly asking me if I want to save the current files as a project. As far as I can tell the whole "project" implementation is too buggy to use. It runs so slowly on a WinXP (Athlon 1.8, 512MB RAM) that it is totally unusable. I'm talking "minutes to respond" not seconds. Price. In it's current configuration it's not worth the price. Things I wanted in Zend but was unable to find, (it may or may not support these): customize the default "new" page. I wanted to create a tool bar with some of my favorite code snippets (like print_r()) I wanted more control over the keyboard, what key combinations did what. In short, I really really wanted to like Zend. It's almost there. But it's not there in enough ways that it found it's way into my trash, not my heart. I used to use jEdit. Thought I would try some other tools. (BTW primary platform is a mac). Now I'm playing with BBEdit. It's incrementally better than Zend. Chris David Mintz wrote: >I can tell you this much about Zend. It's got features I love, and, um, >characteristics I detest, and if I had it to do over, I'd try exhausting >my other free/inexpensive options before springing the $$$$ for this. But >we're together now so I'm trying hard to make it work. > > >--- >David Mintz >http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > From adam at trachtenberg.com Wed Feb 18 13:28:30 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Wed, 18 Feb 2004 13:28:30 -0500 (EST) Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: <4033A3C1.3070308@phpwerx.net> References: <200402181622.i1IGMoD13764@panix1.panix.com> <4033A3C1.3070308@phpwerx.net> Message-ID: On Wed, 18 Feb 2004, Dan Cech wrote: > James Wetterau wrote: > > I believe, but am not certain, that either single or double quotes > > have been acceptable continuously since HTML 1.0. As I mentioned, > > I've used single quotes widely since about 1995 and never noticed > > trouble. It never even occurred to me to give it a second thought > > until this day. > > Yes, in both HTML and XML single and double quotes have both been > allowed since the dawn of time (basically because both are allowed in > SGML). My comment was meant in a broader sense in that it is not as > simple as saying the a particular thing is 'valid HTML' as the language > has evolved and what was valid HTML 3.2 may not be valid HTML 4.0, etc. Normally I would have specficied a DOCTYPE to go along with my statement, but since single and double quotes are valid in ALL versions of HTML, I didn't bother to qualify my claim. > Indeed, on this particular issue as long as you use a form of quoting > you should be safe in terms of adhering to the standard. This is exactly the *opposite* of what I was claiming. I *know* the standard has (and probably always will) allow me to use either form of quotation marks. However, since when has it been safe to rely upon browsers to correctly implement the HTML standards? My point is that *I don't trust* browsers to actually respect single quotes as correct *even though it's in the standard.* I'm sure that I've been burned by this before, but I just can't remember if it was by some random user-agent back in 1995 that only runs on Mac OS 7.1. :) Based on James' comments, however, it's probably safe to start using them again. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From joshmccormack at travelersdiary.com Wed Feb 18 13:37:26 2004 From: joshmccormack at travelersdiary.com (joshmccormack at travelersdiary.com) Date: Wed, 18 Feb 2004 12:37:26 -0600 (CST) Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: <.65.126.132.102.1077125882.squirrel@www.bpang.com> Message-ID: On Wed, 18 Feb 2004 bpang at bpang.com wrote: > vi(m) > > same as last month and the month before.... > > why? because as long as I can access the server, my I'm using the same app > from any terminal. > plus, it took me a long time to train myself to use it. Now so ingrained > that I tend to hit "i" everytime I start typing. I'm a vim guy myself, but have to use HomeSite for my day job. There are things about HomeSite I like, which I'd like to see in an IDE that uses VIM, primarily search replace accross mulitple files, I suppose. I've seen you can use Kvim in Kdevelop. Anyone used Kdevelop? Josh From dcech at phpwerx.net Wed Feb 18 13:47:45 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 18 Feb 2004 13:47:45 -0500 Subject: [nycphp-talk] Can code be executed in a heredoc? In-Reply-To: References: <200402181622.i1IGMoD13764@panix1.panix.com> <4033A3C1.3070308@phpwerx.net> Message-ID: <4033B351.3060801@phpwerx.net> Adam Maccabee Trachtenberg wrote: > On Wed, 18 Feb 2004, Dan Cech wrote: >>James Wetterau wrote: >>>I believe, but am not certain, that either single or double quotes >>>have been acceptable continuously since HTML 1.0. As I mentioned, >>>I've used single quotes widely since about 1995 and never noticed >>>trouble. It never even occurred to me to give it a second thought >>>until this day. >> >>Yes, in both HTML and XML single and double quotes have both been >>allowed since the dawn of time (basically because both are allowed in >>SGML). My comment was meant in a broader sense in that it is not as >>simple as saying the a particular thing is 'valid HTML' as the language >>has evolved and what was valid HTML 3.2 may not be valid HTML 4.0, etc. > > Normally I would have specficied a DOCTYPE to go along with my > statement, but since single and double quotes are valid in ALL versions > of HTML, I didn't bother to qualify my claim. Yes Adam, I am not attacking your statement, but merely commenting that this *type* of question can become complicated when dealing with the different versions of HTML. >>Indeed, on this particular issue as long as you use a form of quoting >>you should be safe in terms of adhering to the standard. > > This is exactly the *opposite* of what I was claiming. I *know* the > standard has (and probably always will) allow me to use either form of > quotation marks. However, since when has it been safe to rely upon > browsers to correctly implement the HTML standards? > > My point is that *I don't trust* browsers to actually respect single > quotes as correct *even though it's in the standard.* I'm sure that > I've been burned by this before, but I just can't remember if it was > by some random user-agent back in 1995 that only runs on Mac OS 7.1. :) > > Based on James' comments, however, it's probably safe to start using > them again. I understand your point, which was why my statement was put in terms of conformance to the HTML standard, the issue of browser support is completely separate. I am deliberately not commenting on that issue because personally I have never used single-quoted attribute values in any HTML or XML document. What I was interested in was other possible reasons people had for choosing one quoting method over the other. Dan From danielk at us.ibm.com Wed Feb 18 13:55:03 2004 From: danielk at us.ibm.com (Daniel Krook) Date: Wed, 18 Feb 2004 13:55:03 -0500 Subject: [nycphp-talk] HomeSite/TopStyle on the Mac... (was: your IDE?) In-Reply-To: Message-ID: I'm a HomeSite and TopStyle Pro guy but prefer the Mac as my primary machine at home. I solved the problem by picking up Virtual PC for Mac last week and cranked out a site using BBEdit and TopStyle in the PC VM while also testing on all the browsers I needed to on a single machine. This is particularly useful when you can map the same external filesystem from the Mac and from the Virtual PC. The feeling of using my own Windows 2000 CD to install the OS (and all its necessary Windows Updates) on my Mac in its own window was interesting to say the least (the base edition of Virtual PC lets you use your own existing copy of Windows or other OS). It's not the fastest thing in the world (it emulates a Pentium II processor, I believe) but it's closed the gap between the tools I need and the platform I prefer. Daniel Krook, Application Developer, Production Services, ibm.com 1133 Westchester Avenue, White Plains, NY 10604 Tel: (914) 642-4474, Tieline 224-4474 danielk at us.ibm.com Personal: http://info.krook.org/ Persona: http://w3.ibm.com/persona/users/9/0/x/90MC212-P.html From jlacey at att.net Wed Feb 18 14:24:20 2004 From: jlacey at att.net (John Lacey) Date: Wed, 18 Feb 2004 12:24:20 -0700 Subject: [nycphp-talk] HomeSite/TopStyle on the Mac...(OT) In-Reply-To: References: Message-ID: <4033BBE4.2080707@att.net> Daniel Krook wrote: > I'm a HomeSite and TopStyle Pro guy but prefer the Mac as my primary > machine at home. slightly off-topic, but I just got off the phone with someone saying they were having trouble with mail and attachments (using Hotmail) with an "older MAC" running 8.1 are there any browser updates/issues I can mention to her? thanks, John From dan at cain.sh Wed Feb 18 14:35:18 2004 From: dan at cain.sh (Daniel J Cain Jr.) Date: Wed, 18 Feb 2004 13:35:18 -0600 Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: <.65.126.132.102.1077125882.squirrel@www.bpang.com> References: <41EE526EC2D3C74286415780D3BA9F879376E5@ehost011-1.exch011.intermedia. net> <.65.126.132.102.1077125882.squirrel@www.bpang.com> Message-ID: <1077132918.1121.47.camel@gigabeast.home.cain.sh> On Wed, 2004-02-18 at 11:38, wrote: > vi(m) > > same as last month and the month before.... > > why? because as long as I can access the server, my I'm using the same app > from any terminal. > plus, it took me a long time to train myself to use it. Now so ingrained > that I tend to hit "i" everytime I start typing. hehehe. I always catch myself hitting ESC when I am done filling in a text area outside of vi(m). Which usually ends up clearing that text area completely(ctrl-z gets it back) :) From brent at landover.com Wed Feb 18 14:49:38 2004 From: brent at landover.com (Brent Baisley) Date: Wed, 18 Feb 2004 14:49:38 -0500 Subject: [nycphp-talk] HomeSite/TopStyle on the Mac... (was: your IDE?) In-Reply-To: References: Message-ID: <96031021-624B-11D8-AFD8-000A95CD828E@landover.com> I haven't used any of those programs, I like to hand code most of my stuff in BBEdit. But there are a few CSS editors available for the Mac, some shareware. Search for CSS on versiontracker.com. I'm not sure where HomeSite falls in. Is it like GoLive or DreamWeaver? You can look for plugins for BBEdit to extend it's functionality. There's a lot you can do just with BBEdit. I find the File Grouper invaluable. On Feb 18, 2004, at 1:55 PM, Daniel Krook wrote: > I'm a HomeSite and TopStyle Pro guy but prefer the Mac as my primary > machine at home. > > I solved the problem by picking up Virtual PC for Mac last week and > cranked > out a site using BBEdit and TopStyle in the PC VM while also testing > on all > the browsers I needed to on a single machine. This is particularly > useful > when you can map the same external filesystem from the Mac and from the > Virtual PC. > > The feeling of using my own Windows 2000 CD to install the OS (and all > its > necessary Windows Updates) on my Mac in its own window was interesting > to > say the least (the base edition of Virtual PC lets you use your own > existing copy of Windows or other OS). > > It's not the fastest thing in the world (it emulates a Pentium II > processor, I believe) but it's closed the gap between the tools I need > and > the platform I prefer. > -- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 From corey at domanistudios.com Wed Feb 18 14:54:29 2004 From: corey at domanistudios.com (corey szopinski) Date: Wed, 18 Feb 2004 14:54:29 -0500 Subject: [nycphp-talk] HomeSite/TopStyle on the Mac... (was: your IDE?) In-Reply-To: <96031021-624B-11D8-AFD8-000A95CD828E@landover.com> Message-ID: Any Mac users out there figure out how to compile the new mySQL Administrator to run on the Mac. I?ve looked at the PC version and it?s pretty slick. Anyone besides me that would like to use it on OS X? -corey On 2/18/04 2:49 PM, "Brent Baisley" wrote: > I haven't used any of those programs, I like to hand code most of my > stuff in BBEdit. But there are a few CSS editors available for the Mac, > some shareware. Search for CSS on versiontracker.com. > I'm not sure where HomeSite falls in. Is it like GoLive or DreamWeaver? > You can look for plugins for BBEdit to extend it's functionality. > There's a lot you can do just with BBEdit. I find the File Grouper > invaluable. > > On Feb 18, 2004, at 1:55 PM, Daniel Krook wrote: > >> > I'm a HomeSite and TopStyle Pro guy but prefer the Mac as my primary >> > machine at home. >> > >> > I solved the problem by picking up Virtual PC for Mac last week and >> > cranked >> > out a site using BBEdit and TopStyle in the PC VM while also testing >> > on all >> > the browsers I needed to on a single machine. This is particularly >> > useful >> > when you can map the same external filesystem from the Mac and from the >> > Virtual PC. >> > >> > The feeling of using my own Windows 2000 CD to install the OS (and all >> > its >> > necessary Windows Updates) on my Mac in its own window was interesting >> > to >> > say the least (the base edition of Virtual PC lets you use your own >> > existing copy of Windows or other OS). >> > >> > It's not the fastest thing in the world (it emulates a Pentium II >> > processor, I believe) but it's closed the gap between the tools I need >> > and >> > the platform I prefer. >> > > -- > Brent Baisley > Systems Architect > Landover Associates, Inc. > Search & Advisory Services for Advanced Technology Environments > p: 212.759.6400/800.759.0577 > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk DOMANI STUDIOS Corey Szopinski Technology Director corey at domanistudios.com 70 Washington St. Suite 710 Brooklyn, NY 11201 718.797.4470 x116 -------------- next part -------------- An HTML attachment was scrubbed... URL: From agfische at email.smith.edu Wed Feb 18 14:56:00 2004 From: agfische at email.smith.edu (Aaron Fischer) Date: Wed, 18 Feb 2004 14:56:00 -0500 Subject: [nycphp-talk] HomeSite/TopStyle on the Mac... (was: your IDE?) In-Reply-To: References: Message-ID: <795CAAFE-624C-11D8-89C7-0003930D07F2@email.smith.edu> I do a somewhat similar thing: On PC I use HTML-Kit, pretty nice for combining the need to do both front and back end stuff. I also prefer Mac but haven't gone the virtual pc route yet. On Mac I use BBEdit, but I've never been able to get it to color code php nicely. Have any BBEdit folks been able to do this, am I missing something? -Aaron On Feb 18, 2004, at 1:55 PM, Daniel Krook wrote: > I'm a HomeSite and TopStyle Pro guy but prefer the Mac as my primary > machine at home. > > I solved the problem by picking up Virtual PC for Mac last week and > cranked > out a site using BBEdit and TopStyle in the PC VM while also testing > on all > the browsers I needed to on a single machine. This is particularly > useful > when you can map the same external filesystem from the Mac and from the > Virtual PC. > > The feeling of using my own Windows 2000 CD to install the OS (and all > its > necessary Windows Updates) on my Mac in its own window was interesting > to > say the least (the base edition of Virtual PC lets you use your own > existing copy of Windows or other OS). > > It's not the fastest thing in the world (it emulates a Pentium II > processor, I believe) but it's closed the gap between the tools I need > and > the platform I prefer. From adam at trachtenberg.com Wed Feb 18 14:58:34 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Wed, 18 Feb 2004 14:58:34 -0500 (EST) Subject: [nycphp-talk] HomeSite/TopStyle on the Mac... (was: your IDE?) In-Reply-To: <795CAAFE-624C-11D8-89C7-0003930D07F2@email.smith.edu> References: <795CAAFE-624C-11D8-89C7-0003930D07F2@email.smith.edu> Message-ID: On Wed, 18 Feb 2004, Aaron Fischer wrote: > On Mac I use BBEdit, but I've never been able to get it to color > code php nicely. Have any BBEdit folks been able to do this, am I > missing something? Just set the language to HTML and it should work correctly. Setting it to PHP only works when you're not popping in and out of PHP. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From brent at landover.com Wed Feb 18 15:01:36 2004 From: brent at landover.com (Brent Baisley) Date: Wed, 18 Feb 2004 15:01:36 -0500 Subject: [nycphp-talk] HomeSite/TopStyle on the Mac... (was: your IDE?) In-Reply-To: References: Message-ID: <41A7BC36-624D-11D8-AFD8-000A95CD828E@landover.com> I talked to the guys at LinuxWorld about MySQL Admin for the Mac. They are developing it using native tools for each platform to get the best performance and look and feel. Thus they will be using Cocoa on the Mac. The big downside, of course, is that you won't be able to just recompile it on another platform to use it. They said it will probably be available on the Mac about midyear. On Feb 18, 2004, at 2:54 PM, corey szopinski wrote: > Any Mac users out there figure out how to compile the new mySQL > Administrator to run on the Mac. I?ve looked at the PC version and > it?s pretty slick. Anyone besides me that would like to use it on OS > X? > > -corey > > > > On 2/18/04 2:49 PM, "Brent Baisley" wrote: > > > I haven't used any of those programs, I like to hand code most of my > stuff in BBEdit. But there are a few CSS editors available for the > Mac, > some shareware. Search for CSS on versiontracker.com. > I'm not sure where HomeSite falls in. Is it like GoLive or > DreamWeaver? > You can look for plugins for BBEdit to extend it's functionality. > There's a lot you can do just with BBEdit. I find the File Grouper > invaluable. > > On Feb 18, 2004, at 1:55 PM, Daniel Krook wrote: > > > I'm a HomeSite and TopStyle Pro guy but prefer the Mac as my primary > > machine at home. > > > > I solved the problem by picking up Virtual PC for Mac last week and > > cranked > > out a site using BBEdit and TopStyle in the PC VM while also testing > > on all > > the browsers I needed to on a single machine. ?This is particularly > > useful > > when you can map the same external filesystem from the Mac and from > the > > Virtual PC. > > > > The feeling of using my own Windows 2000 CD to install the OS (and > all > > its > > necessary Windows Updates) on my Mac in its own window was > interesting > > to > > say the least (the base edition of Virtual PC lets you use your own > > existing copy of Windows or other OS). > > > > It's not the fastest thing in the world (it emulates a Pentium II > > processor, I believe) but it's closed the gap between the tools I > need > > and > > the platform I prefer. > > > -- > Brent Baisley > Systems Architect > Landover Associates, Inc. > Search & Advisory Services for Advanced Technology Environments > p: 212.759.6400/800.759.0577 > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > > > DOMANI STUDIOS > > Corey Szopinski > Technology Director > ??? > corey at domanistudios.com > 70 Washington St. Suite 710 ? > Brooklyn, NY 11201 > 718.797.4470 ?x116 > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 From dmintz at davidmintz.org Wed Feb 18 15:21:42 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 18 Feb 2004 15:21:42 -0500 (EST) Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: <006b01c3f642$3a52b880$8201a8c0@iifwp.local> References: <41EE526EC2D3C74286415780D3BA9F879376F6@ehost011-1.exch011.intermedia.net> <006b01c3f642$3a52b880$8201a8c0@iifwp.local> Message-ID: On Wed, 18 Feb 2004, Allen Shaw wrote: > >It's got features I love, and, um, > > characteristics I detest, ... > > Care to elaborate? Others have pretty much elaborated for me -- I second most of their remarks. In addition, the server installation was painful on Windoze, and when I upgraded it trashed my server installation and I haven't had the fortitude to try it again. The Project thing -- this has been said -- is either buggy or just plain weird. And I haven't figured out how to get Zend to use the PHP binary that *I* want it to use as opposed to the one it shipped with -- though I might find the solution with research &/or RTFM One thing that's screwy on Linux is that if you use US-International keyboard, as I do, because I sometimes write Spanish, then guess what. In Zend you cannot, repeat CANNOT, type either ' or ". Try coding that way sometime. Not fun. They say it's a bug in the Java implementation itself, sorry. It also has half-hearted-at-best support for plain HTML editing. If I'm serious about marking up some HTML I switch to Homesite when on 'Doze, Quanta on Linux. On the plus side, love that code completion, love that debugger, cvs integration is pretty nice (not bug-free however), love that file inspector thing that outlines your functions... though other tools also offer some or all of the above. Yeah it's religious debate but it has to be aired from time to time. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From phillip.powell at adnet-sys.com Wed Feb 18 16:21:50 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Wed, 18 Feb 2004 16:21:50 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - like programming concepts? References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@thinkpad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <006001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.com> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <402BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03.8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.9060400@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adnet-sys.com> Message-ID: <4033D76E.1050101@adnet-sys.com> I am now learning how to write PHP not necessarily as flat script but as an OO construct, that is, classes, "abstract" classes, "interfaces", Singleton Design Patterns, etc. and it's really helping me out a lot toward understanding how to come close to implementing it in Java. Except for one problem. The various Java programming and online resources (and offline books I have) basically all inform me that understanding Java from a "scripter's perspective" is flat wrong, because Java is pure OO and involves concepts such as Polymorphism, Encapsulation, Inheritance, even things like Beans and Struts they claim you cannot know as a scripter but as a pure OO programmer. So I'm asking the experts among me for advice: should I continue my persuit of PHP from what little OO knowledge I have? Also, do any of you share a Java background along with PHP and see any symbiosis possible between the two and if even possible that a scripter such as myself could cross over into the OO Universe anytime? Thanx Phil From Cbielanski at inta.org Wed Feb 18 16:33:13 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Wed, 18 Feb 2004 16:33:13 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - l ike programming concepts? Message-ID: I'm sure more answers will be verbose and forthcoming but in short: Never stop trying to learn more. Nothing about the "scripter's perspective" makes PHP an unusable tool - in fact I'd bet most of what you'd deem "experts" still use a lot of scripting (perl, if I had to guess) and code OO-style all the same. Objects are a nice, tidy package that allow your code re-use to become much more efficient once you've got the knack of it. Yes, there are some things that from a purely procedural approach would be quite annoying. The reverse is also true - sometimes being strict about OO is "just too much stuff" to complete a simple task. To quote Larry Wall - TMTOWTDI: There's More Than One Way To Do It. Welcome aboard, get a helmet - you'll want it for later. ;) ~Chris > -----Original Message----- > From: Phil Powell [mailto:phillip.powell at adnet-sys.com] > Sent: Wednesday, February 18, 2004 4:22 PM > To: NYPHP Talk > Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - > like programming concepts? > > > I am now learning how to write PHP not necessarily as flat > script but as > an OO construct, that is, classes, "abstract" classes, "interfaces", > Singleton Design Patterns, etc. and it's really helping me out a lot > toward understanding how to come close to implementing it in Java. > > Except for one problem. The various Java programming and online > resources (and offline books I have) basically all inform me that > understanding Java from a "scripter's perspective" is flat wrong, > because Java is pure OO and involves concepts such as Polymorphism, > Encapsulation, Inheritance, even things like Beans and Struts > they claim > you cannot know as a scripter but as a pure OO programmer. > > So I'm asking the experts among me for advice: should I continue my > persuit of PHP from what little OO knowledge I have? Also, do any of > you share a Java background along with PHP and see any symbiosis > possible between the two and if even possible that a scripter such as > myself could cross over into the OO Universe anytime? > > Thanx > Phil > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From felix at students.poly.edu Tue Feb 17 21:06:16 2004 From: felix at students.poly.edu (felix zaslavskiy) Date: Tue, 17 Feb 2004 21:06:16 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - like programming concepts? In-Reply-To: <4033D76E.1050101@adnet-sys.com> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@thinkpad> <402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <006001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.com> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <402BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03.8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.9060400@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adnet-sys.com> <4033D76E.1050101@adnet-sys.com> Message-ID: <20040217210616.6c9fb72a.felix@students.poly.edu> My background basically I been trained on c++ in college and I took object oriented programming course and was encouraged to use OO in my senior project. I now mainly rely on PHP. I had not done any OO myself since school although I use PEAR which is OO itself. There been alot of discussion of such things on www.sitepointforums.com Especially how OO can be done in PHP and weather MCV pattern is the right way to do web application and such things. The answer basicaly is yes and no. You should focus on the requirements of the problem you are trying to solve first and then decide which is the best techinique to apply to it. For most simple web based stuff you will almost never need to code objects yourself. Although it is almost always usefull to use objects that others have created such as PEAR. If you are working on a large scale project you may want to definatly look into OO. Alot of this comes down to experience although it does not hurt to learn about it from an academic point of view. Take a look at the book on the subject "Design Patterns" by Gamma and others. On java in particular I rather not comment because I have not had to much experience with it. > I am now learning how to write PHP not necessarily as flat script but > as an OO construct, that is, classes, "abstract" classes, > "interfaces", Singleton Design Patterns, etc. and it's really helping > me out a lot toward understanding how to come close to implementing it > in Java. > > Except for one problem. The various Java programming and online > resources (and offline books I have) basically all inform me that > understanding Java from a "scripter's perspective" is flat wrong, > because Java is pure OO and involves concepts such as Polymorphism, > Encapsulation, Inheritance, even things like Beans and Struts they > claim you cannot know as a scripter but as a pure OO programmer. > > So I'm asking the experts among me for advice: should I continue my > persuit of PHP from what little OO knowledge I have? Also, do any of > you share a Java background along with PHP and see any symbiosis > possible between the two and if even possible that a scripter such as > myself could cross over into the OO Universe anytime? > > Thanx > Phil > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- felix[at]bebinary.com http://www.zaslavskiy.net/ From dcech at phpwerx.net Wed Feb 18 16:43:43 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 18 Feb 2004 16:43:43 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - like programming concepts? In-Reply-To: <4033D76E.1050101@adnet-sys.com> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@thinkpad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <006001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.com> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <402BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03.8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.9060400@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adnet-sys.com> <4033D76E.1050101@adnet-sys.com> Message-ID: <4033DC8F.9070901@phpwerx.net> Ok, my formal training was in Java, and I believe that it is definitely possible (and with php5 much easier and more efficient) to program php in the same way that you program Java. > I am now learning how to write PHP not necessarily as flat script but as > an OO construct, that is, classes, "abstract" classes, "interfaces", > Singleton Design Patterns, etc. and it's really helping me out a lot > toward understanding how to come close to implementing it in Java. I initially took the view that php was a scripting language and attacked it from that perspective, but the more I code the closer I get to a Java-style approach (ie eliminating the majority of the procedural code and encapsulating everything in classes and objects). > Except for one problem. The various Java programming and online > resources (and offline books I have) basically all inform me that > understanding Java from a "scripter's perspective" is flat wrong, > because Java is pure OO and involves concepts such as Polymorphism, > Encapsulation, Inheritance, even things like Beans and Struts they claim > you cannot know as a scripter but as a pure OO programmer. I think in the current world of php there is room for everyone, from the pure procedural 'script' programmer to the OO guru, and everything in between. > So I'm asking the experts among me for advice: should I continue my > persuit of PHP from what little OO knowledge I have? Also, do any of > you share a Java background along with PHP and see any symbiosis > possible between the two and if even possible that a scripter such as > myself could cross over into the OO Universe anytime? I think it is more than possible, though personally I prefer PHP to Java, and for anything web-related I would almost certainly use PHP rather than Java, purely because it is so flexible and easy to use. As for crossing over into OO, just take things one step at a time, once you grasp the concepts behind OO you will see plenty of situations where you could use OO design methods. For example there are countless situations where you can encapsulate functionality into a generic object, then use inheritance to specialise that object for your particular needs. The 'pure-OO' programmers amongst us may frown on this approach, but I think in the world of PHP it makes sense. Dan From webmaster at localnotion.com Wed Feb 18 17:02:34 2004 From: webmaster at localnotion.com (Matthew Terenzio) Date: Wed, 18 Feb 2004 17:02:34 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - like programming concepts? In-Reply-To: <4033D76E.1050101@adnet-sys.com> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@thinkpad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <006001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.com> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <402BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03.8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.9060400@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adnet-sys.com> <4033D76E.1050101@adnet-sys.com> Message-ID: <28119696-625E-11D8-A7C3-0003938BDF32@localnotion.com> I guess I would agree that approaching Java from a scripter's perspective is wrong, but the whole topic is a little bizarre. Java is Java and PHP is PHP. Beyond getting a feeling for what a class is conceptually, I don't think PHP will help you learn Java. I learned them both almost simultaneously. Could a scripter cross into the OO universe? (where Spock has a Goatee) Sure!! But can OO get back? On Feb 18, 2004, at 4:21 PM, Phil Powell wrote: > I am now learning how to write PHP not necessarily as flat script but > as an OO construct, that is, classes, "abstract" classes, > "interfaces", Singleton Design Patterns, etc. and it's really helping > me out a lot toward understanding how to come close to implementing it > in Java. > > Except for one problem. The various Java programming and online > resources (and offline books I have) basically all inform me that > understanding Java from a "scripter's perspective" is flat wrong, > because Java is pure OO and involves concepts such as Polymorphism, > Encapsulation, Inheritance, even things like Beans and Struts they > claim you cannot know as a scripter but as a pure OO programmer. > > So I'm asking the experts among me for advice: should I continue my > persuit of PHP from what little OO knowledge I have? Also, do any of > you share a Java background along with PHP and see any symbiosis > possible between the two and if even possible that a scripter such as > myself could cross over into the OO Universe anytime? > > Thanx > Phil > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From phillip.powell at adnet-sys.com Wed Feb 18 17:40:07 2004 From: phillip.powell at adnet-sys.com (Phil Powell) Date: Wed, 18 Feb 2004 17:40:07 -0500 Subject: [nycphp-talk] Class constructor goofs up parameter assignment Message-ID: <4033E9C7.5080100@adnet-sys.com> [PHP] class MySQLQuery { var $sql; var $mySQLConn; function MySQLQuery($sql, $mySQLConn) { print_r("From CONSTRUCTOR: sql = $sql

"); $this->sql = $sql; $this->mySQLConn =& $mySQLConn; } // MORE STUFF } $sql = "INSERT INTO table (name) VALUES ('Phil')"; print_r($sql); $query =& new MySQLQuery($sql, $this->getDBConn()); print_r($query); [/PHP] Here is the output of the resulting code: [Code] INSERT INTO table (name) VALUES ('Phil') From CONSTRUCTOR: sql = Resource id #18 mysqlquery Object ( [sql] => Resource id #18 [mySQLConn] => Resource id #18 ) [/Code] How on earth did that happen?? for some strange reason when I assigned the parameters to the MySQLQuery constructor everything is fine: the first parameter is a String, the second is a Resource Link Object from a previous DBConnection Object connect() method call. Suddenly, in the constructor, BOTH parameters are the very same Resource Link Object; what happened to my String? I might be missing something but I can't find it here, any suggestions? Thanx Phil -- Phil Powell Web Developer ADNET Systems, Inc. 11260 Roger Bacon Drive, Suite 403 Reston, VA 20190-5203 Phone: (703) 709-7218 x107 Cell: (571) 437-4430 FAX: (703) 709-7219 EMail: Phillip.Powell at adnet-sys.com AOL IM: SOA Dude From bpang at bpang.com Wed Feb 18 17:51:09 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Wed, 18 Feb 2004 17:51:09 -0500 (EST) Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: <4033DC8F.9070901@phpwerx.net> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@think pad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <0 06001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.co m> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <40 2BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03 .8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.90604 00@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adn et-sys.com><4033D76E.1050101@adnet-sys.com> <4033DC8F.9070901@phpwerx.net> Message-ID: <.65.126.132.102.1077144669.squirrel@www.bpang.com> I've been "trying" to cross over, or at least start writing OO code, for a long time, but I never can seem to fully catch on. I am pretty sure I could identify many instances where my code would benefit from OO, and I've been told that my procedural code is written in OO format, just without the use of objects. This may be near impossible to answer, but, what would you say is the key to "grasp the concepts behind OO" and to put it to use? I suppose if I forced myself to use it, I would probably figure it out, and I always feel a little "learning-disabled" for not having picked it up yet, even after some tutorials, etc, but then Felix comes along and makes me feel better about it... Felix said: "For most simple web based stuff you will almost never need to code objects yourself." > I think it is more than possible, though personally I prefer PHP to > Java, and for anything web-related I would almost certainly use PHP > rather than Java, purely because it is so flexible and easy to use. As > for crossing over into OO, just take things one step at a time, once you > grasp the concepts behind OO you will see plenty of situations where you > could use OO design methods. For example there are countless situations > where you can encapsulate functionality into a generic object, then use > inheritance to specialise that object for your particular needs. From dcech at phpwerx.net Wed Feb 18 18:07:39 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 18 Feb 2004 18:07:39 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: <.65.126.132.102.1077144669.squirrel@www.bpang.com> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@think pad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <0 06001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.co m> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <40 2BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03 .8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.90604 00@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adn et-sys.com><4033D76E.1050101@adnet-sys.com> <4033DC8F.9070901@phpwerx.net> <.65.126.132.102.1077144669.squirrel@www.bpang.com> Message-ID: <4033F03B.5000000@phpwerx.net> bpang at bpang.com wrote: > I've been "trying" to cross over, or at least start writing OO code, for a > long time, but I never can seem to fully catch on. > I am pretty sure I could identify many instances where my code would > benefit from OO, and I've been told that my procedural code is written in > OO format, just without the use of objects. > > This may be near impossible to answer, but, what would you say is the key > to "grasp the concepts behind OO" and to put it to use? Hmm, it is definitely tough to pin down, and I would be no means claim to be an expert on OO design. I guess the turning point for me was the idea that rather than working with data you are working with objects which give the data structure and turn it into information. For example, say you have a bunch of news postings to go on the front page of your website. The standard (procedural) approach for php would be to view them as a set of rows in a table, and you would write a loop to go through them and for each row put each piece of data into its place in the output. In an OO approach you would create a class to deal with the table as a whole, and take care of creating/deleting/retrieving news items, and another class for the individual items, so that in your application you can just ask your news system to display the news, and each piece of code is contained within its object. If you want to change the way news is displayed, or add a new attribute, you can just make the changes to the news_item class and the rest of your code should work just fine. Basically you can modularize the code into bite-sized pieces, rather than having it all strung together into one procedural blob. The other advantage comes when you decide you want to be able to have reviews as well as news, so you create a basic class with all the functions common to both reviews and news items, then a class which inherits from the base for news items and one for reviews. By using the OO approach you can effectively reuse your code, rather than the procedural approach which would have required you to copy and paste the news code and then modify it to try and work with reviews. Mambo () is a damn good example of this kind of approach to coding, every type of object in the system has its own class, all of which inherit from a base class with the core functionality. Personally I'm striving toward this kind of reusability and modularity in my own coding, though it is much easier in theory than in practice! > I suppose if I forced myself to use it, I would probably figure it out, > and I always feel a little "learning-disabled" for not having picked it up > yet, even after some tutorials, etc, but then Felix comes along and makes > me feel better about it... > > Felix said: > "For most simple web based stuff you will almost never need to code > objects yourself." Felix is right, there are tons of useful bits and pieces of OO code out there, just ready to be taken and incorporated into your application (one of my favourites is ADOdb), so theoretically you could code a 'crossover' app by stitching together existing OO objects with your own (procedural) code. Dan >>I think it is more than possible, though personally I prefer PHP to >>Java, and for anything web-related I would almost certainly use PHP >>rather than Java, purely because it is so flexible and easy to use. As >>for crossing over into OO, just take things one step at a time, once you >>grasp the concepts behind OO you will see plenty of situations where you >>could use OO design methods. For example there are countless situations >>where you can encapsulate functionality into a generic object, then use >>inheritance to specialise that object for your particular needs. > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From chubbard at next-online.net Wed Feb 18 18:21:20 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Wed, 18 Feb 2004 15:21:20 -0800 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: <.65.126.132.102.1077144669.squirrel@www.bpang.com> References: <402BB1A4.5020602@adnet-sys.com> <003c01c3f18b$10ad5910$6400a8c0@think pad><402BB631.4040609@adnet-sys.com> <402BB920.6060407@phpwerx.net> <0 06001c3f18f$def39ab0$6400a8c0@thinkpad> <402BC1AD.1080107@adnet-sys.co m> <402BC490.6020704@phpwerx.net> <402BC68A.6000006@adnet-sys.com> <40 2BC886.7010309@phpwerx.net> <402BEA90.5070306@adnet-sys.com> <402BED03 .8030509@phpwerx.net> <402BF0B1.8050909@adnet-sys.com> <402BF2A2.90604 00@adnet-sys.com> <402BF493.2080603@phpwerx.net> <402CEDBB.2090407@adn et-sys.com><4033D76E.1050101@adnet-sys.com> <4033DC8F.9070901@phpwerx.net> <.65.126.132.102.1077144669.squirrel@www.bpang.com> Message-ID: <4033F370.7090306@next-online.net> Heh. You sound like where I have been. I spent a bunch of time trying to figure out OO, making myself crazy. Then it dawned on me that I hadn't had a need that OO would solve. Most of my code used functions. Most of my code used the same functions. So I started moving the functions into an included file. Then I had two files; one a bunch of functions, and then the code file. Then I started organizing the functions into different included files. So I had 6 or so possible files and one code file. Then it dawned on me that I was creating the effect of OO. So I rewrote the files that contained the functions, so each file became a single class, with a collection of methods instead of a single file with a collection of functions. (note, as far as I can tell there's no real difference between a method and a function in php) I had to go through and change some stuff, like using $this-> all over the place. When I was done I had a bunch of different classes that were a bit harder to use than the different include files. After grumbling for a while, someone suggested creating a single error handling method that all the methods within a class would use. So now each class has integrated error handling (error reporting), instead of every method. Then I could add in things like a timer, debugging information. Refactoring the code across all the class-methods is easier than if they're just functions. So: procedural -> OO is pointless unless: 1. it makes it easier to maintain the code 2. it makes it easier to improve the code 3. it makes it easier to debug the code 4. it makes it easier to pick up girls 5. it makes it easier to show off at the users group (see #5) Almost all the documentation about OO complicates the issue. It's really not that difficult. If you're not understanding it, it's not because you're missing the OO bone/gene/hair. It's because whoever is explaining it to you doesn't understand it well enough to explain. Relax, drink a beer. It's not that complex. If you're thinking hard about OO, you're doing the wrong thinking. Save your hard thinking to solve the problem. Once you've groked the problem the OO stuff will flow easily. Where to start: take any single function and convert it to a class: function print_array($array) { print_r($array); } becomes class print_array { function print_array($array) { print_r($array); } } Both produce the same output. Hopefully this is clear and helpful. Rather than obscure and annoying. Chris bpang at bpang.com wrote: >I've been "trying" to cross over, or at least start writing OO code, for a >long time, but I never can seem to fully catch on. >I am pretty sure I could identify many instances where my code would >benefit from OO, and I've been told that my procedural code is written in >OO format, just without the use of objects. > >This may be near impossible to answer, but, what would you say is the key >to "grasp the concepts behind OO" and to put it to use? > >I suppose if I forced myself to use it, I would probably figure it out, >and I always feel a little "learning-disabled" for not having picked it up >yet, even after some tutorials, etc, but then Felix comes along and makes >me feel better about it... > >Felix said: >"For most simple web based stuff you will almost never need to code >objects yourself." > > > > > > >>I think it is more than possible, though personally I prefer PHP to >>Java, and for anything web-related I would almost certainly use PHP >>rather than Java, purely because it is so flexible and easy to use. As >>for crossing over into OO, just take things one step at a time, once you >>grasp the concepts behind OO you will see plenty of situations where you >>could use OO design methods. For example there are countless situations >>where you can encapsulate functionality into a generic object, then use >>inheritance to specialise that object for your particular needs. >> >> > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > From james at surgam.net Wed Feb 18 19:39:25 2004 From: james at surgam.net (James Wetterau) Date: Wed, 18 Feb 2004 19:39:25 -0500 Subject: [nycphp-talk] How many of you guys are "down" with Java/OO - likeprogramming concepts? In-Reply-To: Message from "Chris Hubbard" of "Wed, 18 Feb 2004 15:21:20 PST." <4033F370.7090306@next-online.net> Message-ID: <200402190039.i1J0dPb29313@panix3.panix.com> "Chris Hubbard" says: .. > procedural -> OO is pointless unless: > 1. it makes it easier to maintain the code > 2. it makes it easier to improve the code > 3. it makes it easier to debug the code > 4. it makes it easier to pick up girls > 5. it makes it easier to show off at the users group (see #5) You missed the big supposed selling point for OO: 6. It makes it easier to reuse the code (whether in the same way as originally intended or in a slightly different way than originally intended, without having to substantially rewrite). That's one the main goals, anyway. From nyphp at enobrev.com Wed Feb 18 19:46:15 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Wed, 18 Feb 2004 19:46:15 -0500 Subject: [nycphp-talk] your IDE? (was "Zend Survey") In-Reply-To: Message-ID: I've been a huge fan of Homesite for years. Love the regex search and replace, code snippets, fairly stable built in ftp support (most stable of ide's I've worked with). I moved to DWMX after it came out, mostly because it uses Homesite's code base for the editor (at least as far as I can tell, it does). The coloring of HTML, JS and PHP (and CF) is near perfect. Makes digging through a lot of code - especially other people's - much easier. Their quasi CVS sucks, but the FTP for DW is pretty solid. I generally develop remotely, and I hit Ctrl+S every 5 seconds, and barely notice that the file is actually uploading every time (they COULD make it even more invisible, but it's not bad as is). The php code completion is pretty decent, the HTML code completion is perfect, and I miss it when I use anything else. (Typing in a

and have the