From arzala at gmail.com Tue Jul 1 00:13:58 2008 From: arzala at gmail.com (Anirudh Zala) Date: Tue, 1 Jul 2008 09:43:58 +0530 Subject: [nycphp-talk] url pass array as parameter In-Reply-To: <135159E1-03C5-4523-8ED7-1EFA94E168D5@o2group.com> References: <135159E1-03C5-4523-8ED7-1EFA94E168D5@o2group.com> Message-ID: <200807010943.58182.arzala@gmail.com> On Tuesday 01 Jul 2008 03:09:48 Tim Lieberman wrote: > Passing arrays in a query string is the wrong way to do it. Too many > things can go wrong. True. It is not proper way. But if you still want to pass such data using GET method then you can build Query string as shown below: $cartStr='cart[0]=val1&cart[1]=val2'; // assuming that array keys are numeric. This $cartStr string can be appended to URL where request is to be forwarded to. On that receiving page you can have that array in form of $_GET['cart']; which you can use for your purposes. Remember if values in $cart is *sensitive* then neither GET nor POST is safe. Use session instead to store data on server only. Anirudh Zala > > You could try creating a form, and sticking the serialize()d array > value in to a hidden field. Then POST the form to your gallery page. > > echo '
> > >
'; > ?> > > And in gallery.php > $cart = unserialize($_POST['cart']); > ?> > > HTH > > -Tim > > On Jun 30, 2008, at 3:32 PM, chad qian wrote: > > Hi, > > I want to pass an unknow array cart[]: to "gallery" page through > > url link: > > > > My url is:gallery.php?final=cart[] > > > > On gallery.php page > > I want to output everything in this array > > > > My code is: > > $finalcart=array(); > > $finalcart=$_get['final'] > > for(var i=0;i > print finalcart[i]; > > > > > > Maybe my code is wrong.I only want to show my need.Can anyone help > > me to correct my code? > > > > Thanks! > > > > chad > > > > > > The other season of giving begins 6/24/08. Check out the i?m > > Talkathon. Check it out! > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php From kenrbnsn at rbnsn.com Tue Jul 1 06:24:17 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Tue, 01 Jul 2008 06:24:17 -0400 Subject: [nycphp-talk] url pass array as parameter In-Reply-To: <200807010943.58182.arzala@gmail.com> References: <135159E1-03C5-4523-8ED7-1EFA94E168D5@o2group.com> <200807010943.58182.arzala@gmail.com> Message-ID: At 12:13 AM 7/1/2008, Anirudh Zala wrote: >On Tuesday 01 Jul 2008 03:09:48 Tim Lieberman wrote: > > Passing arrays in a query string is the wrong way to do it. Too many > > things can go wrong. > >True. It is not proper way. But if you still want to pass such data using GET >method then you can build Query string as shown below: > >$cartStr='cart[0]=val1&cart[1]=val2'; // assuming that array keys are >numeric. You can take advantage of the mechanism in PHP that's used to use arrays in forms: Go'; ?> Then in gallery.php \n",$_GET['final']); ?> Ken From nynj.tech at hotmail.com Tue Jul 1 10:05:47 2008 From: nynj.tech at hotmail.com (chad qian) Date: Tue, 1 Jul 2008 10:05:47 -0400 Subject: [nycphp-talk] url pass array as parameter In-Reply-To: References: <135159E1-03C5-4523-8ED7-1EFA94E168D5@o2group.com> <200807010943.58182.arzala@gmail.com> Message-ID: Thanks for everyone answer my question! One further question: if url=galleryform.php?$cartStr='cart[0]=val1&cart[1]=val2'; then On gallery.php page: Is gallery.php coding is correct?I want to output array. Thanks again! > Date: Tue, 1 Jul 2008 06:24:17 -0400> To: talk at lists.nyphp.org> From: kenrbnsn at rbnsn.com> Subject: Re: [nycphp-talk] url pass array as parameter> > At 12:13 AM 7/1/2008, Anirudh Zala wrote:> >On Tuesday 01 Jul 2008 03:09:48 Tim Lieberman wrote:> > > Passing arrays in a query string is the wrong way to do it. Too many> > > things can go wrong.> >> >True. It is not proper way. But if you still want to pass such data using GET> >method then you can build Query string as shown below:> >> >$cartStr='cart[0]=val1&cart[1]=val2'; // assuming that array keys are> >numeric.> > You can take advantage of the mechanism in PHP that's used to use > arrays in forms:> > $cart = array('item one','item two','item three');> $urlstr = 'gallery.php?final[]=' . implode('&final[]=',$cart);> echo 'Go';> ?>> > Then in gallery.php> if (isset($_GET['final']))> echo implode("
\n",$_GET['final']);> ?>> > Ken> > > > > _______________________________________________> New York PHP Community Talk Mailing List> http://lists.nyphp.org/mailman/listinfo/talk> > NYPHPCon 2006 Presentations Online> http://www.nyphpcon.com> > Show Your Participation in New York PHP> http://www.nyphp.org/show_participation.php _________________________________________________________________ It?s a talkathon ? but it?s not just talk. http://www.imtalkathon.com/?source=EML_WLH_Talkathon_JustTalk -------------- next part -------------- An HTML attachment was scrubbed... URL: From ka at kacomputerconsulting.com Tue Jul 1 10:18:27 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Tue, 1 Jul 2008 07:18:27 -0700 Subject: [nycphp-talk] url pass array as parameter Message-ID: <1214921907.27187@coral.he.net> url would have to be 'galleryform.php?cart[0]=val1&cart[1]=val2' (i'm not sure if you can use brackets [] in a URL either) or something of that nature. remember, a querystring has to consist of key=value pairs (or it can be just one value if a single parameter)...and it will automatically BE an array after it is passed to the receiving page -- $_SERVER['QUERY_STRING']; -- Kristina > > > Thanks for everyone answer my question! > > One further question: > if > url=galleryform.php?$cartStr='cart[0]=val1&cart[1]=val2'; > > then > On gallery.php page: > $totalcart=$_GET['cartStr'] > for($x=0;$x<$totalcart[].length;$x++) > {echo $totalcart[$x]; > } ?> > > Is gallery.php coding is correct?I want to output array. > > Thanks again! > > > Date: Tue, 1 Jul 2008 06:24:17 -0400> To: talk at lists.nyphp.org> From: kenrbnsn at rbnsn.com> Subject: Re: [nycphp-talk] url pass array as parameter> > At 12:13 AM 7/1/2008, Anirudh Zala wrote:> >On Tuesday 01 Jul 2008 03:09:48 Tim Lieberman wrote:> > > Passing arrays in a query string is the wrong way to do it. Too many> > > things can go wrong.> >> >True. It is not proper way. But if you still want to pass such data using GET> >method then you can build Query string as shown below:> >> >$cartStr='cart[0]=val1&cart[1]=val2'; // assuming that array keys are> >numeric.> > You can take advantage of the mechanism in PHP that's used to use > arrays in forms:> > $cart = array('item one','item two','item three');> $urlstr = 'gallery.php?final[]=' . implode('&final []=',$cart);> echo 'Go';> ?>> > Then in gallery.php> if (isset($_GET['final']))> echo implode ("
\n",$_GET['final']);> ?>> > Ken> > > > > _______________________________________________> New York PHP Community Talk Mailing List> http://lists.nyphp.org/mailman/listinfo/talk> > NYPHPCon 2006 Presentations Online> http://www.nyphpcon.com> > Show Your Participation in New York PHP> http://www.nyphp.org/show_participation.php > _________________________________________________________________ > It?s a talkathon ? but it?s not just talk. > http://www.imtalkathon.com/?source=EML_WLH_Talkathon_JustTalk > From suzerain at suzerain.com Tue Jul 1 18:03:16 2008 From: suzerain at suzerain.com (Marc Antony Vose) Date: Wed, 2 Jul 2008 06:03:16 +0800 Subject: [nycphp-talk] mysql: timestamp issue? In-Reply-To: <1214921907.27187@coral.he.net> References: <1214921907.27187@coral.he.net> Message-ID: <748155C0-DAC4-44D2-B3C7-0BA65BA07FF6@suzerain.com> Hi there. I exported this create table statement from an existing table of mine. I was just wondering if someone would enlighten me as to why my "edi_updated" timestamp column is not auto-updating when a record is updated? Cheers, Marc CREATE TABLE `editions` ( `edi_id` int(10) unsigned NOT NULL auto_increment, `edi_title` int(10) unsigned default NULL, `edi_platform` int(11) unsigned default NULL, `edi_description` text, `edi_date_release` date default NULL, `edi_price` int(11) default NULL, `edi_price_metered` int(11) default NULL, `edi_price_metered_unit` enum('month','game','hour','year') default NULL, `edi_votes` int(11) default NULL, `edi_vote_total` int(11) default NULL, `edi_added` datetime default NULL, `edi_updated` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `edi_id_old` int(10) unsigned default NULL, `edi_released` enum('y','n') NOT NULL default 'n', `edi_date_release_precision` enum('year','month','day','unknown') NOT NULL default 'year', `edi_active` enum('y','n') NOT NULL default 'n', `edi_featured` enum('y','n') NOT NULL default 'n', `edi_vintage` enum('y','n') NOT NULL default 'n', PRIMARY KEY (`edi_id`) ) ENGINE=MyISAM AUTO_INCREMENT=3787 DEFAULT CHARSET=latin1 AUTO_INCREMENT=3787 ; From arzala at gmail.com Tue Jul 1 23:37:09 2008 From: arzala at gmail.com (Anirudh Zala) Date: Wed, 2 Jul 2008 09:07:09 +0530 Subject: [nycphp-talk] url pass array as parameter In-Reply-To: <1214921907.27187@coral.he.net> References: <1214921907.27187@coral.he.net> Message-ID: <200807020907.09137.arzala@gmail.com> On Tuesday 01 Jul 2008 19:48:27 Kristina Anderson wrote: > url would have to be 'galleryform.php?cart[0]=val1&cart[1]=val2' > (i'm not sure if you can use brackets [] in a URL either) > > or something of that nature. remember, a querystring has to consist > of key=value pairs (or it can be just one value if a single > parameter)...and it will automatically BE an array after it is passed > to the receiving page -- $_SERVER['QUERY_STRING']; With the context of PHP, above mentioned array format is also supported for both GET and POST method. Remember HTTP just passes whatever Query_String you have passed to it. It is PHP's feature that it converts both single and double dimensional arrays in equivalent super globals array like $_GET, $_POST etc. > > -- Kristina > > > Thanks for everyone answer my question! > > > > One further question: > > if > > url=galleryform.php?$cartStr='cart[0]=val1&cart[1]=val2'; > > > > then > > On gallery.php page: > > > $totalcart=$_GET['cartStr'] > > for($x=0;$x<$totalcart[].length;$x++) > > {echo $totalcart[$x]; > > } ?> > > > > Is gallery.php coding is correct?I want to output array. > > > > Thanks again! > > > > > Date: Tue, 1 Jul 2008 06:24:17 -0400> To: talk at lists.nyphp.org> > > From: kenrbnsn at rbnsn.com> Subject: Re: [nycphp-talk] url pass array as > parameter> > At 12:13 AM 7/1/2008, Anirudh Zala wrote:> >On Tuesday 01 > Jul 2008 03:09:48 Tim Lieberman wrote:> > > Passing arrays in a query > string is the wrong way to do it. Too many> > > things can go wrong.> > > >> >True. It is not proper way. But if you still want to pass such data > > using GET> >method then you can build Query string as shown below:> >> > > >$cartStr='cart[0]=val1&cart[1]=val2'; // assuming that array keys are> > >numeric.> > You can take advantage of the mechanism in PHP that's used > > to use > arrays in forms:> > $cart = array('item one','item > two','item three');> $urlstr = 'gallery.php?final[]=' . implode('&final > []=',$cart);> echo 'Go';> ?>> > Then in > gallery.php> if (isset($_GET['final']))> echo implode > ("
\n",$_GET['final']);> ?>> > Ken> > > > > > _______________________________________________> New York PHP Community > Talk Mailing List> http://lists.nyphp.org/mailman/listinfo/talk> > > NYPHPCon 2006 Presentations Online> http://www.nyphpcon.com> > Show > Your Participation in New York PHP> > http://www.nyphp.org/show_participation.php > > > _________________________________________________________________ > > It?s a talkathon ? but it?s not just talk. > > http://www.imtalkathon.com/?source=EML_WLH_Talkathon_JustTalk > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From arzala at gmail.com Tue Jul 1 23:38:29 2008 From: arzala at gmail.com (Anirudh Zala) Date: Wed, 2 Jul 2008 09:08:29 +0530 Subject: [nycphp-talk] url pass array as parameter In-Reply-To: References: Message-ID: <200807020908.29645.arzala@gmail.com> On Tuesday 01 Jul 2008 19:35:47 chad qian wrote: > Thanks for everyone answer my question! > > One further question: > if > url=galleryform.php?$cartStr='cart[0]=val1&cart[1]=val2'; > > then > On gallery.php page: > $totalcart=$_GET['cartStr'] > for($x=0;$x<$totalcart[].length;$x++) > {echo $totalcart[$x]; > } ?> foreach{} is better than this. Study PHP manual about how to implement it. Anirudh Zala > > Is gallery.php coding is correct?I want to output array. > > Thanks again! > > > Date: Tue, 1 Jul 2008 06:24:17 -0400> To: talk at lists.nyphp.org> From: > > kenrbnsn at rbnsn.com> Subject: Re: [nycphp-talk] url pass array as > > parameter> > At 12:13 AM 7/1/2008, Anirudh Zala wrote:> >On Tuesday 01 > > Jul 2008 03:09:48 Tim Lieberman wrote:> > > Passing arrays in a query > > string is the wrong way to do it. Too many> > > things can go wrong.> >> > > >True. It is not proper way. But if you still want to pass such data > > using GET> >method then you can build Query string as shown below:> >> > > >$cartStr='cart[0]=val1&cart[1]=val2'; // assuming that array keys are> > > >numeric.> > You can take advantage of the mechanism in PHP that's used > > to use > arrays in forms:> > $cart = array('item one','item > > two','item three');> $urlstr = 'gallery.php?final[]=' . > > implode('&final[]=',$cart);> echo 'Go';> > > ?>> > Then in gallery.php> if (isset($_GET['final']))> echo > > implode("
\n",$_GET['final']);> ?>> > Ken> > > > > > > _______________________________________________> New York PHP Community > > Talk Mailing List> http://lists.nyphp.org/mailman/listinfo/talk> > > > NYPHPCon 2006 Presentations Online> http://www.nyphpcon.com> > Show Your > > Participation in New York PHP> > > http://www.nyphp.org/show_participation.php > > _________________________________________________________________ > It?s a talkathon ? but it?s not just talk. > http://www.imtalkathon.com/?source=EML_WLH_Talkathon_JustTalk From matt at atopia.net Wed Jul 2 00:16:39 2008 From: matt at atopia.net (Matt Juszczak) Date: Wed, 2 Jul 2008 00:16:39 -0400 (EDT) Subject: [nycphp-talk] mysql: timestamp issue? In-Reply-To: <748155C0-DAC4-44D2-B3C7-0BA65BA07FF6@suzerain.com> References: <1214921907.27187@coral.he.net> <748155C0-DAC4-44D2-B3C7-0BA65BA07FF6@suzerain.com> Message-ID: <20080702001540.X67012@mercury.atopia.net> > `edi_updated` timestamp NOT NULL default CURRENT_TIMESTAMP on update > CURRENT_TIMESTAMP, Shouldn't it auto update by default? alter table modify edi_updated timestamp NOT NULL; Wouldn't that auto update it anyway? From ka at kacomputerconsulting.com Wed Jul 2 00:34:30 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Tue, 1 Jul 2008 21:34:30 -0700 Subject: [nycphp-talk] mysql: timestamp issue? Message-ID: <1214973270.17472@coral.he.net> I think the default is to insert the current timestamp on creation of new row and not change that value even if row is updated... ? I remember I had some fun with phpMyAdmin trying to figure out how they had this set up. -- Kristina > > `edi_updated` timestamp NOT NULL default CURRENT_TIMESTAMP on update > > CURRENT_TIMESTAMP, > > Shouldn't it auto update by default? > > alter table modify edi_updated timestamp NOT NULL; > > Wouldn't that auto update it anyway? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From matt at atopia.net Wed Jul 2 00:36:30 2008 From: matt at atopia.net (Matt Juszczak) Date: Wed, 2 Jul 2008 00:36:30 -0400 (EDT) Subject: [nycphp-talk] mysql: timestamp issue? In-Reply-To: <1214973270.17472@coral.he.net> References: <1214973270.17472@coral.he.net> Message-ID: <20080702003539.D71915@mercury.atopia.net> > I think the default is to insert the current timestamp on creation of > new row and not change that value even if row is updated... ? > > I remember I had some fun with phpMyAdmin trying to figure out how they > had this set up. > > -- Kristina If I remember correctly, it will update the first timestamp record automatically. For instance: CREATE TABLE test ( field1 varchar(50) NOT NULL, field2 timestamp NOT NULL, field3 timestamp NOT NULL ); will update field2 on insert AND update. field3 will not be touched. From bzcoder at bzcode.com Wed Jul 2 06:01:31 2008 From: bzcoder at bzcode.com (bzcoder) Date: Wed, 02 Jul 2008 06:01:31 -0400 Subject: [nycphp-talk] mysql: timestamp issue? In-Reply-To: <748155C0-DAC4-44D2-B3C7-0BA65BA07FF6@suzerain.com> References: <1214921907.27187@coral.he.net> <748155C0-DAC4-44D2-B3C7-0BA65BA07FF6@suzerain.com> Message-ID: <486B51FB.5020408@bzcode.com> Marc Antony Vose wrote: > Hi there. > > I exported this create table statement from an existing table of > mine. I was just wondering if someone would enlighten me as to why my > "edi_updated" timestamp column is not auto-updating when a record is > updated? Well, my guess would be because your code tells it not to. For example, if your using some nice object oriented code, where you do something like: ----- // set some edition id value $ediid = 123; // load the edition data $myedi = new editionClass($ediid); // set a 20% discount - ideally this data should actually // have come from someone, ie entered on a form perhaps // by the user $discount = .80; $newprice = $myedi->getField('edi_price') * $discount; // update the price of the edition $myedi->setField('edi_price', $newprice); // update the record $myedi->update(); ---- or if you prefer a condensed coding style: ------ // get the edition $myedi->new editionClass($ediid); //set the discount, ideally this is provided by a user instead // of hardcoded $discount=.80; // make our changes and update the record $myedi->setDiscount($discount)->updateRecord(); ------ The above generates a long update clause such as: UPDATE EDITIONS SET EDI_TITLE='$this->edi_title', ... EDI_UPDATED=$this->edi_updated, ... WHERE EDI_ID = $this->edi_id (though of course, your using the safer syntax where you bind the variables instead of writing it out directly - it's just easier to write this way) In which case, since your code explicitly specified what the update timestamp should be(and since you did not change the value, it is the original timestamp) the field will not be updated. Just a guess though, since I don't have your code here. :-) From nynj.tech at hotmail.com Wed Jul 2 17:35:15 2008 From: nynj.tech at hotmail.com (chad qian) Date: Wed, 2 Jul 2008 17:35:15 -0400 Subject: [nycphp-talk] string function Message-ID: An unknown string,its format is: y="tnk81|98.8$|yuhj78t|32.6$|tris78y|459.78$|....." I need output format: tnk81 98.8$ yuhj78t 32.6$ tris78y 459.78$ ......................... How to program php to get this output?String is divided by "|". Thanks! chad _________________________________________________________________ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_messenger_072008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bzcoder at bzcode.com Wed Jul 2 17:44:14 2008 From: bzcoder at bzcode.com (bzcoder) Date: Wed, 02 Jul 2008 17:44:14 -0400 Subject: [nycphp-talk] string function In-Reply-To: References: Message-ID: <486BF6AE.7080705@bzcode.com> chad qian wrote: > > > How to program php to get this output?String is divided by "|". explode. http://us3.php.net/manual/en/function.explode.php From suzerain at suzerain.com Wed Jul 2 22:11:02 2008 From: suzerain at suzerain.com (Marc Antony Vose) Date: Thu, 3 Jul 2008 10:11:02 +0800 Subject: [nycphp-talk] mysql: timestamp issue? In-Reply-To: <486B51FB.5020408@bzcode.com> References: <1214921907.27187@coral.he.net> <748155C0-DAC4-44D2-B3C7-0BA65BA07FF6@suzerain.com> <486B51FB.5020408@bzcode.com> Message-ID: Hi: I had just wanted to make sure that I wasn't crazy and my understanding of how MySQL (5.0.25 is my version) works was not flawed. It seems from the responses here that I've got the column declared properly, at least. I originally asked the question because I have a different table, with basically the exact same setup. (The data titles, and editions, of software products, in this case the editions mean versions of a title on a different platform. so the "title" might be "Photoshop" and the edition would be "Windows, Mac, etc.".) What is odd is that the title table's timestamp is auto-updating whenever a title is modified, and the editions table isn't. Both tables have only one timestamp column and the structure is very similar. This is from the title table: `ttl_updated` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, This is from the edition table: `edi_updated` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, I'm checking out my code now to see if there's a difference in the editions update form vs. the titles update form, but both forms run through the same framework. Very odd...perhaps just an idiotic mistake of mine somewhere. Cheers, Marc Le 2 juil. 08 ? 18:01, bzcoder a ?crit : > Marc Antony Vose wrote: >> Hi there. >> >> I exported this create table statement from an existing table of >> mine. I was just wondering if someone would enlighten me as to why >> my "edi_updated" timestamp column is not auto-updating when a >> record is updated? > > Well, my guess would be because your code tells it not to. For > example, if your using some nice object oriented code, where you do > something like: > ----- > // set some edition id value > $ediid = 123; > > // load the edition data > $myedi = new editionClass($ediid); > > // set a 20% discount - ideally this data should actually > // have come from someone, ie entered on a form perhaps > // by the user > $discount = .80; > $newprice = $myedi->getField('edi_price') * $discount; > > // update the price of the edition > $myedi->setField('edi_price', $newprice); > > // update the record > $myedi->update(); > ---- > > or if you prefer a condensed coding style: > ------ > // get the edition > $myedi->new editionClass($ediid); > //set the discount, ideally this is provided by a user instead > // of hardcoded > $discount=.80; > // make our changes and update the record > $myedi->setDiscount($discount)->updateRecord(); > ------ > > The above generates a long update clause such as: > UPDATE EDITIONS > SET EDI_TITLE='$this->edi_title', > ... > EDI_UPDATED=$this->edi_updated, > ... > WHERE EDI_ID = $this->edi_id > > (though of course, your using the safer syntax where you bind the > variables instead of writing it out directly - it's just easier to > write this way) > > In which case, since your code explicitly specified what the update > timestamp should be(and since you did not change the value, it is > the original timestamp) the field will not be updated. > > Just a guess though, since I don't have your code here. :-) > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From bzcoder at bzcode.com Thu Jul 3 02:58:26 2008 From: bzcoder at bzcode.com (bzcoder) Date: Thu, 03 Jul 2008 02:58:26 -0400 Subject: [nycphp-talk] mysql: timestamp issue? In-Reply-To: References: <1214921907.27187@coral.he.net> <748155C0-DAC4-44D2-B3C7-0BA65BA07FF6@suzerain.com> <486B51FB.5020408@bzcode.com> Message-ID: <486C7892.30601@bzcode.com> Marc Antony Vose wrote: > > I'm checking out my code now to see if there's a difference in the > editions update form vs. the titles update form, but both forms run > through the same framework. > > Very odd...perhaps just an idiotic mistake of mine somewhere. > An easy way to test would be to do a meaningless update from NaviCat, phpmyAdmin, the mysql command line, or whatever you prefer to use to run SQL commands manually. For each table, update a single record and make a change to the title or some other text field, and then change it back. Then pull up the 2 records and see if the timestamp updated appropriately in both tables. If it did, than you know there is a problem in your code somewhere. Note: just because one table works and one doesn't, does not mean the update timestamp field is working in one and not the other - it is very possible that your code actually updates the timestamp explicitly in one case to the current timestamp, while in the other it updates it to current value explicitly. Since you say your using 5.0, if you have control over your mysql server I'd recommend enabling the general query log and checking that rather than tediously going through your code to find what the update statements are. http://dev.mysql.com/doc/refman/5.0/en/query-log.html That will tell you precisely what SQL commands are sent to the server. From arzala at gmail.com Thu Jul 3 07:48:34 2008 From: arzala at gmail.com (Anirudh Zala) Date: Thu, 3 Jul 2008 17:18:34 +0530 Subject: [nycphp-talk] mysql: timestamp issue? In-Reply-To: <486C7892.30601@bzcode.com> References: <1214921907.27187@coral.he.net> <486C7892.30601@bzcode.com> Message-ID: <200807031718.34121.arzala@gmail.com> On Thursday 03 Jul 2008 12:28:26 bzcoder wrote: > Marc Antony Vose wrote: > > I'm checking out my code now to see if there's a difference in the > > editions update form vs. the titles update form, but both forms run > > through the same framework. > > > > Very odd...perhaps just an idiotic mistake of mine somewhere. Please also make sure that data is really getting modified. For example if you edit record by various ways but actual data residing in fields are not changing then MySQL would not update timestamp. Anirudh Zala > > An easy way to test would be to do a meaningless update from NaviCat, > phpmyAdmin, the mysql command line, or whatever you prefer to use to run > SQL commands manually. > > For each table, update a single record and make a change to the title or > some other text field, and then change it back. > > Then pull up the 2 records and see if the timestamp updated > appropriately in both tables. > > If it did, than you know there is a problem in your code somewhere. > > Note: just because one table works and one doesn't, does not mean the > update timestamp field is working in one and not the other - it is very > possible that your code actually updates the timestamp explicitly in one > case to the current timestamp, while in the other it updates it to > current value explicitly. > > Since you say your using 5.0, if you have control over your mysql server > I'd recommend enabling the general query log and checking that rather > than tediously going through your code to find what the update > statements are. http://dev.mysql.com/doc/refman/5.0/en/query-log.html > > That will tell you precisely what SQL commands are sent to the server. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From urb at e-government.com Thu Jul 3 10:36:41 2008 From: urb at e-government.com (Urb LeJeune) Date: Thu, 03 Jul 2008 10:36:41 -0400 Subject: [nycphp-talk] string function In-Reply-To: References: Message-ID: >An unknown string,its format is: >y="tnk81|98.8$|yuhj78t|32.6$|tris78y|459.78$|....." list($Parts) = explode("|",$y); $Count = count($Parts); for($Sub1=0,$Sub2=1;$Sub2<=$Count;$Sub1++,$Sub1++,$Sub2++,$Sub2++) echo "
$Parts[$Sub1] $Parts[Sub2]\n"; Not tested. Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. From dcech at phpwerx.net Thu Jul 3 10:45:15 2008 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 03 Jul 2008 10:45:15 -0400 Subject: [nycphp-talk] string function In-Reply-To: <20080703143755.6164FBDF500@mail.lansmash.com> References: <20080703143755.6164FBDF500@mail.lansmash.com> Message-ID: <486CE5FB.5060307@phpwerx.net> Urb LeJeune wrote: >> An unknown string,its format is: >> y="tnk81|98.8$|yuhj78t|32.6$|tris78y|459.78$|....." > > list($Parts) = explode("|",$y); > $Count = count($Parts); > for($Sub1=0,$Sub2=1;$Sub2<=$Count;$Sub1++,$Sub1++,$Sub2++,$Sub2++) > echo "
$Parts[$Sub1] $Parts[Sub2]\n"; You could write this a little more simply as: $parts = explode('|',$y); $cnt = count($parts); for ($i = 0;$i < $cnt - 1;$i += 2) { echo $parts[$i] .' '. $parts[$i+1] ."
\n"; } Dan From rotsen at gmail.com Thu Jul 3 10:48:28 2008 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Thu, 3 Jul 2008 07:48:28 -0700 Subject: [nycphp-talk] string function In-Reply-To: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> Message-ID: Is this the same thing that you are trying to accomplish with the for loop? for($Sub1=0,$Sub2=1;$Sub2<=$Count;) { echo "
$Parts[$Sub1] $Parts[Sub2]\n"; $Sub1+=2; $Sub2+=2; } I just want to know if I read it correctly. Thanks, Nestor :-) On Thu, Jul 3, 2008 at 7:36 AM, Urb LeJeune wrote: > > An unknown string,its format is: >> y="tnk81|98.8$|yuhj78t|32.6$|tris78y|459.78$|....." >> > > list($Parts) = explode("|",$y); > $Count = count($Parts); > for($Sub1=0,$Sub2=1;$Sub2<=$Count;$Sub1++,$Sub1++,$Sub2++,$Sub2++) > echo "
$Parts[$Sub1] $Parts[Sub2]\n"; > > Not tested. > > > Urb > > Dr. Urban A. LeJeune, President > E-Government.com > 609-294-0320 800-204-9545 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > E-Government.com lowers you costs while increasing your expectations. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenrbnsn at rbnsn.com Thu Jul 3 11:01:36 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Thu, 03 Jul 2008 11:01:36 -0400 Subject: [nycphp-talk] string function Message-ID: <20080703110136.3pqm73kq8o00k04s@www.rbnsn.com> Quoting Urb LeJeune : > >> An unknown string,its format is: >> y="tnk81|98.8$|yuhj78t|32.6$|tris78y|459.78$|....." > > list($Parts) = explode("|",$y); > $Count = count($Parts); > for($Sub1=0,$Sub2=1;$Sub2<=$Count;$Sub1++,$Sub1++,$Sub2++,$Sub2++) > echo "
$Parts[$Sub1] $Parts[Sub2]\n"; > This works (tested) $Parts[$Sub1] $Parts[$i]\n"; } ?> Ken Robinson From urb at e-government.com Thu Jul 3 11:11:43 2008 From: urb at e-government.com (Urb LeJeune) Date: Thu, 03 Jul 2008 11:11:43 -0400 Subject: [nycphp-talk] string function In-Reply-To: References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> Message-ID: >Is this the same thing that you are trying to accomplish with the >for loop? Yes but increments (or decrements) are executed much more efficiently than additions. Urb >for($Sub1=0,$Sub2=1;$Sub2<=$Count;) >{ > echo "
$Parts[$Sub1] $Parts[Sub2]\n"; > $Sub1+=2; > $Sub2+=2; >} > >I just want to know if I read it correctly. > >Thanks, > >Nestor :-) > >On Thu, Jul 3, 2008 at 7:36 AM, Urb LeJeune ><urb at e-government.com> wrote: > >An unknown string,its format is: >y="tnk81|98.8$|yuhj78t|32.6$|tris78y|459.78$|....." > > >list($Parts) = explode("|",$y); >$Count = count($Parts); >for($Sub1=0,$Sub2=1;$Sub2<=$Count;$Sub1++,$Sub1++,$Sub2++,$Sub2++) > echo "
$Parts[$Sub1] $Parts[Sub2]\n"; Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rolan at omnistep.com Thu Jul 3 11:41:46 2008 From: rolan at omnistep.com (Rolan Yang) Date: Thu, 03 Jul 2008 11:41:46 -0400 Subject: [nycphp-talk] string function In-Reply-To: <486CE5FB.5060307@phpwerx.net> References: <20080703143755.6164FBDF500@mail.lansmash.com> <486CE5FB.5060307@phpwerx.net> Message-ID: <486CF33A.5020405@omnistep.com> Dan Cech wrote: > Urb LeJeune wrote: >>> An unknown string,its format is: >>> y="tnk81|98.8$|yuhj78t|32.6$|tris78y|459.78$|....." >> .. > > You could write this a little more simply as: > > $parts = explode('|',$y); > $cnt = count($parts); > > for ($i = 0;$i < $cnt - 1;$i += 2) { > echo $parts[$i] .' '. $parts[$i+1] ."
\n"; > } > > Dan OR $p=explode('|',$y); while ($p) { echo array_shift($p).' '.array_shift($p)."\n"; } Rolan From jcampbell1 at gmail.com Thu Jul 3 12:06:54 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 3 Jul 2008 12:06:54 -0400 Subject: [nycphp-talk] string function In-Reply-To: <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> Message-ID: <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> On Thu, Jul 3, 2008 at 11:11 AM, Urb LeJeune wrote: > Is this the same thing that you are trying to accomplish with the > for loop? > > Yes but increments (or decrements) are executed much more efficiently than > additions. This is wrong for three reasons: 1) 4 ++ increments is 2.5x slower than one increment by two. 2) Unless you are using an opcode cache, any gains from faster execution are probably lost by the additional parsing required. Of course this depends of the number of elements in the loop. 3) Unreadable code is orders of magnitude more expensive than the performance benefit. Ignoring #3, the fastest way to write it is something like: $p = explode('|',$y); for($i=0,$c = count($p);$i<$c;) { echo $p[$i++],' ', $p[$i++], "
\n"; } Removing the string concatenation is more beneficial than any increment / decrement hacking. Regards, John C. From michael.southwell at nyphp.com Thu Jul 3 12:45:07 2008 From: michael.southwell at nyphp.com (Michael Southwell) Date: Thu, 03 Jul 2008 12:45:07 -0400 Subject: [nycphp-talk] string function In-Reply-To: <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> Message-ID: <486D0213.3020502@nyphp.com> John Campbell wrote: > $p = explode('|',$y); > for($i=0,$c = count($p);$i<$c;) { > echo $p[$i++],' ', $p[$i++], "
\n"; > } I believe this will miss the first element of $p; you need instead: for ( $i = -1, $c = count( $p ); $i < $c; ) { -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From david at davidmintz.org Thu Jul 3 13:10:09 2008 From: david at davidmintz.org (David Mintz) Date: Thu, 3 Jul 2008 13:10:09 -0400 Subject: [nycphp-talk] string function In-Reply-To: <486D0213.3020502@nyphp.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> <486D0213.3020502@nyphp.com> Message-ID: <721f1cc50807031010y69be4465u868339c2bcde5ffd@mail.gmail.com> On Thu, Jul 3, 2008 at 12:45 PM, Michael Southwell < michael.southwell at nyphp.com> wrote: > John Campbell wrote: > >> $p = explode('|',$y); >> for($i=0,$c = count($p);$i<$c;) { >> echo $p[$i++],' ', $p[$i++], "
\n"; >> } >> > > I believe this will miss the first element of $p; you need instead: > > for ( $i = -1, $c = count( $p ); $i < $c; ) { > > Although calling count() repreatedly is also more expensive than doing it once and saving its value in a variable, isn't it? and.... aren't you glad this guy asked this question? -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Thu Jul 3 13:22:47 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 3 Jul 2008 13:22:47 -0400 Subject: [nycphp-talk] string function In-Reply-To: <721f1cc50807031010y69be4465u868339c2bcde5ffd@mail.gmail.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> <486D0213.3020502@nyphp.com> <721f1cc50807031010y69be4465u868339c2bcde5ffd@mail.gmail.com> Message-ID: <8f0676b40807031022p100c4e8bnc2dcb8e9e0c0d313@mail.gmail.com> On Thu, Jul 3, 2008 at 1:10 PM, David Mintz wrote: > > > On Thu, Jul 3, 2008 at 12:45 PM, Michael Southwell > wrote: >> >> John Campbell wrote: >>> >>> $p = explode('|',$y); >>> for($i=0,$c = count($p);$i<$c;) { >>> echo $p[$i++],' ', $p[$i++], "
\n"; >>> } >> >> I believe this will miss the first element of $p; you need instead: >> >> for ( $i = -1, $c = count( $p ); $i < $c; ) { >> > > Although calling count() repreatedly is also more expensive than doing it > once and saving its value in a variable, isn't it? The code doesn't call count repeatedly because it is in the first part of the for loop. > and.... aren't you glad this guy asked this question? No. From jcampbell1 at gmail.com Thu Jul 3 13:29:46 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 3 Jul 2008 13:29:46 -0400 Subject: [nycphp-talk] string function In-Reply-To: <8f0676b40807031022p100c4e8bnc2dcb8e9e0c0d313@mail.gmail.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> <486D0213.3020502@nyphp.com> <721f1cc50807031010y69be4465u868339c2bcde5ffd@mail.gmail.com> <8f0676b40807031022p100c4e8bnc2dcb8e9e0c0d313@mail.gmail.com> Message-ID: <8f0676b40807031029x5f27ddc2wa4dba10d5ab3cee6@mail.gmail.com> On Thu, Jul 3, 2008 at 1:22 PM, John Campbell wrote: > On Thu, Jul 3, 2008 at 1:10 PM, David Mintz wrote: >> >> >> On Thu, Jul 3, 2008 at 12:45 PM, Michael Southwell >> wrote: >>> >>> John Campbell wrote: >>>> >>>> $p = explode('|',$y); >>>> for($i=0,$c = count($p);$i<$c;) { >>>> echo $p[$i++],' ', $p[$i++], "
\n"; >>>> } >>> >>> I believe this will miss the first element of $p; you need instead: >>> >>> for ( $i = -1, $c = count( $p ); $i < $c; ) { >>> >> >> Although calling count() repreatedly is also more expensive than doing it >> once and saving its value in a variable, isn't it? > > The code doesn't call count repeatedly because it is in the first part > of the for loop. > >> and.... aren't you glad this guy asked this question? > > No. > From jcampbell1 at gmail.com Thu Jul 3 13:30:54 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 3 Jul 2008 13:30:54 -0400 Subject: [nycphp-talk] string function In-Reply-To: <8f0676b40807031022p100c4e8bnc2dcb8e9e0c0d313@mail.gmail.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> <486D0213.3020502@nyphp.com> <721f1cc50807031010y69be4465u868339c2bcde5ffd@mail.gmail.com> <8f0676b40807031022p100c4e8bnc2dcb8e9e0c0d313@mail.gmail.com> Message-ID: <8f0676b40807031030t2e9089d0u35a37ab767d58104@mail.gmail.com> >> and.... aren't you glad this guy asked this question? > > No. > Grr... I misread what you wrote... I thought you wrote, "are you the guy that asked the question?" ... I need a vacation. From jcampbell1 at gmail.com Thu Jul 3 13:32:43 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 3 Jul 2008 13:32:43 -0400 Subject: [nycphp-talk] string function In-Reply-To: <486D0213.3020502@nyphp.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> <486D0213.3020502@nyphp.com> Message-ID: <8f0676b40807031032m4e360860ya024fc151dc41647@mail.gmail.com> On Thu, Jul 3, 2008 at 12:45 PM, Michael Southwell wrote: > John Campbell wrote: >> >> $p = explode('|',$y); >> for($i=0,$c = count($p);$i<$c;) { >> echo $p[$i++],' ', $p[$i++], "
\n"; >> } > > I believe this will miss the first element of $p; you need instead: > > for ( $i = -1, $c = count( $p ); $i < $c; ) { If you start from -1, then you would need to use ++$i rather than $i++ Starting from -1 and using ++$i would be faster than what I wrote. From gatzby3jr at gmail.com Thu Jul 3 13:42:16 2008 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Thu, 3 Jul 2008 13:42:16 -0400 Subject: [nycphp-talk] string function In-Reply-To: <486D0213.3020502@nyphp.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> <486D0213.3020502@nyphp.com> Message-ID: <29da5d150807031042g529d812dm5c5695f468a9d8e8@mail.gmail.com> No. $i++ returns the value of $i, then increments it. On Thu, Jul 3, 2008 at 12:45 PM, Michael Southwell < michael.southwell at nyphp.com> wrote: > John Campbell wrote: > >> $p = explode('|',$y); >> for($i=0,$c = count($p);$i<$c;) { >> echo $p[$i++],' ', $p[$i++], "
\n"; >> } >> > > I believe this will miss the first element of $p; you need instead: > > for ( $i = -1, $c = count( $p ); $i < $c; ) { > > > -- > ================= > Michael Southwell > Vice President, Education > NYPHP TRAINING: http://nyphp.com/Training/Indepth > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Thu Jul 3 13:45:33 2008 From: tedd at sperling.com (tedd) Date: Thu, 3 Jul 2008 13:45:33 -0400 Subject: [nycphp-talk] string function In-Reply-To: <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> Message-ID: At 12:06 PM -0400 7/3/08, John Campbell wrote: >On Thu, Jul 3, 2008 at 11:11 AM, Urb LeJeune wrote: >> Is this the same thing that you are trying to accomplish with the >> for loop? >> >> Yes but increments (or decrements) are executed much more efficiently than >> additions. > >This is wrong for three reasons: >1) 4 ++ increments is 2.5x slower than one increment by two. >2) Unless you are using an opcode cache, any gains from faster >execution are probably lost by the additional parsing required. Of >course this depends of the number of elements in the loop. >3) Unreadable code is orders of magnitude more expensive than the >performance benefit. > >Ignoring #3, the fastest way to write it is something like: > >$p = explode('|',$y); >for($i=0,$c = count($p);$i<$c;) { >echo $p[$i++],' ', $p[$i++], "
\n"; >} > >Removing the string concatenation is more beneficial than any >increment / decrement hacking. Geek fight! I think that all the time spent debating this issue far exceeds the time actually saved between using one technique as compared to the other over the next 100+ years. It's interesting to see what we get our collective shorts in a knot about. :-) Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From gatzby3jr at gmail.com Thu Jul 3 13:52:06 2008 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Thu, 3 Jul 2008 13:52:06 -0400 Subject: [nycphp-talk] string function In-Reply-To: <8f0676b40807031032m4e360860ya024fc151dc41647@mail.gmail.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> <486D0213.3020502@nyphp.com> <8f0676b40807031032m4e360860ya024fc151dc41647@mail.gmail.com> Message-ID: <29da5d150807031052y77dea2f1i1074989ad988f40f@mail.gmail.com> On Thu, Jul 3, 2008 at 1:32 PM, John Campbell wrote: > On Thu, Jul 3, 2008 at 12:45 PM, Michael Southwell > wrote: > > John Campbell wrote: > >> > >> $p = explode('|',$y); > >> for($i=0,$c = count($p);$i<$c;) { > >> echo $p[$i++],' ', $p[$i++], "
\n"; > >> } > > > > I believe this will miss the first element of $p; you need instead: > > > > for ( $i = -1, $c = count( $p ); $i < $c; ) { > > If you start from -1, then you would need to use ++$i rather than $i++ > > Starting from -1 and using ++$i would be faster than what I wrote. Starting at -1 to avoid using ++$i seems way more confusing than starting at 0 and using $i++. As someone mentioned above, confusing code will offset any computation savings you gain. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.southwell at nyphp.com Thu Jul 3 14:38:44 2008 From: michael.southwell at nyphp.com (Michael Southwell) Date: Thu, 03 Jul 2008 14:38:44 -0400 Subject: [nycphp-talk] string function In-Reply-To: <8f0676b40807031032m4e360860ya024fc151dc41647@mail.gmail.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> <486D0213.3020502@nyphp.com> <8f0676b40807031032m4e360860ya024fc151dc41647@mail.gmail.com> Message-ID: <486D1CB4.1080305@nyphp.com> John Campbell wrote: > If you start from -1, then you would need to use ++$i rather than $i++ aha, the first *really good* illustration of the difference that I have ever seen ;-) -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From michael.southwell at nyphp.com Thu Jul 3 14:52:29 2008 From: michael.southwell at nyphp.com (Michael Southwell) Date: Thu, 03 Jul 2008 14:52:29 -0400 Subject: [nycphp-talk] string function In-Reply-To: <29da5d150807031052y77dea2f1i1074989ad988f40f@mail.gmail.com> References: <486ce40d.1e2a400a.6aee.3594SMTPIN_ADDED@mx.google.com> <486ceff4.0c17400a.336f.47dbSMTPIN_ADDED@mx.google.com> <8f0676b40807030906m5c886946l35cde557e493e2df@mail.gmail.com> <486D0213.3020502@nyphp.com> <8f0676b40807031032m4e360860ya024fc151dc41647@mail.gmail.com> <29da5d150807031052y77dea2f1i1074989ad988f40f@mail.gmail.com> Message-ID: <486D1FED.2050601@nyphp.com> Brian O'Connor wrote: > >> $p = explode('|',$y); > >> for($i=0,$c = count($p);$i<$c;) { > >> echo $p[$i++],' ', $p[$i++], "
\n"; > >> } > > > > I believe this will miss the first element of $p; you need instead: > > > > for ( $i = -1, $c = count( $p ); $i < $c; ) { > > If you start from -1, then you would need to use ++$i rather than $i++ > > Starting from -1 and using ++$i would be faster than what I wrote. > > > Starting at -1 to avoid using ++$i seems way more confusing than > starting at 0 and using $i++. As someone mentioned above, confusing > code will offset any computation savings you gain. And in the interest of being as clear as possible here, and not to mislead any lurkers or anybody who can be as dumb as I can: I was wrong when I said "this will miss the first element." The reason is that echo $p[$i++] first echoes $p[$i] and only then increments $i; it does *not* echo element $i++ as I must have been thinking (out of stupidity or inattention or whatever) when I wrote that. -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From ka at kacomputerconsulting.com Thu Jul 3 22:05:31 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Thu, 3 Jul 2008 19:05:31 -0700 Subject: [nycphp-talk] string function Message-ID: <1215137131.14744@coral.he.net> If rewriting this function saves me .0001 milliseconds of processing time, can I spend that time watching baseball instead of writing code?? :) Kristina > At 12:06 PM -0400 7/3/08, John Campbell wrote: > >On Thu, Jul 3, 2008 at 11:11 AM, Urb LeJeune wrote: > >> Is this the same thing that you are trying to accomplish with the > >> for loop? > >> > >> Yes but increments (or decrements) are executed much more efficiently than > >> additions. > > > >This is wrong for three reasons: > >1) 4 ++ increments is 2.5x slower than one increment by two. > >2) Unless you are using an opcode cache, any gains from faster > >execution are probably lost by the additional parsing required. Of > >course this depends of the number of elements in the loop. > >3) Unreadable code is orders of magnitude more expensive than the > >performance benefit. > > > >Ignoring #3, the fastest way to write it is something like: > > > >$p = explode('|',$y); > >for($i=0,$c = count($p);$i<$c;) { > >echo $p[$i++],' ', $p[$i++], "
\n"; > >} > > > >Removing the string concatenation is more beneficial than any > >increment / decrement hacking. > > > > > Geek fight! > > I think that all the time spent debating this issue far exceeds the > time actually saved between using one technique as compared to the > other over the next 100+ years. > > It's interesting to see what we get our collective shorts in a knot about. :-) > > Cheers, > > tedd > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From paulcheung at tiscali.co.uk Fri Jul 4 03:35:06 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Fri, 4 Jul 2008 08:35:06 +0100 Subject: [nycphp-talk] Disabling browser back button. References: <2478B6E0A5284FE9858A62B8DC64C4DD@X9183> Message-ID: <562BCE6EE5F34965802930E52D2887F5@X9183> Hi Tedd, Thanks for the solution, it is very much appriciated. Cheers - Paul ----- Original Message ----- From: "tedd" To: "NYPHP Talk" Sent: Sunday, June 22, 2008 9:13 PM Subject: Re: [nycphp-talk] Disabling browser back button. > >Hi Tedd, >>Sorry to say it didn't work or at least I couldn't get it to work. As you >>see the only thing I did was to tidy up the last $_SESSION['token']. >>however I did try using True and False which disabled me completely. >> >>> $token = isset($_SESSION['token']) ? $_SESSION['token'] : 0; >> if ($token == 1) >> { >> exit(); >> } >>$_SESSION['token'] = 1; >>?> >> >> create account/access codes >> >> >>Cheers - Paul > > > Paul: > > It does work -- here's a working example: > > http://webbytedd.com/bb/one-time/ > > You can only see it once per session and it uses exactly the code I > posted. > > You might take out that ob_start() and try it again. > > Cheers, > > tedd > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From brian at realm3.com Fri Jul 4 07:38:18 2008 From: brian at realm3.com (Brian D.) Date: Fri, 4 Jul 2008 07:38:18 -0400 Subject: [nycphp-talk] string function In-Reply-To: References: Message-ID: Note: This response is more or less tongue in cheek, and is not meant to be taken seriously. string(5) "98.8$" ["yuhj78t"]=> string(5) "32.6$" ["tris78y"]=> string(7) "459.78$" } On Wed, Jul 2, 2008 at 5:35 PM, chad qian wrote: > An unknown string,its format is: > y="tnk81|98.8$|yuhj78t|32.6$|tris78y|459.78$|....." > > I need output format: > tnk81 98.8$ > yuhj78t 32.6$ > tris78y 459.78$ > ......................... > > How to program php to get this output?String is divided by "|". > > Thanks! > > chad > > ________________________________ > Need to know now? Get instant answers with Windows Live Messenger. IM on > your terms. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] Information architecture, application development. phone: (917) 512-3594 fax: (440) 744-3559 From danielc at analysisandsolutions.com Fri Jul 4 13:30:55 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 4 Jul 2008 13:30:55 -0400 Subject: [nycphp-talk] mysql slow Internet connection trickery In-Reply-To: <4868E06D.9090603@polymerdb.org> References: <4868E06D.9090603@polymerdb.org> Message-ID: <20080704173055.GA4538@panix.com> Allen: Where is the MySQL server each of the locations is trying to connect to? I'm guessing it's not in Paraguay. Perhaps you can improve reliability by having the central server be in one of the hotels there. --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 ashaw at polymerdb.org Sat Jul 5 08:44:50 2008 From: ashaw at polymerdb.org (Allen Shaw) Date: Sat, 05 Jul 2008 08:44:50 -0400 Subject: [nycphp-talk] mysql slow Internet connection trickery In-Reply-To: <20080704173055.GA4538@panix.com> References: <4868E06D.9090603@polymerdb.org> <20080704173055.GA4538@panix.com> Message-ID: <486F6CC2.6060708@polymerdb.org> Daniel Convissor wrote: > Where is the MySQL server each of the locations is trying to connect to? > I'm guessing it's not in Paraguay. Perhaps you can improve reliability > by having the central server be in one of the hotels there. > Hi Dan, It's a good idea, but this application is accessed worldwide for read and write by various affiliates. I wouldn't want to put the central server behind this slow connection. But one idea is, if we're going to some kind of proxy system, we could do it on a single local server, rather than on each user's laptop. Doing it on the laptops also makes my skin crawl from a security viewpoint, since it would mean putting a copy of the data on the laptop itself (think "Veterans Administration"...), and it's also a tedious PITA from an installation/maintenance viewpoint. What might work well is some kind of headless server-in-a-box to run the local server. Something fairly low-profile, portable, and unobtrusive, thus less likely than a laptop to get stolen by petty thieves (many people wouldn't even know what it was). This would be far better than having to install the local application on each laptop, from viewpoints of installation, maintenance, and security. For this event it's by now too late for a solution, as we're already over the hottest part of the work. But for the future this headless local server idea is probably the best way to go. Thanks. - Allen -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From lists at zaunere.com Sat Jul 5 10:58:16 2008 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 5 Jul 2008 10:58:16 -0400 Subject: [nycphp-talk] mysql slow Internet connection trickery In-Reply-To: <4868E06D.9090603@polymerdb.org> References: <4868E06D.9090603@polymerdb.org> Message-ID: <002a01c8deaf$8ec7c900$ac575b00$@com> > Still, I'm trying to make a way for the user to have "mostly current" > data from the central system, and also enter data without waiting for > each request to be approved. I have been thinking you could run a local > copy of the system on the user's laptop, then have some helper program > in the back that communicates with the central server to send and > receive data asynchronously, pushing user changes and polling for new > data from the central server as fast as the Internet connection allows. > The idea is that, except for a few minutes of latency, the user would > never know the difference. > > The big problem I'm running into is managing potential data collisions: > data changes from two or more users that conflict with each other but > aren't discovered until later because of the latency. As far as I can > see this is an application-specific problem -- that is, it's up to the > developer (me) to make the application smart enough to watch conflicts > and prevent collisions. Jumping into this late... You may want to consider using web services. Data would be stored in a local MySQL database, and then as you mention, a central server aggregates the data from all the locations. The reason I mention web services, is that HTTP is typically more robust over flakey connectivity than database protocols are. The central web service would then hand out data per requests from the remote offices, if it didn't already exist in the local cache, or it was determined to be stale. Using a optimistic type locking scheme and built in conflict resolution, the central web service would then handle data sent back from the remote locations. Each remote location, however, could of course use a local MySQL instance, and in a fully transactional way. Then on some event or time basis, data would be sent back to the central office over HTTP (probably actually HTTPS). Depending on the complexity of the data, though, this may be a good or bad idea. H From chsnyder at gmail.com Sat Jul 5 12:27:11 2008 From: chsnyder at gmail.com (csnyder) Date: Sat, 5 Jul 2008 12:27:11 -0400 Subject: [nycphp-talk] mysql slow Internet connection trickery In-Reply-To: <486F6CC2.6060708@polymerdb.org> References: <4868E06D.9090603@polymerdb.org> <20080704173055.GA4538@panix.com> <486F6CC2.6060708@polymerdb.org> Message-ID: > What might work well is some kind of headless server-in-a-box to run the > local server. Something fairly low-profile, portable, and unobtrusive, thus > less likely than a laptop to get stolen by petty thieves (many people > wouldn't even know what it was). This would be far better than having to > install the local application on each laptop, from viewpoints of > installation, maintenance, and security. HP T5735 is along the lines of what you want. Sold as a thin client, it also makes an excellent, low-power thin server when running a LAMP stack. Or you could just use a beat-up old laptop, which has the advantage of battery backup when the power goes out. chris. From chsnyder at gmail.com Sat Jul 5 12:33:13 2008 From: chsnyder at gmail.com (csnyder) Date: Sat, 5 Jul 2008 12:33:13 -0400 Subject: [nycphp-talk] mysql slow Internet connection trickery In-Reply-To: <002a01c8deaf$8ec7c900$ac575b00$@com> References: <4868E06D.9090603@polymerdb.org> <002a01c8deaf$8ec7c900$ac575b00$@com> Message-ID: On Sat, Jul 5, 2008 at 10:58 AM, Hans Zaunere wrote: > You may want to consider using web services. Data would be stored in a > local MySQL database, and then as you mention, a central server aggregates > the data from all the locations. > > The reason I mention web services, is that HTTP is typically more robust > over flakey connectivity than database protocols are. Hans, have you seen something like this in production? It seems like a great open source project that could become part of MySQL's lineup, for use in exactly the type of situation that Allen describes. MySQL Master <--> HTTPS Transaction Broker <--> Remote MySQL Cache It's kind of the same architecture that Gears wants to put you in on the client: you keep a local copy of all the data that's important to you, synchronized whenever you are online with the main database. The pattern is everywhere, but I've never seen a tool that was purpose-built to do this between MySQL instances. chris. From lists at zaunere.com Sat Jul 5 12:58:20 2008 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 5 Jul 2008 12:58:20 -0400 Subject: [nycphp-talk] mysql slow Internet connection trickery In-Reply-To: References: <4868E06D.9090603@polymerdb.org> <002a01c8deaf$8ec7c900$ac575b00$@com> Message-ID: <003b01c8dec0$54821f00$fd865d00$@com> > > You may want to consider using web services. Data would be stored in a > > local MySQL database, and then as you mention, a central server aggregates > > the data from all the locations. > > > > The reason I mention web services, is that HTTP is typically more robust > > over flakey connectivity than database protocols are. > > Hans, have you seen something like this in production? It seems like a > great open source project that could become part of MySQL's lineup, > for use in exactly the type of situation that Allen describes. > > MySQL Master <--> HTTPS Transaction Broker <--> Remote MySQL Cache > > It's kind of the same architecture that Gears wants to put you in on > the client: you keep a local copy of all the data that's important to > you, synchronized whenever you are online with the main database. The > pattern is everywhere, but I've never seen a tool that was > purpose-built to do this between MySQL instances. I haven't seen a general purpose tool for this type of thing, but have seen the same architecture done in a couple of places. For example, desktop patch level tracking and location tracking for trains. The caveat to all of this is the complexity of the data. As data increases in complexity, conflict resolution gets more difficult on the aggregating web service. And perhaps more importantly, the actual XML/POST/GET/etc actions that transmit the data between remote and central location can grow quickly and be complex to parse/structure themselves. But as you mention, the pattern is good/growing, and useful wherever connectivity can't be guaranteed, or is known to be intermittent. HTTP is a good fit because of its asynchronous nature, whereas database protocols are often latency and connectivity sensitive. But with a flexible framework, the purpose specific logic could be dropped in where needed, and this would be an interesting project. H From edwardpotter at gmail.com Sat Jul 5 14:07:20 2008 From: edwardpotter at gmail.com (Edward Potter) Date: Sat, 5 Jul 2008 14:07:20 -0400 Subject: [nycphp-talk] mysql slow Internet connection trickery In-Reply-To: <003b01c8dec0$54821f00$fd865d00$@com> References: <4868E06D.9090603@polymerdb.org> <002a01c8deaf$8ec7c900$ac575b00$@com> <003b01c8dec0$54821f00$fd865d00$@com> Message-ID: Can you take advantage of a bunch of PCs with EDVO cards? Remove the bandwidth issue from the equation? ------ Paraguay's mobile sector is far more dynamic. New investment and competition are leading to exceptional growth in the take-up of mobile services and innovative new mobile services. There are four major mobile operators offering mainly GSM/GPRS services. They are Telecel (Millicom), Hola (KDDI), Personal (Telecom Argentina) and CTI Movil, (Amercia Movil). The broadband sector is directly benefiting from these trends. Since 2001, several mobile operators have been implementing wireless broadband options (WiFi and WiMAX technologies) that since mid-2007, provide a serious alternative to fixed line broadband services. In the near future, Paraguay's ISPs are predicted to serve more homes and businesses via wireless broadband than ADSL. http://point-topic.com/content/operatorSource/profiles2/paraguay-broadband-overview.htm On Sat, Jul 5, 2008 at 12:58 PM, Hans Zaunere wrote: >> > You may want to consider using web services. Data would be stored in a >> > local MySQL database, and then as you mention, a central server aggregates >> > the data from all the locations. >> > >> > The reason I mention web services, is that HTTP is typically more robust >> > over flakey connectivity than database protocols are. >> >> Hans, have you seen something like this in production? It seems like a >> great open source project that could become part of MySQL's lineup, >> for use in exactly the type of situation that Allen describes. >> >> MySQL Master <--> HTTPS Transaction Broker <--> Remote MySQL Cache >> >> It's kind of the same architecture that Gears wants to put you in on >> the client: you keep a local copy of all the data that's important to >> you, synchronized whenever you are online with the main database. The >> pattern is everywhere, but I've never seen a tool that was >> purpose-built to do this between MySQL instances. > > I haven't seen a general purpose tool for this type of thing, but have seen the same architecture done in a couple of places. For example, desktop patch level tracking and location tracking for trains. > > The caveat to all of this is the complexity of the data. As data increases in complexity, conflict resolution gets more difficult on the aggregating web service. And perhaps more importantly, the actual XML/POST/GET/etc actions that transmit the data between remote and central location can grow quickly and be complex to parse/structure themselves. > > But as you mention, the pattern is good/growing, and useful wherever connectivity can't be guaranteed, or is known to be intermittent. HTTP is a good fit because of its asynchronous nature, whereas database protocols are often latency and connectivity sensitive. But with a flexible framework, the purpose specific logic could be dropped in where needed, and this would be an interesting project. > > H > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Blog: http://www.preceptress.com Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com Projects: http://flickr.com/photos/86842405 at N00/ Store: http://astore.amazon.com/httpwwwutopic-20 From arzala at gmail.com Sun Jul 6 02:25:25 2008 From: arzala at gmail.com (Anirudh Zala) Date: Sun, 6 Jul 2008 11:55:25 +0530 Subject: [nycphp-talk] mysql slow Internet connection trickery In-Reply-To: References: <4868E06D.9090603@polymerdb.org> <003b01c8dec0$54821f00$fd865d00$@com> Message-ID: <200807061155.25640.arzala@gmail.com> On Saturday 05 Jul 2008 23:37:20 Edward Potter wrote: > Can you take advantage of a bunch of PCs with EDVO cards? Remove the > bandwidth issue from the equation? > > ------ > Paraguay's mobile sector is far more dynamic. New investment and > competition are leading to exceptional growth in the take-up of mobile > services and innovative new mobile services. There are four major > mobile operators offering mainly GSM/GPRS services. They are Telecel > (Millicom), Hola (KDDI), Personal (Telecom Argentina) and CTI Movil, > (Amercia Movil). > > The broadband sector is directly benefiting from these trends. Since > 2001, several mobile operators have been implementing wireless > broadband options (WiFi and WiMAX technologies) that since mid-2007, > provide a serious alternative to fixed line broadband services. In the > near future, Paraguay's ISPs are predicted to serve more homes and > businesses via wireless broadband than ADSL. I was thinking on same line. In developing countries like India, China, Brazil and other Latin american and African countries where purchasing PC, Internet connection etc. could be costly and sometimes not feasible, Using mobile services like SMS etc. can be very helpful. Although my suggestion is not direct solution of your problem, but if you have control over design of your application, you can use use Mobile services to handle dynamic operations of your websites such as booking/canelling rooms and making requests which are bound to create conflict when internet is slow/down. Hence you can put static data on website which may not effect slow connection like display of rooms/rates/information about hotel etc., and use mobile services (like sending SMS to book room) whenever dynamic operation is required. This kind of solutions are being very popular in developing countries because mobile costs < 50$ and you can use it from anywhere as far as network is there. Thanks Anirudh Zala > > http://point-topic.com/content/operatorSource/profiles2/paraguay-broadband- >overview.htm > > On Sat, Jul 5, 2008 at 12:58 PM, Hans Zaunere wrote: > >> > You may want to consider using web services. Data would be stored in > >> > a local MySQL database, and then as you mention, a central server > >> > aggregates the data from all the locations. > >> > > >> > The reason I mention web services, is that HTTP is typically more > >> > robust over flakey connectivity than database protocols are. > >> > >> Hans, have you seen something like this in production? It seems like a > >> great open source project that could become part of MySQL's lineup, > >> for use in exactly the type of situation that Allen describes. > >> > >> MySQL Master <--> HTTPS Transaction Broker <--> Remote MySQL Cache > >> > >> It's kind of the same architecture that Gears wants to put you in on > >> the client: you keep a local copy of all the data that's important to > >> you, synchronized whenever you are online with the main database. The > >> pattern is everywhere, but I've never seen a tool that was > >> purpose-built to do this between MySQL instances. > > > > I haven't seen a general purpose tool for this type of thing, but have > > seen the same architecture done in a couple of places. For example, > > desktop patch level tracking and location tracking for trains. > > > > The caveat to all of this is the complexity of the data. As data > > increases in complexity, conflict resolution gets more difficult on the > > aggregating web service. And perhaps more importantly, the actual > > XML/POST/GET/etc actions that transmit the data between remote and > > central location can grow quickly and be complex to parse/structure > > themselves. > > > > But as you mention, the pattern is good/growing, and useful wherever > > connectivity can't be guaranteed, or is known to be intermittent. HTTP > > is a good fit because of its asynchronous nature, whereas database > > protocols are often latency and connectivity sensitive. But with a > > flexible framework, the purpose specific logic could be dropped in where > > needed, and this would be an interesting project. > > > > H > > > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php From matt at atopia.net Sun Jul 6 17:13:40 2008 From: matt at atopia.net (Matt Juszczak) Date: Sun, 6 Jul 2008 17:13:40 -0400 (EDT) Subject: [nycphp-talk] SIMPLE authentication and menu framework Message-ID: <20080706171324.E45478@mercury.atopia.net> I'm looking for a really tiny framework for building an authenticated, dynamic menu-driven web app. Basically, I need to write an application that people can: 1) authenticate to 2) have a menu dynamically generated for them that gives links they can access based on their access I don't mind writing something like this myself, but it seems so basic that I'm sure someone may have written something like it in the past. I don't really want something that's majorly complex. Something simple designed just for this purpose. Any suggestions? From chsnyder at gmail.com Mon Jul 7 08:25:04 2008 From: chsnyder at gmail.com (csnyder) Date: Mon, 7 Jul 2008 08:25:04 -0400 Subject: [nycphp-talk] Upload progress meter Message-ID: Here's a brief writeup of how to enable upload progress bars in PHP. http://undesigned.org.za/2008/07/06/simple-php-upload-progress-meter-using-prototype The PECL extension that enables this is still marked as experimental. I wish browser makers would realize that upload progress is just as important to people as download progress, but at least now we have a way to roll our own. Chris Snyder http://chxor.chxo.com/ From lists at enobrev.com Mon Jul 7 08:34:37 2008 From: lists at enobrev.com (Mark Armendariz) Date: Mon, 07 Jul 2008 08:34:37 -0400 Subject: [nycphp-talk] Upload progress meter In-Reply-To: References: Message-ID: <48720D5D.2040609@enobrev.com> csnyder wrote: > Here's a brief writeup of how to enable upload progress bars in PHP. > http://undesigned.org.za/2008/07/06/simple-php-upload-progress-meter-using-prototype > > The PECL extension that enables this is still marked as experimental. > > I wish browser makers would realize that upload progress is just as > important to people as download progress, but at least now we have a > way to roll our own. > > > Chris Snyder > http://chxor.chxo.com/ > I also recommend swfupload. Has a good deal of control over file types, files size and progress, and the best part is that it's all run via javascript (actual upload is done via swf, but the api is all js). http://swfupload.org/ Mark From jcampbell1 at gmail.com Mon Jul 7 09:42:18 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 7 Jul 2008 09:42:18 -0400 Subject: [nycphp-talk] Upload progress meter In-Reply-To: <48720D5D.2040609@enobrev.com> References: <48720D5D.2040609@enobrev.com> Message-ID: <8f0676b40807070642k4cfc0db2yd178ee12064257e9@mail.gmail.com> > I also recommend swfupload. Has a good deal of control over file types, > files size and progress, and the best part is that it's all run via > javascript (actual upload is done via swf, but the api is all js). > http://swfupload.org/ > +1 for swfupload. It is easy to setup and does everything on the client side. No ajax polling loop necessary, no hidden iframes to do multiple background uploads. IMO, polling the server is the wrong way to do file upload progress bars. As soon as you have more than 1 front end server, it takes a holy hack to make it work. -John C. From brian at realm3.com Mon Jul 7 09:55:51 2008 From: brian at realm3.com (Brian D.) Date: Mon, 7 Jul 2008 09:55:51 -0400 Subject: [nycphp-talk] Upload progress meter In-Reply-To: <8f0676b40807070642k4cfc0db2yd178ee12064257e9@mail.gmail.com> References: <48720D5D.2040609@enobrev.com> <8f0676b40807070642k4cfc0db2yd178ee12064257e9@mail.gmail.com> Message-ID: Does anyone else have problems with SWFUpload freezing Firefox? I'm running FF3 on Ubunty 8.04 and when I load the SWF demo it freezes until the file is completely uploaded. Maybe it's just an Ubuntu problem? -b. On Mon, Jul 7, 2008 at 9:42 AM, John Campbell wrote: >> I also recommend swfupload. Has a good deal of control over file types, >> files size and progress, and the best part is that it's all run via >> javascript (actual upload is done via swf, but the api is all js). >> http://swfupload.org/ >> > > +1 for swfupload. It is easy to setup and does everything on the > client side. No ajax polling loop necessary, no hidden iframes to do > multiple background uploads. > > IMO, polling the server is the wrong way to do file upload progress > bars. As soon as you have more than 1 front end server, it takes a > holy hack to make it work. > > -John C. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] Information architecture, application development. phone: (917) 512-3594 fax: (440) 744-3559 From chsnyder at gmail.com Mon Jul 7 10:05:05 2008 From: chsnyder at gmail.com (csnyder) Date: Mon, 7 Jul 2008 10:05:05 -0400 Subject: [nycphp-talk] Upload progress meter In-Reply-To: <48720D5D.2040609@enobrev.com> References: <48720D5D.2040609@enobrev.com> Message-ID: On Mon, Jul 7, 2008 at 8:34 AM, Mark Armendariz wrote: > > I also recommend swfupload. Has a good deal of control over file types, > files size and progress, and the best part is that it's all run via > javascript (actual upload is done via swf, but the api is all js). > http://swfupload.org/ > D'oh, I totally forgot about that! Plus you get styled upload controls. The tradeoff with swfupload, as I understand it, is that you need to have a process for temporarily associating the uploaded file(s) with a form submission that gets POSTed separately. Not a big deal, but it means that swfupload isn't always a drop-in replacement for file inputs. From zippy1981 at gmail.com Mon Jul 7 10:38:16 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Mon, 7 Jul 2008 10:38:16 -0400 Subject: [nycphp-talk] Upload progress meter In-Reply-To: References: <48720D5D.2040609@enobrev.com> Message-ID: <5458db3c0807070738s321c62e4teae67ac3dfd2274f@mail.gmail.com> Last time I needed an upload progress bar, I couldnt get the php progress bar to work and I didn't find swf upload. I ended up writing the uplaod page in .net using this component :http://www.brettle.com/Default.aspx?pageid=32 The developer write it in mono from the get go so it works great on linux. On Mon, Jul 7, 2008 at 10:05 AM, csnyder wrote: > On Mon, Jul 7, 2008 at 8:34 AM, Mark Armendariz wrote: > >> >> I also recommend swfupload. Has a good deal of control over file types, >> files size and progress, and the best part is that it's all run via >> javascript (actual upload is done via swf, but the api is all js). >> http://swfupload.org/ >> > > D'oh, I totally forgot about that! Plus you get styled upload controls. > > The tradeoff with swfupload, as I understand it, is that you need to > have a process for temporarily associating the uploaded file(s) with a > form submission that gets POSTed separately. > > Not a big deal, but it means that swfupload isn't always a drop-in > replacement for file inputs. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From tedd at sperling.com Mon Jul 7 13:00:18 2008 From: tedd at sperling.com (tedd) Date: Mon, 7 Jul 2008 13:00:18 -0400 Subject: [nycphp-talk] Upload progress meter In-Reply-To: References: Message-ID: At 8:25 AM -0400 7/7/08, csnyder wrote: >Here's a brief writeup of how to enable upload progress bars in PHP. >http://undesigned.org.za/2008/07/06/simple-php-upload-progress-meter-using-prototype > >The PECL extension that enables this is still marked as experimental. > >I wish browser makers would realize that upload progress is just as >important to people as download progress, but at least now we have a >way to roll our own. > The above progress bar doesn't work for me. I've been down this road several times and each time it's a hassle that usually doesn't work well. I finally just placed a animated gif when I want to show the user something -- it works for me. Here's an assortment of images. http://webbytedd.com/bb/wait/ If anyone has any they want to add, please let me know. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ka at kacomputerconsulting.com Mon Jul 7 15:21:36 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Mon, 7 Jul 2008 12:21:36 -0700 Subject: [nycphp-talk] this works Message-ID: <1215458496.31244@coral.he.net> if (form.exists.checked) { if (form.email1.value == "") { alert( "Please enter your email address." ); form.email1.focus(); return false; } exit; } i'm getting pretty good at this stuff. eh?? :> > At 8:25 AM -0400 7/7/08, csnyder wrote: > >Here's a brief writeup of how to enable upload progress bars in PHP. > >http://undesigned.org.za/2008/07/06/simple-php-upload-progress- meter-using-prototype > > > >The PECL extension that enables this is still marked as experimental. > > > >I wish browser makers would realize that upload progress is just as > >important to people as download progress, but at least now we have a > >way to roll our own. > > > > The above progress bar doesn't work for me. > > I've been down this road several times and each time it's a hassle > that usually doesn't work well. > > I finally just placed a animated gif when I want to show the user > something -- it works for me. > > Here's an assortment of images. > > http://webbytedd.com/bb/wait/ > > If anyone has any they want to add, please let me know. > > Cheers, > > tedd > > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > ------------------- Kristina D. H. Anderson Senior Application Developer/Consultant "Building a Better Tomorrow, One Line of Code at a Time" 646-247-4987 From ka at kacomputerconsulting.com Mon Jul 7 15:25:00 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Mon, 7 Jul 2008 12:25:00 -0700 Subject: Fw: [nycphp-talk] this works Message-ID: <1215458700.32745@coral.he.net> oops sorry, this sent in error to listserv. not trying to hijack or spam!!! ------------- Forwarded message follows ------------- if (form.exists.checked) { if (form.email1.value == "") { alert( "Please enter your email address." ); form.email1.focus(); return false; } exit; } i'm getting pretty good at this stuff. eh?? :> > At 8:25 AM -0400 7/7/08, csnyder wrote: > >Here's a brief writeup of how to enable upload progress bars in PHP. > >http://undesigned.org.za/2008/07/06/simple-php-upload-progress- meter-using-prototype > > > >The PECL extension that enables this is still marked as experimental. > > > >I wish browser makers would realize that upload progress is just as > >important to people as download progress, but at least now we have a > >way to roll our own. > > > > The above progress bar doesn't work for me. > > I've been down this road several times and each time it's a hassle > that usually doesn't work well. > > I finally just placed a animated gif when I want to show the user > something -- it works for me. > > Here's an assortment of images. > > http://webbytedd.com/bb/wait/ > > If anyone has any they want to add, please let me know. > > Cheers, > > tedd > > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > ------------------- Kristina D. H. Anderson Senior Application Developer/Consultant "Building a Better Tomorrow, One Line of Code at a Time" 646-247-4987 _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From rahmin at insite-out.com Mon Jul 7 16:10:46 2008 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Mon, 7 Jul 2008 16:10:46 -0400 Subject: [nycphp-talk] ftp_connect(): php_network_getaddresses: gethostbyname failed In-Reply-To: <29da5d150604270926g1d5373d9o12e79a1d60bb61dd@mail.gmail.com> References: <32be13900604261625q61eac567j1d8e1acf6e445e7f@mail.gmail.com> <002f01c6698b$d612ba40$68e4a144@Rubicon> <29da5d150604261750h274f1ec4ic2cdc4745cbc5c85@mail.gmail.com> <29da5d150604270926g1d5373d9o12e79a1d60bb61dd@mail.gmail.com> Message-ID: The following works fine in shell: ftp ftp.domain.com But my script spins out and returns: Warning: ftp_connect(): php_network_getaddresses: gethostbyname failed in file Why is that? From anthony at thrillist.com Mon Jul 7 16:26:29 2008 From: anthony at thrillist.com (anthony wlodarski) Date: Mon, 7 Jul 2008 16:26:29 -0400 Subject: [nycphp-talk] ftp_connect(): php_network_getaddresses: gethostbyname failed In-Reply-To: References: <32be13900604261625q61eac567j1d8e1acf6e445e7f@mail.gmail.com> <002f01c6698b$d612ba40$68e4a144@Rubicon> <29da5d150604261750h274f1ec4ic2cdc4745cbc5c85@mail.gmail.com> <29da5d150604270926g1d5373d9o12e79a1d60bb61dd@mail.gmail.com> Message-ID: Try this On Jul 7, 2008, at 4:10 PM, Rahmin Pavlovic wrote: > The following works fine in shell: > > ftp ftp.domain.com > > But my script spins out and returns: > > Warning: ftp_connect(): php_network_getaddresses: gethostbyname > failed in file > > Why is that? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From rahmin at insite-out.com Mon Jul 7 17:37:41 2008 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Mon, 7 Jul 2008 17:37:41 -0400 Subject: [nycphp-talk] ftp_connect(): php_network_getaddresses: gethostbyname failed In-Reply-To: References: <32be13900604261625q61eac567j1d8e1acf6e445e7f@mail.gmail.com> <002f01c6698b$d612ba40$68e4a144@Rubicon> <29da5d150604261750h274f1ec4ic2cdc4745cbc5c85@mail.gmail.com> <29da5d150604270926g1d5373d9o12e79a1d60bb61dd@mail.gmail.com> Message-ID: <5F35C32D-BBA6-419E-96DD-A7D1030F151E@insite-out.com> On Jul 7, 2008, at 4:26 PM, anthony wlodarski wrote: > > $ftp_server = "ftp.domain.com"; > > // set up a connection or die > $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to > $ftp_server"); That's exactly what produces the error warning. (I actually had single-quotes, but same result either way.) When I ftp via shell, I get a 220 response straight-away, which makes me think something else is going on.. From rmarscher at beaffinitive.com Mon Jul 7 19:02:07 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 7 Jul 2008 19:02:07 -0400 Subject: [nycphp-talk] mysql slow Internet connection trickery In-Reply-To: <002a01c8deaf$8ec7c900$ac575b00$@com> References: <4868E06D.9090603@polymerdb.org> <002a01c8deaf$8ec7c900$ac575b00$@com> Message-ID: <55AA5ED3-738A-44A2-AF58-FDF0F3D9C6E8@beaffinitive.com> On Jul 5, 2008, at 10:58 AM, Hans Zaunere wrote: > You may want to consider using web services. Data would be stored > in a > local MySQL database, and then as you mention, a central server > aggregates > the data from all the locations. > > The reason I mention web services, is that HTTP is typically more > robust > over flakey connectivity than database protocols are. There's that DBSlayer project that implements mysql calls over json. I don't think it would solve the main problem of conflicts though nor was it meant to be used like this. But... if someone really wanted to start some type of project, they might be able to look there to get a jumpstart on the "web services <> mysql" part. I used to work on Lotus Notes... MySQL replication isn't like replication in Lotus Notes. Kinda funny though that an older technology like that would actually be a decent solution for this. It was built back when the internet connections were probably similar to what these clients are experiencing. I think the majority of us these days expect people to have broadband and pity the fool that doesn't. ;) -Rob From rmarscher at beaffinitive.com Mon Jul 7 19:04:43 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 7 Jul 2008 19:04:43 -0400 Subject: [nycphp-talk] Upload progress meter In-Reply-To: References: Message-ID: <8585D7C1-E95F-40DC-BAFD-20913344F8DF@beaffinitive.com> On Jul 7, 2008, at 8:25 AM, csnyder wrote: > The PECL extension that enables this is still marked as experimental. I think the APC implementation of the server side process is the most recently updated php option. Add this to your php.ini assuming your have APC installed (you do have it installed, right?): apc.rfc1867 = on There are serveral articles about it on the web. If you have a multiple server setup, you still run into the issues Mr. Campbell mentioned. From ben at projectskyline.com Mon Jul 7 19:35:55 2008 From: ben at projectskyline.com (Ben Sgro) Date: Mon, 07 Jul 2008 19:35:55 -0400 Subject: [nycphp-talk] ftp_connect(): php_network_getaddresses: gethostbyname failed In-Reply-To: <5F35C32D-BBA6-419E-96DD-A7D1030F151E@insite-out.com> References: <32be13900604261625q61eac567j1d8e1acf6e445e7f@mail.gmail.com> <002f01c6698b$d612ba40$68e4a144@Rubicon> <29da5d150604261750h274f1ec4ic2cdc4745cbc5c85@mail.gmail.com> <29da5d150604270926g1d5373d9o12e79a1d60bb61dd@mail.gmail.com> <5F35C32D-BBA6-419E-96DD-A7D1030F151E@insite-out.com> Message-ID: <4872A85B.8060203@projectskyline.com> Hello, Maybe php or apache (whomever is execing the process) doesn't have perms to open a socket. If your on a chrooted or some shared hosting plan this might happen - I really don't know though. I'm guessing you googled this error message and found no help? If not, I'd surely hit up google. - Ben Rahmin Pavlovic wrote: > > On Jul 7, 2008, at 4:26 PM, anthony wlodarski wrote: >> >> $ftp_server = "ftp.domain.com"; >> >> // set up a connection or die >> $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to >> $ftp_server"); > > > > That's exactly what produces the error warning. (I actually had > single-quotes, but same result either way.) > > When I ftp via shell, I get a 220 response straight-away, which makes > me think something else is going on.. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From greg.rundlett at gmail.com Mon Jul 7 22:50:15 2008 From: greg.rundlett at gmail.com (Greg Rundlett) Date: Mon, 7 Jul 2008 22:50:15 -0400 Subject: [nycphp-talk] HOWTO: Soap imports in SugarCRM - request feedback Message-ID: <5e2aaca40807071950g28446f46l705c70bc6b5e4e4f@mail.gmail.com> I wrote a 'HOWTO' tutorial that I was thinking of submitting to technical websites and/or trade publications for publishing. I would appreciate any feedback. http://freephile.com/wiki/index.php/Importing_contacts Thanks Greg p.s. I use the GNU Free Documentation License, so feel free to re-use the content under those terms. -- http://freephile.openid.org From paulcheung at tiscali.co.uk Wed Jul 9 09:28:07 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Wed, 9 Jul 2008 14:28:07 +0100 Subject: [nycphp-talk] Returning users from whiniest they came Message-ID: Could somebody point me in the right direction or make any suggestion?? On Exiting the "my" application, I want to return the user back to the original "jump-off point" just before they entered the application, wherever that may have been. I believe I can capture the URL save it until required. I have readup on HTTP_REFERER, which I think is correct, but it appears there might be a problem with this and this is it - "HTTP_REFERER is not passed by some older browsers" Ta - Paul From patrick at hexane.org Wed Jul 9 09:45:55 2008 From: patrick at hexane.org (Patrick May) Date: Wed, 9 Jul 2008 09:45:55 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: References: Message-ID: HTTP_REFERER is pretty common, I think you can count on it 9 times out of 10. ~ p On Wed, Jul 9, 2008 at 9:28 AM, PaulCheung wrote: > Could somebody point me in the right direction or make any suggestion?? > > On Exiting the "my" application, I want to return the user back to the > original "jump-off point" just before they entered the application, wherever > that may have been. I believe I can capture the URL save it until required. > I have readup on HTTP_REFERER, which I think is correct, but it appears > there might be a problem with this and this is it - "HTTP_REFERER is not > passed by some older browsers" > > > Ta - Paul > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Patrick May 135 Oak Street New York, NY 11222 +1 (347) 232-5208 patrick at hexane.org http://www.hexane.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From bzcoder at bzcode.com Wed Jul 9 10:16:25 2008 From: bzcoder at bzcode.com (bzcoder) Date: Wed, 09 Jul 2008 10:16:25 -0400 Subject: [nycphp-talk] MySQL PHP Class generation Message-ID: <4874C839.2080608@bzcode.com> Getting tired of typing the same functions over and over to create a table class in PHP, so I'm working out script for my editor(Komodo) to do it for me. I decided to go the XML/XSLT route because I can use the same code to make an online web interface(since PHP5 has such nice XSLT function support), pretty easily automate creating the XML given an existing MySQL table, and most importantly Javascript can also be used to do the conversion(leading me to be able to create everything from within my IDE since it has a javascript macro interface). I also figure since Komodo supports PHP unit testing, I can create the unit test for the class at the same time. Soo, before I go reinventing the wheel, does anyone have any good links for creating simple table classes using XML/XSLT(yes I did run across the plugin for Eclipse to do the same thing. In the end their terminology did not really appeal to me - and since this is for ME to use, I might as well make it the way I want). From chsnyder at gmail.com Wed Jul 9 10:51:56 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 9 Jul 2008 10:51:56 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: References: Message-ID: On Wed, Jul 9, 2008 at 9:45 AM, Patrick May wrote: > HTTP_REFERER is pretty common, I think you can count on it 9 times out of > 10. > > ~ p Or even 999 times out of 1000. Opera lets you turn it off, I believe, but all other modern (since 2001?) browsers send it. You still need to account for the case where someone has no HTTP_REFERER upon first hitting your site--maybe they typed the address into the browser bar, it happens! ;-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulcheung at tiscali.co.uk Wed Jul 9 14:39:08 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Wed, 9 Jul 2008 19:39:08 +0100 Subject: [nycphp-talk] Returning users from whiniest they came References: Message-ID: I have tried running the HTTP_REFERER using the one liner below and nothing happens I cannot see why it should not work on my hosted Linux website, as it works on this site http://unix.cms.gre.ac.uk/code/php/examples/http_referer.php Paul ----- Original Message ----- From: csnyder To: NYPHP Talk Sent: Wednesday, July 09, 2008 3:51 PM Subject: Re: [nycphp-talk] Returning users from whiniest they came On Wed, Jul 9, 2008 at 9:45 AM, Patrick May wrote: HTTP_REFERER is pretty common, I think you can count on it 9 times out of 10. ~ p Or even 999 times out of 1000. Opera lets you turn it off, I believe, but all other modern (since 2001?) browsers send it. You still need to account for the case where someone has no HTTP_REFERER upon first hitting your site--maybe they typed the address into the browser bar, it happens! ;-) ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Wed Jul 9 15:01:36 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 9 Jul 2008 15:01:36 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: References: Message-ID: On Wed, Jul 9, 2008 at 2:39 PM, PaulCheung wrote: > I have tried running the HTTP_REFERER using the one liner below and nothing > happens > > echo $_SERVER['HTTP_REFERER']; > ?> > > I cannot see why it should not work on my hosted Linux website, as it works > on this site > > http://unix.cms.gre.ac.uk/code/php/examples/http_referer.php > > Paul You are using a link on another page to get to your referer test, right? Try print_r( $_SERVER ) to see if the $_SERVER superglobal is being set in the first place. From bzcoder at bzcode.com Wed Jul 9 15:07:10 2008 From: bzcoder at bzcode.com (bzcoder) Date: Wed, 09 Jul 2008 15:07:10 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: References: Message-ID: <48750C5E.2010502@bzcode.com> PaulCheung wrote: > Could somebody point me in the right direction or make any suggestion?? > > On Exiting the "my" application, I want to return the user back to the > original "jump-off point" just before they entered the application, > wherever that may have been. The best solution is for the page they came from to pass the return point to you in some manner(cookie, get or post variable, session variable, etc). That way you have control over some things(like not returning them to a page that requires some posted variables to load properly). Failling that, referrer works, or use some javascript and go "back" the correct number of pages in the history. From smanes at magpie.com Wed Jul 9 16:09:35 2008 From: smanes at magpie.com (Steve Manes) Date: Wed, 09 Jul 2008 16:09:35 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: References: Message-ID: <48751AFF.4080304@magpie.com> PaulCheung wrote: > Could somebody point me in the right direction or make any suggestion?? > > On Exiting the "my" application, I want to return the user back to the > original "jump-off point" just before they entered the application, > wherever that may have been. I believe I can capture the URL save it > until required. I have readup on HTTP_REFERER, which I think is correct, > but it appears there might be a problem with this and this is it - > "HTTP_REFERER is not passed by some older browsers" Some of the older browsers, including I believe Opera, let you mask HTTP_REFERER as a security option. A lot of proxy servers also don't do a good job with it. As a fallback, it might be more effective to cache the URI_REQUEST when the user first hits the page. From david at davidmintz.org Wed Jul 9 16:12:41 2008 From: david at davidmintz.org (David Mintz) Date: Wed, 9 Jul 2008 16:12:41 -0400 Subject: [nycphp-talk] MySQL PHP Class generation In-Reply-To: <4874C839.2080608@bzcode.com> References: <4874C839.2080608@bzcode.com> Message-ID: <721f1cc50807091312o7e7a298en3b585cb5abe34400@mail.gmail.com> On Wed, Jul 9, 2008 at 10:16 AM, bzcoder wrote: > Getting tired of typing the same functions over and over to create a table > class in PHP, so I'm working out script for my editor(Komodo) to do it for > me. > > I guess you're not into any of the popular frameworks? -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthony at thrillist.com Wed Jul 9 16:21:55 2008 From: anthony at thrillist.com (Anthony Wlodarski) Date: Wed, 09 Jul 2008 16:21:55 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: <48751AFF.4080304@magpie.com> References: <48751AFF.4080304@magpie.com> Message-ID: <48751DE3.5090805@thrillist.com> I was seeing some odd behavior myself recently. It seems Firefox 3.0 masks it as "(none)" for some reason so that may be an issue to look into. -Anthony Steve Manes wrote: > PaulCheung wrote: >> Could somebody point me in the right direction or make any suggestion?? >> >> On Exiting the "my" application, I want to return the user back to >> the original "jump-off point" just before they entered the >> application, wherever that may have been. I believe I can capture the >> URL save it until required. I have readup on HTTP_REFERER, which I >> think is correct, but it appears there might be a problem with this >> and this is it - "HTTP_REFERER is not passed by some older browsers" > > Some of the older browsers, including I believe Opera, let you mask > HTTP_REFERER as a security option. A lot of proxy servers also don't > do a good job with it. As a fallback, it might be more effective to > cache the URI_REQUEST when the user first hits the page. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From tom at supertom.com Wed Jul 9 16:23:08 2008 From: tom at supertom.com (Tom Melendez) Date: Wed, 9 Jul 2008 13:23:08 -0700 Subject: [nycphp-talk] MySQL PHP Class generation In-Reply-To: <721f1cc50807091312o7e7a298en3b585cb5abe34400@mail.gmail.com> References: <4874C839.2080608@bzcode.com> <721f1cc50807091312o7e7a298en3b585cb5abe34400@mail.gmail.com> Message-ID: <117286890807091323o740c44a6v7b09a9defdb1d239@mail.gmail.com> On Wed, Jul 9, 2008 at 1:12 PM, David Mintz wrote: > > On Wed, Jul 9, 2008 at 10:16 AM, bzcoder wrote: >> >> Getting tired of typing the same functions over and over to create a table >> class in PHP, so I'm working out script for my editor(Komodo) to do it for >> me. >> > > I guess you're not into any of the popular frameworks? > Yeah, think you could provide some more info as to what you are trying to do? I don't think you want to create a class per table for CRUD or getter/setter operations and that's what it sounds like to me. Tom http://www.liphp.org From guilhermeblanco at gmail.com Wed Jul 9 16:37:00 2008 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Wed, 9 Jul 2008 17:37:00 -0300 Subject: [nycphp-talk] MySQL PHP Class generation In-Reply-To: <117286890807091323o740c44a6v7b09a9defdb1d239@mail.gmail.com> References: <4874C839.2080608@bzcode.com> <721f1cc50807091312o7e7a298en3b585cb5abe34400@mail.gmail.com> <117286890807091323o740c44a6v7b09a9defdb1d239@mail.gmail.com> Message-ID: Instead of reinvent the entire wheel, why don't you use existent tools that does that job for you? The two most known tools are Propel and Doctrine: Doctrine: http://www.phpdoctrine.org Propel: http://propel.phpdb.org Cheers, On Wed, Jul 9, 2008 at 5:23 PM, Tom Melendez wrote: > On Wed, Jul 9, 2008 at 1:12 PM, David Mintz wrote: >> >> On Wed, Jul 9, 2008 at 10:16 AM, bzcoder wrote: >>> >>> Getting tired of typing the same functions over and over to create a table >>> class in PHP, so I'm working out script for my editor(Komodo) to do it for >>> me. >>> >> >> I guess you're not into any of the popular frameworks? >> > > Yeah, think you could provide some more info as to what you are trying > to do? I don't think you want to create a class per table for CRUD or > getter/setter operations and that's what it sounds like to me. > > Tom > http://www.liphp.org > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com Rio de Janeiro - RJ/Brazil From bzcoder at bzcode.com Wed Jul 9 17:17:46 2008 From: bzcoder at bzcode.com (bzcoder) Date: Wed, 09 Jul 2008 17:17:46 -0400 Subject: [nycphp-talk] MySQL PHP Class generation In-Reply-To: <721f1cc50807091312o7e7a298en3b585cb5abe34400@mail.gmail.com> References: <4874C839.2080608@bzcode.com> <721f1cc50807091312o7e7a298en3b585cb5abe34400@mail.gmail.com> Message-ID: <48752AFA.1070301@bzcode.com> David Mintz wrote: > > On Wed, Jul 9, 2008 at 10:16 AM, bzcoder > wrote: > > Getting tired of typing the same functions over and over to create > a table class in PHP, so I'm working out script for my > editor(Komodo) to do it for me. > > > > I guess you're not into any of the popular frameworks? > I am, their not. :-) From arzala at gmail.com Thu Jul 10 09:54:35 2008 From: arzala at gmail.com (Anirudh Zala) Date: Thu, 10 Jul 2008 19:24:35 +0530 Subject: [nycphp-talk] ereg_replace() behavior Message-ID: <200807101924.35714.arzala@gmail.com> I am facing a strange behavior of PHP's ereg_replace() function. Here is scenario: Problem: Removing "__" (2 continuous underscores) and Capitalizing character that immediately follows "__" from a string. In our example our string is 'ss__name' and expected output should be 'ssName'. Solution: Tried following code using function "ereg_replace()" but character is not getting capitalized: echo ereg_replace('__([:alnum:]{1})',strtoupper('\1'),'ss__name'); Outputs: "ssname" instead of "ssName" Here is bit matching explanation of this behavior http://bugs.php.net/bug.php?id=24645&edit=1 (2nd last answer) Contrary to above explanation, following code works properly (I just used different function instead of "strtoupper"): echo ereg_replace('__([:alnum:]{1})',str_repeat('\1',5),'ss__name'); Outputs: "ssnnnnname" as expected. Any idea of such behavior? Or am i making mistake somewhere? I am using PHP 5.1.6 on FC6. Although there is solution in PCRE (preg_replace()) and by many other, long, ways, I would like to dig first about this behavior. Thanks Anirudh Zala From ajai at bitblit.net Thu Jul 10 10:04:35 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 10 Jul 2008 10:04:35 -0400 (EDT) Subject: [nycphp-talk] MySQL PHP Class generation In-Reply-To: Message-ID: On Wed, 9 Jul 2008, Guilherme Blanco wrote: > The two most known tools are Propel and Doctrine: > > Doctrine: http://www.phpdoctrine.org > Propel: http://propel.phpdb.org Doctrine has the added advantage of migrations. -- Aj. From jmcgraw1 at gmail.com Thu Jul 10 10:06:15 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Thu, 10 Jul 2008 10:06:15 -0400 Subject: [nycphp-talk] ereg_replace() behavior In-Reply-To: <200807101924.35714.arzala@gmail.com> References: <200807101924.35714.arzala@gmail.com> Message-ID: > echo ereg_replace('__([:alnum:]{1})',strtoupper('\1'),'ss__name'); Problem: strtoupper('\1') = '\1' => 'ssname' Problem: str_repeat('\1',5) = '\1\1\1\1\1' => 'ssnnnnname' Solution: preg_replace_callback('/__([a-z])/i', create_function('$a', 'return strtoupper($a);'), 'ss__name'); Check out PCRE (Perl Compatible Regular Expressions) http://us3.php.net/manual/en/ref.pcre.php preg_replace_callback http://us3.php.net/preg_replace_callback create_function http://us3.php.net/create_function - jake > > Outputs: > > "ssname" instead of "ssName" > > Here is bit matching explanation of this behavior > http://bugs.php.net/bug.php?id=24645&edit=1 (2nd last answer) > > Contrary to above explanation, following code works properly (I just used > different function instead of "strtoupper"): > > echo ereg_replace('__([:alnum:]{1})',str_repeat('\1',5),'ss__name'); > > Outputs: > > "ssnnnnname" as expected. > > Any idea of such behavior? Or am i making mistake somewhere? I am using PHP > 5.1.6 on FC6. Although there is solution in PCRE (preg_replace()) and by many > other, long, ways, I would like to dig first about this behavior. > > Thanks > > Anirudh Zala > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From dcech at phpwerx.net Thu Jul 10 10:16:25 2008 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 10 Jul 2008 10:16:25 -0400 Subject: [nycphp-talk] ereg_replace() behavior In-Reply-To: <200807101924.35714.arzala@gmail.com> References: <200807101924.35714.arzala@gmail.com> Message-ID: <487619B9.509@phpwerx.net> Anirudh Zala wrote: > I am facing a strange behavior of PHP's ereg_replace() function. Here is > scenario: > > Problem: > > Removing "__" (2 continuous underscores) and Capitalizing character that > immediately follows "__" from a string. In our example our string > is 'ss__name' and expected output should be 'ssName'. > > Solution: > > Tried following code using function "ereg_replace()" but character is not > getting capitalized: > > echo ereg_replace('__([:alnum:]{1})',strtoupper('\1'),'ss__name'); > > Outputs: > > "ssname" instead of "ssName" The strtoupper is being executed before ereg_replace, and doesn't have any effect on the string '\1' because it doesn't contain any alphabet characters. You need to use the /e modifier for preg_replace() echo preg_replace('/__([a-z0-9])/ie','strtoupper(\'$1\')','ss__name'); > Contrary to above explanation, following code works properly (I just used > different function instead of "strtoupper"): > > echo ereg_replace('__([:alnum:]{1})',str_repeat('\1',5),'ss__name'); > > Outputs: > > "ssnnnnname" as expected. This is executed as: echo ereg_replace('__([:alnum:]{1})','\1\1\1\1\1','ss__name'); Dan From dcech at phpwerx.net Thu Jul 10 10:18:45 2008 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 10 Jul 2008 10:18:45 -0400 Subject: [nycphp-talk] ereg_replace() behavior In-Reply-To: References: <200807101924.35714.arzala@gmail.com> Message-ID: <48761A45.1050009@phpwerx.net> Jake McGraw wrote: >> echo ereg_replace('__([:alnum:]{1})',strtoupper('\1'),'ss__name'); > > Problem: > > strtoupper('\1') = '\1' => 'ssname' > > Problem: > > str_repeat('\1',5) = '\1\1\1\1\1' => 'ssnnnnname' > > Solution: > > preg_replace_callback('/__([a-z])/i', create_function('$a', 'return > strtoupper($a);'), 'ss__name'); > > Check out > > PCRE (Perl Compatible Regular Expressions) > http://us3.php.net/manual/en/ref.pcre.php > preg_replace_callback http://us3.php.net/preg_replace_callback > create_function http://us3.php.net/create_function Beat me to it, preg_replace_callback is probably better than /e from a readability and maintenance perspective too! Dan From guilhermeblanco at gmail.com Thu Jul 10 12:19:32 2008 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Thu, 10 Jul 2008 13:19:32 -0300 Subject: [nycphp-talk] MySQL PHP Class generation In-Reply-To: References: Message-ID: Migrations, Behaviors, Multi-Relation to the same table, Utilities, DQL, Fixtures, extremely Active Community, etc... So many advantages that it's difficult to count... that's why it's the #1 on market, even not being the most stable. =) Cheers, On Thu, Jul 10, 2008 at 11:04 AM, Ajai Khattri wrote: > On Wed, 9 Jul 2008, Guilherme Blanco wrote: > >> The two most known tools are Propel and Doctrine: >> >> Doctrine: http://www.phpdoctrine.org >> Propel: http://propel.phpdb.org > > Doctrine has the added advantage of migrations. > > > -- > Aj. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com Rio de Janeiro - RJ/Brazil From aarong at thinkcomputer.com Thu Jul 10 20:28:48 2008 From: aarong at thinkcomputer.com (Aaron Greenspan) Date: Thu, 10 Jul 2008 17:28:48 -0700 Subject: [nycphp-talk] PHP-Related Book Message-ID: <4876A940.4060505@thinkcomputer.com> Hello, I realize this is blatant self-promotion, but hopefully it won't ruin anyone's day... In case anyone is interested, I've recently published a book that's pretty directly related to PHP, as well as issues of programming, intellectual property, and computer security and privacy. It's called "Authoritas: One Student's Harvard Admissions and the Founding of the Facebook Era," and it talks about the complex and mostly unknown story of Facebook's birth. As you may know, Facebook is based on PHP and MySQL, as was houseSYSTEM's Universal Face Book, the site that preceded it at Harvard. The book has a site here: http://www.aarongreenspan.com/authoritas.html and if you're interested in reading the first few pages, you can on the Interbook site for it here: http://www.thinkpress.com/authoritas/index.html The Interbook site also features the actual documents used to write the book (which are linked page-by-page) such as e-mails and IMs with Mark Zuckerberg, Facebook, Inc.'s present CEO, Apache logs, letters to and from the Harvard administration, etc. Both sites are written in PHP (of course!) on the Lampshade framework. If you want, you can buy the book through any of the places listed on the Order page. Feel free to let me know if you have any questions or comments. Aaron Aaron Greenspan President & CEO Think Computer Corporation http://www.thinkcomputer.com From ben at projectskyline.com Thu Jul 10 20:29:44 2008 From: ben at projectskyline.com (Ben Sgro) Date: Thu, 10 Jul 2008 20:29:44 -0400 Subject: [nycphp-talk] PHP-Related Book In-Reply-To: <4876A940.4060505@thinkcomputer.com> References: <4876A940.4060505@thinkcomputer.com> Message-ID: <4876A978.6050803@projectskyline.com> Hey Aaron, Congrats on the book - got any promo copies you need to get rid of? hehe, - Ben Aaron Greenspan wrote: > Hello, > > I realize this is blatant self-promotion, but hopefully it won't ruin > anyone's day... > > In case anyone is interested, I've recently published a book that's > pretty directly related to PHP, as well as issues of programming, > intellectual property, and computer security and privacy. It's called > "Authoritas: One Student's Harvard Admissions and the Founding of the > Facebook Era," and it talks about the complex and mostly unknown story > of Facebook's birth. As you may know, Facebook is based on PHP and > MySQL, as was houseSYSTEM's Universal Face Book, the site that > preceded it at Harvard. > > The book has a site here: > > http://www.aarongreenspan.com/authoritas.html > > and if you're interested in reading the first few pages, you can on > the Interbook site for it here: > > http://www.thinkpress.com/authoritas/index.html > > The Interbook site also features the actual documents used to write > the book (which are linked page-by-page) such as e-mails and IMs with > Mark Zuckerberg, Facebook, Inc.'s present CEO, Apache logs, letters to > and from the Harvard administration, etc. > > Both sites are written in PHP (of course!) on the Lampshade framework. > If you want, you can buy the book through any of the places listed on > the Order page. > > Feel free to let me know if you have any questions or comments. > > Aaron > > Aaron Greenspan > President & CEO > Think Computer Corporation > > http://www.thinkcomputer.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From arzala at gmail.com Thu Jul 10 21:51:57 2008 From: arzala at gmail.com (Anirudh Zala) Date: Fri, 11 Jul 2008 07:21:57 +0530 Subject: [nycphp-talk] ereg_replace() behavior In-Reply-To: References: <200807101924.35714.arzala@gmail.com> Message-ID: <200807110721.57198.arzala@gmail.com> On Thursday 10 Jul 2008 19:36:15 Jake McGraw wrote: > > echo ereg_replace('__([:alnum:]{1})',strtoupper('\1'),'ss__name'); > > Problem: > > strtoupper('\1') = '\1' => 'ssname' > > Problem: > > str_repeat('\1',5) = '\1\1\1\1\1' => 'ssnnnnname' > > Solution: > > preg_replace_callback('/__([a-z])/i', create_function('$a', 'return > strtoupper($a);'), 'ss__name'); > > Check out > > PCRE (Perl Compatible Regular Expressions) > http://us3.php.net/manual/en/ref.pcre.php > preg_replace_callback http://us3.php.net/preg_replace_callback > create_function http://us3.php.net/create_function Thanks to all. Later found that it is limitation of "ereg_replace()" (against preg_replace()) that it can't execute replacement argument as PHP code nor can call other call_back functions like we could do with preg_replace. Anirudh Zala > > - jake > > > Outputs: > > > > "ssname" instead of "ssName" > > > > Here is bit matching explanation of this behavior > > http://bugs.php.net/bug.php?id=24645&edit=1 (2nd last answer) > > > > Contrary to above explanation, following code works properly (I just used > > different function instead of "strtoupper"): > > > > echo ereg_replace('__([:alnum:]{1})',str_repeat('\1',5),'ss__name'); > > > > Outputs: > > > > "ssnnnnname" as expected. > > > > Any idea of such behavior? Or am i making mistake somewhere? I am using > > PHP 5.1.6 on FC6. Although there is solution in PCRE (preg_replace()) and > > by many other, long, ways, I would like to dig first about this behavior. > > > > Thanks > > > > Anirudh Zala > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From paulcheung at tiscali.co.uk Fri Jul 11 08:34:19 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Fri, 11 Jul 2008 13:34:19 +0100 Subject: [nycphp-talk] Returning users from whiniest they came References: Message-ID: Hi Chris , I genuinely believe that I have a misunderstanding of what the HTTP_REFERER is all about. I was trying to grab the address just before the user entered "my" application. In my INDEX.PHP, I used an extra script named LOGIN.PHP, where the HTTP_REFERER was captured. Then in turn LOGIN.PHP called another script named LOGON.PHP which picked up the HTTP_REFERER information. which in my case is the url name of my INDEX.PHP, Which of course pointed the way into the application in the first place. Within the application HTTP_REFERER works just fine. I can see its potential and some importance possible uses within applications. I am guessing the way around my problem is to forget the use of HTTP_REFERER and just put the user back to the login page and let the user press the back button to let themselves out, or is there a more elegant way to do what I want?? Cheers - Paul ----- Original Message ----- From: "csnyder" To: "NYPHP Talk" Sent: Wednesday, July 09, 2008 8:01 PM Subject: Re: [nycphp-talk] Returning users from whiniest they came > On Wed, Jul 9, 2008 at 2:39 PM, PaulCheung > wrote: >> I have tried running the HTTP_REFERER using the one liner below and >> nothing >> happens >> >> > echo $_SERVER['HTTP_REFERER']; >> ?> >> >> I cannot see why it should not work on my hosted Linux website, as it >> works >> on this site >> >> http://unix.cms.gre.ac.uk/code/php/examples/http_referer.php >> >> Paul > > > You are using a link on another page to get to your referer test, right? > > Try print_r( $_SERVER ) to see if the $_SERVER superglobal is being > set in the first place. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ka at kacomputerconsulting.com Fri Jul 11 09:09:06 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Fri, 11 Jul 2008 06:09:06 -0700 Subject: [nycphp-talk] Returning users from whiniest they came Message-ID: <1215781746.10822@coral.he.net> Hi Paul, As someone pointed out earlier this week, unless your app is set up so that the only entry point to it is a link from another URL, in most cases your user's entry point into your app would be typing the address directly, in which case there would not be an HTTP_REFERRER. > Hi Chris , > > I genuinely believe that I have a misunderstanding of what the HTTP_REFERER > is all about. I was trying to grab the address just before the user entered > "my" application. > > In my INDEX.PHP, I used an extra script named LOGIN.PHP, where the > HTTP_REFERER was captured. Then in turn LOGIN.PHP called another script > named LOGON.PHP which picked up the HTTP_REFERER information. which in my > case is the url name of my INDEX.PHP, Which of course pointed the way into > the application in the first place. > > Within the application HTTP_REFERER works just fine. I can see its potential > and some importance possible uses within applications. > > I am guessing the way around my problem is to forget the use of HTTP_REFERER > and just put the user back to the login page and let the user press the back > button to let themselves out, or is there a more elegant way to do what I > want?? > > Cheers - Paul > > ----- Original Message ----- > From: "csnyder" > To: "NYPHP Talk" > Sent: Wednesday, July 09, 2008 8:01 PM > Subject: Re: [nycphp-talk] Returning users from whiniest they came > > > > On Wed, Jul 9, 2008 at 2:39 PM, PaulCheung > > wrote: > >> I have tried running the HTTP_REFERER using the one liner below and > >> nothing > >> happens > >> > >> >> echo $_SERVER['HTTP_REFERER']; > >> ?> > >> > >> I cannot see why it should not work on my hosted Linux website, as it > >> works > >> on this site > >> > >> http://unix.cms.gre.ac.uk/code/php/examples/http_referer.php > >> > >> Paul > > > > > > You are using a link on another page to get to your referer test, right? > > > > Try print_r( $_SERVER ) to see if the $_SERVER superglobal is being > > set in the first place. > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > ------------------- Kristina D. H. Anderson Senior Application Developer/Consultant "Building a Better Tomorrow, One Line of Code at a Time" 646-247-4987 From ka at kacomputerconsulting.com Fri Jul 11 09:18:37 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Fri, 11 Jul 2008 06:18:37 -0700 Subject: [nycphp-talk] Returning users from whiniest they came Message-ID: <1215782317.14401@coral.he.net> Full text of what I was trying to post, below: Hi Paul, As someone pointed out earlier this week, unless your app is set up so that the only entry point to it is a link from another URL, in most cases your user's entry point into your app would be typing the address directly, in which case there would not be an HTTP_REFERRER. HTTP_REFERRER's most common use is to track marketing and sales data coming from links on affiliates' websites, in emails, and etc. and records the URL of the referring site. So you could determine, for instance, which one of your 10 affiliate sites sends the most customers (and how many each sends), or what percentage of persons you send an email to actually click on your sales link. In your case, if your concern is that you want to ensure that users exit your app, I feel that programmatically closing the browser window would not only accomplish that but be best for security reasons. Or, in the alternative, but way more annoying to users, you can use headers to send them outside your app to another URL. If you programmatically send them back to the logon page, the back button won't then send them to the website they may have previously been on, but back to a previous page in your own app. -- Kristina > Hi Chris , > > I genuinely believe that I have a misunderstanding of what the HTTP_REFERER > is all about. I was trying to grab the address just before the user entered > "my" application. > > In my INDEX.PHP, I used an extra script named LOGIN.PHP, where the > HTTP_REFERER was captured. Then in turn LOGIN.PHP called another script > named LOGON.PHP which picked up the HTTP_REFERER information. which in my > case is the url name of my INDEX.PHP, Which of course pointed the way into > the application in the first place. > > Within the application HTTP_REFERER works just fine. I can see its potential > and some importance possible uses within applications. > > I am guessing the way around my problem is to forget the use of HTTP_REFERER > and just put the user back to the login page and let the user press the back > button to let themselves out, or is there a more elegant way to do what I > want?? > > Cheers - Paul > > ----- Original Message ----- > From: "csnyder" > To: "NYPHP Talk" > Sent: Wednesday, July 09, 2008 8:01 PM > Subject: Re: [nycphp-talk] Returning users from whiniest they came > > > > On Wed, Jul 9, 2008 at 2:39 PM, PaulCheung > > wrote: > >> I have tried running the HTTP_REFERER using the one liner below and > >> nothing > >> happens > >> > >> >> echo $_SERVER['HTTP_REFERER']; > >> ?> > >> > >> I cannot see why it should not work on my hosted Linux website, as it > >> works > >> on this site > >> > >> http://unix.cms.gre.ac.uk/code/php/examples/http_referer.php > >> > >> Paul > > > > > > You are using a link on another page to get to your referer test, right? > > > > Try print_r( $_SERVER ) to see if the $_SERVER superglobal is being > > set in the first place. > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > ------------------- Kristina D. H. Anderson Senior Application Developer/Consultant "Building a Better Tomorrow, One Line of Code at a Time" 646-247-4987 From cderr at simons-rock.edu Fri Jul 11 09:31:58 2008 From: cderr at simons-rock.edu (charlie derr) Date: Fri, 11 Jul 2008 09:31:58 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: <1215782317.14401@coral.he.net> References: <1215782317.14401@coral.he.net> Message-ID: <487760CE.1050409@simons-rock.edu> Kristina Anderson wrote: > Full text of what I was trying to post, below: > > Hi Paul, > > As someone pointed out earlier this week, unless your app is set up so > that the only entry point to it is a link from another URL, in most > cases your user's entry point into your app would be typing the address > directly, in which case there would not be an HTTP_REFERRER. > > HTTP_REFERRER's most common use is to track marketing and sales data > coming from links on affiliates' websites, in emails, and etc. and > records the URL of the referring site. So you could determine, for > instance, which one of your 10 affiliate sites sends the most customers > (and how many each sends), or what percentage of persons you send an > email to actually click on your sales link. > > In your case, if your concern is that you want to ensure that users > exit your app, I feel that programmatically closing the browser window > would not only accomplish that but be best for security reasons. Wow, I have to disagree strongly with this (not that it's incorrect, but it is incomplete). The only way I would think this is an even remotely possible design choice is if your users are "captive" in some way. That is, you don't care at all how much you annoy them (because for whatever reaason they *have* to use your app). I'm pretty sure that if the site is one that needs to "attract" or "retain" users in any way, programmatically closing the browser window is not something which should be considered (even if you could find a way to even effectively do it across all browsers). > Or, > in the alternative, but way more annoying to users, you can use headers > to send them outside your app to another URL. While I don't dispute that some users might find that annoying, I would argue that few would find it more annoying than closing the browser window. In any event it's certainly possible to log the user out without redirecting them away to a foreign url. And I do think Kristina gives a lot of other good information. ~c > > If you programmatically send them back to the logon page, the back > button won't then send them to the website they may have previously > been on, but back to a previous page in your own app. > > -- Kristina > From ka at kacomputerconsulting.com Fri Jul 11 09:39:24 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Fri, 11 Jul 2008 06:39:24 -0700 Subject: [nycphp-talk] Returning users from whiniest they came Message-ID: <1215783564.23681@coral.he.net> Charlie -- I do agree 100% that it's best from a design standpoint to just log them out and then let them choose the next action. However, the original question from Paul was how to programmatically get them to another URL (or at best out of his URL) after using the app...so that is what I addressed. Maybe if Paul can give some additional feedback on why he needs to do that specifically, we can better advise him on best practice. -- Kristina > Kristina Anderson wrote: > > Full text of what I was trying to post, below: > > > > Hi Paul, > > > > As someone pointed out earlier this week, unless your app is set up so > > that the only entry point to it is a link from another URL, in most > > cases your user's entry point into your app would be typing the address > > directly, in which case there would not be an HTTP_REFERRER. > > > > HTTP_REFERRER's most common use is to track marketing and sales data > > coming from links on affiliates' websites, in emails, and etc. and > > records the URL of the referring site. So you could determine, for > > instance, which one of your 10 affiliate sites sends the most customers > > (and how many each sends), or what percentage of persons you send an > > email to actually click on your sales link. > > > > In your case, if your concern is that you want to ensure that users > > exit your app, I feel that programmatically closing the browser window > > would not only accomplish that but be best for security reasons. > > Wow, I have to disagree strongly with this (not that it's incorrect, but it is incomplete). The only way I would think this is an > even remotely possible design choice is if your users are "captive" in some way. That is, you don't care at all how much you > annoy them (because for whatever reaason they *have* to use your app). I'm pretty sure that if the site is one that needs to > "attract" or "retain" users in any way, programmatically closing the browser window is not something which should be considered > (even if you could find a way to even effectively do it across all browsers). > > > Or, > > in the alternative, but way more annoying to users, you can use headers > > to send them outside your app to another URL. > > While I don't dispute that some users might find that annoying, I would argue that few would find it more annoying than closing > the browser window. In any event it's certainly possible to log the user out without redirecting them away to a foreign url. > And I do think Kristina gives a lot of other good information. > > ~c > > > > > If you programmatically send them back to the logon page, the back > > button won't then send them to the website they may have previously > > been on, but back to a previous page in your own app. > > > > -- Kristina > > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > ------------------- Kristina D. H. Anderson Senior Application Developer/Consultant "Building a Better Tomorrow, One Line of Code at a Time" 646-247-4987 From bzcoder at bzcode.com Fri Jul 11 09:52:16 2008 From: bzcoder at bzcode.com (bzcoder) Date: Fri, 11 Jul 2008 09:52:16 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: References: Message-ID: <48776590.3010908@bzcode.com> PaulCheung wrote: > > I am guessing the way around my problem is to forget the use of > HTTP_REFERER and just put the user back to the login page and let the > user press the back button to let themselves out, or is there a more > elegant way to do what I want?? Capture the HTTP REFERER when they enter your application to a session or cookie(some prefer session, some cookie, some do it some other way. Session or cookie is simple, you can get fancy when you know for sure what you want to do).. When you exit the application, send them to a logoff screen, clear out their session information, and display a simple goodbye message: "Thank you for using my application, I hope you enjoyed your session. If you would like to log in again, click here. If you would like to return from where you came form, click here. Here are some sites we happen to like and recommend." Obviously, click here should be styled up and made nice. Don't display the return from whence you came text if you don't have a referrer for where they came from. You can make that one a fancy preview thumbnail link(pop up or not) to help them decide. And of course, the here are some sites.... is a chance to monetize your application by accepting advertising, placing affiliate links on your page, or whatnot. From danielc at analysisandsolutions.com Fri Jul 11 10:13:22 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 11 Jul 2008 10:13:22 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: References: Message-ID: <20080711141322.GA2272@panix.com> Hi Paul: You misunderstand what http referer does. In addition, be careful of what some other folks have posted in this thread, they're misunderstanding your situation, so may confuse you further. Here are several key points: * it is set by the browser * it gets sent in the HTTP headers when requesting a page * it indicates the URI a hyperlink was found on Let's say a browser is on Page A. Page A has a link to Page B. When the user clicks the link to Page B, the browser will put the URI of Page A into the referer header. Then, when the person is on Page B they click a link for Page C, the browswer will put the URI of Page B into the header/request for Page C. So note that it contains the page that referred the _current_ request. As others indicated earlier, if you want to know the place someone entered your site, you need to capture that on the first page they hit. Something _like_ this: // Make sure session_start() was called already. if (!isset($_SESSION['source'])) { /* * This is the first hit this person has made to your site * DURING THIS SESSION. So if you don't manage things right * this could be a value from an earlier visit. */ if (empty($_SERVER['HTTP_REFERER'])) { // Either not sent or person typed in the URI directly. $source = false; } else { // They clicked a link to get here. // Make sure it is safe. $source = $_SERVER['HTTP_REFERER']; $source = preg_replace('/[^!#-9:;=?-Z_a-z~]/', '', $source); } $_SESSION['source'] = $source; } --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 smanes at magpie.com Fri Jul 11 11:03:13 2008 From: smanes at magpie.com (Steve Manes) Date: Fri, 11 Jul 2008 11:03:13 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: <20080711141322.GA2272@panix.com> References: <20080711141322.GA2272@panix.com> Message-ID: <48777631.3090101@magpie.com> Daniel Convissor wrote: > You misunderstand what http referer does. In addition, be careful of > what some other folks have posted in this thread, they're > misunderstanding your situation, so may confuse you further. > > Here are several key points: > > * it is set by the browser > * it gets sent in the HTTP headers when requesting a page > * it indicates the URI a hyperlink was found on Daniel's #1 is an important point and one reason why I avoid relying on HTTP_REFERER at almost all costs. Because the browser sends this it means it can be spoofed. Worst case, it's like allowing a potentially tainted global variable into your application unless you're very careful about vetting it. In my pre-PHP days, in fact my very early web days circa 1995, my web server got hacked because of a cleverly configured, spoofed HTTP_REFERER I was using to regulate access to a vintage motorcycle image archive and provide a back link. I learned a lotta security lessons from that episode, including not to trust ANYTHING the browser hands me. From patrick at hexane.org Fri Jul 11 11:10:19 2008 From: patrick at hexane.org (Patrick May) Date: Fri, 11 Jul 2008 11:10:19 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: References: Message-ID: I'm curious -- what does your application do? On Wed, Jul 9, 2008 at 9:28 AM, PaulCheung wrote: > Could somebody point me in the right direction or make any suggestion?? > > On Exiting the "my" application, I want to return the user back to the > original "jump-off point" just before they entered the application, wherever > that may have been. I believe I can capture the URL save it until required. > I have readup on HTTP_REFERER, which I think is correct, but it appears > there might be a problem with this and this is it - "HTTP_REFERER is not > passed by some older browsers" > > > Ta - Paul > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Patrick May 135 Oak Street New York, NY 11222 +1 (347) 232-5208 patrick at hexane.org http://www.hexane.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri Jul 11 11:13:28 2008 From: chsnyder at gmail.com (csnyder) Date: Fri, 11 Jul 2008 11:13:28 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: <48777631.3090101@magpie.com> References: <20080711141322.GA2272@panix.com> <48777631.3090101@magpie.com> Message-ID: On Fri, Jul 11, 2008 at 11:03 AM, Steve Manes wrote: > Daniel's #1 is an important point and one reason why I avoid relying on > HTTP_REFERER at almost all costs. Because the browser sends this it means > it can be spoofed. Worst case, it's like allowing a potentially tainted > global variable into your application unless you're very careful about > vetting it. In the case that Paul is describing it's okay to trust it _as much as you would trust any other user-submitted value_. You should always html_entities encode a referer when displaying it on a page, just like any other value in $_SERVER, $_GET, $_POST, or $_COOKIE. Granted, there are all kinds of reasons not to provide back links. Users aren't really expecting them, the referer is not always going to be there, and it potentially leaves your site open to Google abuse, because suddenly your site has links back to anybody else's website. But at the end of the day if you want to redirect people back to where they came from (like Paypal does, for instance, after you make a payment), you have no choice but to rely on the referer. From bzcoder at bzcode.com Fri Jul 11 11:24:19 2008 From: bzcoder at bzcode.com (bzcoder) Date: Fri, 11 Jul 2008 11:24:19 -0400 Subject: [nycphp-talk] Returning users from whiniest they came In-Reply-To: References: <20080711141322.GA2272@panix.com> <48777631.3090101@magpie.com> Message-ID: <48777B23.6050109@bzcode.com> csnyder wrote: > Granted, there are all kinds of reasons not to provide back links. > Users aren't really expecting them, the referer is not always going to > be there, and it potentially leaves your site open to Google abuse, > because suddenly your site has links back to anybody else's website. > All of the above of course depends on the application: Users aren't expecting them, but they may make sense in the application. The referer is not always going to be there, so simply code in a way that your exit point makes sense if it is not there. Google abuse doesn't really apply if someone has to go through a sequence of form submits before they logoff - Google won't do that so it won't see the backlink page. It does have the potential for people using your site to redirect others to somewhere else(for example, if your application had something to do with surveys about vintage cars, someone might post a redirect link that takes people through a porn site and then automatically redirects them to your site the first time they go through it, but takes them to a popup laden main page when they return. So after someone goes through your entire site, the link they are sent to at the end is porn). > But at the end of the day if you want to redirect people back to where > they came from (like Paypal does, for instance, after you make a > payment), you have no choice but to rely on the referer. > _______________________________________________ > Paypal has a much better mechanism, where the person sending someone to paypal indicates to paypal in the redirect exactly which page on the website to return the user to when the payment is completed or canceled. Depending on his application, this may be a method he can use if he can require people linking to his site to provide that information to him. From lists at enobrev.com Mon Jul 14 18:03:18 2008 From: lists at enobrev.com (Mark Armendariz) Date: Mon, 14 Jul 2008 18:03:18 -0400 Subject: [nycphp-talk] MySQL Support Engineer, Andrii Nikitin's son Ivan Needs Our Help. Message-ID: <487BCD26.4030001@enobrev.com> "Donations are requested to help Andrii Nikitin, a MySQL support engineer in Ukraine, provide for his son Ivan who requires a bone marrow transplant operation. The cost of this operation is expected to be between $150,000 - $250,000. Please help us provide Ivan a chance to live." http://www.mysql.com/about/help-ivan.html http://www.theopenforce.com/2008/07/andrii-nikitin.html http://www.phpcult.com/blog/andrii-nikitis-son-needs-our-help/ Mark From paulcheung at tiscali.co.uk Tue Jul 15 08:51:40 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Tue, 15 Jul 2008 13:51:40 +0100 Subject: [nycphp-talk] Returning users from whiniest they came References: Message-ID: Hi Everybody Thanks for all your help and suggestions. It all appears to be my misunderstand of the use of the index files. Just because it happens to be a file with a PHP extent didn't mean it it going to act as a PHP script. It is logical really, as it does have a special function. The solution for me is to imitate the method in which my broadband service handles logging users out of their site (not service) and it seems to be confirmed by the manner in which my webhosting providers works too. Once again thanks for your help. Paul ----- Original Message ----- From: "PaulCheung" To: Sent: Wednesday, July 09, 2008 2:28 PM Subject: [nycphp-talk] Returning users from whiniest they came > Could somebody point me in the right direction or make any suggestion?? > > On Exiting the "my" application, I want to return the user back to the > original "jump-off point" just before they entered the application, > wherever that may have been. I believe I can capture the URL save it until > required. I have readup on HTTP_REFERER, which I think is correct, but it > appears there might be a problem with this and this is it - "HTTP_REFERER > is not passed by some older browsers" > > > Ta - Paul > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From paul at devonianfarm.com Thu Jul 17 13:54:35 2008 From: paul at devonianfarm.com (paul at devonianfarm.com) Date: Thu, 17 Jul 2008 13:54:35 -0400 (EDT) Subject: [nycphp-talk] Handling empty values in hashes Message-ID: <46569.192.168.1.71.1216317275.webmail@192.168.1.71> I've been "cross-training" in a few languages and been thinking about differences in semantics in dictionaries (associative arrays) in common languages. I wrote an article at: [javascript:void(0);/*1216316970142*/] http://gen5.info/q/2008/07/17/the-semantics-of-dictionaries-maps-and-hashtables/ Which compares and contrasts dictionary semantics in four popular languages, including PHP. In a lot of ways I find the behavior of the $value=$array[$key] operation works well, but I find it pretty obnoxious that: (1) This throws warnings on a missing keys if a certain bit is set in error_reporting, and (2) It's not possible to have strict checking of variable names without also turning on strict checking of array keys (which I'd usually expect to be a bit sloppier) Any thoughts? -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Thu Jul 17 14:17:49 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 17 Jul 2008 14:17:49 -0400 Subject: [nycphp-talk] Handling empty values in hashes In-Reply-To: <46569.192.168.1.71.1216317275.webmail@192.168.1.71> References: <46569.192.168.1.71.1216317275.webmail@192.168.1.71> Message-ID: <20080717181749.GA20378@panix.com> Paul: > $value=$array[$key] One right way to do this is: if (array_key_exists($key, $array)) { // Life is good. $value = $array[$key]; } else { // Erm, it doesn't exist. Now what? // Typically either set to NULL or throw error. } --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 jcampbell1 at gmail.com Thu Jul 17 14:43:26 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 17 Jul 2008 14:43:26 -0400 Subject: [nycphp-talk] Handling empty values in hashes In-Reply-To: <46569.192.168.1.71.1216317275.webmail@192.168.1.71> References: <46569.192.168.1.71.1216317275.webmail@192.168.1.71> Message-ID: <8f0676b40807171143j6eb7bf71t3a0316a9d8ba9421@mail.gmail.com> > operation works well, but I find it pretty obnoxious that: > > (1) This throws warnings on a missing keys if a certain bit is set in > error_reporting, and > (2) It's not possible to have strict checking of variable names without also > turning on strict checking of array keys (which I'd usually expect to be a > bit sloppier) > > Any thoughts? +1 The lack of a default dictionary in php does suck. Of course one can work around this with a function like issetor($array,$key,$default), but in my opinion that makes for ugly code. Of course it is possible to create a class with this behavior using SPL, but that doesn't take care of the superglobals and there might be performance problems. -John Campbell From paul at devonianfarm.com Thu Jul 17 14:58:00 2008 From: paul at devonianfarm.com (paul at devonianfarm.com) Date: Thu, 17 Jul 2008 14:58:00 -0400 (EDT) Subject: [nycphp-talk] Handling empty values in hashes Message-ID: <35902.192.168.1.71.1216321080.webmail@192.168.1.71> > One right way to do this is: > > if (array_key_exists($key, $array)) { > // Life is good. > $value = $array[$key]; > } else { > // Erm, it doesn't exist. Now what? > // Typically either set to NULL or throw error. > } For a long time I've used isset($array[$key]) how's that different from array_key_exists? The article at http://gen5.info/q/2008/07/17/the-semantics-of-dictionaries-maps-and-hashtables/ tries to capture a similar logic into a single function, array_get() Overall I think logic like the code sample you give should be condensed into a function for several reasons: the most serious is that duplicated logic can hide errors. -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at devonianfarm.com Thu Jul 17 15:08:04 2008 From: paul at devonianfarm.com (paul at devonianfarm.com) Date: Thu, 17 Jul 2008 15:08:04 -0400 (EDT) Subject: [nycphp-talk] Handling empty values in hashes Message-ID: <47346.192.168.1.71.1216321684.webmail@192.168.1.71> > Of course it is possible to create a class with this behavior using > SPL, but that doesn't take care of the superglobals and there might be > performance problems. > > -John Campbell Well, I've got a 'framework' that I use for my own projects that I call "PHP on Nails". It has several levels, and "level 0" is the most mature. It's mostly about configuration management, tightening error handling and reducing with variations between environments. It introduces a few single-letter functions, such as Q($string): almost the same as echo(htmlspecialchars($string)) except it maps the empty string to   Your designer and junior programmers ~might~ actually use it in a template. I'm thinking about expanding UTF-8 unicode characters to numeric form here too. G($key) and P($key): which replace $_GET and $_POST while doing a few kinds of filtering. If the key is undefined, it returns the empty string. Whitespace gets trimmed from the beginning and end of the strings. magic_quotes_gpc is undone if set. Perhaps it's a bit crazy to use single character function names, but my take is that these function greatly improve the security and reliability of PHP applications IF people actually use them. If the names were like get_and_filter_post_variable they wouldn't get used. Someday I'll release the level 0 library and blog about it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Thu Jul 17 15:51:54 2008 From: ramons at gmx.net (David Krings) Date: Thu, 17 Jul 2008 15:51:54 -0400 Subject: [nycphp-talk] Handling empty values in hashes In-Reply-To: <20080717181749.GA20378@panix.com> References: <46569.192.168.1.71.1216317275.webmail@192.168.1.71> <20080717181749.GA20378@panix.com> Message-ID: <487FA2DA.9050004@gmx.net> Daniel Convissor wrote: > Paul: > >> $value=$array[$key] > > One right way to do this is: > > if (array_key_exists($key, $array)) { > // Life is good. > $value = $array[$key]; > } else { > // Erm, it doesn't exist. Now what? > // Typically either set to NULL or throw error. > } > > --Dan > I second that. From a professional QA view point I way too often see that developers assume something to be there even if it is a record that their own code wrote to a table or array just a second earlier. While that may pan out most of the time and not cause problems all pieces come off once there is a problem. I use mainly isset() since that allows for crafting the whole checking and default value assignment in one line that is still readable. I find this to be similar to initializing variables. Sure, under PHP you can get away with not doing that, but once you come across the problem where you think $i has the value of 1 when PHP really sets it to 0 you get to understand why other languages/compilers throw errors when a variable gets used and comes out of nowhere. In that sense I find it quite OK that warnings or errors get thrown when one requests the value from an array element, but the provided key is nowhere to be found. David From danielc at analysisandsolutions.com Thu Jul 17 17:20:45 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 17 Jul 2008 17:20:45 -0400 Subject: [nycphp-talk] Handling empty values in hashes In-Reply-To: <35902.192.168.1.71.1216321080.webmail@192.168.1.71> References: <35902.192.168.1.71.1216321080.webmail@192.168.1.71> Message-ID: <20080717212045.GA14968@panix.com> Paul: On Thu, Jul 17, 2008 at 02:58:00PM -0400, paul at devonianfarm.com wrote: > > isset($array[$key]) > how's that different from array_key_exists? isset() thinks NULL is not set. Similarly, empty() can be used for stuff like this, but of course, it thinks NULL, 0, FALSE and "" are all the same. Which function to use depends on how your program needs to work. > http://gen5.info/q/2008/07/17/ > the-semantics-of-dictionaries-maps-and-hashtables > tries to capture a similar logic into a single function, array_get() Sure, that works. But I wouldn't take this person's advice too seriously since they're talking about using isset() to see if a key exists and they don't once discuss that their sample code on lines 11 and 15 can throw notices. > Overall I think logic like the code sample you give should be > condensed into a function for several reasons: the most serious is > that duplicated logic can hide errors. Depends. I tend to like to see exactly what's happening right where you're at. But if you're doing the same thing over and over, functions are helpful. --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 patrick at hexane.org Thu Jul 17 17:52:21 2008 From: patrick at hexane.org (Patrick May) Date: Thu, 17 Jul 2008 17:52:21 -0400 Subject: [nycphp-talk] PHP caching (not opcode) Message-ID: Hello, I'm working on a PHP cache library, and I wanted to check in and see what folks thought. Usually, you have many different front end views that you will want to cache. These may pull from multiple datasources in odd ways. Far away from the front end, there is backend CMS, either a tool like Wordpress or Drupal, or a custom tool. Generally, I find myself managing caches by: 1. Putting the code that generates the cache into the front end, since it is the design that dictates which pieces of information should be grouped together. 2. Putting a very small amount of code in the back end which causes the cache to be deleted on the appropriate CRUD operations. CMS's are complicated enough as they are, and I don't want to clutter them up more then necessary. The hard part is creating the association between the front and back end. What I want to do is to use *tags* to create this association, and to break caches. It works something like this: Does this sound similar to any existing library / tool, either for PHP or for any other platform? Does this sound like a useful library? Thanks for your feedback! Cheers, Patrick -- Patrick May 135 Oak Street New York, NY 11222 +1 (347) 232-5208 patrick at hexane.org http://www.hexane.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at supertom.com Thu Jul 17 19:04:12 2008 From: tom at supertom.com (Tom Melendez) Date: Thu, 17 Jul 2008 16:04:12 -0700 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: Message-ID: <117286890807171604s22675922sc51fde864b60fd01@mail.gmail.com> Hi Patrick, > I'm working on a PHP cache library, and I wanted to check in and see what > folks thought. > First thoughts: why not Zend or Pear cache libraries? http://framework.zend.com/manual/en/zend.cache.theory.html#zend.cache.factory http://pear.php.net/package/Cache_Lite http://pear.php.net/package/Cache The pear packages are looking for maintainers - perhaps you could roll your work into that? > Usually, you have many different front end views that you will want to > cache. These may pull from multiple datasources in odd ways. So, what is your goal with this caching library? FE caching can be fixed with more boxes or a squid layer. Datasources can be harder to cache but will be much more valuable when you try to scale. Tom http://www.liphp.org From patrick at hexane.org Fri Jul 18 08:51:35 2008 From: patrick at hexane.org (Patrick May) Date: Fri, 18 Jul 2008 08:51:35 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: <117286890807171604s22675922sc51fde864b60fd01@mail.gmail.com> References: <117286890807171604s22675922sc51fde864b60fd01@mail.gmail.com> Message-ID: Tom, First thoughts: why not Zend or Pear cache libraries? > > > http://framework.zend.com/manual/en/zend.cache.theory.html#zend.cache.factory > http://pear.php.net/package/Cache_Lite > http://pear.php.net/package/Cache > > The pear packages are looking for maintainers - perhaps you could roll > your work into that? Thanks, these were the sorts of libraries I wanted to check for reference. > So, what is your goal with this caching library? FE caching can be > fixed with more boxes or a squid layer. Datasources can be harder to > cache but will be much more valuable when you try to scale. My experience is that the broader the cache the less effective. Caches can make sites appear un-responsive or oddly buggy to users. I've done reverse proxy caching with Squid, but it's painting with an extremely large brush. You can't target *part* of a response for caching. I also don't believe in "more boxes" all the time. While an important part of scaling is adding more resources, it's also important not to waste the resources you have. For example, you can cache the datasource.... or the result set. If the two have the same effectiveness, then I'd rather cache the result set because that extends the per-box capacity. If my application is failing to meet performance expectations, I like to have on hand some caching tools to see if I can rescue it. And that would be the purpose of this library. Cheers, Patrick -- Patrick May 135 Oak Street New York, NY 11222 +1 (347) 232-5208 patrick at hexane.org http://www.hexane.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri Jul 18 09:24:51 2008 From: chsnyder at gmail.com (csnyder) Date: Fri, 18 Jul 2008 09:24:51 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: Message-ID: On Thu, Jul 17, 2008 at 5:52 PM, Patrick May wrote: > I'm working on a PHP cache library, and I wanted to check in and see what > folks thought. > I love the idea of providing the cache with an event model, so that you can fire events that invalidate the parts of the cache that are listening for them. I haven't ever seen that before, but then again I don't get out much. Is it derived from some other system/language? The caches I've used and built are of the stock squid or apc variety--they check on load to see if the cache is valid, and recreate it if necessary. Call it "pull". What you propose (in part) is "push": mark the cache as expired at action time, so that when a subsequent request gets around to reading out the cached value it can already be regenerated and ready to go. One thing that would make this extremely useful (to me, anyway) would be to have the methods pay attention to additional metadata besides just the name of the cache. I would want to be able to also pass a request signature: a string that encodes the user-agent, language, content-type, and even the userid or sessionid, in both the cache and break_cache methods. Chris Snyder http://chxor.chxo.com/ From d at ingk.com Fri Jul 18 10:24:54 2008 From: d at ingk.com (Damion Hankejh (ingk)) Date: Fri, 18 Jul 2008 10:24:54 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: Message-ID: <070d01c8e8e2$0c7f9580$257ec080$@com> This push cache concept has me intrigued. As to passing a request signature that encodes user agent, language, userid, etc. - can't this simply be added to the cache id (for instance with Cache_Lite)? We've had great luck using pretty urls for caching db result set objects and embedding userid on the end of the url. Damion Hankejh www.ActiveCause.com www.InstantService.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of csnyder Sent: Friday, July 18, 2008 9:25 AM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP caching (not opcode) On Thu, Jul 17, 2008 at 5:52 PM, Patrick May wrote: > I'm working on a PHP cache library, and I wanted to check in and see what > folks thought. > I love the idea of providing the cache with an event model, so that you can fire events that invalidate the parts of the cache that are listening for them. I haven't ever seen that before, but then again I don't get out much. Is it derived from some other system/language? The caches I've used and built are of the stock squid or apc variety--they check on load to see if the cache is valid, and recreate it if necessary. Call it "pull". What you propose (in part) is "push": mark the cache as expired at action time, so that when a subsequent request gets around to reading out the cached value it can already be regenerated and ready to go. One thing that would make this extremely useful (to me, anyway) would be to have the methods pay attention to additional metadata besides just the name of the cache. I would want to be able to also pass a request signature: a string that encodes the user-agent, language, content-type, and even the userid or sessionid, in both the cache and break_cache methods. Chris Snyder http://chxor.chxo.com/ From tom at supertom.com Fri Jul 18 11:27:48 2008 From: tom at supertom.com (Tom Melendez) Date: Fri, 18 Jul 2008 08:27:48 -0700 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: <117286890807171604s22675922sc51fde864b60fd01@mail.gmail.com> Message-ID: <117286890807180827v52d79d4dqd07eb605229eaad9@mail.gmail.com> On Fri, Jul 18, 2008 at 5:51 AM, Patrick May wrote: > Tom, > >> First thoughts: why not Zend or Pear cache libraries? >> >> >> http://framework.zend.com/manual/en/zend.cache.theory.html#zend.cache.factory >> http://pear.php.net/package/Cache_Lite >> http://pear.php.net/package/Cache >> >> The pear packages are looking for maintainers - perhaps you could roll >> your work into that? > > Thanks, these were the sorts of libraries I wanted to check for reference. > >> >> So, what is your goal with this caching library? FE caching can be >> fixed with more boxes or a squid layer. Datasources can be harder to >> cache but will be much more valuable when you try to scale. > > My experience is that the broader the cache the less effective. Caches can > make sites appear un-responsive or oddly buggy to users. I've done reverse > proxy caching with Squid, but it's painting with an extremely large brush. > You can't target *part* of a response for caching. > Agreed. Multiple layers of caching are also can be a pain to testing and debug. But even if I only I only served from that cache 10% of the time, I'd still want it there. > I also don't believe in "more boxes" all the time. While an important part > of scaling is adding more resources, it's also important not to waste the > resources you have. For example, you can cache the datasource.... or the > result set. If the two have the same effectiveness, then I'd rather cache > the result set because that extends the per-box capacity. > Yes, as long your data is tied to only one view. My experience has been that performance issues stem from the datasource rather than the FE rendering. Don't get me wrong, I used local, file based cache as well, but I cache the datasource separately. And for FE cache, you of course don't want to cache the view (or page module or widget or whatever) if your datasource fails. > If my application is failing to meet performance expectations, I like to > have on hand some caching tools to see if I can rescue it. And that would > be the purpose of this library. > Yes, this would be the quickest way to breath life into a fledgling or over-taxed application. Wouldn't require too much work and can handle user/session specific page modules. Tom http://www.liphp.org From tom at supertom.com Fri Jul 18 11:42:37 2008 From: tom at supertom.com (Tom Melendez) Date: Fri, 18 Jul 2008 08:42:37 -0700 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: Message-ID: <117286890807180842n6d3d9837q1d5ce44545140b0e@mail.gmail.com> > I love the idea of providing the cache with an event model, so that > you can fire events that invalidate the parts of the cache that are > listening for them. I haven't ever seen that before, but then again I > don't get out much. Is it derived from some other system/language? > > The caches I've used and built are of the stock squid or apc > variety--they check on load to see if the cache is valid, and recreate > it if necessary. Call it "pull". What you propose (in part) is "push": > mark the cache as expired at action time, so that when a subsequent > request gets around to reading out the cached value it can already be > regenerated and ready to go. > So this is basically the "perfect" cache. Items are cached "forever" until invalidated. Easier to achieve with data sources that don't depend on many variables (basically static data coming from a database, an article, a block, data appropriate for everyone vs. user specific data) with basically a publish methodology and file cache and a mechanism to flush. Much more difficult for the variants. We've done alot of work on this at Y! and unfortunately it is tailored a little too much to our environment to be useful to others. A lot of effort went into invalidating not only the file cache but the squid layers as well, on box CPU usage as well as network performance. A drop-in technique for the popular frameworks out there would be an awesome invention. With anything else, you need to weight whether or not you need it and if it is worth the overhead of implementing it. Tom http://www.liphp.org From bzcoder at bzcode.com Fri Jul 18 11:54:20 2008 From: bzcoder at bzcode.com (bzcoder) Date: Fri, 18 Jul 2008 11:54:20 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: Message-ID: <4880BCAC.2020506@bzcode.com> Patrick May wrote: > Hello, > > I'm working on a PHP cache library, and I wanted to check in and see > what folks thought. > > Usually, you have many different front end views that you will want to > cache. These may pull from multiple datasources in odd ways. Far > away from the front end, there is backend CMS, either a tool like > Wordpress or Drupal, or a custom tool. Generally, I find myself > managing caches by: > > 1. Putting the code that generates the cache into the front end, since > it is the design that dictates which pieces of information should be > grouped together. > 2. Putting a very small amount of code in the back end which causes > the cache to be deleted on the appropriate CRUD operations. CMS's are > complicated enough as they are, and I don't want to clutter them up > more then necessary. > > The hard part is creating the association between the front and back > end. What I want to do is to use *tags* to create this association, > and to break caches. Part of this has to do with your system. For example, Joomla is made up of Templates, Components, Modules, and Plugins all of which go into generating a page. A component will generate HTML content for the main section of the website(think displaying articles, displaying a directory, etc). A Module will generate a small block of HTML for specific purposes(think "most popular articles" list, "advertising banners", "number of users online") A template is used to put all of that together into the layout of the page. Finally, a plugin will take that page and do a bunch of regular expression find and replaces(so in your content, if you put {contact author} the author of an articles contact information is placed on the page). Therefore, Joomla has multiple levels of caching. As I recall, you can have it cache the output of specific modules and you can have it cache the complete page output. Now, compare that to the Smarty template system. In Smarty, you can cache the results of applying a template to generate HTML. Smarty also has an invalidate function, so whenever something is changed you can run the invalidate function and kill the cached object. My feeling is it really needs to be taken to the next level. So, when a cached object is generated, that object needs to record somewhere what underlying data points make up the cache. So, for example, your looking at a listing of all articles relating to PHP and Caching. As a first step, if an article is added, most systems just do a generic "invalidate all article cache files" - but a more specific function would say "lookup all files related to caching that where cached tagged with X and invalidate them". A smarter step would be to refresh the cache if possible. So instead of deleting the existing cached files, generate new ones. Considering that create/update operations are already expected to be slow, making them a few milliseconds slower is not a big deal. Especially since the editor is a user you don't need to worry about getting upset at site slowness and moving on to a competitors site. Wheras the reader is the person who you have to be quick for. However, I will say the main issue is that developers have to USE the cache. It does no good to have a method of storing data in a cache unless the developers of the components trigger the flush/refresh mechanisms that are already there and most CMS systems have(similiar to the logging facility. It seems every framework has one, yet how often do people actually add a bunch of extra code to log information except for failures). From patrick at hexane.org Fri Jul 18 12:02:43 2008 From: patrick at hexane.org (Patrick May) Date: Fri, 18 Jul 2008 12:02:43 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: Message-ID: > I love the idea of providing the cache with an event model, so that > you can fire events that invalidate the parts of the cache that are > listening for them. I haven't ever seen that before, but then again I > don't get out much. Is it derived from some other system/language? > When I was working on caching, I remembered having to implement double buffering for applets when I was learning to program. Part of the abstraction included marking the buffer as "damaged" when something was drawn on it. This would trigger an actual re-draw to the screen, when it was time. Dealing with caching websites, I found it was useful for the front end to write caches to disk, and have the backend just delete the cache file. These apis worked something like: The advantage of this technique is that it is very easy to span environments and applications, since the 'event' is the deleting of a file. But it can get annoying making sure each event has the right file deletions. So then I started working on the tag / events idea, to make it easier to create the association. Cheers, Patrick -- Patrick May 135 Oak Street New York, NY 11222 +1 (347) 232-5208 patrick at hexane.org http://www.hexane.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at enobrev.com Fri Jul 18 12:16:24 2008 From: lists at enobrev.com (Mark Armendariz) Date: Fri, 18 Jul 2008 12:16:24 -0400 Subject: [nycphp-talk] Handling empty values in hashes In-Reply-To: <20080717212045.GA14968@panix.com> References: <35902.192.168.1.71.1216321080.webmail@192.168.1.71> <20080717212045.GA14968@panix.com> Message-ID: <4880C1D8.2030508@enobrev.com> Daniel Convissor wrote: > Paul: > > On Thu, Jul 17, 2008 at 02:58:00PM -0400, paul at devonianfarm.com wrote: > >> isset($array[$key]) >> how's that different from array_key_exists? >> > > isset() thinks NULL is not set. Similarly, empty() can be used for stuff > like this, but of course, it thinks NULL, 0, FALSE and "" are all the > same. Which function to use depends on how your program needs to work. > > I also prefer array_key_exists - mostly due to being exactly what I need when I use it (checking for a key, though I recall seeing somewhere (sorry no source, but should be easy enough to test), that isset is somewhat faster than array_key_exists. Anyways, I like the article, but I noticed 2 errors. You forgot an "I" in "mplementations" in the 2nd paragraph. And you have an extra closing parentheses in one of your early examples: [11] if ($_GET["q"])) { // <-- Extra Closing Paren. [12] throw new InvalidInputException("You must specify a query"); [13] } Have a great weekend NYPHP! Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrick at hexane.org Fri Jul 18 12:28:55 2008 From: patrick at hexane.org (Patrick May) Date: Fri, 18 Jul 2008 12:28:55 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: <4880BCAC.2020506@bzcode.com> References: <4880BCAC.2020506@bzcode.com> Message-ID: bzcoder, I hear your point that using a framework, one should be aware of the various framework-specific options for improving performance. Through the 'tags' structure, I am trying to create an api to specify the underlying data points that make up the cache. I disagree that it is smarter to re-generate the cache immediately on the backend update. Generally speaking, front end and back end code can be very different and should be kept separate. Also, I disagree that CMS users can tolerate a poorly responding site. They add value to the site, and if the cache gets in their way, then they give up on improving the quality of site content. Cheers, Patrick On Fri, Jul 18, 2008 at 11:54 AM, bzcoder wrote: > Patrick May wrote: > >> Hello, >> >> I'm working on a PHP cache library, and I wanted to check in and see what >> folks thought. >> >> Usually, you have many different front end views that you will want to >> cache. These may pull from multiple datasources in odd ways. Far away from >> the front end, there is backend CMS, either a tool like Wordpress or Drupal, >> or a custom tool. Generally, I find myself managing caches by: >> >> 1. Putting the code that generates the cache into the front end, since it >> is the design that dictates which pieces of information should be grouped >> together. >> 2. Putting a very small amount of code in the back end which causes the >> cache to be deleted on the appropriate CRUD operations. CMS's are >> complicated enough as they are, and I don't want to clutter them up more >> then necessary. >> >> The hard part is creating the association between the front and back end. >> What I want to do is to use *tags* to create this association, and to break >> caches. >> > > Part of this has to do with your system. For example, Joomla is made up of > Templates, Components, Modules, and Plugins all of which go into generating > a page. > > A component will generate HTML content for the main section of the > website(think displaying articles, displaying a directory, etc). > A Module will generate a small block of HTML for specific purposes(think > "most popular articles" list, "advertising banners", "number of users > online") > A template is used to put all of that together into the layout of the page. > > Finally, a plugin will take that page and do a bunch of regular expression > find and replaces(so in your content, if you put {contact author} the author > of an articles contact information is placed on the page). > > Therefore, Joomla has multiple levels of caching. As I recall, you can > have it cache the output of specific modules and you can have it cache the > complete page output. > Now, compare that to the Smarty template system. In Smarty, you can cache > the results of applying a template to generate HTML. Smarty also has an > invalidate function, so whenever something is changed you can run the > invalidate function and kill the cached object. > > > My feeling is it really needs to be taken to the next level. So, when a > cached object is generated, that object needs to record somewhere what > underlying data points make up the cache. > So, for example, your looking at a listing of all articles relating to PHP > and Caching. > > As a first step, if an article is added, most systems just do a generic > "invalidate all article cache files" - but a more specific function would > say "lookup all files related to caching that where cached tagged with X and > invalidate them". > > A smarter step would be to refresh the cache if possible. So instead of > deleting the existing cached files, generate new ones. Considering that > create/update operations are already expected to be slow, making them a few > milliseconds slower is not a big deal. Especially since the editor is a > user you don't need to worry about getting upset at site slowness and moving > on to a competitors site. Wheras the reader is the person who you have to > be quick for. > > However, I will say the main issue is that developers have to USE the > cache. It does no good to have a method of storing data in a cache unless > the developers of the components trigger the flush/refresh mechanisms that > are already there and most CMS systems have(similiar to the logging > facility. It seems every framework has one, yet how often do people > actually add a bunch of extra code to log information except for failures). > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Patrick May 135 Oak Street New York, NY 11222 +1 (347) 232-5208 patrick at hexane.org http://www.hexane.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From jusheehy at vassar.edu Fri Jul 18 12:51:10 2008 From: jusheehy at vassar.edu (Julia Sheehy) Date: Fri, 18 Jul 2008 12:51:10 -0400 (EDT) Subject: [nycphp-talk] Embedding PL/SQL procedure into PHP Message-ID: <759576948.2303681216399870831.JavaMail.root@zimmbox01> Rather than recreating an entire procedure and the functions it uses we'd like to call the proc from within PHP like you would a stored perl function. We are an Oracle-PHP shop. Any suggestions/resources you'd recommend? From patrick at hexane.org Fri Jul 18 12:52:54 2008 From: patrick at hexane.org (Patrick May) Date: Fri, 18 Jul 2008 12:52:54 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: <117286890807180842n6d3d9837q1d5ce44545140b0e@mail.gmail.com> References: <117286890807180842n6d3d9837q1d5ce44545140b0e@mail.gmail.com> Message-ID: Tom, Perfect caching is indeed what I am after. Knowing that you work at Y!, I understand why you need to throw boxes at the problem :) With anything else, you need to weight whether or not you need it and > if it is worth the overhead of implementing it. > Definitely. I want the api to be simple enough to be useful. The pure file-based caching is dead simple, and extremely flexible. The tags-based system has rewards, but also drawbacks (like the need for the backend to run php). I'm trying to get some feedback to find the right balance of simplicity and features. It does sound like there is some interest. I'll get something released, and we can see if it is useful. Thanks for all the feedback! Cheers, Patrick -- Patrick May 135 Oak Street New York, NY 11222 +1 (347) 232-5208 patrick at hexane.org http://www.hexane.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Sat Jul 19 17:36:36 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sat, 19 Jul 2008 17:36:36 -0400 Subject: [nycphp-talk] Change in magic method + reference behavior? Message-ID: <78c6bd860807191436y5dfca4aej5262cd28cc2d0cf0@mail.gmail.com> I have a class that implements __get which retrieves the named attribute from a $this->_data array. In the past I believe I was able to do the following: $a = &$this->a; such that modifying array $a would be reflected in the underlying $this->_data array. However currently I'm using a machine with 5.2.6 and that code no longer works. If I change this to the following it works: $a = &$this->_data['a']; This is not a big deal for me because the code in question is isolated within the class but I was wondering if something has changed or if I'm just mistaken or if there's an INI setting behind this? Any ideas? Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jmcgraw1 at gmail.com Sat Jul 19 21:17:19 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Sat, 19 Jul 2008 21:17:19 -0400 Subject: [nycphp-talk] Change in magic method + reference behavior? In-Reply-To: <78c6bd860807191436y5dfca4aej5262cd28cc2d0cf0@mail.gmail.com> References: <78c6bd860807191436y5dfca4aej5262cd28cc2d0cf0@mail.gmail.com> Message-ID: On Sat, Jul 19, 2008 at 5:36 PM, Michael B Allen wrote: > I have a class that implements __get which retrieves the named > attribute from a $this->_data array. In the past I believe I was able > to do the following: > > $a = &$this->a; Could you post the code for your __get function? I think there are two possible reasons for the discrepancy between 5.2.* and whatever version you were running before: 1. You're using "Call-time pass-by-reference" by marking your return value with an ampersand, try changing your code to this: public function __get($field) { return &$this->_data[$field]; } and removing the ampersand from the function call: $a = $this->a; or: 2. Perhaps the bug fix in 5.2.6 (see http://bugs.php.net/bug.php?id=43201) changed the reference scheme. - jake > > > such that modifying array $a would be reflected in the underlying > $this->_data array. > > However currently I'm using a machine with 5.2.6 and that code no longer > works. > > If I change this to the following it works: > > $a = &$this->_data['a']; > > This is not a big deal for me because the code in question is isolated > within the class but I was wondering if something has changed or if > I'm just mistaken or if there's an INI setting behind this? > > Any ideas? > > Mike > > -- > Michael B Allen > PHP Active Directory SPNEGO SSO > http://www.ioplex.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Sat Jul 19 22:46:57 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sat, 19 Jul 2008 22:46:57 -0400 Subject: [nycphp-talk] Change in magic method + reference behavior? In-Reply-To: References: <78c6bd860807191436y5dfca4aej5262cd28cc2d0cf0@mail.gmail.com> Message-ID: <78c6bd860807191946t7aff77a4x7735075c8e02735b@mail.gmail.com> On Sat, Jul 19, 2008 at 9:17 PM, Jake McGraw wrote: > > > On Sat, Jul 19, 2008 at 5:36 PM, Michael B Allen wrote: >> >> I have a class that implements __get which retrieves the named >> attribute from a $this->_data array. In the past I believe I was able >> to do the following: >> >> $a = &$this->a; > > Could you post the code for your __get function? public function get($name, $default = null, $flags = 0) { if ($this->_data !== null && array_key_exists($name, $this->_data)) return $this->_data[$name]; if (func_num_args() === 1 || ($flags & self::FLAG_NO_DEFAULT) != 0) { require_once 'Plex/Exception.php'; throw new Plex_Exception("No such member: $name"); } return $default; } public function __get($name) { return $this->get($name); } > I think there are two > possible reasons for the discrepancy between 5.2.* and whatever version you > were running before: > > 1. You're using "Call-time pass-by-reference" by marking your return value > with an ampersand, try changing your code to this: > > public function __get($field) { > return &$this->_data[$field]; > } But I don't want the default behavior to be to return a reference. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jmcgraw1 at gmail.com Sat Jul 19 22:55:47 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Sat, 19 Jul 2008 22:55:47 -0400 Subject: [nycphp-talk] Change in magic method + reference behavior? In-Reply-To: <78c6bd860807191946t7aff77a4x7735075c8e02735b@mail.gmail.com> References: <78c6bd860807191436y5dfca4aej5262cd28cc2d0cf0@mail.gmail.com> <78c6bd860807191946t7aff77a4x7735075c8e02735b@mail.gmail.com> Message-ID: > > 1. You're using "Call-time pass-by-reference" by marking your return > value > > with an ampersand, try changing your code to this: > > > > public function __get($field) { > > return &$this->_data[$field]; > > } > > But I don't want the default behavior to be to return a reference. > > Mike > Ah, well, you're setting yourself up for some fun debugging later on, it's probably best not to mix and match pass by reference/value, which is why I think the PHP group depreciated the ability to do call-time pass by reference. IMO, whether a function returns a reference or a value should be part of the object method definition, not on the basis of the way the function was called. - jake > > -- > Michael B Allen > PHP Active Directory SPNEGO SSO > http://www.ioplex.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Sat Jul 19 23:55:05 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sat, 19 Jul 2008 23:55:05 -0400 Subject: [nycphp-talk] Change in magic method + reference behavior? In-Reply-To: References: <78c6bd860807191436y5dfca4aej5262cd28cc2d0cf0@mail.gmail.com> <78c6bd860807191946t7aff77a4x7735075c8e02735b@mail.gmail.com> Message-ID: <78c6bd860807192055r5756a8d6q7cd8fce1905ea46c@mail.gmail.com> On Sat, Jul 19, 2008 at 10:55 PM, Jake McGraw wrote: > >> > 1. You're using "Call-time pass-by-reference" by marking your return >> > value >> > with an ampersand, try changing your code to this: >> > >> > public function __get($field) { >> > return &$this->_data[$field]; >> > } >> >> But I don't want the default behavior to be to return a reference. >> >> Mike > > Ah, well, you're setting yourself up for some fun debugging later on, it's > probably best not to mix and match pass by reference/value, which is why I > think the PHP group depreciated the ability to do call-time pass by > reference. IMO, whether a function returns a reference or a value should be > part of the object method definition, not on the basis of the way the > function was called. I did not use, do not use and do not want to use call-time pass-by-reference. The code in question was "&$this->a" where $this is "magic" so it should, in theory, behave as though "a" was a real object member. If that code did in fact work like I thought it did, it must have been doing some extra "magic" because my __get function does not specify a reference in the signature or in the return. I suppose someone could have decided this case was call-time pass-by-reference in practice since it does go through the magic functions, declared it a bug and changed it. But I'm fine with &$this->_data['a']. I was just curious to know if something fundamental had changed. At this point I'm not sure if the code ever worked the way I claim and I don't care enough to write test programs to find out. Thanks tho, Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jmcgraw1 at gmail.com Sun Jul 20 08:55:31 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Sun, 20 Jul 2008 08:55:31 -0400 Subject: [nycphp-talk] Change in magic method + reference behavior? In-Reply-To: <78c6bd860807192055r5756a8d6q7cd8fce1905ea46c@mail.gmail.com> References: <78c6bd860807191436y5dfca4aej5262cd28cc2d0cf0@mail.gmail.com> <78c6bd860807191946t7aff77a4x7735075c8e02735b@mail.gmail.com> <78c6bd860807192055r5756a8d6q7cd8fce1905ea46c@mail.gmail.com> Message-ID: On Sat, Jul 19, 2008 at 11:55 PM, Michael B Allen wrote: > On Sat, Jul 19, 2008 at 10:55 PM, Jake McGraw wrote: > > > >> > 1. You're using "Call-time pass-by-reference" by marking your return > >> > value > >> > with an ampersand, try changing your code to this: > >> > > >> > public function __get($field) { > >> > return &$this->_data[$field]; > >> > } > >> > >> But I don't want the default behavior to be to return a reference. > >> > >> Mike > > > > Ah, well, you're setting yourself up for some fun debugging later on, > it's > > probably best not to mix and match pass by reference/value, which is why > I > > think the PHP group depreciated the ability to do call-time pass by > > reference. IMO, whether a function returns a reference or a value should > be > > part of the object method definition, not on the basis of the way the > > function was called. > > I did not use, do not use and do not want to use call-time > pass-by-reference. > The code in question was "&$this->a" where $this is "magic" so it > should, in theory, behave as though "a" was a real object member. Ahhhhh... sorry, that's what I get for having a programming conversation late on a Saturday night. - jake -------------- next part -------------- An HTML attachment was scrubbed... URL: From bzcoder at bzcode.com Mon Jul 21 16:26:54 2008 From: bzcoder at bzcode.com (bzcoder) Date: Mon, 21 Jul 2008 16:26:54 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: <4880BCAC.2020506@bzcode.com> Message-ID: <4884F10E.9090904@bzcode.com> Patrick May wrote: > > Also, I disagree that CMS users can tolerate a poorly responding > site. They add value to the site, and if the cache gets in their > way, then they give up on improving the quality of site content. I don't consider an extra millisecond or ( even 5) when editing a web page to be poorly performing, as the human based edit process is already structured around making changes, hitting save, waiting a second, making more changes, etc. I consider an extra millisecond when generating content for readers(and having it added to thousands of requests, if not tens of thousands) to be poorly performing. Both are working with user expectations, readers expect things to be instantaneous, editors expect something to take a little bit of time. From bzcoder at bzcode.com Mon Jul 21 16:30:26 2008 From: bzcoder at bzcode.com (bzcoder) Date: Mon, 21 Jul 2008 16:30:26 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: <117286890807180842n6d3d9837q1d5ce44545140b0e@mail.gmail.com> Message-ID: <4884F1E2.8020602@bzcode.com> Patrick May wrote: > Tom, > > Perfect caching is indeed what I am after. Knowing that you work at > Y!, I understand why you need to throw boxes at the problem :) > > With anything else, you need to weight whether or not you need it and > if it is worth the overhead of implementing it. > > > Definitely. I want the api to be simple enough to be useful. The > pure file-based caching is dead simple, and extremely flexible. The > tags-based system has rewards, but also drawbacks (like the need for > the backend to run php). I'm trying to get some feedback to find the > right balance of simplicity and features. Even pure file based caching uses tags. You have to go from: http://www.mydomain.com/somepath/to/myscript/script.php To saving a cached file to /some/path/to/my/cache/somecachefile You can embed your tags in your filename convention From patrick at hexane.org Mon Jul 21 16:45:37 2008 From: patrick at hexane.org (Patrick May) Date: Mon, 21 Jul 2008 16:45:37 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: <4884F10E.9090904@bzcode.com> References: <4880BCAC.2020506@bzcode.com> <4884F10E.9090904@bzcode.com> Message-ID: On Mon, Jul 21, 2008 at 4:26 PM, bzcoder wrote: > I don't consider an extra millisecond or ( even 5) when editing a web page > to be poorly performing, as the human based edit process is already > structured around making changes, hitting save, waiting a second, making > more changes, etc. Oh I wasn't thinking of an extra millisecond to be too much for the editor. I referring to the 5 minutes of waiting for caches to clear b/c the cache isn't integrated with the event of CMS updates. I'm sacrificing the occasional 500ms wait for content in favor of simplified code management and integration, with the goal of more widely deploying perfect caching. If the content generation stretches above 500ms I agree pre-generation in the CMS is necessary. I wonder if there's a pattern here that could also be supported by the library? Also, you are correct that you can embed information in the cache files. What I'm going for is some library support to automatically clear both of these caches on article updates: /cache/article/1234 /cache/frontpage/article/sidebar I know this could be done with: system('find /cache | grep article | xargs rm -f'); and I do question what's wrong with such a simple line of code :D I want a simple abstract "clear cache" line of code to embed in various CMS locations, while the actual mechanics of clearing cache are managed by the library. By simplifing the process of describing something that is cached, I hope to have widespread 'perfect' caching. I've got the code written for another project, just need to fiddle with the namespaces and release it. Thanks for the help thinking through the idea. Cheers, Patrick -- Patrick May 135 Oak Street Brooklyn, NY 11222 +1 (347) 232-5208 patrick at hexane.org http://www.hexane.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From bzcoder at bzcode.com Mon Jul 21 17:41:50 2008 From: bzcoder at bzcode.com (bzcoder) Date: Mon, 21 Jul 2008 17:41:50 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: References: <4880BCAC.2020506@bzcode.com> <4884F10E.9090904@bzcode.com> Message-ID: <4885029E.3090004@bzcode.com> Patrick May wrote: > > I know this could be done with: > > system('find /cache | grep article | xargs rm -f'); > > and I do question what's wrong with such a simple line of code :D > > I want a simple abstract "clear cache" line of code to embed in > various CMS locations, while the actual mechanics of clearing cache > are managed by the library. By simplifing the process of describing > something that is cached, I hope to have widespread 'perfect' caching. Perhaps this goes without saying, but I was assuming you were thinking of file system caching only as the basic underlying method, and not the only method. IE you have a system cache setup as: $cache->check("somecode1"); $cache->get("somecode1"); $cache->save("somecode1"); $cache->clear("code1"); But your actual cache function should be extendable, so it can cache to the file system, it can cache to a database, and it can cache to memcached(http://www.danga.com/memcached/). That way your scalable from people who need file system caching, to people who want a central repository and can't do shared files, and then people who want to maximize performance and can throw memory at the problem. From ioplex at gmail.com Mon Jul 21 17:48:06 2008 From: ioplex at gmail.com (Michael B Allen) Date: Mon, 21 Jul 2008 17:48:06 -0400 Subject: [nycphp-talk] PCRE expression for tokenizing? Message-ID: <78c6bd860807211448k32bb4d5arf3d955ccfddf2704@mail.gmail.com> I trying to write a Wiki syntax tokenizer using preg_match. Meaning I want to match any token like '~', '**', '//', '=====', ... etc but if none of those tokens match I want to match any valid printable string. The expression I have so far is the following: @(~)|(\*\*)|(//)|(=====)|(====)|(===)|(==)|(=)|([[:print:]]*)@ The problem with this is that the [[:print:]] class matches the entire input. Strangely if I use [a-zA-Z0-9 ]* instead it works (but of course I want to support more than ASCII and a space). Meaning given the input: [The **fox** jumped //over// the fence] I want each call to preg_match to return tokens (while advancing the offset accordingly of course): [The ] [**] [fox] [**] [ jumped ] [//] [over] [//] [ the fence] Can someone recommend a good PCRE expression for tokenizing like this? Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From patrick at hexane.org Mon Jul 21 17:50:32 2008 From: patrick at hexane.org (Patrick May) Date: Mon, 21 Jul 2008 17:50:32 -0400 Subject: [nycphp-talk] PHP caching (not opcode) In-Reply-To: <4885029E.3090004@bzcode.com> References: <4880BCAC.2020506@bzcode.com> <4884F10E.9090904@bzcode.com> <4885029E.3090004@bzcode.com> Message-ID: Having a configurable cache backend is definitely one of the reasons I want to put this stuff in a library. Ideally the backend would use a URL-like configuration line, so it becomes like a JDBC url that is set in a config file. Thanks again, Patrick On Mon, Jul 21, 2008 at 5:41 PM, bzcoder wrote: > Patrick May wrote: > >> >> I know this could be done with: >> >> system('find /cache | grep article | xargs rm -f'); >> >> and I do question what's wrong with such a simple line of code :D >> >> I want a simple abstract "clear cache" line of code to embed in various >> CMS locations, while the actual mechanics of clearing cache are managed by >> the library. By simplifing the process of describing something that is >> cached, I hope to have widespread 'perfect' caching. >> > > Perhaps this goes without saying, but I was assuming you were thinking of > file system caching only as the basic underlying method, and not the only > method. > > IE you have a system cache setup as: > > $cache->check("somecode1"); > $cache->get("somecode1"); > $cache->save("somecode1"); > $cache->clear("code1"); > > But your actual cache function should be extendable, so it can cache to the > file system, it can cache to a database, and it can cache to memcached( > http://www.danga.com/memcached/). > That way your scalable from people who need file system caching, to people > who want a central repository and can't do shared files, and > then people who want to maximize performance and can throw memory at the > problem. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Patrick May 135 Oak Street Brooklyn, NY 11222 +1 (347) 232-5208 patrick at hexane.org http://www.hexane.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Mon Jul 21 18:08:08 2008 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 21 Jul 2008 18:08:08 -0400 Subject: [nycphp-talk] PCRE expression for tokenizing? In-Reply-To: <78c6bd860807211448k32bb4d5arf3d955ccfddf2704@mail.gmail.com> References: <78c6bd860807211448k32bb4d5arf3d955ccfddf2704@mail.gmail.com> Message-ID: <488508C8.6080603@phpwerx.net> Michael B Allen wrote: > I trying to write a Wiki syntax tokenizer using preg_match. Meaning I > want to match any token like '~', '**', '//', '=====', ... etc but if > none of those tokens match I want to match any valid printable string. > > The expression I have so far is the following: > > @(~)|(\*\*)|(//)|(=====)|(====)|(===)|(==)|(=)|([[:print:]]*)@ > > The problem with this is that the [[:print:]] class matches the entire > input. Strangely if I use [a-zA-Z0-9 ]* instead it works (but of > course I want to support more than ASCII and a space). The reason for this is that your token characters are included in [[:print:]] but not in [a-zA-Z0-9 ]. > Meaning given the input: > > [The **fox** jumped //over// the fence] > > I want each call to preg_match to return tokens (while advancing the > offset accordingly of course): > > [The ] > [**] > [fox] > [**] > [ jumped ] > [//] > [over] > [//] > [ the fence] > > Can someone recommend a good PCRE expression for tokenizing like this? If you want to end up with everything in an array, you might want to look at preg_split with the PREG_SPLIT_DELIM_CAPTURE argument. Something like: $tokens = preg_split('@(~|\*\*|//|=====|====|===|==|=)@',$string,PREG_SPLIT_DELIM_CAPTURE); May do what you're after. Dan From ioplex at gmail.com Mon Jul 21 18:32:02 2008 From: ioplex at gmail.com (Michael B Allen) Date: Mon, 21 Jul 2008 18:32:02 -0400 Subject: [nycphp-talk] PCRE expression for tokenizing? In-Reply-To: <488508C8.6080603@phpwerx.net> References: <78c6bd860807211448k32bb4d5arf3d955ccfddf2704@mail.gmail.com> <488508C8.6080603@phpwerx.net> Message-ID: <78c6bd860807211532h3cfd8f05ybbb84040d0297200@mail.gmail.com> On Mon, Jul 21, 2008 at 6:08 PM, Dan Cech wrote: > Michael B Allen wrote: >> >> I trying to write a Wiki syntax tokenizer using preg_match. Meaning I >> want to match any token like '~', '**', '//', '=====', ... etc but if >> none of those tokens match I want to match any valid printable string. >> >> The expression I have so far is the following: >> >> @(~)|(\*\*)|(//)|(=====)|(====)|(===)|(==)|(=)|([[:print:]]*)@ >> >> The problem with this is that the [[:print:]] class matches the entire >> input. Strangely if I use [a-zA-Z0-9 ]* instead it works (but of >> course I want to support more than ASCII and a space). > > The reason for this is that your token characters are included in > [[:print:]] but not in [a-zA-Z0-9 ]. Oh, yeah. Duh. So is there any way to say "capture anything that didn't match" (aside from created a sub-expression that explicitly excludes all of the tokens)? >> Meaning given the input: >> >> [The **fox** jumped //over// the fence] >> >> I want each call to preg_match to return tokens (while advancing the >> offset accordingly of course): >> >> [The ] >> [**] >> [fox] >> [**] >> [ jumped ] >> [//] >> [over] >> [//] >> [ the fence] >> >> Can someone recommend a good PCRE expression for tokenizing like this? > > If you want to end up with everything in an array, you might want to look at > preg_split with the PREG_SPLIT_DELIM_CAPTURE argument. > > Something like: > > $tokens = > preg_split('@(~|\*\*|//|=====|====|===|==|=)@',$string,PREG_SPLIT_DELIM_CAPTURE); No, I need the tokens (or rather I need to know which token matched) for the state-machine that follows so preg_split probably isn't going to do the trick. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From dcech at phpwerx.net Mon Jul 21 18:45:42 2008 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 21 Jul 2008 18:45:42 -0400 Subject: [nycphp-talk] PCRE expression for tokenizing? In-Reply-To: <78c6bd860807211532h3cfd8f05ybbb84040d0297200@mail.gmail.com> References: <78c6bd860807211448k32bb4d5arf3d955ccfddf2704@mail.gmail.com> <488508C8.6080603@phpwerx.net> <78c6bd860807211532h3cfd8f05ybbb84040d0297200@mail.gmail.com> Message-ID: <48851196.9040508@phpwerx.net> Michael B Allen wrote: > On Mon, Jul 21, 2008 at 6:08 PM, Dan Cech wrote: >> Michael B Allen wrote: > So is there any way to say "capture anything that didn't match" (aside > from created a sub-expression that explicitly excludes all of the > tokens)? Afaik no, you could probably do something like: preg_match('@^(.*?)(~|\*\*|//|=====|====|===|==|=|$)@',$string,$m); Which would give you anything before the first token (or end if there are no more tokens) in $m[1] and the first token (or nothing if there are no more tokens) in $m[2]. >>> Can someone recommend a good PCRE expression for tokenizing like this? >> If you want to end up with everything in an array, you might want to look at >> preg_split with the PREG_SPLIT_DELIM_CAPTURE argument. >> >> Something like: >> >> $tokens = >> preg_split('@(~|\*\*|//|=====|====|===|==|=)@',$string,PREG_SPLIT_DELIM_CAPTURE); > > No, I need the tokens (or rather I need to know which token matched) > for the state-machine that follows so preg_split probably isn't going > to do the trick. That's what the PREG_SPLIT_DELIM_CAPTURE flag does, it returns the delimiters. You can iterate over the returned array and you'll get either a token or text in each element. An iterative preg_match setup will most likely be more memory efficient but also slower. Dan From dcech at phpwerx.net Mon Jul 21 18:51:26 2008 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 21 Jul 2008 18:51:26 -0400 Subject: [nycphp-talk] PCRE expression for tokenizing? In-Reply-To: <48851196.9040508@phpwerx.net> References: <78c6bd860807211448k32bb4d5arf3d955ccfddf2704@mail.gmail.com> <488508C8.6080603@phpwerx.net> <78c6bd860807211532h3cfd8f05ybbb84040d0297200@mail.gmail.com> <48851196.9040508@phpwerx.net> Message-ID: <488512EE.9030508@phpwerx.net> Dan Cech wrote: > Michael B Allen wrote: >> On Mon, Jul 21, 2008 at 6:08 PM, Dan Cech wrote: >>> Michael B Allen wrote: >> So is there any way to say "capture anything that didn't match" (aside >> from created a sub-expression that explicitly excludes all of the >> tokens)? > > Afaik no, you could probably do something like: > > preg_match('@^(.*?)(~|\*\*|//|=====|====|===|==|=|$)@',$string,$m); > > Which would give you anything before the first token (or end if there > are no more tokens) in $m[1] and the first token (or nothing if there > are no more tokens) in $m[2]. This should actually be: preg_match('@^(.*?)(~|\*\*|//|=====|====|===|==|=|$)@s',$string,$m); if your string is going to contain newlines. Dan From ioplex at gmail.com Mon Jul 21 19:53:39 2008 From: ioplex at gmail.com (Michael B Allen) Date: Mon, 21 Jul 2008 19:53:39 -0400 Subject: [nycphp-talk] PCRE expression for tokenizing? In-Reply-To: <48851196.9040508@phpwerx.net> References: <78c6bd860807211448k32bb4d5arf3d955ccfddf2704@mail.gmail.com> <488508C8.6080603@phpwerx.net> <78c6bd860807211532h3cfd8f05ybbb84040d0297200@mail.gmail.com> <48851196.9040508@phpwerx.net> Message-ID: <78c6bd860807211653j2b8ed726hb4e56207f9f66e3@mail.gmail.com> On Mon, Jul 21, 2008 at 6:45 PM, Dan Cech wrote: > Michael B Allen wrote: >> >> On Mon, Jul 21, 2008 at 6:08 PM, Dan Cech wrote: >>> >>> Michael B Allen wrote: >> >> So is there any way to say "capture anything that didn't match" (aside >> from created a sub-expression that explicitly excludes all of the >> tokens)? > > Afaik no, you could probably do something like: > > preg_match('@^(.*?)(~|\*\*|//|=====|====|===|==|=|$)@',$string,$m); > > Which would give you anything before the first token (or end if there are no > more tokens) in $m[1] and the first token (or nothing if there are no more > tokens) in $m[2]. Actually matching two tokens is what I started with and probably what I end up using. Except I don't try to match the string. I match only tokens, capture them separately and then use the offset of the captured value to determine which token was matched. That way I get a numeric value representing which token matched (otherwise I have to try to map strings to token values after the preg_match). Then I use the offset of the matched token to determine if I also got a string and if so, save the token for the next iteration. It's probably more efficient processing two tokens at a time anyway. Thanks, Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From krook at us.ibm.com Tue Jul 22 08:29:53 2008 From: krook at us.ibm.com (Daniel Krook) Date: Tue, 22 Jul 2008 08:29:53 -0400 Subject: [nycphp-talk] Reminder, tonight's meeting is not at IBM Message-ID: Good morning folks, Just a reminder. Tonight's meeting is *not* at IBM. I've seen a few RSVPs come in to our system, but the new venue (Suspenders, downtown) does not require RSVPs: http://nyphp.org/content/calendar/view_entry.php?id=125&date=20080722 Thanks, -Dan Daniel Krook Senior IT Specialist Content Tools Developer - SCSA, SCJP, SCWCD, ZCE, ICDAssoc. Global Solutions, ibm.com From ken at secdat.com Tue Jul 22 08:32:26 2008 From: ken at secdat.com (Kenneth Downs) Date: Tue, 22 Jul 2008 08:32:26 -0400 Subject: [nycphp-talk] Reminder, tonight's meeting is not at IBM In-Reply-To: References: Message-ID: <4885D35A.4020600@secdat.com> When you say "new venue", do you mean permanent, or just for summer presentations? Daniel Krook wrote: > Good morning folks, > > Just a reminder. Tonight's meeting is *not* at IBM. I've seen a few > RSVPs come in to our system, but the new venue (Suspenders, downtown) does > not require RSVPs: > > http://nyphp.org/content/calendar/view_entry.php?id=125&date=20080722 > > > Thanks, > -Dan > > > Daniel Krook > Senior IT Specialist > Content Tools Developer - SCSA, SCJP, SCWCD, ZCE, ICDAssoc. > Global Solutions, ibm.com > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From krook at us.ibm.com Tue Jul 22 08:41:18 2008 From: krook at us.ibm.com (Daniel Krook) Date: Tue, 22 Jul 2008 08:41:18 -0400 Subject: [nycphp-talk] Reminder, tonight's meeting is not at IBM In-Reply-To: <4885D35A.4020600@secdat.com> References: <4885D35A.4020600@secdat.com> Message-ID: Hi Kenneth, Kenneth Downs wrote on 07/22/2008 08:32:26 AM: > When you say "new venue", do you mean permanent, or just for summer > presentations? > > Daniel Krook wrote: > > Good morning folks, > > > > Just a reminder. Tonight's meeting is *not* at IBM. It's just a change for tonight since the room wasn't available. All other meetings this year will be at IBM. Thanks, -Dan Daniel Krook Senior IT Specialist Content Tools Developer - SCSA, SCJP, SCWCD, ZCE, ICDAssoc. Global Solutions, ibm.com From ka at kacomputerconsulting.com Wed Jul 23 17:28:51 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Wed, 23 Jul 2008 14:28:51 -0700 Subject: [nycphp-talk] need another pair of eyes! Message-ID: <1216848531.4409@coral.he.net> Hi everyone, I really need another pair of eyes to take a look at this. I'm pretty sure this form needs to be submitted twice in order to pass the post array to the included file (see code below)...is that the only issue here..? this is a bare bones code sample which i will have to integrate into my paypal app. the code modification was prompted by the fact that the buyers were not seeing an html page on my client's website before the download box popped up, and this needs to be rectified. Thanks in advance! FILE 1 - testdowndisp.php Thanks for your purchase. The charge will appear on your statement as Rough Draft P.

Welcome back to Proof Magazine website.

FILE 2 -- downloadfile2.php "; //echo $filename."
"; //==== $path = '/usr431/home/p/r/proof/PDFs/'; $filesize=filesize($path.$filename); header("Content-Type: application/pdf"); header("Content-Length: ".$filesize); header("Content-Disposition: attachment; filename=$filename"); header("Content-Transfer-Encoding: binary"); readfile($path.$filename); //fopen($path.$filename); //=== ?> -- Kristina From tim_lists at o2group.com Wed Jul 23 17:36:00 2008 From: tim_lists at o2group.com (Tim Lieberman) Date: Wed, 23 Jul 2008 15:36:00 -0600 Subject: [nycphp-talk] need another pair of eyes! In-Reply-To: <1216848531.4409@coral.he.net> References: <1216848531.4409@coral.he.net> Message-ID: <2F9B8159-43AD-439D-A877-6C992D6AA8E2@o2group.com> Not entirely clear on what you're trying to accomplish. Can you give us some context, maybe tell us a user story? -Tim On Jul 23, 2008, at 3:28 PM, Kristina Anderson wrote: > Hi everyone, I really need another pair of eyes to take a look at > this. I'm pretty sure this form needs to be submitted twice in order > to pass the post array to the included file (see code below)...is that > the only issue here..? this is a bare bones code sample which i will > have to integrate into my paypal app. > > the code modification was prompted by the fact that the buyers were > not > seeing an html page on my client's website before the download box > popped up, and this needs to be rectified. > > Thanks in advance! > > FILE 1 - testdowndisp.php > > $itemno = "333"; > > ?> > > > > > > > > > Thanks for your purchase. The charge will appear on your statement as > Rough Draft P.

Welcome back to Proof Magazine website. > >

> > >
> > ob_clean(); > include('downloadfile2.php'); > //exit(0); > > ?> > > > > > FILE 2 -- downloadfile2.php > > > $pdfid = $_POST['pdfid']; > $filename = $pdfid.".pdf"; > //echo $pdfid."
"; > //echo $filename."
"; > > > //==== > $path = '/usr431/home/p/r/proof/PDFs/'; > $filesize=filesize($path.$filename); > header("Content-Type: application/pdf"); > header("Content-Length: ".$filesize); > header("Content-Disposition: attachment; filename=$filename"); > header("Content-Transfer-Encoding: binary"); > readfile($path.$filename); > //fopen($path.$filename); > //=== > > ?> > > > -- Kristina_______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ka at kacomputerconsulting.com Wed Jul 23 17:52:33 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Wed, 23 Jul 2008 14:52:33 -0700 Subject: [nycphp-talk] need another pair of eyes! Message-ID: <1216849953.15101@coral.he.net> The situation is this...the full app needs to 1. upon redirection from Paypal, display some text on an HTML page, 2. post some data that is passed to the download page, and 3. serve up a file for download. In order for me to use headers to serve up the file, I have to pass the data on the transation to another page after I render the HTML. There is database validation stuff which is stripped out for this sample but which is working in the original code. Thanks! > Not entirely clear on what you're trying to accomplish. Can you give > us some context, maybe tell us a user story? > > -Tim > > On Jul 23, 2008, at 3:28 PM, Kristina Anderson wrote: > > > Hi everyone, I really need another pair of eyes to take a look at > > this. I'm pretty sure this form needs to be submitted twice in order > > to pass the post array to the included file (see code below)...is that > > the only issue here..? this is a bare bones code sample which i will > > have to integrate into my paypal app. > > > > the code modification was prompted by the fact that the buyers were > > not > > seeing an html page on my client's website before the download box > > popped up, and this needs to be rectified. > > > > Thanks in advance! > > > > FILE 1 - testdowndisp.php > > > > > $itemno = "333"; > > > > ?> > > > > > > > > > > > > > > > > > > Thanks for your purchase. The charge will appear on your statement as > > Rough Draft P.

Welcome back to Proof Magazine website. > > > >

> > > > > >
> > > > > ob_clean(); > > include('downloadfile2.php'); > > //exit(0); > > > > ?> > > > > > > > > > > FILE 2 -- downloadfile2.php > > > > > > > $pdfid = $_POST['pdfid']; > > $filename = $pdfid.".pdf"; > > //echo $pdfid."
"; > > //echo $filename."
"; > > > > > > //==== > > $path = '/usr431/home/p/r/proof/PDFs/'; > > $filesize=filesize($path.$filename); > > header("Content-Type: application/pdf"); > > header("Content-Length: ".$filesize); > > header("Content-Disposition: attachment; filename=$filename"); > > header("Content-Transfer-Encoding: binary"); > > readfile($path.$filename); > > //fopen($path.$filename); > > //=== > > > > ?> > > > > > > -- Kristina_______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From tim_lists at o2group.com Wed Jul 23 18:02:23 2008 From: tim_lists at o2group.com (Tim Lieberman) Date: Wed, 23 Jul 2008 16:02:23 -0600 Subject: [nycphp-talk] need another pair of eyes! In-Reply-To: <1216849953.15101@coral.he.net> References: <1216849953.15101@coral.he.net> Message-ID: <7E0C9993-46E0-4119-ACC7-517949F74838@o2group.com> So why not approach it like this: 1) Redirect back from paypal. Display whatever text you need. 2) Include in that page a good ole "Your download should start momentarily, if not, click here 3) Include a hidden iframe pointing at an empty page 4) Include a hidden form that targets the iframe 5) Use javascript to trigger to form submit 6) Whatever the form-handler script is, I'm assuming it's the bit that outputs some headers and then emits the PDF content. This seems to be close to what you're trying to do, but with the addition of the iframe. -Tim On Jul 23, 2008, at 3:52 PM, Kristina Anderson wrote: > The situation is this...the full app needs to > > 1. upon redirection from Paypal, display some text on an HTML page, > > 2. post some data that is passed to the download page, and > > 3. serve up a file for download. > > In order for me to use headers to serve up the file, I have to pass > the > data on the transation to another page after I render the HTML. There > is database validation stuff which is stripped out for this sample but > which is working in the original code. > > > > Thanks! > >> Not entirely clear on what you're trying to accomplish. Can you > give >> us some context, maybe tell us a user story? >> >> -Tim >> >> On Jul 23, 2008, at 3:28 PM, Kristina Anderson wrote: >> >>> Hi everyone, I really need another pair of eyes to take a look at >>> this. I'm pretty sure this form needs to be submitted twice in > order >>> to pass the post array to the included file (see code below)...is > that >>> the only issue here..? this is a bare bones code sample which i > will >>> have to integrate into my paypal app. >>> >>> the code modification was prompted by the fact that the buyers > were >>> not >>> seeing an html page on my client's website before the download box >>> popped up, and this needs to be rectified. >>> >>> Thanks in advance! >>> >>> FILE 1 - testdowndisp.php >>> >> >>> $itemno = "333"; >>> >>> ?> >>> >>> >>> >>> >>> >>> >>> >>> >>> Thanks for your purchase. The charge will appear on your statement > as >>> Rough Draft P.

Welcome back to Proof Magazine website. >>> >>>

>>> >>> >>>
>>> >> >>> ob_clean(); >>> include('downloadfile2.php'); >>> //exit(0); >>> >>> ?> >>> >>> >>> >>> >>> FILE 2 -- downloadfile2.php >>> >>> >> >>> $pdfid = $_POST['pdfid']; >>> $filename = $pdfid.".pdf"; >>> //echo $pdfid."
"; >>> //echo $filename."
"; >>> >>> >>> //==== >>> $path = '/usr431/home/p/r/proof/PDFs/'; >>> $filesize=filesize($path.$filename); >>> header("Content-Type: application/pdf"); >>> header("Content-Length: ".$filesize); >>> header("Content-Disposition: attachment; filename=$filename"); >>> header("Content-Transfer-Encoding: binary"); >>> readfile($path.$filename); >>> //fopen($path.$filename); >>> //=== >>> >>> ?> >>> >>> >>> -- Kristina_______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> >> > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ka at kacomputerconsulting.com Wed Jul 23 18:11:20 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Wed, 23 Jul 2008 15:11:20 -0700 Subject: [nycphp-talk] need another pair of eyes! Message-ID: <1216851080.22521@coral.he.net> Hi Tim -- is there any way to get it to work by submitting the form twice and then including the file with the headers/pdf content? thanks. > So why not approach it like this: > > 1) Redirect back from paypal. Display whatever text you need. > 2) Include in that page a good ole "Your download should start > momentarily, if not, click here > 3) Include a hidden iframe pointing at an empty page > 4) Include a hidden form that targets the iframe > 5) Use javascript to trigger to form submit > 6) Whatever the form-handler script is, I'm assuming it's the bit > that outputs some headers and then emits the PDF content. > > This seems to be close to what you're trying to do, but with the > addition of the iframe. > > -Tim > > On Jul 23, 2008, at 3:52 PM, Kristina Anderson wrote: > > > The situation is this...the full app needs to > > > > 1. upon redirection from Paypal, display some text on an HTML page, > > > > 2. post some data that is passed to the download page, and > > > > 3. serve up a file for download. > > > > In order for me to use headers to serve up the file, I have to pass > > the > > data on the transation to another page after I render the HTML. There > > is database validation stuff which is stripped out for this sample but > > which is working in the original code. > > > > > > > > Thanks! > > > >> Not entirely clear on what you're trying to accomplish. Can you > > give > >> us some context, maybe tell us a user story? > >> > >> -Tim > >> > >> On Jul 23, 2008, at 3:28 PM, Kristina Anderson wrote: > >> > >>> Hi everyone, I really need another pair of eyes to take a look at > >>> this. I'm pretty sure this form needs to be submitted twice in > > order > >>> to pass the post array to the included file (see code below)...is > > that > >>> the only issue here..? this is a bare bones code sample which i > > will > >>> have to integrate into my paypal app. > >>> > >>> the code modification was prompted by the fact that the buyers > > were > >>> not > >>> seeing an html page on my client's website before the download box > >>> popped up, and this needs to be rectified. > >>> > >>> Thanks in advance! > >>> > >>> FILE 1 - testdowndisp.php > >>> >>> > >>> $itemno = "333"; > >>> > >>> ?> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> Thanks for your purchase. The charge will appear on your statement > > as > >>> Rough Draft P.

Welcome back to Proof Magazine website. > >>> > >>>

> >>> > >>> > >>>
> >>> >>> > >>> ob_clean(); > >>> include('downloadfile2.php'); > >>> //exit(0); > >>> > >>> ?> > >>> > >>> > >>> > >>> > >>> FILE 2 -- downloadfile2.php > >>> > >>> >>> > >>> $pdfid = $_POST['pdfid']; > >>> $filename = $pdfid.".pdf"; > >>> //echo $pdfid."
"; > >>> //echo $filename."
"; > >>> > >>> > >>> //==== > >>> $path = '/usr431/home/p/r/proof/PDFs/'; > >>> $filesize=filesize($path.$filename); > >>> header("Content-Type: application/pdf"); > >>> header("Content-Length: ".$filesize); > >>> header("Content-Disposition: attachment; filename=$filename"); > >>> header("Content-Transfer-Encoding: binary"); > >>> readfile($path.$filename); > >>> //fopen($path.$filename); > >>> //=== > >>> > >>> ?> > >>> > >>> > >>> -- Kristina_______________________________________________ > >>> New York PHP Community Talk Mailing List > >>> http://lists.nyphp.org/mailman/listinfo/talk > >>> > >>> NYPHPCon 2006 Presentations Online > >>> http://www.nyphpcon.com > >>> > >>> Show Your Participation in New York PHP > >>> http://www.nyphp.org/show_participation.php > >> > >> _______________________________________________ > >> New York PHP Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> NYPHPCon 2006 Presentations Online > >> http://www.nyphpcon.com > >> > >> Show Your Participation in New York PHP > >> http://www.nyphp.org/show_participation.php > >> > >> > > > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From tim_lists at o2group.com Wed Jul 23 18:21:16 2008 From: tim_lists at o2group.com (Tim Lieberman) Date: Wed, 23 Jul 2008 16:21:16 -0600 Subject: [nycphp-talk] need another pair of eyes! In-Reply-To: <1216851080.22521@coral.he.net> References: <1216851080.22521@coral.he.net> Message-ID: <5986AA64-9CC6-4929-A7F6-E5BFA1336421@o2group.com> I suppose you could try just rendering the page, along with your hidden form that automagically submits... something like: --BEGIN-- ... Hi, and thanks. Here's yer file.
Hi Tim -- is there any way to get it to work by submitting the form > twice and then including the file with the headers/pdf content? > > thanks. > >> So why not approach it like this: >> >> 1) Redirect back from paypal. Display whatever text you need. >> 2) Include in that page a good ole "Your download should start >> momentarily, if not, click here >> 3) Include a hidden iframe pointing at an empty page >> 4) Include a hidden form that targets the iframe >> 5) Use javascript to trigger to form submit >> 6) Whatever the form-handler script is, I'm assuming it's the > bit >> that outputs some headers and then emits the PDF content. >> >> This seems to be close to what you're trying to do, but with the >> addition of the iframe. >> >> -Tim >> >> On Jul 23, 2008, at 3:52 PM, Kristina Anderson wrote: >> >>> The situation is this...the full app needs to >>> >>> 1. upon redirection from Paypal, display some text on an HTML page, >>> >>> 2. post some data that is passed to the download page, and >>> >>> 3. serve up a file for download. >>> >>> In order for me to use headers to serve up the file, I have to > pass >>> the >>> data on the transation to another page after I render the HTML. > There >>> is database validation stuff which is stripped out for this sample > but >>> which is working in the original code. >>> >>> >>> >>> Thanks! >>> >>>> Not entirely clear on what you're trying to accomplish. Can you >>> give >>>> us some context, maybe tell us a user story? >>>> >>>> -Tim >>>> >>>> On Jul 23, 2008, at 3:28 PM, Kristina Anderson wrote: >>>> >>>>> Hi everyone, I really need another pair of eyes to take a look at >>>>> this. I'm pretty sure this form needs to be submitted twice in >>> order >>>>> to pass the post array to the included file (see code below)...is >>> that >>>>> the only issue here..? this is a bare bones code sample which i >>> will >>>>> have to integrate into my paypal app. >>>>> >>>>> the code modification was prompted by the fact that the buyers >>> were >>>>> not >>>>> seeing an html page on my client's website before the download box >>>>> popped up, and this needs to be rectified. >>>>> >>>>> Thanks in advance! >>>>> >>>>> FILE 1 - testdowndisp.php >>>>> >>>> >>>>> $itemno = "333"; >>>>> >>>>> ?> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Thanks for your purchase. The charge will appear on your > statement >>> as >>>>> Rough Draft P.

Welcome back to Proof Magazine website. >>>>> >>>>> >>>>> >>>>> >>>>>

>>>>> >>>> >>>>> ob_clean(); >>>>> include('downloadfile2.php'); >>>>> //exit(0); >>>>> >>>>> ?> >>>>> >>>>> >>>>> >>>>> >>>>> FILE 2 -- downloadfile2.php >>>>> >>>>> >>>> >>>>> $pdfid = $_POST['pdfid']; >>>>> $filename = $pdfid.".pdf"; >>>>> //echo $pdfid."
"; >>>>> //echo $filename."
"; >>>>> >>>>> >>>>> //==== >>>>> $path = '/usr431/home/p/r/proof/PDFs/'; >>>>> $filesize=filesize($path.$filename); >>>>> header("Content-Type: application/pdf"); >>>>> header("Content-Length: ".$filesize); >>>>> header("Content-Disposition: attachment; filename=$filename"); >>>>> header("Content-Transfer-Encoding: binary"); >>>>> readfile($path.$filename); >>>>> //fopen($path.$filename); >>>>> //=== >>>>> >>>>> ?> >>>>> >>>>> >>>>> -- Kristina_______________________________________________ >>>>> New York PHP Community Talk Mailing List >>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>> >>>>> NYPHPCon 2006 Presentations Online >>>>> http://www.nyphpcon.com >>>>> >>>>> Show Your Participation in New York PHP >>>>> http://www.nyphp.org/show_participation.php >>>> >>>> _______________________________________________ >>>> New York PHP Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> NYPHPCon 2006 Presentations Online >>>> http://www.nyphpcon.com >>>> >>>> Show Your Participation in New York PHP >>>> http://www.nyphp.org/show_participation.php >>>> >>>> >>> >>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> >> > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From bzcoder at bzcode.com Thu Jul 24 08:41:05 2008 From: bzcoder at bzcode.com (bzcoder) Date: Thu, 24 Jul 2008 08:41:05 -0400 Subject: [nycphp-talk] Embedding PL/SQL procedure into PHP In-Reply-To: <759576948.2303681216399870831.JavaMail.root@zimmbox01> References: <759576948.2303681216399870831.JavaMail.root@zimmbox01> Message-ID: <48887861.7070804@bzcode.com> Julia Sheehy wrote: > Rather than recreating an entire procedure and the functions it uses we'd like to call the proc from within PHP like you would a stored perl function. We are an Oracle-PHP shop. > > Well, I don't use stored procedures or Oracle much, but a quick google search reveals this article: http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_sps.html Seems straight forward. From ka at kacomputerconsulting.com Thu Jul 24 09:17:23 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Thu, 24 Jul 2008 06:17:23 -0700 Subject: [nycphp-talk] need another pair of eyes! Message-ID: <1216905443.4009@coral.he.net> This project has since lost some of its urgency and so I've decided to try both suggestions, below (thanks Tim), and whatever else is necessary to get this working the way I need. I'll post both the old code which is working without the new "feature" and the new code in progress. What the application does: Processes Paypal-returned transaction information, inserts into database and then authenticates for unique transaction ID to download a particular file residing in a non-web directory, as identified by id# of purchased document. File save/open dialogue box appears if authenticated. The current code redirects back to the original website but opens up a file save/open dialogue box in that domain only, and does not offer the capability to display your thank you message and custom web page. Right now after working on this yesterday and looking at it again, I'm not at all certain my original proposed approach, below, could ever work. Tim's suggestions look interesting. -- Kristina > I suppose you could try just rendering the page, along with your > hidden form that automagically submits... something like: > > --BEGIN-- > if (! empty($_POST['txid']) && ! !empty($_POST['pdfid'])){ > //Send headers and PDF data > die(); > } > ?> > ... > > > > Hi, and thanks. > > Here's yer file. >
> > and continue to display your content from the first request. But you > should test thoroughly. > > -Tim > > On Jul 23, 2008, at 4:11 PM, Kristina Anderson wrote: > > > Hi Tim -- is there any way to get it to work by submitting the form > > twice and then including the file with the headers/pdf content? > > > > thanks. > > > >> So why not approach it like this: > >> > >> 1) Redirect back from paypal. Display whatever text you need. > >> 2) Include in that page a good ole "Your download should start > >> momentarily, if not, click here > >> 3) Include a hidden iframe pointing at an empty page > >> 4) Include a hidden form that targets the iframe > >> 5) Use javascript to trigger to form submit > >> 6) Whatever the form-handler script is, I'm assuming it's the > > bit > >> that outputs some headers and then emits the PDF content. > >> > >> This seems to be close to what you're trying to do, but with the > >> addition of the iframe. > >> > >> -Tim > >> > >> On Jul 23, 2008, at 3:52 PM, Kristina Anderson wrote: > >> > >>> The situation is this...the full app needs to > >>> > >>> 1. upon redirection from Paypal, display some text on an HTML page, > >>> > >>> 2. post some data that is passed to the download page, and > >>> > >>> 3. serve up a file for download. > >>> > >>> In order for me to use headers to serve up the file, I have to > > pass > >>> the > >>> data on the transation to another page after I render the HTML. > > There > >>> is database validation stuff which is stripped out for this sample > > but > >>> which is working in the original code. > >>> > >>> > >>> > >>> Thanks! > >>> > >>>> Not entirely clear on what you're trying to accomplish. Can you > >>> give > >>>> us some context, maybe tell us a user story? > >>>> > >>>> -Tim > >>>> > >>>> On Jul 23, 2008, at 3:28 PM, Kristina Anderson wrote: > >>>> > >>>>> Hi everyone, I really need another pair of eyes to take a look at > >>>>> this. I'm pretty sure this form needs to be submitted twice in > >>> order > >>>>> to pass the post array to the included file (see code below)...is > >>> that > >>>>> the only issue here..? this is a bare bones code sample which i > >>> will > >>>>> have to integrate into my paypal app. > >>>>> > >>>>> the code modification was prompted by the fact that the buyers > >>> were > >>>>> not > >>>>> seeing an html page on my client's website before the download box > >>>>> popped up, and this needs to be rectified. > >>>>> > >>>>> Thanks in advance! > >>>>> > >>>>> FILE 1 - testdowndisp.php > >>>>> >>>>> > >>>>> $itemno = "333"; > >>>>> > >>>>> ?> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> Thanks for your purchase. The charge will appear on your > > statement > >>> as.

Welcome back to Magazine website. > >>>>> > >>>>> > >>>>> > >>>>> > >>>>>

> >>>>> >>>>> > >>>>> ob_clean(); > >>>>> include('downloadfile2.php'); > >>>>> //exit(0); > >>>>> > >>>>> ?> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> FILE 2 -- downloadfile2.php > >>>>> > >>>>> >>>>> > >>>>> $pdfid = $_POST['pdfid']; > >>>>> $filename = $pdfid.".pdf"; > >>>>> //echo $pdfid."
"; > >>>>> //echo $filename."
"; > >>>>> > >>>>> > >>>>> //==== > >>>>> $path = '/usr431/home/p/r/proof/PDFs/'; > >>>>> $filesize=filesize($path.$filename); > >>>>> header("Content-Type: application/pdf"); > >>>>> header("Content-Length: ".$filesize); > >>>>> header("Content-Disposition: attachment; filename=$filename"); > >>>>> header("Content-Transfer-Encoding: binary"); > >>>>> readfile($path.$filename); > >>>>> //fopen($path.$filename); > >>>>> //=== > >>>>> > >>>>> ?> > >>>>> > >>>>> > >>>>> -- Kristina_______________________________________________ > >>>>> New York PHP Community Talk Mailing List > >>>>> http://lists.nyphp.org/mailman/listinfo/talk > >>>>> > >>>>> NYPHPCon 2006 Presentations Online > >>>>> http://www.nyphpcon.com > >>>>> > >>>>> Show Your Participation in New York PHP > >>>>> http://www.nyphp.org/show_participation.php > >>>> > >>>> _______________________________________________ > >>>> New York PHP Community Talk Mailing List > >>>> http://lists.nyphp.org/mailman/listinfo/talk > >>>> > >>>> NYPHPCon 2006 Presentations Online > >>>> http://www.nyphpcon.com > >>>> > >>>> Show Your Participation in New York PHP > >>>> http://www.nyphp.org/show_participation.php > >>>> > >>>> > >>> > >>> > >>> _______________________________________________ > >>> New York PHP Community Talk Mailing List > >>> http://lists.nyphp.org/mailman/listinfo/talk > >>> > >>> NYPHPCon 2006 Presentations Online > >>> http://www.nyphpcon.com > >>> > >>> Show Your Participation in New York PHP > >>> http://www.nyphp.org/show_participation.php > >> > >> _______________________________________________ > >> New York PHP Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> NYPHPCon 2006 Presentations Online > >> http://www.nyphpcon.com > >> > >> Show Your Participation in New York PHP > >> http://www.nyphp.org/show_participation.php > >> > >> > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From support at corp.scour.com Thu Jul 24 09:24:50 2008 From: support at corp.scour.com (Joseph Crawford) Date: Thu, 24 Jul 2008 06:24:50 -0700 (PDT) Subject: [nycphp-talk] Scour.com invite from Joseph Crawford Message-ID: <20080724134028.4EDE682A6E@www1.scour.com> Hey, Did you hear about Scour? It is the next gen search engine with Google/Yahoo/MSN results and user comments all on one page. Best of all we get paid for using it by earning points with every search, comment and vote. The points are redeemable for Visa gift cards! It's like earning credit card or airline points just for searching! Hit the link below to join for free and we will both get points! http://scour.com/invite/jcrawford/ I know you'll like it! - Joseph Crawford From scott at crisscott.com Thu Jul 24 10:17:05 2008 From: scott at crisscott.com (Scott Mattocks) Date: Thu, 24 Jul 2008 10:17:05 -0400 Subject: [nycphp-talk] Scour.com invite from Joseph Crawford In-Reply-To: <20080724134028.4EDE682A6E@www1.scour.com> References: <20080724134028.4EDE682A6E@www1.scour.com> Message-ID: <48888EE1.1070209@crisscott.com> Do you really plan to spam every list you are on with this message? I just want to know now so that I can set up a filter to remove then automatically. Thanks. From codebowl at gmail.com Thu Jul 24 10:23:36 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 24 Jul 2008 10:23:36 -0400 Subject: [nycphp-talk] Scour.com invite from Joseph Crawford In-Reply-To: <48888EE1.1070209@crisscott.com> References: <20080724134028.4EDE682A6E@www1.scour.com> <48888EE1.1070209@crisscott.com> Message-ID: <8BA88532-BE33-4E77-921E-D98EB3275B7E@gmail.com> Scott, This was not intentional. I imported my google contacts, choose which addresses to NOT send to and YET it STILL sent to them. I apologize this was not done on purpose. Thanks, Joseph Crawford On Jul 24, 2008, at 10:17 AM, Scott Mattocks wrote: > Do you really plan to spam every list you are on with this message? > I just want to know now so that I can set up a filter to remove then > automatically. > > Thanks. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From rolan at omnistep.com Thu Jul 24 10:41:45 2008 From: rolan at omnistep.com (Rolan Yang) Date: Thu, 24 Jul 2008 10:41:45 -0400 Subject: [nycphp-talk] Scour.com invite from Joseph Crawford In-Reply-To: <8BA88532-BE33-4E77-921E-D98EB3275B7E@gmail.com> References: <20080724134028.4EDE682A6E@www1.scour.com> <48888EE1.1070209@crisscott.com> <8BA88532-BE33-4E77-921E-D98EB3275B7E@gmail.com> Message-ID: <488894A9.1030907@omnistep.com> Hrm.. another web 2.0'ism is about to be born. We already have phishing, vishing (voip based phishing). I'd like to coin the term scishing (scour.com phishing?). Scishing - (ski'-shing) : The act of fooling an internet user into divulging their web mail login/password during registration, then raping them for and spamming their entire email contact list. perhaps on a lesser malicious level there could also be FBishing, Plaxoishing, Linkedishing, recently MySpaishing, and so forth.. ~Rolan Joseph Crawford wrote: > Scott, > > This was not intentional. I imported my google contacts, choose which > addresses to NOT send to and YET it STILL sent to them. > > I apologize this was not done on purpose. > > Thanks, > Joseph Crawford > > On Jul 24, 2008, at 10:17 AM, Scott Mattocks wrote: > >> Do you really plan to spam every list you are on with this message? I >> just want to know now so that I can set up a filter to remove then >> automatically. >> >> Thanks. >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From codebowl at gmail.com Thu Jul 24 10:46:09 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 24 Jul 2008 10:46:09 -0400 Subject: [nycphp-talk] Scour.com invite from Joseph Crawford In-Reply-To: <488894A9.1030907@omnistep.com> References: <20080724134028.4EDE682A6E@www1.scour.com> <48888EE1.1070209@crisscott.com> <8BA88532-BE33-4E77-921E-D98EB3275B7E@gmail.com> <488894A9.1030907@omnistep.com> Message-ID: <982C74C0-0CCC-4C45-8553-F17E2DE08B31@gmail.com> haha Rolan, I hear ya there. I dunno why it sent to everyone like it did, seems kinda retarded to me. Joseph Crawford On Jul 24, 2008, at 10:41 AM, Rolan Yang wrote: > Hrm.. another web 2.0'ism is about to be born. We already have > phishing, vishing (voip based phishing). > I'd like to coin the term scishing (scour.com phishing?). > > Scishing - (ski'-shing) : The act of fooling an internet user into > divulging their web mail login/password during registration, then > raping them for and spamming their entire email contact list. > > perhaps on a lesser malicious level there could also be FBishing, > Plaxoishing, Linkedishing, recently MySpaishing, and so forth.. > > ~Rolan > > > > > Joseph Crawford wrote: >> Scott, >> >> This was not intentional. I imported my google contacts, choose >> which addresses to NOT send to and YET it STILL sent to them. >> >> I apologize this was not done on purpose. >> >> Thanks, >> Joseph Crawford >> >> On Jul 24, 2008, at 10:17 AM, Scott Mattocks wrote: >> >>> Do you really plan to spam every list you are on with this >>> message? I just want to know now so that I can set up a filter to >>> remove then automatically. >>> >>> Thanks. >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From mitch.pirtle at gmail.com Thu Jul 24 11:05:26 2008 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 24 Jul 2008 11:05:26 -0400 Subject: [nycphp-talk] Scour.com invite from Joseph Crawford In-Reply-To: <982C74C0-0CCC-4C45-8553-F17E2DE08B31@gmail.com> References: <20080724134028.4EDE682A6E@www1.scour.com> <48888EE1.1070209@crisscott.com> <8BA88532-BE33-4E77-921E-D98EB3275B7E@gmail.com> <488894A9.1030907@omnistep.com> <982C74C0-0CCC-4C45-8553-F17E2DE08B31@gmail.com> Message-ID: <330532b60807240805o6dd79840w69b8659ea1fac48e@mail.gmail.com> I was starting to wonder about you Joe - you didn't seem the type to send an email and then send it again; and then send it again..... ;-) On Thu, Jul 24, 2008 at 10:46 AM, Joseph Crawford wrote: > haha Rolan, > > I hear ya there. I dunno why it sent to everyone like it did, seems kinda > retarded to me. > > Joseph Crawford > > On Jul 24, 2008, at 10:41 AM, Rolan Yang wrote: > >> Hrm.. another web 2.0'ism is about to be born. We already have phishing, >> vishing (voip based phishing). >> I'd like to coin the term scishing (scour.com phishing?). >> >> Scishing - (ski'-shing) : The act of fooling an internet user into >> divulging their web mail login/password during registration, then raping >> them for and spamming their entire email contact list. >> >> perhaps on a lesser malicious level there could also be FBishing, >> Plaxoishing, Linkedishing, recently MySpaishing, and so forth.. >> >> ~Rolan >> >> >> >> >> Joseph Crawford wrote: >>> >>> Scott, >>> >>> This was not intentional. I imported my google contacts, choose which >>> addresses to NOT send to and YET it STILL sent to them. >>> >>> I apologize this was not done on purpose. >>> >>> Thanks, >>> Joseph Crawford >>> >>> On Jul 24, 2008, at 10:17 AM, Scott Mattocks wrote: >>> >>>> Do you really plan to spam every list you are on with this message? I >>>> just want to know now so that I can set up a filter to remove then >>>> automatically. >>>> >>>> Thanks. >>>> _______________________________________________ >>>> New York PHP Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> NYPHPCon 2006 Presentations Online >>>> http://www.nyphpcon.com >>>> >>>> Show Your Participation in New York PHP >>>> http://www.nyphp.org/show_participation.php >>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >>> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From codebowl at gmail.com Thu Jul 24 11:08:46 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 24 Jul 2008 11:08:46 -0400 Subject: [nycphp-talk] Scour.com invite from Joseph Crawford In-Reply-To: <330532b60807240805o6dd79840w69b8659ea1fac48e@mail.gmail.com> References: <20080724134028.4EDE682A6E@www1.scour.com> <48888EE1.1070209@crisscott.com> <8BA88532-BE33-4E77-921E-D98EB3275B7E@gmail.com> <488894A9.1030907@omnistep.com> <982C74C0-0CCC-4C45-8553-F17E2DE08B31@gmail.com> <330532b60807240805o6dd79840w69b8659ea1fac48e@mail.gmail.com> Message-ID: <37F4B358-A519-480E-85D4-A1B4D984ABE4@gmail.com> Yea sorry about that Mitch :) This is not typical of me and YOU know that. Thanks, Joseph Crawford On Jul 24, 2008, at 11:05 AM, Mitch Pirtle wrote: > I was starting to wonder about you Joe - you didn't seem the type to > send an email and then send it again; and then send it again..... > > ;-) > > On Thu, Jul 24, 2008 at 10:46 AM, Joseph Crawford > wrote: >> haha Rolan, >> >> I hear ya there. I dunno why it sent to everyone like it did, >> seems kinda >> retarded to me. >> >> Joseph Crawford >> >> On Jul 24, 2008, at 10:41 AM, Rolan Yang wrote: >> >>> Hrm.. another web 2.0'ism is about to be born. We already have >>> phishing, >>> vishing (voip based phishing). >>> I'd like to coin the term scishing (scour.com phishing?). >>> >>> Scishing - (ski'-shing) : The act of fooling an internet user into >>> divulging their web mail login/password during registration, then >>> raping >>> them for and spamming their entire email contact list. >>> >>> perhaps on a lesser malicious level there could also be FBishing, >>> Plaxoishing, Linkedishing, recently MySpaishing, and so forth.. >>> >>> ~Rolan >>> >>> >>> >>> >>> Joseph Crawford wrote: >>>> >>>> Scott, >>>> >>>> This was not intentional. I imported my google contacts, choose >>>> which >>>> addresses to NOT send to and YET it STILL sent to them. >>>> >>>> I apologize this was not done on purpose. >>>> >>>> Thanks, >>>> Joseph Crawford >>>> >>>> On Jul 24, 2008, at 10:17 AM, Scott Mattocks wrote: >>>> >>>>> Do you really plan to spam every list you are on with this >>>>> message? I >>>>> just want to know now so that I can set up a filter to remove then >>>>> automatically. >>>>> >>>>> Thanks. >>>>> _______________________________________________ >>>>> New York PHP Community Talk Mailing List >>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>> >>>>> NYPHPCon 2006 Presentations Online >>>>> http://www.nyphpcon.com >>>>> >>>>> Show Your Participation in New York PHP >>>>> http://www.nyphp.org/show_participation.php >>>> >>>> _______________________________________________ >>>> New York PHP Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> NYPHPCon 2006 Presentations Online >>>> http://www.nyphpcon.com >>>> >>>> Show Your Participation in New York PHP >>>> http://www.nyphp.org/show_participation.php >>>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From radalapsker at yahoo.com Thu Jul 24 12:45:20 2008 From: radalapsker at yahoo.com (-- rada --) Date: Thu, 24 Jul 2008 09:45:20 -0700 (PDT) Subject: [nycphp-talk] Re: Embedding PL/SQL procedure into PHP Message-ID: <539623.5133.qm@web54101.mail.re2.yahoo.com> Julia Do you still need info re. using oracle stored procs?in php? I have a lot of experience with both...?feel free to ask any questions. -rada ----- Original Message ---- From: "talk-request at lists.nyphp.org" To: talk at lists.nyphp.org Sent: Thursday, July 24, 2008 11:07:04 AM Subject: talk Digest, Vol 21, Issue 24 Send talk mailing list submissions to ??? talk at lists.nyphp.org To subscribe or unsubscribe via the World Wide Web, visit ??? http://lists.nyphp.org/mailman/listinfo/talk or, via email, send a message with subject or body 'help' to ??? talk-request at lists.nyphp.org You can reach the person managing the list at ??? talk-owner at lists.nyphp.org When replying, please edit your Subject line so it is more specific than "Re: Contents of talk digest..." Today's Topics: ? 1. Re: Embedding PL/SQL procedure into PHP (bzcoder) ? 2. Re: need another pair of eyes! (Kristina Anderson) ? 3. Scour.com invite from Joseph Crawford (Joseph Crawford) ? 4. Re: Scour.com invite from Joseph Crawford (Scott Mattocks) ? 5. Re: Scour.com invite from Joseph Crawford (Joseph Crawford) ? 6. Re: Scour.com invite from Joseph Crawford (Rolan Yang) ? 7. Re: Scour.com invite from Joseph Crawford (Joseph Crawford) ? 8. Re: Scour.com invite from Joseph Crawford (Mitch Pirtle) I was starting to wonder about you Joe - you didn't seem the type to send an email and then send it again; and then send it again..... ;-) On Thu, Jul 24, 2008 at 10:46 AM, Joseph Crawford wrote: > haha Rolan, > > I hear ya there.? I dunno why it sent to everyone like it did, seems kinda > retarded to me. > > Joseph Crawford > > On Jul 24, 2008, at 10:41 AM, Rolan Yang wrote: > >> Hrm.. another web 2.0'ism is about to be born. We already have phishing, >> vishing (voip based phishing). >> I'd like to coin the term scishing (scour.com phishing?). >> >> Scishing - (ski'-shing)? : The act of fooling an internet user into >> divulging their web mail login/password during registration, then raping >> them for and spamming their entire email contact list. >> >> perhaps on a lesser malicious level there could also be FBishing, >> Plaxoishing, Linkedishing, recently MySpaishing, and so forth.. >> >> ~Rolan >> >> >> >> >> Joseph Crawford wrote: >>> >>> Scott, >>> >>> This was not intentional.? I imported my google contacts, choose which >>> addresses to NOT send to and YET it STILL sent to them. >>> >>> I apologize this was not done on purpose. >>> >>> Thanks, >>> Joseph Crawford >>> >>> On Jul 24, 2008, at 10:17 AM, Scott Mattocks wrote: >>> >>>> Do you really plan to spam every list you are on with this message? I >>>> just want to know now so that I can set up a filter to remove then >>>> automatically. >>>> >>>> Thanks. >>>> _______________________________________________ >>>> New York PHP Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> NYPHPCon 2006 Presentations Online >>>> http://www.nyphpcon.com >>>> >>>> Show Your Participation in New York PHP >>>> http://www.nyphp.org/show_participation.php >>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >>> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Thu Jul 24 14:19:58 2008 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 24 Jul 2008 14:19:58 -0400 Subject: [nycphp-talk] A good PCRE expression for matching URLs Message-ID: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> Does anyone have a good PCRE for matching URLs? All of the examples that I have looked at in various places are too simple or exclude invalid characters rather than include valid ones (and of course fail to exclude all bad characters) or don't properly use escaping ... etc. Or perhaps someone can improve (or correct) the expression I'm using currently: $expr = '[a-zA-Z0-9]{1,10}://[a-zA-Z0-9.-]+[\p{L}/~._-]*|mailto:[a-zA-Z0-9\\@.-]+'; The exprssion breakdown is: [a-zA-Z0-9]{1,10} - Protocol specifier (e.g. http, ftps, smb, gopher, ...) :// - Protocol host separator (mailto style handled by or condition) [a-zA-Z0-9.-]+ - The hostname (currently we assume only ASCII) [\p{L}/~._-]* - A UTF-8 path (probably need to allow some other chars but not '?') |mailto:[a-zA-Z0-9\@.-]+ - Or a mailto URL Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jcampbell1 at gmail.com Thu Jul 24 14:37:02 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 24 Jul 2008 14:37:02 -0400 Subject: [nycphp-talk] A good PCRE expression for matching URLs In-Reply-To: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> References: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> Message-ID: <8f0676b40807241137s27aecf5ay72bc7310db47e891@mail.gmail.com> On Thu, Jul 24, 2008 at 2:19 PM, Michael B Allen wrote: > Does anyone have a good PCRE for matching URLs? > > Or perhaps someone can improve (or correct) the expression I'm using currently: > > $expr = '[a-zA-Z0-9]{1,10}://[a-zA-Z0-9.-]+[\p{L}/~._-]*|mailto:[a-zA-Z0-9\\@.-]+'; > I am not sure I completely understand what you are trying to do, but it doesn't look like you are matching + or %. What is the context for the matching? -John C. From ben at projectskyline.com Thu Jul 24 14:42:16 2008 From: ben at projectskyline.com (Ben Sgro) Date: Thu, 24 Jul 2008 14:42:16 -0400 Subject: [nycphp-talk] Scour.com invite from Joseph Crawford In-Reply-To: <37F4B358-A519-480E-85D4-A1B4D984ABE4@gmail.com> References: <20080724134028.4EDE682A6E@www1.scour.com> <48888EE1.1070209@crisscott.com> <8BA88532-BE33-4E77-921E-D98EB3275B7E@gmail.com> <488894A9.1030907@omnistep.com> <982C74C0-0CCC-4C45-8553-F17E2DE08B31@gmail.com> <330532b60807240805o6dd79840w69b8659ea1fac48e@mail.gmail.com> <37F4B358-A519-480E-85D4-A1B4D984ABE4@gmail.com> Message-ID: <4888CD08.7000201@projectskyline.com> Hey Joseph, You seem to have subscribed my email (along w/the signup for scour) to a codebowl mailing list...I've already received 3 emails in the last 4 hours. Please remove me........................... - Ben Joseph Crawford wrote: > Yea sorry about that Mitch :) This is not typical of me and YOU know > that. > > Thanks, > Joseph Crawford > > On Jul 24, 2008, at 11:05 AM, Mitch Pirtle wrote: > >> I was starting to wonder about you Joe - you didn't seem the type to >> send an email and then send it again; and then send it again..... >> >> ;-) >> >> On Thu, Jul 24, 2008 at 10:46 AM, Joseph Crawford >> wrote: >>> haha Rolan, >>> >>> I hear ya there. I dunno why it sent to everyone like it did, seems >>> kinda >>> retarded to me. >>> >>> Joseph Crawford >>> >>> On Jul 24, 2008, at 10:41 AM, Rolan Yang wrote: >>> >>>> Hrm.. another web 2.0'ism is about to be born. We already have >>>> phishing, >>>> vishing (voip based phishing). >>>> I'd like to coin the term scishing (scour.com phishing?). >>>> >>>> Scishing - (ski'-shing) : The act of fooling an internet user into >>>> divulging their web mail login/password during registration, then >>>> raping >>>> them for and spamming their entire email contact list. >>>> >>>> perhaps on a lesser malicious level there could also be FBishing, >>>> Plaxoishing, Linkedishing, recently MySpaishing, and so forth.. >>>> >>>> ~Rolan >>>> >>>> >>>> >>>> >>>> Joseph Crawford wrote: >>>>> >>>>> Scott, >>>>> >>>>> This was not intentional. I imported my google contacts, choose >>>>> which >>>>> addresses to NOT send to and YET it STILL sent to them. >>>>> >>>>> I apologize this was not done on purpose. >>>>> >>>>> Thanks, >>>>> Joseph Crawford >>>>> >>>>> On Jul 24, 2008, at 10:17 AM, Scott Mattocks wrote: >>>>> >>>>>> Do you really plan to spam every list you are on with this >>>>>> message? I >>>>>> just want to know now so that I can set up a filter to remove then >>>>>> automatically. >>>>>> >>>>>> Thanks. >>>>>> _______________________________________________ >>>>>> New York PHP Community Talk Mailing List >>>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>>> >>>>>> NYPHPCon 2006 Presentations Online >>>>>> http://www.nyphpcon.com >>>>>> >>>>>> Show Your Participation in New York PHP >>>>>> http://www.nyphp.org/show_participation.php >>>>> >>>>> _______________________________________________ >>>>> New York PHP Community Talk Mailing List >>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>> >>>>> NYPHPCon 2006 Presentations Online >>>>> http://www.nyphpcon.com >>>>> >>>>> Show Your Participation in New York PHP >>>>> http://www.nyphp.org/show_participation.php >>>>> >>>> _______________________________________________ >>>> New York PHP Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> NYPHPCon 2006 Presentations Online >>>> http://www.nyphpcon.com >>>> >>>> Show Your Participation in New York PHP >>>> http://www.nyphp.org/show_participation.php >>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >>> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From codebowl at gmail.com Thu Jul 24 15:00:25 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 24 Jul 2008 15:00:25 -0400 Subject: [nycphp-talk] Scour.com invite from Joseph Crawford In-Reply-To: <4888CD08.7000201@projectskyline.com> References: <20080724134028.4EDE682A6E@www1.scour.com> <48888EE1.1070209@crisscott.com> <8BA88532-BE33-4E77-921E-D98EB3275B7E@gmail.com> <488894A9.1030907@omnistep.com> <982C74C0-0CCC-4C45-8553-F17E2DE08B31@gmail.com> <330532b60807240805o6dd79840w69b8659ea1fac48e@mail.gmail.com> <37F4B358-A519-480E-85D4-A1B4D984ABE4@gmail.com> <4888CD08.7000201@projectskyline.com> Message-ID: Ben, I am not sure what you mean. I imported my google contacts into scour and told it to only send to certain contacts but it sent to ALL contacts. Sorry for the spam Thanks, Joseph Crawford On Jul 24, 2008, at 2:42 PM, Ben Sgro wrote: > Hey Joseph, > > You seem to have subscribed my email (along w/the signup for scour) > to a codebowl mailing list...I've already received 3 emails in the > last 4 hours. > > Please remove me........................... > > - Ben > > Joseph Crawford wrote: >> Yea sorry about that Mitch :) This is not typical of me and YOU >> know that. >> >> Thanks, >> Joseph Crawford >> >> On Jul 24, 2008, at 11:05 AM, Mitch Pirtle wrote: >> >>> I was starting to wonder about you Joe - you didn't seem the type to >>> send an email and then send it again; and then send it again..... >>> >>> ;-) >>> >>> On Thu, Jul 24, 2008 at 10:46 AM, Joseph Crawford >> > wrote: >>>> haha Rolan, >>>> >>>> I hear ya there. I dunno why it sent to everyone like it did, >>>> seems kinda >>>> retarded to me. >>>> >>>> Joseph Crawford >>>> >>>> On Jul 24, 2008, at 10:41 AM, Rolan Yang wrote: >>>> >>>>> Hrm.. another web 2.0'ism is about to be born. We already have >>>>> phishing, >>>>> vishing (voip based phishing). >>>>> I'd like to coin the term scishing (scour.com phishing?). >>>>> >>>>> Scishing - (ski'-shing) : The act of fooling an internet user >>>>> into >>>>> divulging their web mail login/password during registration, >>>>> then raping >>>>> them for and spamming their entire email contact list. >>>>> >>>>> perhaps on a lesser malicious level there could also be FBishing, >>>>> Plaxoishing, Linkedishing, recently MySpaishing, and so forth.. >>>>> >>>>> ~Rolan >>>>> >>>>> >>>>> >>>>> >>>>> Joseph Crawford wrote: >>>>>> >>>>>> Scott, >>>>>> >>>>>> This was not intentional. I imported my google contacts, >>>>>> choose which >>>>>> addresses to NOT send to and YET it STILL sent to them. >>>>>> >>>>>> I apologize this was not done on purpose. >>>>>> >>>>>> Thanks, >>>>>> Joseph Crawford >>>>>> >>>>>> On Jul 24, 2008, at 10:17 AM, Scott Mattocks wrote: >>>>>> >>>>>>> Do you really plan to spam every list you are on with this >>>>>>> message? I >>>>>>> just want to know now so that I can set up a filter to remove >>>>>>> then >>>>>>> automatically. >>>>>>> >>>>>>> Thanks. >>>>>>> _______________________________________________ >>>>>>> New York PHP Community Talk Mailing List >>>>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>>>> >>>>>>> NYPHPCon 2006 Presentations Online >>>>>>> http://www.nyphpcon.com >>>>>>> >>>>>>> Show Your Participation in New York PHP >>>>>>> http://www.nyphp.org/show_participation.php >>>>>> >>>>>> _______________________________________________ >>>>>> New York PHP Community Talk Mailing List >>>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>>> >>>>>> NYPHPCon 2006 Presentations Online >>>>>> http://www.nyphpcon.com >>>>>> >>>>>> Show Your Participation in New York PHP >>>>>> http://www.nyphp.org/show_participation.php >>>>>> >>>>> _______________________________________________ >>>>> New York PHP Community Talk Mailing List >>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>> >>>>> NYPHPCon 2006 Presentations Online >>>>> http://www.nyphpcon.com >>>>> >>>>> Show Your Participation in New York PHP >>>>> http://www.nyphp.org/show_participation.php >>>> >>>> _______________________________________________ >>>> New York PHP Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> NYPHPCon 2006 Presentations Online >>>> http://www.nyphpcon.com >>>> >>>> Show Your Participation in New York PHP >>>> http://www.nyphp.org/show_participation.php >>>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From radalapsker at yahoo.com Thu Jul 24 15:25:36 2008 From: radalapsker at yahoo.com (-- rada --) Date: Thu, 24 Jul 2008 12:25:36 -0700 (PDT) Subject: [nycphp-talk] Re: A good PCRE expression for matching URLs Message-ID: <611495.26536.qm@web54104.mail.re2.yahoo.com> Michael Check out Zend's URI validation. It?uses permissible characters rather than excluded characters. http://framework.zend.com/manual/en/zend.uri.html#zend.uri.chapter (you'll want to take a look at /Uri/Http.php) Cheers Rada Lapsker -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Thu Jul 24 16:22:33 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 24 Jul 2008 16:22:33 -0400 Subject: [nycphp-talk] A good PCRE expression for matching URLs In-Reply-To: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> References: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> Message-ID: <20080724202233.GA16501@panix.com> On Thu, Jul 24, 2008 at 02:19:58PM -0400, Michael B Allen wrote: > Does anyone have a good PCRE for matching URLs? Here's an ereg expression I wrote many years ago: eregi_replace("(http://|https://|ftp://|gopher://|news:|mailto:)([[:alnum:]/!#$%&'()*+,.:;=?@_~-]+)([[:alnum:]/!#$%&'()*+:;=?@_~-])", '\\1\\2\\3', $Val); --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 ioplex at gmail.com Thu Jul 24 16:32:18 2008 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 24 Jul 2008 16:32:18 -0400 Subject: [nycphp-talk] A good PCRE expression for matching URLs In-Reply-To: <8f0676b40807241137s27aecf5ay72bc7310db47e891@mail.gmail.com> References: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> <8f0676b40807241137s27aecf5ay72bc7310db47e891@mail.gmail.com> Message-ID: <78c6bd860807241332k12c4ef21s14674231f73c5600@mail.gmail.com> On Thu, Jul 24, 2008 at 2:37 PM, John Campbell wrote: > On Thu, Jul 24, 2008 at 2:19 PM, Michael B Allen wrote: >> Does anyone have a good PCRE for matching URLs? >> >> Or perhaps someone can improve (or correct) the expression I'm using currently: >> >> $expr = '[a-zA-Z0-9]{1,10}://[a-zA-Z0-9.-]+[\p{L}/~._-]*|mailto:[a-zA-Z0-9\\@.-]+'; >> > > I am not sure I completely understand what you are trying to do, but > it doesn't look like you are matching + or %. You mean in the path? In the path I suppose I should permit quite a few more characters (I forgot 0-9 too). This makes the expression: $expr = '[a-zA-Z0-9]{1,10}://[a-zA-Z0-9.-]+[\p{L}0-9!$%&\\()+-./;=^_~]*|mailto:[a-zA-Z0-9\\@.-]+', > What is the context for the matching? This will be used to pick out URLs in Creole Wiki markup. Which incedentally is not supposed to match characters that can occur naturally at the end of a sentence (,.?!:;"') so I guess I need to leave out '.' and ';' for my particular application. So given markup: Please visit http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;=^(!)foo. The regex should match (minus the dot at the end): [http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;=^(!)foo] although in practice a URL this crazy should probably be formalized with square brackets as defined by Creole for links. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ioplex at gmail.com Thu Jul 24 16:34:56 2008 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 24 Jul 2008 16:34:56 -0400 Subject: [nycphp-talk] Re: A good PCRE expression for matching URLs In-Reply-To: <611495.26536.qm@web54104.mail.re2.yahoo.com> References: <611495.26536.qm@web54104.mail.re2.yahoo.com> Message-ID: <78c6bd860807241334m1bfcaeb1i77ced83ecc6d3e4@mail.gmail.com> On Thu, Jul 24, 2008 at 3:25 PM, -- rada -- wrote: > Michael > > Check out Zend's URI validation. It uses permissible characters rather than > excluded characters. > > http://framework.zend.com/manual/en/zend.uri.html#zend.uri.chapter > > (you'll want to take a look at /Uri/Http.php) Hi Rada, Zend_Uri_Http is using regrex to capture each component separately and is quite complicated about how it builds the regex so I don't think it's going to help me. Thanks, Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ioplex at gmail.com Thu Jul 24 16:40:28 2008 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 24 Jul 2008 16:40:28 -0400 Subject: [nycphp-talk] A good PCRE expression for matching URLs In-Reply-To: <78c6bd860807241332k12c4ef21s14674231f73c5600@mail.gmail.com> References: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> <8f0676b40807241137s27aecf5ay72bc7310db47e891@mail.gmail.com> <78c6bd860807241332k12c4ef21s14674231f73c5600@mail.gmail.com> Message-ID: <78c6bd860807241340t430b4e19p71c0a140f2422071@mail.gmail.com> On Thu, Jul 24, 2008 at 4:32 PM, Michael B Allen wrote: > Please visit http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;=^(!)foo. Well gmail is picking out and linking the above link up to but not including '^'. I wonder if it will link the remaining characters ... http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;=(!)foo http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;=!)foo( http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;=)foo(! http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;=foo(!) http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;^(!)foo http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;(!)foo^ http://www.yahoo.com/us?rs+100%&lusers$/~jerry/y_a-n.g/Yahoo;!)foo^( Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jcampbell1 at gmail.com Thu Jul 24 17:34:52 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 24 Jul 2008 17:34:52 -0400 Subject: [nycphp-talk] A good PCRE expression for matching URLs In-Reply-To: <78c6bd860807241332k12c4ef21s14674231f73c5600@mail.gmail.com> References: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> <8f0676b40807241137s27aecf5ay72bc7310db47e891@mail.gmail.com> <78c6bd860807241332k12c4ef21s14674231f73c5600@mail.gmail.com> Message-ID: <8f0676b40807241434n253acd70x631e5317b4e7511@mail.gmail.com> On Thu, Jul 24, 2008 at 4:32 PM, Michael B Allen wrote: > On Thu, Jul 24, 2008 at 2:37 PM, John Campbell wrote: >> On Thu, Jul 24, 2008 at 2:19 PM, Michael B Allen wrote: >> What is the context for the matching? > > This will be used to pick out URLs in Creole Wiki markup. Which > incedentally is not supposed to match characters that can occur > naturally at the end of a sentence (,.?!:;"') so I guess I need to > leave out '.' and ';' for my particular application. > Many urls contain a question mark. Why not just accept anything except a period or an question mark at the end? (http://|ftp://|mailto:).*?[\.\?]?\s John C. From ioplex at gmail.com Thu Jul 24 19:50:13 2008 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 24 Jul 2008 19:50:13 -0400 Subject: [nycphp-talk] A good PCRE expression for matching URLs In-Reply-To: <8f0676b40807241434n253acd70x631e5317b4e7511@mail.gmail.com> References: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> <8f0676b40807241137s27aecf5ay72bc7310db47e891@mail.gmail.com> <78c6bd860807241332k12c4ef21s14674231f73c5600@mail.gmail.com> <8f0676b40807241434n253acd70x631e5317b4e7511@mail.gmail.com> Message-ID: <78c6bd860807241650v403967c5v2c1c8f8d90d37de1@mail.gmail.com> On Thu, Jul 24, 2008 at 5:34 PM, John Campbell wrote: > On Thu, Jul 24, 2008 at 4:32 PM, Michael B Allen wrote: >> On Thu, Jul 24, 2008 at 2:37 PM, John Campbell wrote: >>> On Thu, Jul 24, 2008 at 2:19 PM, Michael B Allen wrote: >>> What is the context for the matching? >> >> This will be used to pick out URLs in Creole Wiki markup. Which >> incedentally is not supposed to match characters that can occur >> naturally at the end of a sentence (,.?!:;"') so I guess I need to >> leave out '.' and ';' for my particular application. >> > > Many urls contain a question mark. Why not just accept anything > except a period or an question mark at the end? > (http://|ftp://|mailto:).*?[\.\?]?\s Despite the fact that things should be escaped when output, I think it's a good opportunity to effectively validate things. But it would be nice to exclude those end-of-sentence punctuation from the capture output. I tried the following minimalistic expression just to try and get the trailing condition right I'm not able to distinguish between a dot that is part of the URL and a period at the end. $expr = '(http://[a-z./]+)\\. '; Your expression doesn't seem to work for me either. It seems that '.*' is just matching everything. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ioplex at gmail.com Fri Jul 25 02:27:20 2008 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 25 Jul 2008 02:27:20 -0400 Subject: [nycphp-talk] A good PCRE expression for matching URLs In-Reply-To: <78c6bd860807241650v403967c5v2c1c8f8d90d37de1@mail.gmail.com> References: <78c6bd860807241119m571a023eg3fd40d8325d230c8@mail.gmail.com> <8f0676b40807241137s27aecf5ay72bc7310db47e891@mail.gmail.com> <78c6bd860807241332k12c4ef21s14674231f73c5600@mail.gmail.com> <8f0676b40807241434n253acd70x631e5317b4e7511@mail.gmail.com> <78c6bd860807241650v403967c5v2c1c8f8d90d37de1@mail.gmail.com> Message-ID: <78c6bd860807242327k64926ecdq16f01561b29df776@mail.gmail.com> On Thu, Jul 24, 2008 at 7:50 PM, Michael B Allen wrote: > But it would be nice to exclude those end-of-sentence punctuation from > the capture output. I tried the following minimalistic expression just > to try and get the trailing condition right I'm not able to > distinguish between a dot that is part of the URL and a period at the > end. Got it. I just needed to negate the end-of-sentence punctuation character class. This seems to be handling all cases properly: $expr = '([a-zA-Z0-9]{1,10}://[a-zA-Z0-9.-]+[\p{L}0-9"!#$%&\\()+,\\./:;=?\\@\\\\^_{}~-]*)[^,\\.?!:;"\'\\s]'; Thanks, Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From paul at devonianfarm.com Fri Jul 25 12:22:27 2008 From: paul at devonianfarm.com (paul at devonianfarm.com) Date: Fri, 25 Jul 2008 12:22:27 -0400 (EDT) Subject: [nycphp-talk] Multitons and Late Static Binding Message-ID: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> I've been thinking a lot about the weaknesses of static inheritance and polymorphism in most of the languages that people use. Often we need to write really complicated code to handle initialization of systems. In PHP, on the other hand, there are really good tools like dynamic constructors $obj=new $SelectedObject($param); and PHP 5.3 introduces late static binding. I've been wondering if late static binding could be used to implement a Singleton or Multiton base class that other classes could inherit from. See the following article for a typical Multiton implementation in a static language: http://gen5.info/q/2008/07/25/the-multiton-design-pattern/ In the article I suggest that LSB could be used to do it better in PHP, but I haven't figured out exactly how. Any ideas? P.S. I think that the memory disadvantages of multitons would be less severe in PHP than they would be in other environments because of the short-lived nature of the PHP process. -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Sat Jul 26 11:16:52 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 26 Jul 2008 11:16:52 -0400 Subject: [nycphp-talk] Multitons and Late Static Binding In-Reply-To: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> Message-ID: <20080726151652.GA9750@panix.com> Hi Paul: Hadn't heard of "multitons" before despite my using them under the name "singletons." So I checked out the Wikipedia entry about it, http://en.wikipedia.org/wiki/Multiton. What's even more interesting, is the versions of this article prior to May of this year said this term is kind of made up: Multiton is a (disputed) term often used to describe a Singleton-like pattern that allows more than just one instance to be created. While there is no official Gang of Four design pattern called Multiton... That aside, the code I was doing this in has its roots in PHP 4, so the hash/objects were being stored in $GLOBALS. But seeing Wikipedia's example made me realize I could store the hash in the class itself. > In the article I suggest that LSB could be used to do it better in PHP, > but I haven't figured out exactly how. Any ideas? Not sure how late static binding is really needed for this since the pattern works just fine in PHP 5.2: class db { private $db_resource = null; private static $dbs = array(); public function __construct($user, $db, $host, $port, $pass) { $this->db_resource = @new mysqli($host, $user, $pass, $db, $port); if (mysqli_connect_errno()) { // handle it... } } public static function multiton($user, $db, $host, $port, $pass) { $hash = self::get_auth_hash($user, $db, $host, $port, $pass); if (!isset(self::$dbs[$hash])) { self::$dbs[$hash] = new db($user, $db, $host, $port, $pass); } return self::$dbs[$hash]; } } --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 paulcheung at tiscali.co.uk Sun Jul 27 14:23:30 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Sun, 27 Jul 2008 19:23:30 +0100 Subject: [nycphp-talk] CSS problem??? References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> Message-ID: <6D87B13E86924C94A46EC1B61BC673C2@X9183> Hi I am at the stage where I need to put style to the site and am using CSS. with Firefox, Opera, Internet Explorer and Safari to test for browser compatibility. What I find puzzling is there seems to be differences in the styles of output, Using the same the exact same coding the only varible in the testing are the browsers themselves. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik at hecanjog.com Sun Jul 27 14:29:09 2008 From: erik at hecanjog.com (Erik Schoster) Date: Sun, 27 Jul 2008 14:29:09 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <6D87B13E86924C94A46EC1B61BC673C2@X9183> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> Message-ID: Hi Paul, This is what you would call an "extremely known issue" - have a look at http://www.quirksmode.org Especially this page to start: http://www.quirksmode.org/css/quirksmode.html Best, Erik On Jul 27, 2008, at 2:23 PM, PaulCheung wrote: > Hi > > I am at the stage where I need to put style to the site and am using > CSS. with Firefox, Opera, Internet Explorer and Safari to test for > browser compatibility. What I find puzzling is there seems to be > differences in the styles of output, Using the same the exact same > coding the only varible in the testing are the browsers themselves. > > Paul. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Sun Jul 27 14:41:17 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Sun, 27 Jul 2008 14:41:17 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <6D87B13E86924C94A46EC1B61BC673C2@X9183> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> Message-ID: <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> Welcome to the world of web development. Cross browser css development is plagued with problems. IE 6 is consistently the worst offender. Even something as simple as centering a block is different in IE, and the standards compatible browsers. There are dozens of quirks, and it is not something that is easy to learn, but I'll give you a few pointers. 1) Make sure you have a doctype that put IE into "standards mode" 2) Get firebug and use the inspector to learn from other people's code. 3) Do some reading on "CSS columns", "CSS clear fix", "CSS centering", "CSS IE bugs". There are tons of articles and blogs that contain useful pointers. 4) Make sure you understand the box model inside and out. Hope that helps, -John Campbell On Sun, Jul 27, 2008 at 2:23 PM, PaulCheung wrote: > Hi > > I am at the stage where I need to put style to the site and am using CSS. > with Firefox, Opera, Internet Explorer and Safari to test for browser > compatibility. What I find puzzling is there seems to be differences in the > styles of output, Using the same the exact same coding the only varible in > the testing are the browsers themselves. > > Paul. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From lists at enobrev.com Sun Jul 27 15:59:27 2008 From: lists at enobrev.com (Mark Armendariz) Date: Sun, 27 Jul 2008 15:59:27 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> Message-ID: <488CD39F.5020601@enobrev.com> John Campbell wrote: > Welcome to the world of web development. > > Cross browser css development is plagued with problems. IE 6 is > consistently the worst offender. > > Even something as simple as centering a block is different in IE, and > the standards compatible browsers. There are dozens of quirks, and it > is not something that is easy to learn, but I'll give you a few > pointers. > > 1) Make sure you have a doctype that put IE into "standards mode" > 2) Get firebug and use the inspector to learn from other people's code. > 3) Do some reading on "CSS columns", "CSS clear fix", "CSS centering", > "CSS IE bugs". There are tons of articles and blogs that contain > useful pointers. > 4) Make sure you understand the box model inside and out. > > Hope that helps, > -John Campbell > Great summary, John. When you really decide you don't like yourself anymore, start reading up on IE's "hasLayout" property. Mark From zippy1981 at gmail.com Sun Jul 27 16:07:16 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Sun, 27 Jul 2008 16:07:16 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <488CD39F.5020601@enobrev.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> Message-ID: <5458db3c0807271307w4a9cf3a6q6afc3fbf0e5114b3@mail.gmail.com> On 7/27/08, Mark Armendariz wrote: > When you really decide you don't like yourself anymore, start reading up on > IE's "hasLayout" property. I never encountered that property before but it sounds like something Raymond Chen would think is a good idea. From lists at enobrev.com Sun Jul 27 16:12:25 2008 From: lists at enobrev.com (Mark Armendariz) Date: Sun, 27 Jul 2008 16:12:25 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <5458db3c0807271307w4a9cf3a6q6afc3fbf0e5114b3@mail.gmail.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <5458db3c0807271307w4a9cf3a6q6afc3fbf0e5114b3@mail.gmail.com> Message-ID: <488CD6A9.1060406@enobrev.com> Justin Dearing wrote: > On 7/27/08, Mark Armendariz wrote: > >> When you really decide you don't like yourself anymore, start reading up on >> IE's "hasLayout" property. >> > > I never encountered that property before but it sounds like something > Raymond Chen would think is a good idea. > _______________________________________________ It's a beast. Here's some misc. description I found with a quick search: ""Layout" is an IE/Win proprietary concept that determines how elements draw and bound their content, interact with and relate to other elements, and react on and transmit application/user events." And then later... "Consequences of an element having, or not having "layout" can include: * Many common IE float bugs. * Boxes themselves treating basic properties differently. * Margin collapsing between a container and its descendants. * Various problems with the construction of lists. * Differences in the positioning of background images. * Differences between browsers when using scripting." -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Sun Jul 27 17:08:13 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Sun, 27 Jul 2008 17:08:13 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <488CD39F.5020601@enobrev.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> Message-ID: <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> > When you really decide you don't like yourself anymore, start reading up on > IE's "hasLayout" property. When in doubt: *height:1% min-height:0; - - - - - - As a side note, is anyone thinking about abandoning IE6 testing? My numbers on IE6 market share show it is around 20%. (my sites are US based and tend to be "consumer" focused). Apple has dropped support for IE6 on their new me.com site. I feel like once IE6 drops to 10%, it will no longer be worth supporting. How do most people even do IE 6 testing? As far as I can tell, there is no legal means to test IE6 on a mac or linux. I was told that microsoft has virtual PC images available for free, but that only works on the Pro/Business editions of XP/Vista. Microsoft should release free copies of XP and Vista that only have a web browser and don't allow other software to be installed. -John C. From zippy1981 at gmail.com Sun Jul 27 17:29:06 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Sun, 27 Jul 2008 17:29:06 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> Message-ID: <5458db3c0807271429g85f32c3od3cf698901c56699@mail.gmail.com> On 7/27/08, John Campbell wrote: > > As a side note, is anyone thinking about abandoning IE6 testing? My > numbers on IE6 market share show it is around 20%. (my sites are US > based and tend to be "consumer" focused). Apple has dropped support > for IE6 on their new me.com site. I feel like once IE6 drops to 10%, > it will no longer be worth supporting. Well what are the firefox numbers? I think IE6 is still relevant for e-commerce and 15 year old girl sites. No one runs windows update and no one is buying vista. I would consider limiting support of IE6 at this point, and maybe exclude IE6 from new features in your site. > How do most people even do IE 6 testing? As far as I can tell, there > is no legal means to test IE6 on a mac or linux. I was told that > microsoft has virtual PC images available for free, but that only > works on the Pro/Business editions of XP/Vista. Microsoft should > release free copies of XP and Vista that only have a web browser and > don't allow other software to be installed. The same way we tested Safari before it was released for windows. Also your suggestion is totatly unfeasable for Microsoft. It would be hard to limit what you can install on Windows. From jcampbell1 at gmail.com Sun Jul 27 17:47:38 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Sun, 27 Jul 2008 17:47:38 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <5458db3c0807271429g85f32c3od3cf698901c56699@mail.gmail.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> <5458db3c0807271429g85f32c3od3cf698901c56699@mail.gmail.com> Message-ID: <8f0676b40807271447m237e6d64i3881c188fe57a4c6@mail.gmail.com> On Sun, Jul 27, 2008 at 5:29 PM, Justin Dearing wrote: > On 7/27/08, John Campbell wrote: >> > > The same way we tested Safari before it was released for windows. How was that? I used webkit back in the day. Is that what you mean? > Also > your suggestion is totatly unfeasable for Microsoft. It would be hard > to limit what you can install on Windows. I think the virtual PC images already have this property. I just wish they would ship the images as an installable iso. -John C. From zippy1981 at gmail.com Sun Jul 27 18:01:22 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Sun, 27 Jul 2008 18:01:22 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <8f0676b40807271447m237e6d64i3881c188fe57a4c6@mail.gmail.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> <5458db3c0807271429g85f32c3od3cf698901c56699@mail.gmail.com> <8f0676b40807271447m237e6d64i3881c188fe57a4c6@mail.gmail.com> Message-ID: <5458db3c0807271501i5a5848f1k9031e7531aea2d8@mail.gmail.com> On 7/27/08, John Campbell wrote: > On Sun, Jul 27, 2008 at 5:29 PM, Justin Dearing wrote: > > On 7/27/08, John Campbell wrote: > >> > > > > > The same way we tested Safari before it was released for windows. > > > How was that? I used webkit back in the day. Is that what you mean? No with a real apple. From tedd at sperling.com Sun Jul 27 18:36:20 2008 From: tedd at sperling.com (tedd) Date: Sun, 27 Jul 2008 18:36:20 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> Message-ID: At 5:08 PM -0400 7/27/08, John Campbell wrote: >As a side note, is anyone thinking about abandoning IE6 testing? My >numbers on IE6 market share show it is around 20%. (my sites are US >based and tend to be "consumer" focused). Apple has dropped support >for IE6 on their new me.com site. I feel like once IE6 drops to 10%, >it will no longer be worth supporting. I feel your pain, but remember that even Apple has less than 10% and most of us support Safari. (Granted, it's easier to support). My figures show IE 6 has about 26 percent of the market and that figure is dropping about a percent a month. So I plan on supporting it for probably another two years. The good side is that I'm pretty familiar with the problems that IE 6 presents and have solutions for them -- so, it's not a big deal for me. >How do most people even do IE 6 testing? I do my testing on BrowserCam -- if it passes there, then I don't worry about it. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From dcech at phpwerx.net Sun Jul 27 18:46:03 2008 From: dcech at phpwerx.net (Dan Cech) Date: Sun, 27 Jul 2008 18:46:03 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> Message-ID: <488CFAAB.1050007@phpwerx.net> John Campbell wrote: > How do most people even do IE 6 testing? As far as I can tell, there > is no legal means to test IE6 on a mac or linux. Under windows I've had good luck with MultipleIEs [1], for Linux there is IEs4 Linux [2]. The easiest route is probably to keep a Windows machine around running IE7, IE6 (via MultipleIEs), Firefox, Safari and Opera. You'll still run into issues that only raise their heads in older versions, but you'll have the major bases covered. Dan [1] http://tredosoft.com/Multiple_IE [2] http://www.tatanka.com.br/ies4linux/page/Main_Page From ka at kacomputerconsulting.com Sun Jul 27 19:28:06 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Sun, 27 Jul 2008 16:28:06 -0700 Subject: [nycphp-talk] CSS problem??? Message-ID: <1217201286.20538@coral.he.net> Interesting discussion. We are now working on a heavily CSS'd site and already finding some weirdness in IE6 behavior with our new dynamic menu. I remember back when the incompatibilities were very bad already, and IE and Netscape kept thinking that adding new incompatible features would cause the other product to become extinct overnight...haha. What it really caused was 10,000 different browser detection routines and an unwillingness on the part of developers to go anywhere that might not be universally supported. Is there anything out there now that's a good comprehensive "where not to go with client side dev" overview, like we used to have? -- Kristina > John Campbell wrote: > > How do most people even do IE 6 testing? As far as I can tell, there > > is no legal means to test IE6 on a mac or linux. > > Under windows I've had good luck with MultipleIEs [1], for Linux there > is IEs4 Linux [2]. > > The easiest route is probably to keep a Windows machine around running > IE7, IE6 (via MultipleIEs), Firefox, Safari and Opera. You'll still run > into issues that only raise their heads in older versions, but you'll > have the major bases covered. > > Dan > > [1] http://tredosoft.com/Multiple_IE > [2] http://www.tatanka.com.br/ies4linux/page/Main_Page > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From lists at enobrev.com Sun Jul 27 20:44:53 2008 From: lists at enobrev.com (Mark Armendariz) Date: Sun, 27 Jul 2008 20:44:53 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <5458db3c0807271429g85f32c3od3cf698901c56699@mail.gmail.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> <5458db3c0807271429g85f32c3od3cf698901c56699@mail.gmail.com> Message-ID: <488D1685.3090103@enobrev.com> Justin Dearing wrote: > On 7/27/08, John Campbell wrote: > >> As a side note, is anyone thinking about abandoning IE6 testing? My >> numbers on IE6 market share show it is around 20%. (my sites are US >> based and tend to be "consumer" focused). Apple has dropped support >> for IE6 on their new me.com site. I feel like once IE6 drops to 10%, >> it will no longer be worth supporting. >> > > Well what are the firefox numbers? I think IE6 is still relevant for > e-commerce and 15 year old girl sites. No one runs windows update and > no one is buying vista. I would consider limiting support of IE6 at > this point, and maybe exclude IE6 from new features in your site. > > Here's a pretty decent roundup of how long a few well known companies / developers will be supporting IE6, if at all - some good arguments on both sides. http://www.infoq.com/news/2008/07/ie6_on_its_way_out Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulcheung at tiscali.co.uk Mon Jul 28 06:57:27 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Mon, 28 Jul 2008 11:57:27 +0100 Subject: [nycphp-talk] CSS problem??? References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70><6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> Message-ID: Thanks everybody Great suggestion Erik and I am checking it out. John when you say - Make sure you have a doctype that put IE into "standards mode" I am not sure how to do that. Could either of you gve me snippets of coding so that I can see what these quirks, strict and standard mode locoding looks like. Paul ----- Original Message ----- From: "John Campbell" To: "NYPHP Talk" Sent: Sunday, July 27, 2008 7:41 PM Subject: Re: [nycphp-talk] CSS problem??? > Welcome to the world of web development. > > Cross browser css development is plagued with problems. IE 6 is > consistently the worst offender. > > Even something as simple as centering a block is different in IE, and > the standards compatible browsers. There are dozens of quirks, and it > is not something that is easy to learn, but I'll give you a few > pointers. > > 1) Make sure you have a doctype that put IE into "standards mode" > 2) Get firebug and use the inspector to learn from other people's code. > 3) Do some reading on "CSS columns", "CSS clear fix", "CSS centering", > "CSS IE bugs". There are tons of articles and blogs that contain > useful pointers. > 4) Make sure you understand the box model inside and out. > > Hope that helps, > -John Campbell > > > On Sun, Jul 27, 2008 at 2:23 PM, PaulCheung > wrote: >> Hi >> >> I am at the stage where I need to put style to the site and am using CSS. >> with Firefox, Opera, Internet Explorer and Safari to test for browser >> compatibility. What I find puzzling is there seems to be differences in >> the >> styles of output, Using the same the exact same coding the only varible >> in >> the testing are the browsers themselves. >> >> Paul. >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jcampbell1 at gmail.com Mon Jul 28 10:28:58 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 28 Jul 2008 10:28:58 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> Message-ID: <8f0676b40807280728yd4379cagbefce9864c17282@mail.gmail.com> On Mon, Jul 28, 2008 at 6:57 AM, PaulCheung wrote: > John when you say - Make sure you have a doctype that put IE into "standards > mode" I am not sure how to do that. > Could either of you gve me snippets of coding so that I can see what these > quirks, strict and standard mode locoding looks like. This page has a pretty good summary: http://www.ericmeyeroncss.com/bonus/render-mode.html Use or Depending on whether you prefer XHTML or HTML. Regards, John Campbell From paulcheung at tiscali.co.uk Mon Jul 28 12:09:31 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Mon, 28 Jul 2008 17:09:31 +0100 Subject: [nycphp-talk] CSS problem??? References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70><6D87B13E86924C94A46EC1B61BC673C2@X9183><8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <8f0676b40807280728yd4379cagbefce9864c17282@mail.gmail.com> Message-ID: <6E4288E4A58D4BB4B3EA91E1B3D41DB0@X9183> Thanks John, Very much appreciated. Paul ----- Original Message ----- From: "John Campbell" To: "NYPHP Talk" Sent: Monday, July 28, 2008 3:28 PM Subject: Re: [nycphp-talk] CSS problem??? > On Mon, Jul 28, 2008 at 6:57 AM, PaulCheung > wrote: >> John when you say - Make sure you have a doctype that put IE into >> "standards >> mode" I am not sure how to do that. >> Could either of you gve me snippets of coding so that I can see what >> these >> quirks, strict and standard mode locoding looks like. > > This page has a pretty good summary: > http://www.ericmeyeroncss.com/bonus/render-mode.html > > Use > "http://www.w3.org/TR/REC-html40/strict.dtd"> > or > "http://www.w3.org/TR/xhtml1/xhtml1-strict.dtd"> > > Depending on whether you prefer XHTML or HTML. > > Regards, > John Campbell > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From tim_lists at o2group.com Mon Jul 28 13:05:51 2008 From: tim_lists at o2group.com (Tim Lieberman) Date: Mon, 28 Jul 2008 11:05:51 -0600 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <488CFAAB.1050007@phpwerx.net> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> <488CFAAB.1050007@phpwerx.net> Message-ID: On Jul 27, 2008, at 4:46 PM, Dan Cech wrote: > John Campbell wrote: >> How do most people even do IE 6 testing? As far as I can tell, there >> is no legal means to test IE6 on a mac or linux. > > Under windows I've had good luck with MultipleIEs [1], for Linux > there is IEs4 Linux [2]. > > The easiest route is probably to keep a Windows machine around > running IE7, IE6 (via MultipleIEs), Firefox, Safari and Opera. > You'll still run into issues that only raise their heads in older > versions, but you'll have the major bases covered. > > Dan > > [1] http://tredosoft.com/Multiple_IE > [2] http://www.tatanka.com.br/ies4linux/page/Main_Page The best way to test IE is in windows. If you're doing web stuff, most of your users will be on windows, so you have to run windows. My solution, which works quite well: VirtualBox (http:// www.virtualbox.org), is a free Virtual machine. A couple of small VMs running under MacOS as the host operating system (you can run VirtualBox on linux too) let me test in both IE6 and IE7. I figured out how to do it when my (non-virtual) windows machine died. It actually works quite well. I suppose the multipleIE setup could work too, but it seemed wonky last time I tried. So now I just have to virtual windows boxes, one running IE6, another running 7. Yes, this means paying for a copy of XP. I hate to do it, personally, but if you're in this business, it's a necessary evil. -Tim From dsteplight at gmail.com Mon Jul 28 16:23:19 2008 From: dsteplight at gmail.com (Darryle Steplight) Date: Mon, 28 Jul 2008 16:23:19 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> <488CFAAB.1050007@phpwerx.net> Message-ID: <47f4c4570807281323j98d5e7drd2bdb03743e8dcd0@mail.gmail.com> Hi Paul, Everyone gave some really good suggestions, but you should invest in this book http://www.cssmastery.com/ . I'm more of a back-end guy now, but i've done front-end development for some big name companies and this book has been my CSS bible. It's hasn't let me down once. Additionally it provided answers to all previous CSS problems I've googled prior to buying the book. On Mon, Jul 28, 2008 at 1:05 PM, Tim Lieberman wrote: > On Jul 27, 2008, at 4:46 PM, Dan Cech wrote: > >> John Campbell wrote: >>> >>> How do most people even do IE 6 testing? As far as I can tell, there >>> is no legal means to test IE6 on a mac or linux. >> >> Under windows I've had good luck with MultipleIEs [1], for Linux there is >> IEs4 Linux [2]. >> >> The easiest route is probably to keep a Windows machine around running >> IE7, IE6 (via MultipleIEs), Firefox, Safari and Opera. You'll still run >> into issues that only raise their heads in older versions, but you'll have >> the major bases covered. >> >> Dan >> >> [1] http://tredosoft.com/Multiple_IE >> [2] http://www.tatanka.com.br/ies4linux/page/Main_Page > > The best way to test IE is in windows. > > If you're doing web stuff, most of your users will be on windows, so you > have to run windows. > > My solution, which works quite well: VirtualBox (http://www.virtualbox.org), > is a free Virtual machine. A couple of small VMs running under MacOS as the > host operating system (you can run VirtualBox on linux too) let me test in > both IE6 and IE7. I figured out how to do it when my (non-virtual) windows > machine died. It actually works quite well. I suppose the multipleIE setup > could work too, but it seemed wonky last time I tried. So now I just have > to virtual windows boxes, one running IE6, another running 7. > > Yes, this means paying for a copy of XP. I hate to do it, personally, but > if you're in this business, it's a necessary evil. > > -Tim > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From consult at covenantedesign.com Mon Jul 28 16:38:36 2008 From: consult at covenantedesign.com (Edward JS Prevost II) Date: Mon, 28 Jul 2008 16:38:36 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <47f4c4570807281323j98d5e7drd2bdb03743e8dcd0@mail.gmail.com> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> <488CFAAB.1050007@phpwerx.net> <47f4c4570807281323j98d5e7drd2bdb03743e8dcd0@mail.gmail.com> Message-ID: <488E2E4C.5020901@covenantedesign.com> Is there a GNU version? =D Darryle Steplight wrote: > Hi Paul, > Everyone gave some really good suggestions, but you should invest > in this book http://www.cssmastery.com/ . I'm more of a back-end guy > now, but i've done front-end development for some big name companies > and this book has been my CSS bible. It's hasn't let me down once. > Additionally it provided answers to all previous CSS problems I've > googled prior to buying the book. > > On Mon, Jul 28, 2008 at 1:05 PM, Tim Lieberman wrote: > >> On Jul 27, 2008, at 4:46 PM, Dan Cech wrote: >> >> >>> John Campbell wrote: >>> >>>> How do most people even do IE 6 testing? As far as I can tell, there >>>> is no legal means to test IE6 on a mac or linux. >>>> >>> Under windows I've had good luck with MultipleIEs [1], for Linux there is >>> IEs4 Linux [2]. >>> >>> The easiest route is probably to keep a Windows machine around running >>> IE7, IE6 (via MultipleIEs), Firefox, Safari and Opera. You'll still run >>> into issues that only raise their heads in older versions, but you'll have >>> the major bases covered. >>> >>> Dan >>> >>> [1] http://tredosoft.com/Multiple_IE >>> [2] http://www.tatanka.com.br/ies4linux/page/Main_Page >>> >> The best way to test IE is in windows. >> >> If you're doing web stuff, most of your users will be on windows, so you >> have to run windows. >> >> My solution, which works quite well: VirtualBox (http://www.virtualbox.org), >> is a free Virtual machine. A couple of small VMs running under MacOS as the >> host operating system (you can run VirtualBox on linux too) let me test in >> both IE6 and IE7. I figured out how to do it when my (non-virtual) windows >> machine died. It actually works quite well. I suppose the multipleIE setup >> could work too, but it seemed wonky last time I tried. So now I just have >> to virtual windows boxes, one running IE6, another running 7. >> >> Yes, this means paying for a copy of XP. I hate to do it, personally, but >> if you're in this business, it's a necessary evil. >> >> -Tim >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> >> > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > From david at davidmintz.org Mon Jul 28 20:43:06 2008 From: david at davidmintz.org (David Mintz) Date: Mon, 28 Jul 2008 20:43:06 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <8f0676b40807271141g4f3b259fma358ebce82f25e78@mail.gmail.com> <488CD39F.5020601@enobrev.com> <8f0676b40807271408p23d87advfe3b0d9da62a6dd5@mail.gmail.com> Message-ID: <721f1cc50807281743r49a904beh71445241156f0fb8@mail.gmail.com> On Sun, Jul 27, 2008 at 6:36 PM, tedd wrote: > > My figures show IE 6 has about 26 percent of the market and that figure is > dropping about a percent a month. So I plan on supporting it for probably > another two years. > > The question is who is that 26% and do you have to care about them? I've been developing an app for a private audience, inside an intranet, so you'd think it would be easy in that at least I know whom to expect and what they are running. Turns out that some of my most useful cute Web 2.0 tricks fail in the browser that a lot of them are running: IE6. Why don't they upgrade? Because, I am told, IE6 is the top and the end of the line for their Windows flavor, Win 2K , and management doesn't want to pay Microsoft prices to upgrade. I need Scriptaculous' autocompleter to work -- it's supposed to support IE6, but it aint so in my case. I am forced to consider dumbing down my UI to the lowest common denominator. Pardon the OT, I guess is isn't about CSS per se. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at susannathornton.com Wed Jul 30 00:20:05 2008 From: info at susannathornton.com (susanna thornton STUDIO) Date: Wed, 30 Jul 2008 00:20:05 -0400 Subject: [nycphp-talk] soccer website - need help ASAP! Message-ID: <006c01c8f1fb$8d041740$6601a8c0@STPHOTO> Hello: I am a fine art photographer based here in New York- I also run a pickup soccer group on the side. I am looking for someone with experience in the following areas to take over the maintenence and development of the soccer website (which utilizes databases and has e-commerce facets for the online registrations) and also to help me maintain my php mailing list for my photography site. I need someone ASAP for the soccer website! We are switching over to our fall season registrations soon and I need to talk to someone as soon as possible about this as I'm leaving the country next week! Please send all inquiries to me here: info at susannathornton.com The soccer website url is: http://www.pickupsoccernyc.org This is where I currently need the most help. The new registration has to go online by August 15th- I am looking for someone with solid expertise in the following areas: The skills you need are: PHP MySQL SSL certificates credit card processing HTML CSS The last person I worked with was a student with pretty solid knowledge who I paid $10/hour but he is no longer available to work on this. Thanks. SUSANNA THORNTON SUSANNA THORNTON STUDIO New York, NY -------------- next part -------------- An HTML attachment was scrubbed... URL: From birgunjp0071 at yahoo.com Wed Jul 30 02:07:59 2008 From: birgunjp0071 at yahoo.com (birgunj birgunj) Date: Tue, 29 Jul 2008 23:07:59 -0700 (PDT) Subject: [nycphp-talk] need help to create slide like www.slide.com Message-ID: <600942.13230.qm@web59316.mail.re1.yahoo.com> dear All, i want to build the slideshow like slideshow of www.slide.com.at the slide.com they build it using flash and php. i am not getting help or any reference from anywhere to build the slide show like that.if any body has any idea or help material please share with us. thanks humayoo -------------- next part -------------- An HTML attachment was scrubbed... URL: From craigs.nyc.eugene at gmail.com Wed Jul 30 02:25:15 2008 From: craigs.nyc.eugene at gmail.com (Eugene Y. Jen) Date: Wed, 30 Jul 2008 02:25:15 -0400 Subject: [nycphp-talk] need help to create slide like www.slide.com In-Reply-To: <600942.13230.qm@web59316.mail.re1.yahoo.com> References: <600942.13230.qm@web59316.mail.re1.yahoo.com> Message-ID: <4890094B.3070907@gmail.com> I build one, go to http://www.kickfly.com/ birgunj birgunj wrote: > > dear All, > > i want to build the slideshow like slideshow of www.slide.com.at > the slide.com they build it using flash and php. > i am not getting help or any reference from anywhere to build the > slide show like that.if any body has any idea or > help material please share with us. > > thanks > > humayoo > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Wed Jul 30 06:29:53 2008 From: ramons at gmx.net (David Krings) Date: Wed, 30 Jul 2008 06:29:53 -0400 Subject: [nycphp-talk] need help to create slide like www.slide.com In-Reply-To: <600942.13230.qm@web59316.mail.re1.yahoo.com> References: <600942.13230.qm@web59316.mail.re1.yahoo.com> Message-ID: <489042A1.2080905@gmx.net> birgunj birgunj wrote: > dear All, > > i want to build the slideshow like slideshow of www.slide.com.at > the slide.com they build it using flash and php. > i am not getting help or any reference from anywhere to build the slide > show like that.if any body has any idea or > help material please share with us. The best slide show I ever saw is the Image Rotator from Jeroen Wijering. It is Flash based and if it works like anything else Jeroen created you can set plenty of options through parameters as well as determine the play list through an XML file. I don't know any of the details. I use the JW Flash Video Player, which is just awesome. For the image rotator see here: http://www.jeroenwijering.com/?item=JW_Image_Rotator David From lists at nopersonal.info Wed Jul 30 09:03:20 2008 From: lists at nopersonal.info (BAS) Date: Wed, 30 Jul 2008 09:03:20 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <6D87B13E86924C94A46EC1B61BC673C2@X9183> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> Message-ID: <48906698.70103@nopersonal.info> PaulCheung wrote: > Hi > > I am at the stage where I need to put style to the site and am using > CSS. with Firefox, Opera, Internet Explorer and Safari to test for > browser compatibility. What I find puzzling is there seems to be > differences in the styles of output, Using the same the exact same > coding the only varible in the testing are the browsers themselves. I'm coming to this discussion late, and while you've already gotten some excellent advice, I don't think anyone has mentioned CSS resets yet. Every browser, or rather browser family, has its own internal stylesheet that sets the default presentation of HTML elements. For example: In IE & Opera lists are indented by setting a left margin of 40px on the
    element, whereas in Gecko-based browsers lists are indented by setting 40px of left padding. Trying to achieve consistent list indentation can drive you insane if you're unaware of this. The best way I've found to avoid these inconsistencies is to use CSS reset, which sets page elements to margin: 0, padding: 0. There are tons of examples out there--just google "css reset". Some people only reset certain commonly used elements, others reset everything (I reset everything so I don't have to think about it again). Personally, I have a prototype CSS file (also referred to as "CSS framework"--another term you can google) which I use for all the sites I build. My file first resets all elements, then sets up basic layout divs like #wrapper, #branding, #navPrimary, #contentMain, #sidebarPrimary, etc. It also includes a default set of rules for typography, headings, lists, links, etc. It takes time to create one that works for you--mine took months and is still constantly evolving--but in the long run it's a huge time saver. If you decide to go the prototype/framework route, you'd do well to read up on CSS naming conventions. For maximum flexibility you'll want to use structural rather than presentational names--i.e. #navPrimary, #navSecondary, #sidebarPrimary, #sidebarSecondary instead of #navTop, #navLeft, #sidebarRight, #sidebarLeft. Hope that helps a little. From jmcgraw1 at gmail.com Wed Jul 30 09:08:55 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 30 Jul 2008 09:08:55 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <48906698.70103@nopersonal.info> References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <48906698.70103@nopersonal.info> Message-ID: On Wed, Jul 30, 2008 at 9:03 AM, BAS wrote: > PaulCheung wrote: > >> Hi >> I am at the stage where I need to put style to the site and am using CSS. >> with Firefox, Opera, Internet Explorer and Safari to test for browser >> compatibility. What I find puzzling is there seems to be differences in the >> styles of output, Using the same the exact same coding the only varible in >> the testing are the browsers themselves. >> > Try using YUI CSS Reset + Base: http://developer.yahoo.com/yui/base/ to help ease the pain between all of the A Grade browsers. - jake > > I'm coming to this discussion late, and while you've already gotten some > excellent advice, I don't think anyone has mentioned CSS resets yet. > > Every browser, or rather browser family, has its own internal stylesheet > that sets the default presentation of HTML elements. For example: In IE & > Opera lists are indented by setting a left margin of 40px on the
      > element, whereas in Gecko-based browsers lists are indented by setting 40px > of left padding. Trying to achieve consistent list indentation can drive you > insane if you're unaware of this. > > The best way I've found to avoid these inconsistencies is to use CSS reset, > which sets page elements to margin: 0, padding: 0. There are tons of > examples out there--just google "css reset". Some people only reset certain > commonly used elements, others reset everything (I reset everything so I > don't have to think about it again). > > Personally, I have a prototype CSS file (also referred to as "CSS > framework"--another term you can google) which I use for all the sites I > build. My file first resets all elements, then sets up basic layout divs > like #wrapper, #branding, #navPrimary, #contentMain, #sidebarPrimary, etc. > It also includes a default set of rules for typography, headings, lists, > links, etc. It takes time to create one that works for you--mine took months > and is still constantly evolving--but in the long run it's a huge time > saver. > > If you decide to go the prototype/framework route, you'd do well to read up > on CSS naming conventions. For maximum flexibility you'll want to use > structural rather than presentational names--i.e. #navPrimary, > #navSecondary, #sidebarPrimary, #sidebarSecondary instead of #navTop, > #navLeft, #sidebarRight, #sidebarLeft. > > Hope that helps a little. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at enobrev.com Wed Jul 30 09:33:01 2008 From: lists at enobrev.com (Mark Armendariz) Date: Wed, 30 Jul 2008 09:33:01 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: References: <57536.192.168.1.70.1217002947.webmail@192.168.1.70> <6D87B13E86924C94A46EC1B61BC673C2@X9183> <48906698.70103@nopersonal.info> Message-ID: <48906D8D.1070703@enobrev.com> Jake McGraw wrote: > > > On Wed, Jul 30, 2008 at 9:03 AM, BAS > wrote: > > PaulCheung wrote: > > Hi > I am at the stage where I need to put style to the site and > am using CSS. with Firefox, Opera, Internet Explorer and > Safari to test for browser compatibility. What I find puzzling > is there seems to be differences in the styles of output, > Using the same the exact same coding the only varible in the > testing are the browsers themselves. > > > Try using YUI CSS Reset + Base: > > http://developer.yahoo.com/yui/base/ > > to help ease the pain between all of the A Grade browsers. > > - jake > Eric Meyer has a good reset, which I've used on quite a few projects as well: http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ As a matter of fact, just read Eric Meyer. http://meyerweb.com/eric/writing.html Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at nopersonal.info Wed Jul 30 10:18:53 2008 From: lists at nopersonal.info (BAS) Date: Wed, 30 Jul 2008 10:18:53 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <1217201286.20538@coral.he.net> References: <1217201286.20538@coral.he.net> Message-ID: <4890784D.1030502@nopersonal.info> Kristina Anderson wrote: > Is there anything out there now that's a good comprehensive "where not > to go with client side dev" overview, like we used to have? Hi Kristina, I don't know of anything offhand. As you undoubtedly know, web technologies change so rapidly that it's well nigh impossible to come up with a definitive guide that won't be outdated by the time the next browser is released. I'd say your best bet is just to be aware of current standards, bugs in current browsers, and make sure you have a solid understanding of the box model & proper doctypes (as already mentioned by someone else). IMO, it's also important to understand how floats work as well as the cascade itself (inheritance & specificity). As long as you're aware of the possibilities & limitations of those things, you should be fine. Of course, knowing who your users are is probably the most important thing as evidenced by what David M. said about discovering that his intranet audience was using IE6, which screwed up his cool Web 2.0 tricks. On a more practical & somewhat OT note, our web site clearly states which browsers we develop for: only mainstream, non-proprietary, modern browsers (nothing more than 5 years old, with the exception of IE6). We also educate clients on what to expect--i.e. consistency doesn't necessarily mean identical, pixel-perfect rendering across all browsers/platforms. Oh--and this is important--we let them know that while we follow current web standards & best practices, it is impossible to predict future browser bugs & technology changes, therefore we cannot guarantee future consistency. Regards, Bev From radalapsker at yahoo.com Wed Jul 30 10:34:18 2008 From: radalapsker at yahoo.com (-- rada --) Date: Wed, 30 Jul 2008 07:34:18 -0700 (PDT) Subject: [nycphp-talk] Fw: soccer website - need help ASAP! (susanna thornton STUDIO) Message-ID: <445707.55595.qm@web54112.mail.re2.yahoo.com> Below are?current Cut-off Wages for?computer specialists?from the New York State Department of Labor. These are not some extravagant rates. These are rates that the NYS DOL considers so low that if you are unemployed and someone offers you work below this rate, you can refuse the job without losing your unemployment insurance. Needless to say, nobody with a brain will work for cut-off wages, these are just examples of absolute rock-bottom rates. ? Occupation Cut-off Wage Computer Programmers $31.77 Computer Software Engineers $35.79 Computer Support Specialists $24.30 ? The above hourly rates are for full-time work. For less than 40 hours/week, the rates have to be proportionately higher. For example, if you are a "Computer Programmer", the hourly cut-off wage is $31.77 but the corresponding yearly wage is $74,626.00. To Susanna: This is a professional PHP community and frankly, your $10/hour?for part-time work?is inappropriate to the point of being insulting.?You may think that an offer is just an offer and those who don't like it could simply pass on by, but I'd rather not see this online space turn into a craigslist ghetto with its infamous "looking for someone to build me a?YouTube/Ebay?combo for $1,000" ads.? ? To fellow PHP developers: I know we are all flooded with work and don't necesarily have time for nonsense, but let's?try and take care of each other.?Save this link for the DOL minimum wages page and let unethical?would-be clients?know?when they've crossed the line.?For?sample language,?please?refer to the No Spec project which contains lots of great examples like this.??? ? ? Sincerely Rada Lapsker -------------- next part -------------- An HTML attachment was scrubbed... URL: From zippy1981 at gmail.com Wed Jul 30 11:22:36 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Wed, 30 Jul 2008 11:22:36 -0400 Subject: [nycphp-talk] Fw: soccer website - need help ASAP! (susanna thornton STUDIO) In-Reply-To: <445707.55595.qm@web54112.mail.re2.yahoo.com> References: <445707.55595.qm@web54112.mail.re2.yahoo.com> Message-ID: <5458db3c0807300822x2bbaecbfve1e16d929363e405@mail.gmail.com> Rada, She did say it was a student and you get what you pay for. She could do much less than $10 an hour if she went to rent a coder and this student probably couldn't get better than $10 an hour if he or she was working for this person. If this student no longer can do the work then one can assume they are making better than $10 an hour. If no one is willing to do the work, at that rate she will be forced to pay someone a higher rate. As a photographer, she has to hire models, assistants, makeup people etc. She's well aware of the costs of labor. Now if some 16 year old kids want to give it a go at $10 an hour I'd say more power to him. It will probably take him three times as long. Its not taking any food out of my mouth. I do business with people that are willing and able to pay my rates, and I don't begrudge those who deal with those jobs below my rate. I would have never had the experience to be able to command my current salary if it were not for me taking jobs that paid little and demanded too much. Regards, Justin Dearing On Wed, Jul 30, 2008 at 10:34 AM, -- rada -- wrote: > Below are current Cut-off Wages for computer specialists from the New York > State Department of Labor. These are not some extravagant rates. These are > rates that the NYS DOL considers so low that if you are unemployed and > someone offers you work below this rate, you can refuse the job without > losing your unemployment insurance. Needless to say, nobody with a brain > will work for cut-off wages, these are just examples of absolute rock-bottom > rates. > > Occupation Cut-off Wage > Computer Programmers $31.77 > Computer Software Engineers $35.79 > Computer Support Specialists $24.30 > > The above hourly rates are for full-time work. For less than 40 hours/week, > the rates have to be proportionately higher. For example, if you are a > "Computer Programmer", the hourly cut-off wage is $31.77 but the > corresponding yearly wage is $74,626.00. > To Susanna: > This is a professional PHP community and frankly, your $10/hour for > part-time work is inappropriate to the point of being insulting. You may > think that an offer is just an offer and those who don't like it could > simply pass on by, but I'd rather not see this online space turn into a > craigslist ghetto with its infamous "looking for someone to build me > a YouTube/Ebay combo for $1,000" ads. > > To fellow PHP developers: > I know we are all flooded with work and don't necesarily have time for > nonsense, but let's try and take care of each other. Save this link for the > DOL minimum wages page and let unethical would-be clients know when they've > crossed the line. For sample language, please refer to the No Spec project > which contains lots of great examples like this. > > > Sincerely > Rada Lapsker > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From david at davidmintz.org Wed Jul 30 11:56:18 2008 From: david at davidmintz.org (David Mintz) Date: Wed, 30 Jul 2008 11:56:18 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? Message-ID: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> Greetings all, I got two CentOS 5 LAMP production servers and a Zend Framework app. The CentOS boxes have PHP 5.1.6 and CentOS evidently has no intention of offering an upgrade. There are third-party RPMs available but as a novice sysadmin I am uneasy about going there lest I break stuff. Why upgrade? There's a strange and subtle bug in IE6's, also Safari's behavior with an Ajax call involving Scriptaculous' Autocompleter. What's the server side got to do with it? I don't know, except that I cannot for the life of me reproduce the bug when I run the selfsame code on PHP 5.2.x I am out of hypotheses. I am dissatisfied with CentOS' conservatism -- I guess it's not for me -- but installing another distro based on a hunch that it might help seems like overkill, doesn't it? What would you do? PS, the code that acts weird only on 5.1.6 is substantially this: http://davidmintz.org/eg/autocompleter.php (source: http://davidmintz.org/eg/autocompleter.php/source). If you see anything wrong with it, do share. In deepest gratitude, David -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From bzcoder at bzcode.com Wed Jul 30 12:44:11 2008 From: bzcoder at bzcode.com (bzcoder) Date: Wed, 30 Jul 2008 12:44:11 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> Message-ID: <48909A5B.2060801@bzcode.com> David Mintz wrote: > I am dissatisfied with CentOS' conservatism -- I guess it's not for me > -- but installing another distro based on a hunch that it might help > seems like overkill, doesn't it? > > What would you do? I'd configure yum to use a repository that has PHP 5.2 for CentOS, http://www.jasonlitka.com/yum-repository/ From ka at kacomputerconsulting.com Wed Jul 30 13:02:31 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Wed, 30 Jul 2008 10:02:31 -0700 Subject: [nycphp-talk] CSS problem??? Message-ID: <1217437351.16539@coral.he.net> Bev, Thanks, some great info! I will read up on the below as you suggest, and have forwarded this to my other team member. -- Kristina > Kristina Anderson wrote: > > Is there anything out there now that's a good comprehensive "where not > > to go with client side dev" overview, like we used to have? > > Hi Kristina, > > I don't know of anything offhand. As you undoubtedly know, web > technologies change so rapidly that it's well nigh impossible to come up > with a definitive guide that won't be outdated by the time the next > browser is released. > > I'd say your best bet is just to be aware of current standards, bugs in > current browsers, and make sure you have a solid understanding of the > box model & proper doctypes (as already mentioned by someone else). IMO, > it's also important to understand how floats work as well as the cascade > itself (inheritance & specificity). As long as you're aware of the > possibilities & limitations of those things, you should be fine. > > Of course, knowing who your users are is probably the most important > thing as evidenced by what David M. said about discovering that his > intranet audience was using IE6, which screwed up his cool Web 2.0 tricks. > > On a more practical & somewhat OT note, our web site clearly states > which browsers we develop for: only mainstream, non-proprietary, modern > browsers (nothing more than 5 years old, with the exception of IE6). We > also educate clients on what to expect--i.e. consistency doesn't > necessarily mean identical, pixel-perfect rendering across all > browsers/platforms. Oh--and this is important--we let them know that > while we follow current web standards & best practices, it is impossible > to predict future browser bugs & technology changes, therefore we cannot > guarantee future consistency. > > Regards, > Bev > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From danielc at analysisandsolutions.com Wed Jul 30 13:02:35 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 30 Jul 2008 13:02:35 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> Message-ID: <20080730170234.GA16170@panix.com> Hi David: On Wed, Jul 30, 2008 at 11:56:18AM -0400, David Mintz wrote: > Why upgrade? There's a strange and subtle bug in IE6's, also Safari's > behavior with an Ajax call involving Scriptaculous' Autocompleter. What's wrong? Seems to work for me. > I am dissatisfied with CentOS' conservatism -- I guess it's not for me -- > but installing another distro based on a hunch that it might help seems like > overkill, doesn't it? Yeah, there are many Linux distros that really suck at updating packages. You can always compile PHP yourself. --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 zippy1981 at gmail.com Wed Jul 30 13:04:14 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Wed, 30 Jul 2008 13:04:14 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> Message-ID: <5458db3c0807301004w5ef283f9wc147a33b3c2d3d56@mail.gmail.com> David, So what exactly is the cause of the bug? Is different html of javascript being generated by different versions of PHP? Is it a matter of warningnotices and errors being raised in the code producing the javascript? Also, why not install a seperate copy of apache and php in a seperate directory that you built from source? You can run apache on a port other than 81 and see if the problem still exists. I have a hunch though that warning are being inserted into the output code that your other php configuration places in a log file. Check the PHP.INI settings. On Wed, Jul 30, 2008 at 11:56 AM, David Mintz wrote: > Greetings all, > > I got two CentOS 5 LAMP production servers and a Zend Framework app. The > CentOS boxes have PHP 5.1.6 and CentOS evidently has no intention of > offering an upgrade. There are third-party RPMs available but as a novice > sysadmin I am uneasy about going there lest I break stuff. > > Why upgrade? There's a strange and subtle bug in IE6's, also Safari's > behavior with an Ajax call involving Scriptaculous' Autocompleter. What's > the server side got to do with it? I don't know, except that I cannot for > the life of me reproduce the bug when I run the selfsame code on PHP 5.2.x I > am out of hypotheses. > > I am dissatisfied with CentOS' conservatism -- I guess it's not for me -- > but installing another distro based on a hunch that it might help seems like > overkill, doesn't it? > > What would you do? > > PS, the code that acts weird only on 5.1.6 is substantially this: > http://davidmintz.org/eg/autocompleter.php (source: > http://davidmintz.org/eg/autocompleter.php/source). If you see anything > wrong with it, do share. > > In deepest gratitude, > > David > > -- > David Mintz > http://davidmintz.org/ > > The subtle source is clear and bright > The tributary streams flow through the darkness > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From donnamarievincent at yahoo.com Wed Jul 30 13:11:16 2008 From: donnamarievincent at yahoo.com (Donna Marie Vincent) Date: Wed, 30 Jul 2008 10:11:16 -0700 (PDT) Subject: [nycphp-talk] Fw: soccer website - need help ASAP! (susanna thornton STUDIO) Message-ID: <475077.43207.qm@web35605.mail.mud.yahoo.com> Rada, Thanks for this valuable info. Date: Wed, 30 Jul 2008 07:34:18 -0700 (PDT) From: -- rada -- Subject: [nycphp-talk] Fw: soccer website - need help ASAP! (susanna thornton STUDIO) To: talk at lists.nyphp.org Message-ID: <445707.55595.qm at web54112.mail.re2.yahoo.com> Content-Type: text/plain; charset="iso-8859-1" Below are current Cut-off Wages for computer specialists from the New York State Department of Labor. These are not some extravagant rates. These are rates that the NYS DOL considers so low that if you are unemployed and someone offers you work below this rate, you can refuse the job without losing your unemployment insurance. Needless to say, nobody with a brain will work for cut-off wages, these are just examples of absolute rock-bottom rates. Occupation Cut-off Wage Computer Programmers $31.77 Computer Software Engineers $35.79 Computer Support Specialists $24.30 The above hourly rates are for full-time work. For less than 40 hours/week, the rates have to be proportionately higher. For example, if you are a "Computer Programmer", the hourly cut-off wage is $31.77 but the corresponding yearly wage is $74,626.00. ... Sincerely Rada Lapsker From edwardpotter at gmail.com Wed Jul 30 13:20:39 2008 From: edwardpotter at gmail.com (Edward Potter) Date: Wed, 30 Jul 2008 13:20:39 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> Message-ID: > What would you do? Well a quick fix is to replace the Scriptaculus Autocompleter with a jquery version. http://plugins.jquery.com/search/node/autocomplete+type%3Aproject_project Then worry about the upgrade down the road. :-) ed On Wed, Jul 30, 2008 at 11:56 AM, David Mintz wrote: > Greetings all, > > I got two CentOS 5 LAMP production servers and a Zend Framework app. The > CentOS boxes have PHP 5.1.6 and CentOS evidently has no intention of > offering an upgrade. There are third-party RPMs available but as a novice > sysadmin I am uneasy about going there lest I break stuff. > > Why upgrade? There's a strange and subtle bug in IE6's, also Safari's > behavior with an Ajax call involving Scriptaculous' Autocompleter. What's > the server side got to do with it? I don't know, except that I cannot for > the life of me reproduce the bug when I run the selfsame code on PHP 5.2.x I > am out of hypotheses. > > I am dissatisfied with CentOS' conservatism -- I guess it's not for me -- > but installing another distro based on a hunch that it might help seems like > overkill, doesn't it? > > What would you do? > > PS, the code that acts weird only on 5.1.6 is substantially this: > http://davidmintz.org/eg/autocompleter.php (source: > http://davidmintz.org/eg/autocompleter.php/source). If you see anything > wrong with it, do share. > > In deepest gratitude, > > David > > -- > David Mintz > http://davidmintz.org/ > > The subtle source is clear and bright > The tributary streams flow through the darkness > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Blog: http://www.preceptress.com Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com Projects: http://flickr.com/photos/86842405 at N00/ Store: http://astore.amazon.com/httpwwwutopic-20 From ioplex at gmail.com Wed Jul 30 13:46:41 2008 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 30 Jul 2008 13:46:41 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <20080730170234.GA16170@panix.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> <20080730170234.GA16170@panix.com> Message-ID: <78c6bd860807301046k1449e877p8cc61bfc0e48bf4c@mail.gmail.com> On Wed, Jul 30, 2008 at 1:02 PM, Daniel Convissor wrote: >> I am dissatisfied with CentOS' conservatism -- I guess it's not for me -- >> but installing another distro based on a hunch that it might help seems like >> overkill, doesn't it? > > Yeah, there are many Linux distros that really suck at updating packages. Your analysis is faulty. CentOS (or really Red Hat since CentOS is mostly just re-branded RHEL) not "updating" packages is quite deliberate. Once the major.minor version of a package is selected, it does not change for the life of that OS' major.minor version (and for many things only the major version - ie. the kernel). The reason is that the API provided by the package can change if the minor number changes. So the new package could cause all sorts of strange things to happen if it's linked with or used by other packages. And in fact, the internal PHP API has changed with 5.0, 5.1 and 5.2. So if you install a third party extension for PHP 5.1 and then upgrade to PHP 5.2, the extension will no longer load. > You can always compile PHP yourself. And then re-compile it for every patch level release? Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From lists at nopersonal.info Wed Jul 30 15:38:57 2008 From: lists at nopersonal.info (BAS) Date: Wed, 30 Jul 2008 15:38:57 -0400 Subject: [nycphp-talk] CSS problem??? In-Reply-To: <1217437351.16539@coral.he.net> References: <1217437351.16539@coral.he.net> Message-ID: <4890C351.9060904@nopersonal.info> Kristina Anderson wrote: > Bev, > > Thanks, some great info! > > I will read up on the below as you suggest, and have forwarded this to > my other team member. You're welcome, Kristina. ;-) I forgot to mention that while our web site says we only build sites for modern browsers, we also say that if they have special needs we can accommodate them. I just wanted to clarify that. Anyway, since we're on the subject and there may be people who are still learning & need pointers, here are some links that may prove helpful: Browser Trends & Stats ---------------------- http://www.upsdell.com/BrowserNews/stat_trends.htm http://www.upsdell.com/BrowserNews/stat.htm http://www.thecounter.com/stats/ CSS Specificity Calculator -------------------------- http://www.rebelinblue.com/specificity.php CSS Support Charts ------------------ http://developer.mozilla.org/en/docs/Mozilla_CSS_support_chart http://msdn.microsoft.com/en-us/library/cc351024(VS.85).aspx http://www.opera.com/docs/specs/opera9/css/ (other charts in sidebar) I couldn't find any up-to-date charts for Macs, but MacEdition has some older stuff: http://old.macedition.com/cb/resources/index.html HTML E-mail ----------- If you code anything that generates HTML emails these are good: 2008 Guide to CSS Email Support (desktop & web clients) http://www.campaignmonitor.com/css/ Email Standards Project http://www.email-standards.org/ Online Browser Testing ---------------------- Browsershots http://browsershots.org/ IE NetRenderer http://ipinfo.info/netrenderer/ Browsrcamp (Mac) http://www.browsrcamp.com/ Ajaxian Safari Test (Mac) http://ajaxian.com/archives/safaritest-browser-testing-for-non-mac-folk Vischeck (Colorblind vision simulator) http://www.vischeck.com/ Online Validation ----------------- X/HTML http://validator.w3.org/ CSS http://jigsaw.w3.org/css-validator/ Accessibility http://www.contentquality.com/ Misc. ----- Typetester (compare screen fonts) http://www.typetester.org/ Cheat Sheets http://www.addedbytes.com/cheat-sheets/ Ultimate .htaccess Examples http://www.evolt.org/ultimate_htaccess_examples Best .htaccess Tutorials with Sample .htaccess files http://www.askapache.com/htaccess/apache-htaccess.html Xenu open source link checker (Windows only) http://home.snafu.de/tilman/xenulink.html HTTRack open source link checker (Windows only) http://www.httrack.com/ Dust-Me Selectors A Firefox extension that finds unused CSS selectors - current v2.1 works with FF v3.0, but not v3.0.1. Kindly google this one as I dislike the creators' promotion of spec work and would rather not provide another link to their site. Going back into lurk mode... Regards, Bev From david at davidmintz.org Wed Jul 30 15:52:26 2008 From: david at davidmintz.org (David Mintz) Date: Wed, 30 Jul 2008 15:52:26 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <48909A5B.2060801@bzcode.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> <48909A5B.2060801@bzcode.com> Message-ID: <721f1cc50807301252m1d203703vd5e47026664ae207@mail.gmail.com> On Wed, Jul 30, 2008 at 12:44 PM, bzcoder wrote: > David Mintz wrote: > >> I am dissatisfied with CentOS' conservatism -- I guess it's not for me -- >> but installing another distro based on a hunch that it might help seems like >> overkill, doesn't it? >> >> What would you do? >> > > I'd configure yum to use a repository that has PHP 5.2 for CentOS, > http://www.jasonlitka.com/yum-repository/ > Good point, thanks. Actually I have just now been flirting with les RPM de Remi (http://blog.famillecollet.com/) and considering that route, but I heard of the site you mention in a thread about this very issue (need to upgrade PHP on CentOS 5) -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at davidmintz.org Wed Jul 30 15:58:01 2008 From: david at davidmintz.org (David Mintz) Date: Wed, 30 Jul 2008 15:58:01 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> Message-ID: <721f1cc50807301258q9c875edq2bbfbec827b4e750@mail.gmail.com> On Wed, Jul 30, 2008 at 1:20 PM, Edward Potter wrote: > > What would you do? > > Well a quick fix is to replace the Scriptaculus Autocompleter with a > jquery version. > > http://plugins.jquery.com/search/node/autocomplete+type%3Aproject_project > > Then worry about the upgrade down the road. > > :-) ed > > Kind of like, if you don't like your spouse, get divorced and re-marry someone else. It makes sense but it's a lot of work. (-: Seriously, my js is now loaded with Prototype-dependent stuff -- hmm just how similar are the Prototype and JQuery APIs? I will go have a look. Maybe that divorce/re-marriage wouldn't be so awful... -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at davidmintz.org Wed Jul 30 16:24:53 2008 From: david at davidmintz.org (David Mintz) Date: Wed, 30 Jul 2008 16:24:53 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <5458db3c0807301004w5ef283f9wc147a33b3c2d3d56@mail.gmail.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> <5458db3c0807301004w5ef283f9wc147a33b3c2d3d56@mail.gmail.com> Message-ID: <721f1cc50807301324x70e63b1bn46f6145d7469b774@mail.gmail.com> On Wed, Jul 30, 2008 at 1:04 PM, Justin Dearing wrote: > David, > > So what exactly is the cause of the bug? Is different html of > javascript being generated by different versions of PHP? Is it a > matter of warningnotices and errors being raised in the code producing > the javascript? Ummm -- I don't know. That is, it's an Ajax thing and the JS is (mostly) hard-coded client-side. With Firefox/Firebug of course I see exactly what's going on with XHR. With IE6 I have no clue what's going on when it fails/acts funny. That's the issue -- code that breaks ONLY with IE6 and as far as I can tell, IE6 + PHP 5.1.6. Because try though I might, I can't reproduce the IE6 bug on my dev box (PHP 5.2.6) but the bug does happen with the same code on the production boxes (PHP 5.1.6). Specifically, it's a situation where the user is posting a request for a court interpreter for a court proceeding -- so there's a form with fields for stuff like date, time, language. For the defendant name(s) however we have thousands in the db already and don't need/want them trying to spell -- it's an ideal scenario for autocompletion. So they type something and select a name from the results returned, and my callback inserts a node in the DOM with a hidden field holding the record id, bla bla bla. Works great but in IE6 sometimes there's an apparently random extra record gratuitously added to the POST payload. At first I thought it might be caused by multiple users doing stuff at the same time but that ain't it. Oh yeah, in IE6 there is also the issue where they type something and nothing happens the first time, type some more and then it works normally (more or less). That's a known issue that was supposed to be fixed in the release I am using but it ain't so. > Also, why not install a seperate copy of apache and php in a seperate > directory that you built from source? You can run apache on a port > other than 81 and see if the problem still exists. > Jeez, I suppose I could but I have been there and done that: wget and tar xzf whatever, ./configure --etc --etc --etc, watch it fail,, chase down dependencies, and dependencies upon dependencies, google obscure (to me) configure errors, watch the compiler work for 11 minutes and then puke, google obscure compile errors, feel manly once it's all over and lay back and have a smoke... nah. I mean, I have never had much trouble compiling apache but PHP has been too exciting. > > I have a hunch though that warning are being inserted into the output > code that your other php configuration places in a log file. Check the > PHP.INI settings. I could be logging more verbosely and I will do that. Thanks. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From zippy1981 at gmail.com Wed Jul 30 20:22:18 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Wed, 30 Jul 2008 20:22:18 -0400 Subject: [nycphp-talk] Fw: soccer website - need help ASAP! (susanna thornton STUDIO) In-Reply-To: <5458db3c0807300822x2bbaecbfve1e16d929363e405@mail.gmail.com> References: <445707.55595.qm@web54112.mail.re2.yahoo.com> <5458db3c0807300822x2bbaecbfve1e16d929363e405@mail.gmail.com> Message-ID: <5458db3c0807301722x2a6d1b30va70149bc6626b2fa@mail.gmail.com> Rada, Sorry for coming on so strong. I generally follow these lists for the technical discussion, and not the solicitations for work. I get annoyed when people don't let the market take care of lowball offers like this. You are right that people on this list in general command a better than $10.00/hr fee, and that's about living wage in the NY area.I know a security (as in rent a cop) company that pays people about that much to watch construction sites, and many of them are immigrants that are completely illiterate in both English and their native languages. So I do appreciate how little $10.00/hr is. That being said, I started out programming for $8.00 an hour when I was hired to do clerical work. It was a benefit to both parties. It made their operations more efficient. It helped me to get a help desk position for more money, and lead me down a path to earning my current salary doing something I love. Without the crappy jobs I would not have ended up in my current good one. When I was at the stage of my life where I wasn't good enough to get paid a proper wage to program, I preffered to make a substandard wage programming to making a substandard wage doing something I didn't like. Regards, Justin Dearing http://www.ohloh.net/accounts/1193 On Wed, Jul 30, 2008 at 11:22 AM, Justin Dearing wrote: > Rada, > > She did say it was a student and you get what you pay for. She could > do much less than $10 an hour if she went to rent a coder and this > student probably couldn't get better than $10 an hour if he or she was > working for this person. > > If this student no longer can do the work then one can assume they are > making better than $10 an hour. If no one is willing to do the work, > at that rate she will be forced to pay someone a higher rate. As a > photographer, she has to hire models, assistants, makeup people etc. > She's well aware of the costs of labor. > > Now if some 16 year old kids want to give it a go at $10 an hour I'd > say more power to him. It will probably take him three times as long. > Its not taking any food out of my mouth. I do business with people > that are willing and able to pay my rates, and I don't begrudge those > who deal with those jobs below my rate. I would have never had the > experience to be able to command my current salary if it were not for > me taking jobs that paid little and demanded too much. > > Regards, > > Justin Dearing > > On Wed, Jul 30, 2008 at 10:34 AM, -- rada -- wrote: >> Below are current Cut-off Wages for computer specialists from the New York >> State Department of Labor. These are not some extravagant rates. These are >> rates that the NYS DOL considers so low that if you are unemployed and >> someone offers you work below this rate, you can refuse the job without >> losing your unemployment insurance. Needless to say, nobody with a brain >> will work for cut-off wages, these are just examples of absolute rock-bottom >> rates. >> >> Occupation Cut-off Wage >> Computer Programmers $31.77 >> Computer Software Engineers $35.79 >> Computer Support Specialists $24.30 >> >> The above hourly rates are for full-time work. For less than 40 hours/week, >> the rates have to be proportionately higher. For example, if you are a >> "Computer Programmer", the hourly cut-off wage is $31.77 but the >> corresponding yearly wage is $74,626.00. >> To Susanna: >> This is a professional PHP community and frankly, your $10/hour for >> part-time work is inappropriate to the point of being insulting. You may >> think that an offer is just an offer and those who don't like it could >> simply pass on by, but I'd rather not see this online space turn into a >> craigslist ghetto with its infamous "looking for someone to build me >> a YouTube/Ebay combo for $1,000" ads. >> >> To fellow PHP developers: >> I know we are all flooded with work and don't necesarily have time for >> nonsense, but let's try and take care of each other. Save this link for the >> DOL minimum wages page and let unethical would-be clients know when they've >> crossed the line. For sample language, please refer to the No Spec project >> which contains lots of great examples like this. >> >> >> Sincerely >> Rada Lapsker >> >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> > From dan.horning at planetnoc.com Wed Jul 30 20:39:34 2008 From: dan.horning at planetnoc.com (Dan Horning) Date: Wed, 30 Jul 2008 20:39:34 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <48909A5B.2060801@bzcode.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> <48909A5B.2060801@bzcode.com> Message-ID: <1217464774.31939.2.camel@dan-linux-home.nycap.rr.com> thanks for the link btw - i've also been testing a few repos without much luck (first on a dev env then on production of course ...) how's the stability on this repo and have you ever got bad builds ? -dan On Wed, 2008-07-30 at 12:44 -0400, bzcoder wrote: > David Mintz wrote: > > I am dissatisfied with CentOS' conservatism -- I guess it's not for me > > -- but installing another distro based on a hunch that it might help > > seems like overkill, doesn't it? > > > > What would you do? > > I'd configure yum to use a repository that has PHP 5.2 for CentOS, > http://www.jasonlitka.com/yum-repository/ > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Dan Horning American Digital Services - Where you are only limited by imagination. direct 1-866-493-4218 . main 1-800-863-3854 . fax 1-888-474-6133 dan.horning at planetnoc.com http://www.americandigitalservices.com From tim_lists at o2group.com Wed Jul 30 20:54:20 2008 From: tim_lists at o2group.com (Tim Lieberman) Date: Wed, 30 Jul 2008 18:54:20 -0600 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <78c6bd860807301046k1449e877p8cc61bfc0e48bf4c@mail.gmail.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> <20080730170234.GA16170@panix.com> <78c6bd860807301046k1449e877p8cc61bfc0e48bf4c@mail.gmail.com> Message-ID: On Jul 30, 2008, at 11:46 AM, Michael B Allen wrote: >> You can always compile PHP yourself. > > And then re-compile it for every patch level release? That's why you write build scripts. Especially for a minor version update, my upgrade procedure is: cd /src/archive wget http://.....php-X-Y-Z.tar.gz cd .. emacs build.php [edit some line that looks like "export PHP_VERSION=X-Y-Y" to read "export PHP_VERSION=X-Y-Z] exit emacs ./build.php Well, actually, my setup is a little more complicated (it compiles a bunch of things, openssl, zlib, mhash, etc, then builds apache and php, linking against the various libraries) If anyone's interested, I can try to document them and up them up on the web somehwere. Binary packages are great, until they're not. In my experience, it's worth spending a few days putting together some scripts to compile what you need. That way, you know what you're getting. -Tim From dan.horning at planetnoc.com Wed Jul 30 20:58:55 2008 From: dan.horning at planetnoc.com (Dan Horning) Date: Wed, 30 Jul 2008 20:58:55 -0400 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> <20080730170234.GA16170@panix.com> <78c6bd860807301046k1449e877p8cc61bfc0e48bf4c@mail.gmail.com> Message-ID: <1217465935.31939.15.camel@dan-linux-home.nycap.rr.com> On Wed, 2008-07-30 at 18:54 -0600, Tim Lieberman wrote: > Well, actually, my setup is a little more complicated (it compiles a > bunch of things, openssl, zlib, mhash, etc, then builds apache and > php, linking against the various libraries) > > If anyone's interested, I can try to document them and up them up on > the web somehwere. I'd love to see that!! maybe even turn it into a phundamentals doc... just my thoughts. -- Dan Horning American Digital Services - Where you are only limited by imagination. direct 1-866-493-4218 . main 1-800-863-3854 . fax 1-888-474-6133 dan.horning at planetnoc.com http://www.americandigitalservices.com From suzerain at suzerain.com Thu Jul 31 02:06:59 2008 From: suzerain at suzerain.com (Marc Antony Vose) Date: Thu, 31 Jul 2008 14:06:59 +0800 Subject: [nycphp-talk] nested set tree sorting In-Reply-To: <5458db3c0807301722x2a6d1b30va70149bc6626b2fa@mail.gmail.com> References: <445707.55595.qm@web54112.mail.re2.yahoo.com> <5458db3c0807300822x2bbaecbfve1e16d929363e405@mail.gmail.com> <5458db3c0807301722x2a6d1b30va70149bc6626b2fa@mail.gmail.com> Message-ID: <0C283277-BB21-4B34-A848-627710FFE82C@suzerain.com> Hey there: I had a category structure that was previously limited to two degrees, but I've decided that I want it to be able to grow however it needs to. I has been using a "parent" field previously, and I converted it to be stored using a typical nested set model, so that I could achieve display with a single database query, and so forth. I now have a slight problem, which is that I would like the categories to be alphabetized in each level. Has anyone previously tackled this problem before, and have some sample code to rebuild the entire tree, but alphabetize or sort the entries in each level? Cheers, Marc Vose Suzerain Studios http://www.suzerain.com From tim_lists at o2group.com Thu Jul 31 02:19:27 2008 From: tim_lists at o2group.com (Tim Lieberman) Date: Thu, 31 Jul 2008 00:19:27 -0600 Subject: [nycphp-talk] nested set tree sorting In-Reply-To: <0C283277-BB21-4B34-A848-627710FFE82C@suzerain.com> References: <445707.55595.qm@web54112.mail.re2.yahoo.com> <5458db3c0807300822x2bbaecbfve1e16d929363e405@mail.gmail.com> <5458db3c0807301722x2a6d1b30va70149bc6626b2fa@mail.gmail.com> <0C283277-BB21-4B34-A848-627710FFE82C@suzerain.com> Message-ID: <4DDFCC58-C156-43A9-8A49-0F9A4ECE192A@o2group.com> From memory ... I don't think you can do it in SQL (but I very well may be wrong), at least on the query-end. It's probably best to approach it by restructuring the tree when you insert/update, though that's going to be a good deal of hairy code in your business logic. Sorry I don't have a better answer. -Tim On Jul 31, 2008, at 12:06 AM, Marc Antony Vose wrote: > Hey there: > > I had a category structure that was previously limited to two > degrees, but I've decided that I want it to be able to grow however > it needs to. I has been using a "parent" field previously, and I > converted it to be stored using a typical nested set model, so that > I could achieve display with a single database query, and so forth. > > I now have a slight problem, which is that I would like the > categories to be alphabetized in each level. Has anyone previously > tackled this problem before, and have some sample code to rebuild > the entire tree, but alphabetize or sort the entries in each level? > > Cheers, > > Marc Vose > Suzerain Studios > http://www.suzerain.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From tim_lists at o2group.com Thu Jul 31 04:02:59 2008 From: tim_lists at o2group.com (Tim Lieberman) Date: Thu, 31 Jul 2008 02:02:59 -0600 Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <1217465935.31939.15.camel@dan-linux-home.nycap.rr.com> References: <721f1cc50807300856r26551d88m424667cd446cd5fd@mail.gmail.com> <20080730170234.GA16170@panix.com> <78c6bd860807301046k1449e877p8cc61bfc0e48bf4c@mail.gmail.com> <1217465935.31939.15.camel@dan-linux-home.nycap.rr.com> Message-ID: On Jul 30, 2008, at 6:58 PM, Dan Horning wrote: > On Wed, 2008-07-30 at 18:54 -0600, Tim Lieberman wrote: >> Well, actually, my setup is a little more complicated (it compiles a >> bunch of things, openssl, zlib, mhash, etc, then builds apache and >> php, linking against the various libraries) >> >> If anyone's interested, I can try to document them and up them up on >> the web somehwere. > > I'd love to see that!! > > maybe even turn it into a phundamentals doc... > > just my thoughts. http://blog.electricmindcontrol.net/2008/07/building-apache-22-and- php-5-with-openssl-and-other-handy-modules-and-libraries/ You made me create a blog (for myself, done a dozen for others). I'm one of "those people" now. Enjoy the build scripts while your soul burns in a fiery lake :-) -Tim From ajai at bitblit.net Thu Jul 31 09:38:23 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 31 Jul 2008 09:38:23 -0400 (EDT) Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: <20080730170234.GA16170@panix.com> Message-ID: On Wed, 30 Jul 2008, Daniel Convissor wrote: > > I am dissatisfied with CentOS' conservatism -- I guess it's not for me -- > > but installing another distro based on a hunch that it might help seems like > > overkill, doesn't it? > > Yeah, there are many Linux distros that really suck at updating packages. > You can always compile PHP yourself. I think CentOS (and other RedHat-derived distros) all suffer from this problem. (I had the same problem with Ruby packages too). That's why I stopped using those distros a few years ago. I now use Gentoo. -- Aj. From ajai at bitblit.net Thu Jul 31 09:40:54 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 31 Jul 2008 09:40:54 -0400 (EDT) Subject: [nycphp-talk] upgrading PHP on CentOS 5 -- or should I? In-Reply-To: Message-ID: On Wed, 30 Jul 2008, Tim Lieberman wrote: > That's why you write build scripts. Especially for a minor version > update, my upgrade procedure is: Yeah, I tried this when I still used RedHat-derived distros. Its doable if you only have one or two servers, but not if you have more to update. Hence the attraction of source-based distros. -- Aj. From 1j0lkq002 at sneakemail.com Thu Jul 31 16:15:47 2008 From: 1j0lkq002 at sneakemail.com (inforequest) Date: 31 Jul 2008 20:15:47 -0000 Subject: [nycphp-talk] open source event calendar code? Message-ID: <20193-13869@sneakemail.com> I'm looking to build a new web-based event calendar system, and would appreciate suggestions for an existing quality code base from which to build it. I'm not looking for general framework suggestions as much as an existing system that is well-coded and worthy of adoption/mimicry for this kind of app. Typical add - manage - publish - integrate & cross-reference stuff for events, hopefully including some handling of recurrence/venues/etc. PHP and MySQL preferred, Python and PostgreSQL ok if the PHP folks recommend it in this case, ZF is fine... CalDAV should on the roadmap at least if it's already an even calendar. I don't mean to trivialize development.. but this is a personal project for an amateur coder (me) and I simply hate building upon something that smart developers later tell me at a NYPHP gathering was poorly written, badly coded, or completely stupid ;-) Thanks in advance for the guidance! -=john andrews I love PHP but I love SEO more... From ajai at bitblit.net Thu Jul 31 17:10:06 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 31 Jul 2008 17:10:06 -0400 (EDT) Subject: [nycphp-talk] open source event calendar code? In-Reply-To: <20193-13869@sneakemail.com> Message-ID: On 31 Jul 2008, inforequest wrote: > I'm looking to build a new web-based event calendar system, and would appreciate suggestions for an existing quality code base from which to build it. http://www.k5n.us/webcalendar.php -- Aj.