From ps at sun-code.com Tue Jan 1 09:45:48 2008 From: ps at sun-code.com (Peter Sawczynec) Date: Tue, 1 Jan 2008 09:45:48 -0500 Subject: [nycphp-talk] [OT] Select Highlights Global Disruptive Tech Message-ID: <001201c84c84$ffe1a0b0$ffa4e210$@com> Adobe Air :: http://labs.adobe.com/technologies/air/ Google Gears :: http://gears.google.com/ MS Silverlight :: http://silverlight.net/ BT Vision :: http://www.btvision.bt.com/vision/index.htm Orange :: http://www.orange.co.uk/ O2 :: http://www.o2.co.uk/ Skype :: http://www.skype.com/intl/en-gb/ Truphone :: http://www.truphone.com/ Jahja :: http://www.jajah.com/ XO Laptop :: http://www.laptopgiving.org/en/explore.php ASUS EEE PC :: http://event.asus.com/eeepc/microsites/en/index.htm :()> hpy nu yr n grrrt tidings 2 u n urs Warmest regards, ? Peter Sawczynec Technology Dir. Sun-code Interactive Sun-code.com 646.316.3678 ps at sun-code.com From jonathanw at amoeba.co.za Tue Jan 1 12:15:47 2008 From: jonathanw at amoeba.co.za (Jonathan Wagener) Date: Tue, 1 Jan 2008 19:15:47 +0200 Subject: [nycphp-talk] PHP multiple image upload using a zip file In-Reply-To: References: Message-ID: Hi, i am trying to add a function my gallery app that i builkt in php/mysql to allow people to upload a zip file of JPG images and the system would extract the JPGs, rename them, reference them in MySQL, create thumbnails, and then move the images to their directories. I have seen this function in all the galleries that i have looked at and have googled the problem but i have not found a good answer. I have been struggling with this issue for two days now. Jonathan Wagener Web Developer / Architect Amoeba Business Solutions Cell: +27 72 928 0513 Office: +27 21 785 1424 Web: www.amoeba.co.za Blog: www.espresso-online.info -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of talk-request at lists.nyphp.org Sent: 01 January 2008 19:15 To: talk at lists.nyphp.org Subject: talk Digest, Vol 15, Issue 1 Send talk mailing list submissions to talk at lists.nyphp.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.nyphp.org/mailman/listinfo/talk or, via email, send a message with subject or body 'help' to talk-request at lists.nyphp.org You can reach the person managing the list at talk-owner at lists.nyphp.org When replying, please edit your Subject line so it is more specific than "Re: Contents of talk digest..." Today's Topics: 1. OT: MidwestSource?? (Thomas O'Neill) 2. [OT] Select Highlights Global Disruptive Tech (Peter Sawczynec) ---------------------------------------------------------------------- Message: 1 Date: Mon, 31 Dec 2007 14:24:44 -0600 From: "Thomas O'Neill" Subject: [nycphp-talk] OT: MidwestSource?? To: "NYPHP Talk" Message-ID: Content-Type: text/plain; charset="iso-8859-1" First off I want to apologize for the blatant solicitation. I have been actively following this list for about 4 years and have found the discussion on all things web development related an outstanding resource. The group has great participation and members that often provide excellent advice to the PHP development community. I hope that I am not out of line seeking some business advice. I work for a growing web development company in Minneapolis, MN (4+ years 45+ employees) and we are looking to expand our customer base to the east coast. Does anyone have any suggestions for a company rooted in the Midwest to get in on the action out east? Does anyone need a partner to supplement their workload? We are an agile development shop with ~30 programmers that bills ~1000 hours/week. Thomas O'Neill Director of Software Development Sierra Bravo Corporation http://www.sierra-bravo.com Email: toneill at sierra-bravo.com Cell: (612) 327-0574 Direct: (952) 567-6316 Main Office: (952) 948-1211 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.nyphp.org/pipermail/talk/attachments/20071231/4d1e7323/attachment-0001.html ------------------------------ Message: 2 Date: Tue, 1 Jan 2008 09:45:48 -0500 From: "Peter Sawczynec" Subject: [nycphp-talk] [OT] Select Highlights Global Disruptive Tech To: "'Org, Talk at Nyphp.'" Message-ID: <001201c84c84$ffe1a0b0$ffa4e210$@com> Content-Type: text/plain; charset="iso-8859-1" Adobe Air :: http://labs.adobe.com/technologies/air/ Google Gears :: http://gears.google.com/ MS Silverlight :: http://silverlight.net/ BT Vision :: http://www.btvision.bt.com/vision/index.htm Orange :: http://www.orange.co.uk/ O2 :: http://www.o2.co.uk/ Skype :: http://www.skype.com/intl/en-gb/ Truphone :: http://www.truphone.com/ Jahja :: http://www.jajah.com/ XO Laptop :: http://www.laptopgiving.org/en/explore.php ASUS EEE PC :: http://event.asus.com/eeepc/microsites/en/index.htm :()> hpy nu yr n grrrt tidings 2 u n urs Warmest regards, ? Peter Sawczynec Technology Dir. Sun-code Interactive Sun-code.com 646.316.3678 ps at sun-code.com ------------------------------ _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk End of talk Digest, Vol 15, Issue 1 *********************************** From ramons at gmx.net Tue Jan 1 13:36:44 2008 From: ramons at gmx.net (David Krings) Date: Tue, 01 Jan 2008 13:36:44 -0500 Subject: [nycphp-talk] PHP multiple image upload using a zip file In-Reply-To: References: Message-ID: <477A883C.80201@gmx.net> Jonathan Wagener wrote: > Hi, i am trying to add a function my gallery app that i builkt in php/mysql to allow people to upload a zip file of JPG images and the system would extract the JPGs, rename them, reference them in MySQL, create thumbnails, and then move the images to their directories. > > I have seen this function in all the galleries that i have looked at and have googled the problem but i have not found a good answer. I have been struggling with this issue for two days now. > > Jonathan Wagener Hi! I added this to my piviviewer app (Picture & Video Viewer) and it works great. I call the feature 'turboload' as I managed to jam 800 jpegs straight from my camera into my system within a matter of minutes. I store the images with a dummy name so that I can later query for it and add the description and search tags whenever I like. I attached the two scripts that show the upload form allowing for both direct upload or using the cURL library to obtain the file from somewhere else (for example the FTP server that is on the web server, so one can first upload via FTP and then load from the same box, which makes things much quicker within the app). The zip library is then used to unzip the files and add them to the system. I also use exif to read out the date stamp as I let my system arrange the uploaded images in a directory structure that is based on year and month. That way I have at least some structure that I can outside of the app. In case you wonder, I made my app to be language aware so that some of the queries go to language dependent tables. The current user language and some of the basic file paths are stored in $_SESSION, so you will find several references to $_SESSION. You can just ignore all that stuff and pick out what you need. My scripts are extensively commented, which helps me a lot. I first write the comment for the next step to take and then write the code for it. Oh, and 80% of these scripts are from NYPHP anyway, so if you find it useful, thank the good helpers on this list. The remaining 20% are the comments, hehe. David -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: turboloadpics.php URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: tlsubmit.php URL: From nynj.tech at hotmail.com Tue Jan 1 23:36:34 2008 From: nynj.tech at hotmail.com (chad qian) Date: Tue, 1 Jan 2008 23:36:34 -0500 Subject: [nycphp-talk] simple form action Message-ID: Here is the one PHP page code
......
When people click "submit", I want to execute the first php coding part above . so,form action=what? Thanks! chad _________________________________________________________________ Share life as it happens with the new Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_122007 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenrbnsn at rbnsn.com Tue Jan 1 23:42:01 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Tue, 01 Jan 2008 23:42:01 -0500 Subject: [nycphp-talk] simple form action In-Reply-To: References: Message-ID: At 11:36 PM 1/1/2008, chad qian wrote: >Here is the one PHP page code >..... >.... >...... >?> > >
>...... > >
> >When people click "submit", I want to execute the first php coding >part above . >so,form action=what? You can just leave the action attribute out of the
tag and it will be submitted to the same script. Make sure you test that the form was submitted before trying to process it. ... Ken -------------- next part -------------- An HTML attachment was scrubbed... URL: From codeshepherd at gmail.com Wed Jan 2 09:56:13 2008 From: codeshepherd at gmail.com (=?ISO-8859-1?Q?Dee=FEan_Chakravarthy?=) Date: Wed, 02 Jan 2008 22:56:13 +0800 Subject: [nycphp-talk] OT: MidwestSource?? In-Reply-To: References: Message-ID: <477BA60D.6040003@gmail.com> Thomas O'Neill wrote: > First off I want to apologize for the blatant solicitation. I have > been actively following this list for about 4 years and have found the > discussion on all things web development related an outstanding > resource. The group has great participation and members that often > provide excellent advice to the PHP development community. I hope > that I am not out of line seeking some business advice. I work for a > growing web development company in Minneapolis, MN (4+ years 45+ > employees) and we are looking to expand our customer base to the east > coast. Does anyone have any suggestions for a company rooted in the > Midwest to get in on the action out east? Does anyone need a partner > to supplement their workload? We are an agile development shop with > ~30 programmers that bills ~1000 hours/week. Hi Thomas, You might want to try assembla.com or other similar sites. -- Deepan http://sudoku-solver.net/ From aw at sap8.com Wed Jan 2 10:56:12 2008 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 2 Jan 2008 10:56:12 -0500 Subject: [nycphp-talk] OT: MidwestSource?? In-Reply-To: <477BA60D.6040003@gmail.com> References: <477BA60D.6040003@gmail.com> Message-ID: <007f01c84d58$003abf50$00b03df0$@com> Also try the NYPHPJobs mailing list. Good resource if you got talent and people want to share the workload with your organization. Anthony Wlodarski Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Dee?an Chakravarthy Sent: Wednesday, January 02, 2008 9:56 AM To: NYPHP Talk Subject: Re: [nycphp-talk] OT: MidwestSource?? Thomas O'Neill wrote: > First off I want to apologize for the blatant solicitation. I have > been actively following this list for about 4 years and have found the > discussion on all things web development related an outstanding > resource. The group has great participation and members that often > provide excellent advice to the PHP development community. I hope > that I am not out of line seeking some business advice. I work for a > growing web development company in Minneapolis, MN (4+ years 45+ > employees) and we are looking to expand our customer base to the east > coast. Does anyone have any suggestions for a company rooted in the > Midwest to get in on the action out east? Does anyone need a partner > to supplement their workload? We are an agile development shop with > ~30 programmers that bills ~1000 hours/week. Hi Thomas, You might want to try assembla.com or other similar sites. -- Deepan http://sudoku-solver.net/ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From tgales at tgaconnect.com Wed Jan 2 11:11:30 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 02 Jan 2008 11:11:30 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java Message-ID: <477BB7B2.7090101@tgaconnect.com> Thought this might be of interest: http://php.sys-con.com/read/457324.htm James Anderson writes (in his response to the article): The really simple answer is that after the release of php 5, php became the better language... -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From jmcgraw1 at gmail.com Wed Jan 2 11:56:59 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 2 Jan 2008 11:56:59 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477BB7B2.7090101@tgaconnect.com> References: <477BB7B2.7090101@tgaconnect.com> Message-ID: Pure flame-bait and total non-article used to drive traffic to sys-con.com. Not worth a glance IMO. - jake On Jan 2, 2008 11:11 AM, Tim Gales < tgales at tgaconnect.com> wrote: > Thought this might be of interest: > http://php.sys-con.com/read/457324.htm > > James Anderson writes (in his response to the article): The really > simple answer is that after the release > of php 5, php became the better language... > > > -- > > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.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 ken at secdat.com Wed Jan 2 12:08:53 2008 From: ken at secdat.com (Kenneth Downs) Date: Wed, 02 Jan 2008 12:08:53 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: References: <477BB7B2.7090101@tgaconnect.com> Message-ID: <477BC525.2090203@secdat.com> Agreed, content-free. Lots of ads. Jake McGraw wrote: > Pure flame-bait and total non-article used to drive traffic to > sys-con.com . Not worth a glance IMO. > > - jake > > On Jan 2, 2008 11:11 AM, Tim Gales < tgales at tgaconnect.com > > wrote: > > Thought this might be of interest: > http://php.sys-con.com/read/457324.htm > > James Anderson writes (in his response to the article): The really > simple answer is that after the release > of php 5, php became the better language... > > > -- > > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tgales at tgaconnect.com Wed Jan 2 12:26:05 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 02 Jan 2008 12:26:05 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: References: <477BB7B2.7090101@tgaconnect.com> Message-ID: <477BC92D.1020009@tgaconnect.com> Jake McGraw wrote: > Pure flame-bait and total non-article sorry, I thought the part about Java's multitudinous specialty "collection" classes versus using an 'Array()' type which is simpler and faster was a valid point -- my mistake. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From ben at projectskyline.com Wed Jan 2 12:28:49 2008 From: ben at projectskyline.com (Ben Sgro) Date: Wed, 02 Jan 2008 12:28:49 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477BB7B2.7090101@tgaconnect.com> References: <477BB7B2.7090101@tgaconnect.com> Message-ID: <477BC9D1.8040100@projectskyline.com> Right on, I read that and was, woah, when does the article start...looking for a link the "page 2 >>" trash. Tim Gales wrote: > Thought this might be of interest: > http://php.sys-con.com/read/457324.htm > > James Anderson writes (in his response to the article): The really > simple answer is that after the release > of php 5, php became the better language... > > From jmcgraw1 at gmail.com Wed Jan 2 12:37:08 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 2 Jan 2008 12:37:08 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477BC92D.1020009@tgaconnect.com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> Message-ID: Tim: You're not to fault, and the point about Java collections Vs array() is pretty good, unfortunately, I never made it that far because I was completely turned off by the "article", the exact text Tim was referring to: James Anderson wrote: The really simple answer is that after the release of php 5, php became the better language. Just one example -- collections; php has one all purpose collection type which is an array/hash/stack or queue depending on how you choose to use it, and, as you can store any object or another array in the array it handles any type of tree. Java on the other hand has:- ArrayList, AttributeList, BeanContextSupport, CopyOnWriteArrayList, CopyOnWriteArraySet, DelayQueue, EnumSet, HashSet, LinkedHashSet, LinkedList, PriorityQueue, RoleList, RoleUnresolvedList, Stack, TreeSet, Vector etc. etc. and this is only from the official " java.util....." there are thousands of other "collection" classes out there. Nearly of the functionality provided by this mass of classes is available in php's 'Array()' type. And php does it faster! - jake On Jan 2, 2008 12:26 PM, Tim Gales wrote: > Jake McGraw wrote: > > Pure flame-bait and total non-article > > sorry, I thought the part about Java's > multitudinous specialty "collection" classes > versus using an 'Array()' type which is > simpler and faster was a valid point -- > my mistake. > > -- > > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.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 ken at secdat.com Wed Jan 2 12:40:26 2008 From: ken at secdat.com (Kenneth Downs) Date: Wed, 02 Jan 2008 12:40:26 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> Message-ID: <477BCC8A.4020201@secdat.com> Jake McGraw wrote: > Tim: > > You're not to fault, and the point about Java collections Vs array() > is pretty good, unfortunately, I never made it that far because I was > completely turned off by the "article", the exact text Tim was > referring to: > > James Anderson wrote: The really simple answer is that after the > release of php 5, php became the better language. Just one example -- > collections; php has one all purpose collection type which is an > array/hash/stack or queue depending on how you choose to use it, and, > as you can store any object or another array in the array it handles > any type of tree. Java on the other hand has:- ArrayList, > AttributeList, BeanContextSupport, CopyOnWriteArrayList, > CopyOnWriteArraySet, DelayQueue, EnumSet, HashSet, LinkedHashSet, > LinkedList, PriorityQueue, RoleList, RoleUnresolvedList, Stack, > TreeSet, Vector etc. etc. and this is only from the official > "java.util....." there are thousands of other "collection" classes out > there. Nearly of the functionality provided by this mass of classes is > available in php's 'Array()' type. And php does it faster! This more or less sums up my entire purpose in using PHP. And the philosophy behind that leads to numerous other features that makes it easier. > > - jake > > On Jan 2, 2008 12:26 PM, Tim Gales > wrote: > > Jake McGraw wrote: > > Pure flame-bait and total non-article > > sorry, I thought the part about Java's > multitudinous specialty "collection" classes > versus using an 'Array()' type which is > simpler and faster was a valid point -- > my mistake. > > -- > > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw at sap8.com Wed Jan 2 13:01:06 2008 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 2 Jan 2008 13:01:06 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477BB7B2.7090101@tgaconnect.com> References: <477BB7B2.7090101@tgaconnect.com> Message-ID: <00be01c84d69$726a40d0$573ec270$@com> This article was funny and yet sad... I thoroughly enjoyed the Ajax world popup that crashed my I.E. when I clicked on 'close this window'. When we were evaluating on how to build our internal apps a big part of the decision came on how we would continue support on the back end we decided to go against Java. Working with Java for web applications is like pulling a toe nail with a pair of pliers, not fun stuff. Setting up a prepackaged system in LAMP or using Xxamp depending on your platform is much easier than getting an environment working for JSP type pages. Even compiling Apache/PHP/MySQL from source is easier than working with Java web technologies. My .02 on the matter. Anthony Wlodarski 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Tim Gales Sent: Wednesday, January 02, 2008 11:12 AM To: NYPHP Talk Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java Thought this might be of interest: http://php.sys-con.com/read/457324.htm James Anderson writes (in his response to the article): The really simple answer is that after the release of php 5, php became the better language... -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ramons at gmx.net Wed Jan 2 15:44:56 2008 From: ramons at gmx.net (David Krings) Date: Wed, 02 Jan 2008 15:44:56 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477BB7B2.7090101@tgaconnect.com> References: <477BB7B2.7090101@tgaconnect.com> Message-ID: <477BF7C8.6070007@gmx.net> I found this article also a waste of bandwidth. What is even more sad than the contents (or the lack thereof) is that the writer couldn't answer the question he put out. I started learning Java and got reminded at my dreadful experiences with C. Java inherited all the crappy, annoying stuff from C and managed to make it even more complicated. PHP is much easier to use and understand. There is often a function for pretty much anything and adding a library is as easy as removing a semicolon or dropping a file where all the others are and adding a line to the ini file. I started programming on the C64 with BASIC, then learned Logo, then did a bit assembler on the 64. Later I did Pascal on the Apple IIe (in high school), then did MS-BASIC, then looked at the early stages of Delphi, and did ANSI C as well as Assembler on the 8088 at the university. Later I was forced to find my way through ObjectPAL after the only developer who knew it quit, then tried my luck with VB6 and VB.NET, and took a stab at Java. During all these times I loathed programming with every fiber of my being. It was always dumb, cumbersome, complicated, difficult to understand, or did not have enough features or didn't give access to other resources. I absolutely hate programming. Then came a course on E-business during my MS degree and I decided to program a web app as project. I found PHP and since then I am in constant awe as how easy and powerful application development can be. PHP is easy, it offers a lot, it just works, and it doesn't drive one nuts with this compiling and linking crap like C, doesn't require to write 50 lines of code first to get "Hello World" on screen as it is with Java, and doesn't cost hundreds of bucks like VS. Back then I was impressed by Delphi, but today I think the GUIs of Delphi apps suck and Delphi is becoming irrelevant quickly. Oh, and none can really be used easily for web development - unlike PHP. The kids that pick PHP aren't just cool, they are above all damn smart. Java is the language of choice for masochists. David From felix.shnir at gmail.com Wed Jan 2 15:53:04 2008 From: felix.shnir at gmail.com (Felix Shnir) Date: Wed, 2 Jan 2008 15:53:04 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477BF7C8.6070007@gmx.net> References: <477BB7B2.7090101@tgaconnect.com> <477BF7C8.6070007@gmx.net> Message-ID: Jeez, whats up with all the Java hating today? First, LUG, now PHP list. This article is a useless rant and indeed a waste of bandwidth, but the constant Java sux in this and PHP rules in that conversation is a lot more annoying simply because it is an irrelevant flame war. This is a PHP list, lets stick to it. Felix. On Jan 2, 2008 3:44 PM, David Krings wrote: > I found this article also a waste of bandwidth. What is even more sad than > the > contents (or the lack thereof) is that the writer couldn't answer the > question > he put out. I started learning Java and got reminded at my dreadful > experiences with C. Java inherited all the crappy, annoying stuff from C > and > managed to make it even more complicated. PHP is much easier to use and > understand. There is often a function for pretty much anything and adding > a > library is as easy as removing a semicolon or dropping a file where all > the > others are and adding a line to the ini file. > I started programming on the C64 with BASIC, then learned Logo, then did a > bit > assembler on the 64. Later I did Pascal on the Apple IIe (in high school), > then did MS-BASIC, then looked at the early stages of Delphi, and did ANSI > C > as well as Assembler on the 8088 at the university. Later I was forced to > find > my way through ObjectPAL after the only developer who knew it quit, then > tried > my luck with VB6 and VB.NET, and took a stab at Java. During all these > times I > loathed programming with every fiber of my being. It was always dumb, > cumbersome, complicated, difficult to understand, or did not have enough > features or didn't give access to other resources. I absolutely hate > programming. > Then came a course on E-business during my MS degree and I decided to > program > a web app as project. I found PHP and since then I am in constant awe as > how > easy and powerful application development can be. PHP is easy, it offers a > lot, it just works, and it doesn't drive one nuts with this compiling and > linking crap like C, doesn't require to write 50 lines of code first to > get > "Hello World" on screen as it is with Java, and doesn't cost hundreds of > bucks > like VS. Back then I was impressed by Delphi, but today I think the GUIs > of > Delphi apps suck and Delphi is becoming irrelevant quickly. Oh, and none > can > really be used easily for web development - unlike PHP. > > The kids that pick PHP aren't just cool, they are above all damn smart. > Java > is the language of choice for masochists. > > David > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Wed Jan 2 15:59:22 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Wed, 02 Jan 2008 15:59:22 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477BB7B2.7090101@tgaconnect.com> References: <477BB7B2.7090101@tgaconnect.com> Message-ID: <477BFB2A.7070504@beezifies.com> Tim Gales wrote: > Thought this might be of interest: > http://php.sys-con.com/read/457324.htm > > James Anderson writes (in his response to the article): The really > simple answer is that after the release of php 5, php became the > better language... I wasn't aware that PHP was the cool language. I thought the "cool" language was Ruby. Personally, I tend not to be a fan of the "cool" language because it means you either pay an arm and a leg for programmers, or you pay to train someone on your project so they can charge an arm and a leg for other projects. Java has it's place, I like it for cross platform development, but for a website you don't need a cross platform CGI language, you just need a language which runs on your server. I think Java is getting hit on two sides. On the webside, Ruby is now the "cool" langauge that everyone wants to program in so they can charge lots of money, while for graphical apps Flash is becoming the cross platform tool of choice. From ka at kacomputerconsulting.com Wed Jan 2 16:02:44 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Wed, 2 Jan 2008 13:02:44 -0800 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java Message-ID: <1199307764.12160@coral.he.net> Next I trust we can look forward to a bracing discussion on why "cool kids" use Phillips screwdrivers instead of blowtorches to open their computer cases? -- Kristina > Tim Gales wrote: > > Thought this might be of interest: > > http://php.sys-con.com/read/457324.htm > > > > James Anderson writes (in his response to the article): The really > > simple answer is that after the release of php 5, php became the > > better language... > > I wasn't aware that PHP was the cool language. I thought the "cool" > language was Ruby. > > Personally, I tend not to be a fan of the "cool" language because it > means you either pay an arm and a leg for programmers, or you pay to > train someone on your project so they can charge an arm and a leg for > other projects. > > Java has it's place, I like it for cross platform development, but for a > website you don't need a cross platform CGI language, you just need a > language which runs on your server. > > I think Java is getting hit on two sides. On the webside, Ruby is now > the "cool" langauge that everyone wants to program in so they can charge > lots of money, while for graphical apps Flash is becoming the cross > platform tool of choice. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 gypsyfella at gmail.com Wed Jan 2 16:09:41 2008 From: gypsyfella at gmail.com (Erik Baker) Date: Wed, 2 Jan 2008 16:09:41 -0500 Subject: [nycphp-talk] Time Card / Scheduling Open Source Package Message-ID: <2dbcc80f0801021309p4500838akdaf3a7fb745ede97@mail.gmail.com> Hello All, I need to create a low-level time card & scheduling application. It will track contract employee hours, produce reports & time cards, and allow scheduling of contract employees. This is for contract employees who work in the entertainment field, so forms for director sign-off will be needed & some procedure built into the access of information and generation of reports. Does anyone know if parts of this already exist in Open Source projects? I would love not to have to start from scratch on this one. Erik -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Wed Jan 2 16:25:19 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Wed, 02 Jan 2008 16:25:19 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <1199307764.12160@coral.he.net> References: <1199307764.12160@coral.he.net> Message-ID: <477C013F.6040809@beezifies.com> So that is what I was doing wrong! No wonder the computer service reps keep telling me I voided my warranty when I added a hard drive to the system. Kristina Anderson wrote: > Next I trust we can look forward to a bracing discussion on why "cool > kids" use Phillips screwdrivers instead of blowtorches to open their > computer cases? > > -- Kristina > > From jmcgraw1 at gmail.com Wed Jan 2 16:38:22 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 2 Jan 2008 16:38:22 -0500 Subject: [nycphp-talk] Time Card / Scheduling Open Source Package In-Reply-To: <2dbcc80f0801021309p4500838akdaf3a7fb745ede97@mail.gmail.com> References: <2dbcc80f0801021309p4500838akdaf3a7fb745ede97@mail.gmail.com> Message-ID: Sounds pretty specific, how do you plan on utilizing PHP? Certainly not for interfacing with the card reading hardware, perhaps providing a web based system for administrators? As far as I know, the client side software should be provided with whatever hardware has been purchased (card readers, etc)... The server side software should be available via IBM or some other systems/HR company. - jake On Jan 2, 2008 4:09 PM, Erik Baker wrote: > Hello All, > > I need to create a low-level time card & scheduling application. It will > track contract employee hours, produce reports & time cards, and allow > scheduling of contract employees. This is for contract employees who work > in the entertainment field, so forms for director sign-off will be needed & > some procedure built into the access of information and generation of > reports. Does anyone know if parts of this already exist in Open Source > projects? I would love not to have to start from scratch on this one. > > > Erik > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 JJainschigg at cmp.com Wed Jan 2 17:03:57 2008 From: JJainschigg at cmp.com (JJainschigg at cmp.com) Date: Wed, 2 Jan 2008 17:03:57 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477C013F.6040809@beezifies.com> Message-ID: Neither - cool kids use Torx wrenches. (grin) John Jainschigg Director, Online Technology and New Business, Software Group Executive Director, CMP Metaverse CMP Technology, LLC 600 Community Drive Manhasset, New York 11030 Instant Message to: AIM: jjainschigg MSN: jjainschigg at cmp.com Skype: jjainschigg at cmp.com Voice call to: try first: 718-472-0788 try second: 917-405-3116 try third: 516-562-5617 email: jjainschigg at cmp.com www.ddj.com www.life20.net In Second Life -- Avatar Name: John Zhaoying Island: Dr Dobbs Island http://slurl.com/secondlife/Dr%20Dobbs%20Island/89/115/22 Fax: 516-467-8817 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Wed Jan 2 17:15:17 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Wed, 02 Jan 2008 17:15:17 -0500 Subject: [nycphp-talk] Time Card / Scheduling Open Source Package In-Reply-To: <2dbcc80f0801021309p4500838akdaf3a7fb745ede97@mail.gmail.com> References: <2dbcc80f0801021309p4500838akdaf3a7fb745ede97@mail.gmail.com> Message-ID: <477C0CF5.6050506@beezifies.com> Just about any project management software, such as BaseCamp, ActiveCollab, or Project Pier has time tracking abilities. Erik Baker wrote: > Hello All, > > I need to create a low-level time card & scheduling application. It > will track contract employee hours, produce reports & time cards, and > allow scheduling of contract employees. This is for contract > employees who work in the entertainment field, so forms for director > sign-off will be needed & some procedure built into the access of > information and generation of reports. Does anyone know if parts of > this already exist in Open Source projects? I would love not to have > to start from scratch on this one. > > > Erik > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 elharo at metalab.unc.edu Wed Jan 2 18:09:26 2008 From: elharo at metalab.unc.edu (Elliotte Rusty Harold) Date: Wed, 02 Jan 2008 18:09:26 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> Message-ID: <477C19A6.9020109@metalab.unc.edu> Jake McGraw wrote: > Tim: > > You're not to fault, and the point about Java collections Vs array() is > pretty good, unfortunately, I never made it that far because I was > completely turned off by the "article", the exact text Tim was referring > to: > > James Anderson wrote: The really simple answer is that after the release > of php 5, php became the better language. Oh really? From http://zestyping.livejournal.com/124503.html % cat equality.php % php equality.php a == b b != c a == c a == d b != d c != d (Of course, starting in version 5, Java began to mess up simple Aristotelian logic too, but not quite this badly.) -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From michael.southwell at nyphp.com Wed Jan 2 19:22:30 2008 From: michael.southwell at nyphp.com (Michael Southwell) Date: Wed, 02 Jan 2008 19:22:30 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477C19A6.9020109@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> Message-ID: <477C2AC6.2060203@nyphp.com> Elliotte Rusty Harold wrote: > Jake McGraw wrote: >> Tim: >> >> You're not to fault, and the point about Java collections Vs array() >> is pretty good, unfortunately, I never made it that far because I was >> completely turned off by the "article", the exact text Tim was >> referring to: >> >> James Anderson wrote: The really simple answer is that after the >> release of php 5, php became the better language. > > Oh really? From http://zestyping.livejournal.com/124503.html > > > % cat equality.php > > $a = 0; > $b = "eggs"; > $c = "spam"; > > print ($a == $b) ? "a == b\n" : "a != b\n"; > print ($b == $c) ? "b == c\n" : "b != c\n"; > print ($a == $c) ? "a == c\n" : "a != c\n"; > print ($a == $d) ? "a == d\n" : "a != d\n"; > print ($b == $d) ? "b == d\n" : "b != d\n"; > print ($c == $d) ? "c == d\n" : "c != d\n"; > > ?> > > % php equality.php > a == b > b != c > a == c > a == d > b != d > c != d > > (Of course, starting in version 5, Java began to mess up simple > Aristotelian logic too, but not quite this badly.) ah, no, these answers are exactly right, given that $a is an integer, $b and $c are strings, and $d is unset. $b and $c when converted to integers for the purpose of comparison in #1 and #3 turn into 0 (zero) so the comparisons are true. #2 compares two different strings and so is false. #4 compares 0 to the integer of unset and so is true. #5 and #6 compare strings to the string of unset and so are false. > > -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From mailinglists at caseysoftware.com Wed Jan 2 22:34:42 2008 From: mailinglists at caseysoftware.com (Keith Casey) Date: Wed, 2 Jan 2008 22:34:42 -0500 Subject: [nycphp-talk] Time Card / Scheduling Open Source Package In-Reply-To: <477C0CF5.6050506@beezifies.com> References: <2dbcc80f0801021309p4500838akdaf3a7fb745ede97@mail.gmail.com> <477C0CF5.6050506@beezifies.com> Message-ID: On Jan 2, 2008 5:15 PM, Gary Mort wrote: > Just about any project management software, such as BaseCamp, > ActiveCollab, or Project Pier has time tracking abilities. A bit biased on this one... former dotProject contributor and one of the founders of the new fork: web2project ( http://web2project.net/ ). Simply tracking time is easy. You can actually do that with Notepad using the LOG feature. It's what you do with it that's important. Scheduling and resource planning is one good step. Comparing against estimates is even better. Tracking estimates over time and learning people's biases for better estimating is the best of all. ;) dotProject and web2project do the first couple points. I'm working on a useful Estimation module now to automate what I've been doing by hand. kc -- D. Keith Casey Jr. CEO, CaseySoftware, LLC http://CaseySoftware.com From arzala at gmail.com Wed Jan 2 22:42:11 2008 From: arzala at gmail.com (Anirudh Zala) Date: Thu, 3 Jan 2008 09:12:11 +0530 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477C19A6.9020109@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> Message-ID: <200801030912.11259.arzala@gmail.com> On Thursday 03 Jan 2008 04:39:26 Elliotte Rusty Harold wrote: > Jake McGraw wrote: > > Tim: > > > > You're not to fault, and the point about Java collections Vs array() is > > pretty good, unfortunately, I never made it that far because I was > > completely turned off by the "article", the exact text Tim was referring > > to: > > > > James Anderson wrote: The really simple answer is that after the release > > of php 5, php became the better language. > > Oh really? From http://zestyping.livejournal.com/124503.html > > > % cat equality.php > > $a = 0; > $b = "eggs"; > $c = "spam"; > > print ($a == $b) ? "a == b\n" : "a != b\n"; > print ($b == $c) ? "b == c\n" : "b != c\n"; > print ($a == $c) ? "a == c\n" : "a != c\n"; > print ($a == $d) ? "a == d\n" : "a != d\n"; > print ($b == $d) ? "b == d\n" : "b != d\n"; > print ($c == $d) ? "c == d\n" : "c != d\n"; > > ?> > > % php equality.php > a == b > b != c > a == c > a == d > b != d > c != d > > (Of course, starting in version 5, Java began to mess up simple > Aristotelian logic too, but not quite this badly.) Seriously PHP is not for cool kids. You need to grow a bit to learn and understand it properly. I think PHP has chosen *different* rules to evaluate expressions and since those rules are bit different than other regular programming/scripting languages it is obvious that we can see this kind of opposition. From bz-gmort at beezifies.com Thu Jan 3 05:14:10 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Thu, 03 Jan 2008 05:14:10 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477C19A6.9020109@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> Message-ID: <477CB572.5040200@beezifies.com> Elliotte Rusty Harold wrote: > % cat equality.php > > $a = 0; > $b = "eggs"; > $c = "spam"; > > print ($a == $b) ? "a == b\n" : "a != b\n"; > print ($b == $c) ? "b == c\n" : "b != c\n"; > print ($a == $c) ? "a == c\n" : "a != c\n"; > print ($a == $d) ? "a == d\n" : "a != d\n"; > print ($b == $d) ? "b == d\n" : "b != d\n"; > print ($c == $d) ? "c == d\n" : "c != d\n"; > ?> > I don't see this as a problem, basically the issue being raised is: PHP does not have strong typing, this 0, NULL, and false are all equivalent(add a $d=false; to the definitions and everything still comes out with the same result). However, knowing that these 3 values are considered the same, you can replace 2 equal signs with 3, ===, and get the output your expecting. From aw at sap8.com Thu Jan 3 09:14:21 2008 From: aw at sap8.com (Anthony Wlodarski) Date: Thu, 3 Jan 2008 09:14:21 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477CB572.5040200@beezifies.com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477CB572.5040200@beezifies.com> Message-ID: <002401c84e12$ef88b1b0$ce9a1510$@com> Zesty Ping never learned === apparently. This one's for you Zesty: http://www.php.net/manual/en/language.operators.comparison.php "===" introduced type facing in php4 so it is a moot point or just poor reading skills on some developers parts if they missed this essential comparison operator... Anthony Wlodarski 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Gary Mort Sent: Thursday, January 03, 2008 5:14 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java Elliotte Rusty Harold wrote: > % cat equality.php > > $a = 0; > $b = "eggs"; > $c = "spam"; > > print ($a == $b) ? "a == b\n" : "a != b\n"; > print ($b == $c) ? "b == c\n" : "b != c\n"; > print ($a == $c) ? "a == c\n" : "a != c\n"; > print ($a == $d) ? "a == d\n" : "a != d\n"; > print ($b == $d) ? "b == d\n" : "b != d\n"; > print ($c == $d) ? "c == d\n" : "c != d\n"; > ?> > I don't see this as a problem, basically the issue being raised is: PHP does not have strong typing, this 0, NULL, and false are all equivalent(add a $d=false; to the definitions and everything still comes out with the same result). However, knowing that these 3 values are considered the same, you can replace 2 equal signs with 3, ===, and get the output your expecting. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/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 jmcgraw1 at gmail.com Thu Jan 3 09:29:47 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Thu, 3 Jan 2008 09:29:47 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <002401c84e12$ef88b1b0$ce9a1510$@com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477CB572.5040200@beezifies.com> <002401c84e12$ef88b1b0$ce9a1510$@com> Message-ID: I believe it was my Uncle Ben who once said "With great power comes great responsibility." PHP does things in a manner different than C or Java or Python or etc etc etc (that is why it is called PHP). There are features that some programmers believe are shortcomings, there are shortcomings that some programmers believe are features. Know the language and its quirks and you'll never get bitten, program with some "responsibility". - jake On Jan 3, 2008 9:14 AM, Anthony Wlodarski wrote: > Zesty Ping never learned === apparently. This one's for you Zesty: > > http://www.php.net/manual/en/language.operators.comparison.php > > "===" introduced type facing in php4 so it is a moot point or just poor > reading skills on some developers parts if they missed this essential > comparison operator... > > Anthony Wlodarski > 646-285-0500 x230 > aw at sap8.com > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Gary Mort > Sent: Thursday, January 03, 2008 5:14 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites > instead of Java > > Elliotte Rusty Harold wrote: > > % cat equality.php > > > > > $a = 0; > > $b = "eggs"; > > $c = "spam"; > > > > print ($a == $b) ? "a == b\n" : "a != b\n"; > > print ($b == $c) ? "b == c\n" : "b != c\n"; > > print ($a == $c) ? "a == c\n" : "a != c\n"; > > print ($a == $d) ? "a == d\n" : "a != d\n"; > > print ($b == $d) ? "b == d\n" : "b != d\n"; > > print ($c == $d) ? "c == d\n" : "c != d\n"; > > ?> > > > I don't see this as a problem, basically the issue being raised is: > PHP does not have strong typing, this 0, NULL, and false are all > equivalent(add a $d=false; to the definitions and everything still comes > out with the same result). > > However, knowing that these 3 values are considered the same, you can > replace 2 equal signs with 3, ===, and get the output your expecting. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 tgales at tgaconnect.com Thu Jan 3 10:43:33 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Thu, 03 Jan 2008 10:43:33 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <00be01c84d69$726a40d0$573ec270$@com> References: <477BB7B2.7090101@tgaconnect.com> <00be01c84d69$726a40d0$573ec270$@com> Message-ID: <477D02A5.7080106@tgaconnect.com> Anthony Wlodarski wrote: > This article was funny and yet sad... > Yes me too -- but for different reasons. I thought it was extremely immature to say "PHP is a better language". It is like trying to argue that a Phillips head screwdriver is a better screwdriver (as was mentioned) without taking in to account what type of screws are being used. I thought if I put that phrase about being a better language in the post everyone would know there might be a good portion of ill-informed (and childish) opinions in the article. Judging from some responses, that was more than a slight miscalculation on my part -- and none too smart. So let me say, in the words of the inimitable 'agent 86', "Sorry about that, Chief" -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From jeff at newnewmedia.com Thu Jan 3 10:54:34 2008 From: jeff at newnewmedia.com (Jeff Loiselle) Date: Thu, 3 Jan 2008 11:54:34 -0400 Subject: [nycphp-talk] Editing a PDF Message-ID: <9562C2D2-D264-4C6D-8333-EC61F7806EA4@newnewmedia.com> Hello, Can anyone recommend a package they've used (written in PHP, no extensions) to open a PDF, add a simple text header line, and save it? Regards, jeff From afischer at email.smith.edu Thu Jan 3 11:01:58 2008 From: afischer at email.smith.edu (Aaron Fischer) Date: Thu, 3 Jan 2008 11:01:58 -0500 Subject: [nycphp-talk] Editing a PDF In-Reply-To: <9562C2D2-D264-4C6D-8333-EC61F7806EA4@newnewmedia.com> References: <9562C2D2-D264-4C6D-8333-EC61F7806EA4@newnewmedia.com> Message-ID: <89A5CDDC-70C4-406B-B614-C7DA5207EAF9@email.smith.edu> I've had great success with this one: http://www.fpdf.org/ On Jan 3, 2008, at 10:54 AM, Jeff Loiselle wrote: > Hello, > > Can anyone recommend a package they've used (written in PHP, no > extensions) to open a PDF, add a simple text header line, and save it? > > Regards, > jeff From dlmerryweather at gmail.com Thu Jan 3 11:06:21 2008 From: dlmerryweather at gmail.com (David Merryweather) Date: Thu, 3 Jan 2008 10:06:21 -0600 Subject: [nycphp-talk] Editing a PDF In-Reply-To: <89A5CDDC-70C4-406B-B614-C7DA5207EAF9@email.smith.edu> References: <9562C2D2-D264-4C6D-8333-EC61F7806EA4@newnewmedia.com> <89A5CDDC-70C4-406B-B614-C7DA5207EAF9@email.smith.edu> Message-ID: <793b2bec0801030806u15e92019we45df9f93be8b403@mail.gmail.com> To open an existing PDF, you will need the FPDI library too. http://www.setasign.de/products/pdf-php-solutions/fpdi/ On Jan 3, 2008 10:01 AM, Aaron Fischer wrote: > I've had great success with this one: > http://www.fpdf.org/ > > > On Jan 3, 2008, at 10:54 AM, Jeff Loiselle wrote: > > > Hello, > > > > Can anyone recommend a package they've used (written in PHP, no > > extensions) to open a PDF, add a simple text header line, and save it? > > > > Regards, > > jeff > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- David Merryweather Vice President of Information Technologies Creative Education Institute, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Thu Jan 3 11:15:48 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 3 Jan 2008 11:15:48 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477CB572.5040200@beezifies.com> <002401c84e12$ef88b1b0$ce9a1510$@com> Message-ID: <8f0676b40801030815m1d2083aer6ee15869f696e407@mail.gmail.com> Rusty has a perfectly valid point, but comparing java and php in this regard is nonsensical because java is typed, php is not. I think a more relevant comparison is comparing the same code in other non-typed languages. JAVASCRIPT: var a = 0; var b = "eggs"; var c = "spam"; var d = null; var e = []; var f = "0"; console.log( (a == b) ? "a == b\n" : "a != b\n"); console.log( (b == c) ? "b == c\n" : "b != c\n"); console.log( (a == c) ? "a == c\n" : "a != c\n"); console.log( (a == d) ? "a == d\n" : "a != d\n"); console.log( (b == d) ? "b == d\n" : "b != d\n"); console.log( (c == d) ? "c == d\n" : "c != d\n"); console.log( !!e ? "empty arrays are true \n" : "empty arrays are false \n"); console.log( (a == f) ? "a == f\n" : "a != f\n"); Result: a != b b != c a != c a != d b != d c != d empty arrays are true a == f PYTHON: a = 0 b = "eggs" c = "spam" d = None e = [] f = "0" print( (a == b) and "a == b" or "a != b") print( (b == c) and "b == c" or "b != c") print( (a == c) and "a == c" or "a != c") print( (a == d) and "a == d" or "a != d") print( (b == d) and "b == d" or "b != d") print( (c == d) and "c == d" or "c != d") print( e and "empty arrays are true" or "empty arrays are false") print( (a == f) and "a == f" or "a != f") Result: a != b b != c a != c a != d b != d c != d empty arrays are false a != f Note that javascript and python fail if "d" is not defined. (PHP can be configured to do the same if that is what you want). I won't comment on which I think is best, but I know it sucks having to remember the quirks of each language for something as simple as "==". Regards, John Campbell From tedd at sperling.com Thu Jan 3 12:09:28 2008 From: tedd at sperling.com (tedd) Date: Thu, 3 Jan 2008 12:09:28 -0500 Subject: [nycphp-talk] Editing a PDF In-Reply-To: <9562C2D2-D264-4C6D-8333-EC61F7806EA4@newnewmedia.com> References: <9562C2D2-D264-4C6D-8333-EC61F7806EA4@newnewmedia.com> Message-ID: At 11:54 AM -0400 1/3/08, Jeff Loiselle wrote: >Hello, > >Can anyone recommend a package they've used (written in PHP, no >extensions) to open a PDF, add a simple text header line, and save >it? > >Regards, >jeff Arrggg, that's going to be difficult. The innards of pdf files are not trivial. You can use things like: http://www.fpdf.org/ to write your own, like this: http://webbytedd.com/bb/pdf/ But to take an existing PDF file and open it up and change something is much more complicated than you might think, or so I've found. If anyone disagrees, please provide me with an example to review. Sorry, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ioplex at gmail.com Thu Jan 3 12:12:30 2008 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 3 Jan 2008 12:12:30 -0500 Subject: [nycphp-talk] Editing a PDF In-Reply-To: <9562C2D2-D264-4C6D-8333-EC61F7806EA4@newnewmedia.com> References: <9562C2D2-D264-4C6D-8333-EC61F7806EA4@newnewmedia.com> Message-ID: <78c6bd860801030912h64bcc119g923f3a2ba4acbad2@mail.gmail.com> On 1/3/08, Jeff Loiselle wrote: > Hello, > > Can anyone recommend a package they've used (written in PHP, no > extensions) to open a PDF, add a simple text header line, and save it? I have not tried this myself but the Zend_Pdf component of Zend Framework can probably do what you want: http://framework.zend.com/manual/en/zend.pdf.html Note that even though ZF looks like you would have to commit to a whole new set of rules, there are actually little or no dependencies between components. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From afischer at email.smith.edu Thu Jan 3 14:07:52 2008 From: afischer at email.smith.edu (Aaron Fischer) Date: Thu, 3 Jan 2008 14:07:52 -0500 Subject: [nycphp-talk] Editing a PDF In-Reply-To: References: <9562C2D2-D264-4C6D-8333-EC61F7806EA4@newnewmedia.com> Message-ID: <0D40480B-E063-4B85-BB88-D59F6DB1F496@email.smith.edu> I use FPDF and FPDI to import existing PDFs and modify them. However, I agree it's probably not in the sense that you are referring to them Tedd. Basically it brings the PDF in as a template and then you can write to it, images or text for example. Everything I have done has involved writing text on an imported PDF template. Works great for that. Haven't tried to do anything like edit existing text, etc. Not sure if or how that would work with those packages. I too found that PDF appeared to be fairly complicated in terms of modifying and working with those files. The FPDF/FPDI packages allowed me to accomplish what I needed so I haven't had to go deeper. -A On Jan 3, 2008, at 12:09 PM, tedd wrote: > At 11:54 AM -0400 1/3/08, Jeff Loiselle wrote: >> Hello, >> >> Can anyone recommend a package they've used (written in PHP, no >> extensions) to open a PDF, add a simple text header line, and save >> it? >> >> Regards, >> jeff > > Arrggg, that's going to be difficult. The innards of pdf files are > not trivial. > > You can use things like: http://www.fpdf.org/ to write your own, > like this: > > http://webbytedd.com/bb/pdf/ > > But to take an existing PDF file and open it up and change something > is much more complicated than you might think, or so I've found. > > If anyone disagrees, please provide me with an example to review. > > Sorry, > > 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 jonathanw at amoeba.co.za Fri Jan 4 06:18:44 2008 From: jonathanw at amoeba.co.za (Jonathan Wagener) Date: Fri, 4 Jan 2008 13:18:44 +0200 Subject: [nycphp-talk] PHPThumb -- how does it work?? In-Reply-To: References: Message-ID: Hi, I would like to know how I can make phpthumb work, I don't really understand how it works. How do I make it create thumbnails? Kind regards, Jonathan Wagener Web Developer / Architect Amoeba Business Solutions Cell: +27 72 928 0513 Office: +27 21 785 1424 Web: www.amoeba.co.za Blog: www.espresso-online.info -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of talk-request at lists.nyphp.org Sent: 03 January 2008 18:01 To: talk at lists.nyphp.org Subject: talk Digest, Vol 15, Issue 6 Send talk mailing list submissions to talk at lists.nyphp.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.nyphp.org/mailman/listinfo/talk or, via email, send a message with subject or body 'help' to talk-request at lists.nyphp.org You can reach the person managing the list at talk-owner at lists.nyphp.org When replying, please edit your Subject line so it is more specific than "Re: Contents of talk digest..." Today's Topics: 1. Re: Why do "cool kids" choose PHP to build websites instead of Java (Elliotte Rusty Harold) 2. Re: Why do "cool kids" choose PHP to build websites instead of Java (Michael Southwell) 3. Re: Time Card / Scheduling Open Source Package (Keith Casey) 4. Re: Why do "cool kids" choose PHP to build websites instead of Java (Anirudh Zala) 5. Re: Why do "cool kids" choose PHP to build websites instead of Java (Gary Mort) 6. RE: Why do "cool kids" choose PHP to build websites instead of Java (Anthony Wlodarski) 7. Re: Why do "cool kids" choose PHP to build websites instead of Java (Jake McGraw) 8. Re: Why do "cool kids" choose PHP to build websites instead of Java (Tim Gales) ---------------------------------------------------------------------- Message: 1 Date: Wed, 02 Jan 2008 18:09:26 -0500 From: Elliotte Rusty Harold Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java To: NYPHP Talk Message-ID: <477C19A6.9020109 at metalab.unc.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Jake McGraw wrote: > Tim: > > You're not to fault, and the point about Java collections Vs array() > is pretty good, unfortunately, I never made it that far because I was > completely turned off by the "article", the exact text Tim was > referring > to: > > James Anderson wrote: The really simple answer is that after the > release of php 5, php became the better language. Oh really? From http://zestyping.livejournal.com/124503.html % cat equality.php % php equality.php a == b b != c a == c a == d b != d c != d (Of course, starting in version 5, Java began to mess up simple Aristotelian logic too, but not quite this badly.) -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ ------------------------------ Message: 2 Date: Wed, 02 Jan 2008 19:22:30 -0500 From: Michael Southwell Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java To: NYPHP Talk Message-ID: <477C2AC6.2060203 at nyphp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Elliotte Rusty Harold wrote: > Jake McGraw wrote: >> Tim: >> >> You're not to fault, and the point about Java collections Vs array() >> is pretty good, unfortunately, I never made it that far because I was >> completely turned off by the "article", the exact text Tim was >> referring to: >> >> James Anderson wrote: The really simple answer is that after the >> release of php 5, php became the better language. > > Oh really? From http://zestyping.livejournal.com/124503.html > > > % cat equality.php > > $a = 0; > $b = "eggs"; > $c = "spam"; > > print ($a == $b) ? "a == b\n" : "a != b\n"; > print ($b == $c) ? "b == c\n" : "b != c\n"; > print ($a == $c) ? "a == c\n" : "a != c\n"; > print ($a == $d) ? "a == d\n" : "a != d\n"; > print ($b == $d) ? "b == d\n" : "b != d\n"; > print ($c == $d) ? "c == d\n" : "c != d\n"; > > ?> > > % php equality.php > a == b > b != c > a == c > a == d > b != d > c != d > > (Of course, starting in version 5, Java began to mess up simple > Aristotelian logic too, but not quite this badly.) ah, no, these answers are exactly right, given that $a is an integer, $b and $c are strings, and $d is unset. $b and $c when converted to integers for the purpose of comparison in #1 and #3 turn into 0 (zero) so the comparisons are true. #2 compares two different strings and so is false. #4 compares 0 to the integer of unset and so is true. #5 and #6 compare strings to the string of unset and so are false. > > -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth ------------------------------ Message: 3 Date: Wed, 2 Jan 2008 22:34:42 -0500 From: "Keith Casey" Subject: Re: [nycphp-talk] Time Card / Scheduling Open Source Package To: "NYPHP Talk" Message-ID: Content-Type: text/plain; charset=ISO-8859-1 On Jan 2, 2008 5:15 PM, Gary Mort wrote: > Just about any project management software, such as BaseCamp, > ActiveCollab, or Project Pier has time tracking abilities. A bit biased on this one... former dotProject contributor and one of the founders of the new fork: web2project ( http://web2project.net/ ). Simply tracking time is easy. You can actually do that with Notepad using the LOG feature. It's what you do with it that's important. Scheduling and resource planning is one good step. Comparing against estimates is even better. Tracking estimates over time and learning people's biases for better estimating is the best of all. ;) dotProject and web2project do the first couple points. I'm working on a useful Estimation module now to automate what I've been doing by hand. kc -- D. Keith Casey Jr. CEO, CaseySoftware, LLC http://CaseySoftware.com ------------------------------ Message: 4 Date: Thu, 3 Jan 2008 09:12:11 +0530 From: Anirudh Zala Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java To: NYPHP Talk Message-ID: <200801030912.11259.arzala at gmail.com> Content-Type: text/plain; charset="utf-8" On Thursday 03 Jan 2008 04:39:26 Elliotte Rusty Harold wrote: > Jake McGraw wrote: > > Tim: > > > > You're not to fault, and the point about Java collections Vs array() is > > pretty good, unfortunately, I never made it that far because I was > > completely turned off by the "article", the exact text Tim was referring > > to: > > > > James Anderson wrote: The really simple answer is that after the release > > of php 5, php became the better language. > > Oh really? From http://zestyping.livejournal.com/124503.html > > > % cat equality.php > > $a = 0; > $b = "eggs"; > $c = "spam"; > > print ($a == $b) ? "a == b\n" : "a != b\n"; > print ($b == $c) ? "b == c\n" : "b != c\n"; > print ($a == $c) ? "a == c\n" : "a != c\n"; > print ($a == $d) ? "a == d\n" : "a != d\n"; > print ($b == $d) ? "b == d\n" : "b != d\n"; > print ($c == $d) ? "c == d\n" : "c != d\n"; > > ?> > > % php equality.php > a == b > b != c > a == c > a == d > b != d > c != d > > (Of course, starting in version 5, Java began to mess up simple > Aristotelian logic too, but not quite this badly.) Seriously PHP is not for cool kids. You need to grow a bit to learn and understand it properly. I think PHP has chosen *different* rules to evaluate expressions and since those rules are bit different than other regular programming/scripting languages it is obvious that we can see this kind of opposition. ------------------------------ Message: 5 Date: Thu, 03 Jan 2008 05:14:10 -0500 From: Gary Mort Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java To: NYPHP Talk Message-ID: <477CB572.5040200 at beezifies.com> Content-Type: text/plain; charset=UTF-8; format=flowed Elliotte Rusty Harold wrote: > % cat equality.php > > $a = 0; > $b = "eggs"; > $c = "spam"; > > print ($a == $b) ? "a == b\n" : "a != b\n"; > print ($b == $c) ? "b == c\n" : "b != c\n"; > print ($a == $c) ? "a == c\n" : "a != c\n"; > print ($a == $d) ? "a == d\n" : "a != d\n"; > print ($b == $d) ? "b == d\n" : "b != d\n"; > print ($c == $d) ? "c == d\n" : "c != d\n"; > ?> > I don't see this as a problem, basically the issue being raised is: PHP does not have strong typing, this 0, NULL, and false are all equivalent(add a $d=false; to the definitions and everything still comes out with the same result). However, knowing that these 3 values are considered the same, you can replace 2 equal signs with 3, ===, and get the output your expecting. ------------------------------ Message: 6 Date: Thu, 3 Jan 2008 09:14:21 -0500 From: "Anthony Wlodarski" Subject: RE: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java To: "'NYPHP Talk'" Message-ID: <002401c84e12$ef88b1b0$ce9a1510$@com> Content-Type: text/plain; charset="UTF-8" Zesty Ping never learned === apparently. This one's for you Zesty: http://www.php.net/manual/en/language.operators.comparison.php "===" introduced type facing in php4 so it is a moot point or just poor reading skills on some developers parts if they missed this essential comparison operator... Anthony Wlodarski 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Gary Mort Sent: Thursday, January 03, 2008 5:14 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java Elliotte Rusty Harold wrote: > % cat equality.php > > $a = 0; > $b = "eggs"; > $c = "spam"; > > print ($a == $b) ? "a == b\n" : "a != b\n"; > print ($b == $c) ? "b == c\n" : "b != c\n"; > print ($a == $c) ? "a == c\n" : "a != c\n"; > print ($a == $d) ? "a == d\n" : "a != d\n"; > print ($b == $d) ? "b == d\n" : "b != d\n"; > print ($c == $d) ? "c == d\n" : "c != d\n"; > ?> > I don't see this as a problem, basically the issue being raised is: PHP does not have strong typing, this 0, NULL, and false are all equivalent(add a $d=false; to the definitions and everything still comes out with the same result). However, knowing that these 3 values are considered the same, you can replace 2 equal signs with 3, ===, and get the output your expecting. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php ------------------------------ Message: 7 Date: Thu, 3 Jan 2008 09:29:47 -0500 From: "Jake McGraw" Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java To: "NYPHP Talk" Message-ID: Content-Type: text/plain; charset="iso-8859-1" I believe it was my Uncle Ben who once said "With great power comes great responsibility." PHP does things in a manner different than C or Java or Python or etc etc etc (that is why it is called PHP). There are features that some programmers believe are shortcomings, there are shortcomings that some programmers believe are features. Know the language and its quirks and you'll never get bitten, program with some "responsibility". - jake On Jan 3, 2008 9:14 AM, Anthony Wlodarski wrote: > Zesty Ping never learned === apparently. This one's for you Zesty: > > http://www.php.net/manual/en/language.operators.comparison.php > > "===" introduced type facing in php4 so it is a moot point or just poor > reading skills on some developers parts if they missed this essential > comparison operator... > > Anthony Wlodarski > 646-285-0500 x230 > aw at sap8.com > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Gary Mort > Sent: Thursday, January 03, 2008 5:14 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites > instead of Java > > Elliotte Rusty Harold wrote: > > % cat equality.php > > > > > $a = 0; > > $b = "eggs"; > > $c = "spam"; > > > > print ($a == $b) ? "a == b\n" : "a != b\n"; > > print ($b == $c) ? "b == c\n" : "b != c\n"; > > print ($a == $c) ? "a == c\n" : "a != c\n"; > > print ($a == $d) ? "a == d\n" : "a != d\n"; > > print ($b == $d) ? "b == d\n" : "b != d\n"; > > print ($c == $d) ? "c == d\n" : "c != d\n"; > > ?> > > > I don't see this as a problem, basically the issue being raised is: > PHP does not have strong typing, this 0, NULL, and false are all > equivalent(add a $d=false; to the definitions and everything still comes > out with the same result). > > However, knowing that these 3 values are considered the same, you can > replace 2 equal signs with 3, ===, and get the output your expecting. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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: http://lists.nyphp.org/pipermail/talk/attachments/20080103/382c8da9/atta chment-0001.html ------------------------------ Message: 8 Date: Thu, 03 Jan 2008 10:43:33 -0500 From: Tim Gales Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java To: NYPHP Talk Message-ID: <477D02A5.7080106 at tgaconnect.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Anthony Wlodarski wrote: > This article was funny and yet sad... > Yes me too -- but for different reasons. I thought it was extremely immature to say "PHP is a better language". It is like trying to argue that a Phillips head screwdriver is a better screwdriver (as was mentioned) without taking in to account what type of screws are being used. I thought if I put that phrase about being a better language in the post everyone would know there might be a good portion of ill-informed (and childish) opinions in the article. Judging from some responses, that was more than a slight miscalculation on my part -- and none too smart. So let me say, in the words of the inimitable 'agent 86', "Sorry about that, Chief" -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com ------------------------------ _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk End of talk Digest, Vol 15, Issue 6 *********************************** From ramons at gmx.net Fri Jan 4 07:01:09 2008 From: ramons at gmx.net (David Krings) Date: Fri, 04 Jan 2008 07:01:09 -0500 Subject: [nycphp-talk] PHPThumb -- how does it work?? In-Reply-To: References: Message-ID: <477E2005.7030801@gmx.net> Jonathan Wagener wrote: > Hi, I would like to know how I can make phpthumb work, I don't really > understand how it works. How do I make it create thumbnails? > Hi! I can't answer your question, but I know about an alternative. You can use exif to read out the thumbnail from jpegs and then display that. The thumbnail is stored as a string, but PHP has functions for that. I put this together with a lot of help from the smart people from NYPHP. This is the piece of code that displays the thumbnail // Show thumbnail $exifthumbnail = exif_thumbnail($totalpath, $exifwidth, $exifheight, $exiftype); if ($exifthumbnail !== FALSE) { echo "Thumbnail image"; echo "\n"; } else { echo "Thumbnail imageNo thumbnail available!\n"; } And that is piece of code that makes the thumbnail (reference above as tn.php): $totalpath is the path to the jped image, $degrees is the amount of degrees the thumbnail needs to be rotated (the same as the image, I specify the angle on image insert/edit, also some cameras have a sensor that stores it in the exif info), the $exif.... values are straight from the thumbnail info out of the exif header. I display all exif info in a table and show the thumbnail in the table cell centered with a border (see class for img tag). The really weird thing with this is that the img tag src value is a link to the tn.php script. Also a nice example where GET comes to the rescue where POST would be awfully complicated. HTH, David From ashaw at polymerdb.org Fri Jan 4 10:44:39 2008 From: ashaw at polymerdb.org (Allen Shaw) Date: Fri, 04 Jan 2008 09:44:39 -0600 Subject: [nycphp-talk] combining forum and list Message-ID: <477E5467.2040606@polymerdb.org> I'm looking for something similar to the lists/forums at mysql.com, in which forum messages are copied to the list, and list messages are copied to the forums. Anyone here know how they do that, or have clues on how it could be done? I'm helping out with a small community site currently running Joomla with Simple Machines Forum. Almost all the site usage is in the forums, but since it's a small community traffic is rather low (about 150 posts/month). There's been a suggestion that since some people prefer forums over email lists, and vice verse, we might be able to improve the conversation by allowing people to choose either format and still be kept in the mix. An alternative solution would be a Joomla or SMF plugin that would allow people to subscribe to the whole forum and get all posts by email. Even if they had to sign onto the forums to respond, they would at least be kept informed of the discussion just by checking email. Anyone have some leads on such a scheme? (Googling for keywords like forum and list has turned up nothing useful.) Thanks, Allen -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From phplists at jellyandcustard.com Fri Jan 4 10:51:17 2008 From: phplists at jellyandcustard.com (Khalid Hanif) Date: Fri, 4 Jan 2008 15:51:17 +0000 Subject: [nycphp-talk] combining forum and list In-Reply-To: <477E5467.2040606@polymerdb.org> References: <477E5467.2040606@polymerdb.org> Message-ID: Hi Allen, FUDForum ( http://fudforum.org/features.php ) has NNTP & Mailing List integration. It's written by Ilia A, one of the PHP Core developers, and has all the features you'd expect from a forum. Regards, Khalid On 4 Jan 2008, at 15:44, Allen Shaw wrote: > I'm looking for something similar to the lists/forums at mysql.com, > in which forum messages are copied to the list, and list messages > are copied to the forums. Anyone here know how they do that, or > have clues on how it could be done? > > I'm helping out with a small community site currently running > Joomla with Simple Machines Forum. Almost all the site usage is in > the forums, but since it's a small community traffic is rather low > (about 150 posts/month). There's been a suggestion that since some > people prefer forums over email lists, and vice verse, we might be > able to improve the conversation by allowing people to choose > either format and still be kept in the mix. > > An alternative solution would be a Joomla or SMF plugin that would > allow people to subscribe to the whole forum and get all posts by > email. Even if they had to sign onto the forums to respond, they > would at least be kept informed of the discussion just by checking > email. > > Anyone have some leads on such a scheme? (Googling for keywords > like forum and list has turned up nothing useful.) > > Thanks, > Allen > > -- > Allen Shaw > slidePresenter (http://slides.sourceforge.net) > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From bz-gmort at beezifies.com Fri Jan 4 11:10:06 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Fri, 04 Jan 2008 11:10:06 -0500 Subject: [nycphp-talk] combining forum and list In-Reply-To: <477E5467.2040606@polymerdb.org> References: <477E5467.2040606@polymerdb.org> Message-ID: <477E5A5E.6030009@beezifies.com> Allen Shaw wrote: > I'm looking for something similar to the lists/forums at mysql.com, in > which forum messages are copied to the list, and list messages are > copied to the forums. Anyone here know how they do that, or have > clues on how it could be done? > > I'm helping out with a small community site currently running Joomla > with Simple Machines Forum. Almost all the site usage is in the > forums, but since it's a small community traffic is rather low (about > 150 posts/month). There's been a suggestion that since some people > prefer forums over email lists, and vice verse, we might be able to > improve the conversation by allowing people to choose either format > and still be kept in the mix. > > FUDforum - you can subscribe forums to email lists and crosspost between the two. It has a simple API for logon, so integration with Joomla should be fairly simple. From randalrust at gmail.com Fri Jan 4 12:19:49 2008 From: randalrust at gmail.com (Randal Rust) Date: Fri, 4 Jan 2008 12:19:49 -0500 Subject: [nycphp-talk] POSTing with HTTP and PHP Message-ID: I've got a strange project that I'm working on for a school district. Apparently their CGI email program likes to add additional line breaks before processing the body of the email. It has something to do with the user having to indicate line breaks with a ^ symbol. Rather than just bore everyone with the details, I'll just ask my question. Can I send data via HTTP POST with the header() function? -- Randal Rust R.Squared Communications www.r2communications.com From ashaw at polymerdb.org Fri Jan 4 12:27:50 2008 From: ashaw at polymerdb.org (Allen Shaw) Date: Fri, 04 Jan 2008 11:27:50 -0600 Subject: [nycphp-talk] combining forum and list (Joomla / SMF) In-Reply-To: <477E5A5E.6030009@beezifies.com> References: <477E5467.2040606@polymerdb.org> <477E5A5E.6030009@beezifies.com> Message-ID: <477E6C96.40002@polymerdb.org> Gary Mort wrote: > FUDforum - you can subscribe forums to email lists and crosspost > between the two. > > It has a simple API for logon, so integration with Joomla should be > fairly simple. Great, thanks. Any leads on an existing Joomla or SMF plugin that would facilitate easy email subscription to all messages in a forum? - A. -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From rahmin at insite-out.com Fri Jan 4 12:51:51 2008 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Fri, 04 Jan 2008 12:51:51 -0500 Subject: [nycphp-talk] POSTing with HTTP and PHP In-Reply-To: Message-ID: Randal Rust wrote: > Can I send data via HTTP POST with the header() function? You'll have to set a variety of headers. Depending on your app, this can become burdensome. You might want to look into something like: http://pear.php.net/package/HTTP_Request From rahmin at insite-out.com Fri Jan 4 12:55:42 2008 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Fri, 04 Jan 2008 12:55:42 -0500 Subject: [nycphp-talk] XML to JSON? In-Reply-To: Message-ID: Does anyone know of a clean way to covert XML directly to JSON? I'm currently using SimpleXMLElement to convert the tree to JSON, so I'm wondering if I can or if its even worth eliminating the middle-man. From jcampbell1 at gmail.com Fri Jan 4 12:57:23 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Fri, 4 Jan 2008 12:57:23 -0500 Subject: [nycphp-talk] POSTing with HTTP and PHP In-Reply-To: References: Message-ID: <8f0676b40801040957x703e758fv311542f197eae298@mail.gmail.com> > Can I send data via HTTP POST with the header() function? No. Generally speaking, the header function sends *response* headers. HTTP POST data is sent as part of a *request* header. I would recommend using curl to create http requests that contain post data. Regards, John Campbell From jmcgraw1 at gmail.com Fri Jan 4 13:06:36 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Fri, 4 Jan 2008 13:06:36 -0500 Subject: [nycphp-talk] XML to JSON? In-Reply-To: References: Message-ID: Check out: http://www.ibm.com/developerworks/xml/library/x-xml2jsonphp/ On Jan 4, 2008 12:55 PM, Rahmin Pavlovic wrote: > Does anyone know of a clean way to covert XML directly to JSON? > > I'm currently using SimpleXMLElement to convert the tree to JSON, so I'm > wondering if I can or if its even worth eliminating the middle-man. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 jeff at comprehensivity.com Fri Jan 4 13:19:59 2008 From: jeff at comprehensivity.com (Jeff Knight) Date: Fri, 4 Jan 2008 12:19:59 -0600 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477BB7B2.7090101@tgaconnect.com> References: <477BB7B2.7090101@tgaconnect.com> Message-ID: I do it because PHP tastes more like alligator or rattlesnake, whereas Java tastes too much like chicken. From randalrust at gmail.com Fri Jan 4 13:24:10 2008 From: randalrust at gmail.com (Randal Rust) Date: Fri, 4 Jan 2008 13:24:10 -0500 Subject: [nycphp-talk] POSTing with HTTP and PHP In-Reply-To: <8f0676b40801040957x703e758fv311542f197eae298@mail.gmail.com> References: <8f0676b40801040957x703e758fv311542f197eae298@mail.gmail.com> Message-ID: On Jan 4, 2008 12:57 PM, John Campbell wrote: > No. Generally speaking, the header function sends *response* headers. > HTTP POST data is sent as part of a *request* header. that's what i thought. just needed to hear it from some better programmers than myself:) -- Randal Rust R.Squared Communications www.r2communications.com From tgales at tgaconnect.com Fri Jan 4 13:50:58 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 04 Jan 2008 13:50:58 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: References: <477BB7B2.7090101@tgaconnect.com> Message-ID: <477E8012.50908@tgaconnect.com> Jeff Knight wrote: > I do it because PHP tastes more like alligator or rattlesnake, whereas > Java tastes too much like chicken. Thought we had agreed you would do all your graphical front end stuff in "flush" -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From aw at sap8.com Fri Jan 4 14:31:31 2008 From: aw at sap8.com (Anthony Wlodarski) Date: Fri, 4 Jan 2008 14:31:31 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477E8012.50908@tgaconnect.com> References: <477BB7B2.7090101@tgaconnect.com> <477E8012.50908@tgaconnect.com> Message-ID: <003e01c84f08$68aed4c0$3a0c7e40$@com> Actually crocodile taste more like chicken than chicken tastes like chicken. Anthony Wlodarski 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Tim Gales Sent: Friday, January 04, 2008 1:51 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java Jeff Knight wrote: > I do it because PHP tastes more like alligator or rattlesnake, whereas > Java tastes too much like chicken. Thought we had agreed you would do all your graphical front end stuff in "flush" -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ramons at gmx.net Fri Jan 4 15:53:39 2008 From: ramons at gmx.net (David Krings) Date: Fri, 04 Jan 2008 15:53:39 -0500 Subject: [nycphp-talk] List of langauge/country names and codes Message-ID: <477E9CD3.9010803@gmx.net> Hi! Does anyone of you have a list of language/country names in the native language and the associated country codes? For example USA - American English - en_us UK - English - en_uk Schweiz - Deutsch - ch_de Suisse - Francais - ch_fr Deutschland - Deutsch - de and so on. Format is not important, country names are also optional as I guess someone in the USA could pick Deutsch (like me). I do want the native name of the language as someone who speeks only German may not know to look under "G" in the list rather than "D" for Deutsch. Also, pointers where I could find such a list are welcome as well. Thanks in advance, David From bz-gmort at beezifies.com Fri Jan 4 16:00:53 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Fri, 04 Jan 2008 16:00:53 -0500 Subject: [nycphp-talk] List of langauge/country names and codes In-Reply-To: <477E9CD3.9010803@gmx.net> References: <477E9CD3.9010803@gmx.net> Message-ID: <477E9E85.8030407@beezifies.com> Google ISO and country codes, there is a standard set of country to country code mappings, along with a standard set of language to language code mappings. David Krings wrote: > Hi! > Does anyone of you have a list of language/country names in the native > language and the associated country codes? > For example > > USA - American English - en_us > UK - English - en_uk > Schweiz - Deutsch - ch_de > Suisse - Francais - ch_fr > Deutschland - Deutsch - de > > and so on. Format is not important, country names are also optional as > I guess someone in the USA could pick Deutsch (like me). I do want the > native name of the language as someone who speeks only German may not > know to look under "G" in the list rather than "D" for Deutsch. > Also, pointers where I could find such a list are welcome as well. > > Thanks in advance, > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jonbaer at jonbaer.com Sat Jan 5 00:31:05 2008 From: jonbaer at jonbaer.com (Jon Baer) Date: Sat, 5 Jan 2008 00:31:05 -0500 Subject: [nycphp-talk] XML to JSON? In-Reply-To: References: Message-ID: <72714AB3-DA26-4C27-89C9-D6E9D15B1780@jonbaer.com> Go straight to binary :-) http://hessianphp.sourceforge.net/quickstart.html All kidding aside, there is a nice client way w/ jQuery to accomplish it (cuz the client could always do *more* work) ... http://plugins.jquery.com/project/xmlObjectifier Examples: http://www.terracoder.com/examples.html - Jon On Jan 4, 2008, at 12:55 PM, Rahmin Pavlovic wrote: > Does anyone know of a clean way to covert XML directly to JSON? > > I'm currently using SimpleXMLElement to convert the tree to JSON, so > I'm > wondering if I can or if its even worth eliminating the middle-man. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ramons at gmx.net Sat Jan 5 17:15:38 2008 From: ramons at gmx.net (David Krings) Date: Sat, 05 Jan 2008 17:15:38 -0500 Subject: [nycphp-talk] List of langauge/country names and codes In-Reply-To: <477E9E85.8030407@beezifies.com> References: <477E9CD3.9010803@gmx.net> <477E9E85.8030407@beezifies.com> Message-ID: <4780018A.80403@gmx.net> Gary Mort wrote: > Google ISO and country codes, there is a standard set of country to > country code mappings, along with a standard set of language to language > code mappings. After some extensive googling I found that the ISO codes are crap omitting about 80% of the langauges spoken in the world. That is why SIL created a new list, which is obviously way larger and uses three letter codes. Both lists are published and free to use (as far as I can tell), but both fail to list the languages in their native names. So for someone who doesn't speak English these lists are useless. In any case, the complete list is available here: http://www.ethnologue.com/codes/ I guess I keep on searching... David From rmarscher at beaffinitive.com Sat Jan 5 21:44:53 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Sat, 5 Jan 2008 21:44:53 -0500 Subject: [nycphp-talk] PHPThumb -- how does it work?? In-Reply-To: References: Message-ID: On Jan 4, 2008, at 6:18 AM, Jonathan Wagener wrote: > Hi, I would like to know how I can make phpthumb work, I don't really > understand how it works. How do I make it create thumbnails? I haven't looked at phpthumb... but ImageMagick is sort of the "industry standard" for thumbnail creation. Flickr uses it, for example. It uses less system resources than GD and offers some easy methods to crop/constrain the thumbnails. It's not actually part of php. It's a standalone command-line application. I believe there is a php extension for it... but it's not necessary, you can call command-line tools using the backtick operator. The name command-line tool to create thumbnails with ImageMagick is called "convert" ("mogrify" can be used to resize a file and overwrite it). Pretty much every *nix based host will have it available. It's available for windows too -- http://www.imagemagick.org. It's so simple... you'll love it. Check this out: Want to get crazy and resize all jpg's to say 600x600 and create 100x100 thumbnails and name them sequentially? There's TONS more options for ImageMagick: http://www.imagemagick.org/Usage Good luck, Rob From jcampbell1 at gmail.com Sat Jan 5 22:29:33 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Sat, 5 Jan 2008 22:29:33 -0500 Subject: [nycphp-talk] List of langauge/country names and codes In-Reply-To: <4780018A.80403@gmx.net> References: <477E9CD3.9010803@gmx.net> <477E9E85.8030407@beezifies.com> <4780018A.80403@gmx.net> Message-ID: <8f0676b40801051929n7b3c13b0m5d93cc10af064494@mail.gmail.com> > After some extensive googling I found that the ISO codes are crap omitting > about 80% of the langauges spoken in the world. That is why SIL created a new > list, which is obviously way larger and uses three letter codes. Both lists > are published and free to use (as far as I can tell), but both fail to list > the languages in their native names. So for someone who doesn't speak English > these lists are useless. In any case, the complete list is available here: > http://www.ethnologue.com/codes/ What are you trying to do? If this is for translating software, just use ISO 639-1 (language) + ISO 3166-1 (country). If you attempt to use ISO 639-3 it will be a huge mess. ISO 639-1 may exclude 80% of the "known" languages, but it covers 99.99% of the computer using population. It is also the format included in the "Accept-Language" HTTP header. The problem with ISO 639-3 is that it includes things like 60 different Arabic dialects, but there is only one "software" version of Arabic. Regards, John Campbell From ramons at gmx.net Sat Jan 5 23:07:57 2008 From: ramons at gmx.net (David Krings) Date: Sat, 05 Jan 2008 23:07:57 -0500 Subject: [nycphp-talk] List of langauge/country names and codes In-Reply-To: <8f0676b40801051929n7b3c13b0m5d93cc10af064494@mail.gmail.com> References: <477E9CD3.9010803@gmx.net> <477E9E85.8030407@beezifies.com> <4780018A.80403@gmx.net> <8f0676b40801051929n7b3c13b0m5d93cc10af064494@mail.gmail.com> Message-ID: <4780541D.50408@gmx.net> John Campbell wrote: >> After some extensive googling I found that the ISO codes are crap omitting >> about 80% of the langauges spoken in the world. That is why SIL created a new >> list, which is obviously way larger and uses three letter codes. Both lists >> are published and free to use (as far as I can tell), but both fail to list >> the languages in their native names. So for someone who doesn't speak English >> these lists are useless. In any case, the complete list is available here: >> http://www.ethnologue.com/codes/ > > What are you trying to do? If this is for translating software, just > use ISO 639-1 (language) + ISO 3166-1 (country). If you attempt to > use ISO 639-3 it will be a huge mess. ISO 639-1 may exclude 80% of > the "known" languages, but it covers 99.99% of the computer using > population. It is also the format included in the "Accept-Language" > HTTP header. The problem with ISO 639-3 is that it includes things > like 60 different Arabic dialects, but there is only one "software" > version of Arabic. For my current project I use language dependent tables or better to say, some tables that are identical in structure exist multiple times once for each language currently supported in the system. Right now I only have tables that each have a common name extended by "_de" and "_en_us" (subject to change). Each user account can select the preferred language, which leaves only the login page up to guessing based on what the browser sends (and which in my case is sometimes inaccurate as I want German, but my browser sends over that it uses English). To me it just doesn't make sense to show in the list for example "Farsi", because Farsi doesn't use the latin alphabet. I also don't think that listing all languages by the English names makes much sense, because that way someone speaking German would need to look under "G" rather than "D" for "Deutsch". I fully understand that I won't get a full and comprehensive list as there seems to be none, but I like to base it on the SIL three letter codes and fill in as much as possible with native names and writing as possible. I did find a few lists such as the one on wikipedia: http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes Now, you bring up a very good point. Since this all will be displayed in a browser in the end choosing something that isn't supported by the http header doesn't help much. SIL is working on getting their list to be the new ISO list, but that isn't the case and who knows when that happens. So I guess I save myself a lot of useless work and keep in mind that the SIL list exists, but go ahead and use ISO 639-1 for the language codes. That list is really kludgy as it really needs ISO 3166-1 to make sense as for example UK English is different from US English and different from Indian English. Not so much as that one being able to read one couldn't read the other, but there may be different words in use. For example, how many words are there for a grinder? There is grinder, hero, sub, sandwich, hoagie, po'boy and a bunch of other ones that I can't recall. Also, the word "sneaker" strikes me not to be common around the capital region. Likewise, I never heard of a package store being called a beverage store, but people generally understand what is meant unlike when talking to someone from California, where at least in some regions the package store is something like a UPS store or the post office. Also, in regards to German (de) there are German dialects in the US that have nothing to do with each other, such as the Pennsylvanian German and the Texas German, which both are not really close to the High German spoken in most parts of Germany, so how will then de_us differ from de_us? I think I have to draw down my lofty goals quite a bit and prepare for expansion later as there are apparently a few things that are not likely to fall into place - there is no list that I am looking, most likely due to the problems that I ran into - ISO 639-1 seems to be the one and only widely supported language code list - even when this list rapidly inhales - the chance to find all the native names and writings and display them properly in unicode is slim to none (not that unicode can't do it, but I won't have the input that I need), which will make my list to be largely incomplete pretty much forever - even if I could compile a list of languages the way I want to, while it may suit others who are free to use it later, getting translations for a language spoken by a few hundred on a south pacific island is unlikely I didn't want to base my approach on the fact who has a computer today or not. That would be shortsighted and arrogant, but I guess higher powers created a status quo that to ignore doesn't seem to be beneficial for anyone. I will need to think about this a bit more and come up with a solution that allows for adding/editing/changing the list in use. Damn, I suck at saving the world...hehehe. Thanks for showing me the wall I was about to run into. David From bz-gmort at beezifies.com Sun Jan 6 04:19:27 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Sun, 06 Jan 2008 04:19:27 -0500 Subject: [nycphp-talk] List of langauge/country names and codes In-Reply-To: <4780018A.80403@gmx.net> References: <477E9CD3.9010803@gmx.net> <477E9E85.8030407@beezifies.com> <4780018A.80403@gmx.net> Message-ID: <47809D1F.8030006@beezifies.com> David Krings wrote: > but both fail to list the languages in their native names. So for > someone who doesn't speak English these lists are useless. In any > case, the complete list is available here: > http://www.ethnologue.com/codes/ Extend it. Add an extra column for native language name, store it in UTF8, and use the current english version of the name but give users who choose the language an opportunity to fix the language for future users. So initially, they may choose German (German). But someone can submit an alternate spelling, which after you approve it changes it to Duetch (German) Though if you go by the UN standard, than display the alternate languages in English and French (English/French) From don at donpavlish.com Sun Jan 6 12:06:03 2008 From: don at donpavlish.com (Don Pavlish) Date: Sun, 6 Jan 2008 12:06:03 -0500 Subject: [nycphp-talk] version mismatch - MySQL vs. PHP MySQL client Message-ID: <34BEE64C-198F-43A0-8D32-B04C05BEA942@donpavlish.com> Hi everyone, Longtime lurker, posting for the first time. :) I'm coding a LAMP site now where the development server is running MySQL Server version 5.0.45 and PHP MySQL client library 5.0.41. Everything is working great. However, the final server we'll be deploying the site on is through a different hosting provider. They're also running MySQL 5.0.45, but an older version of the PHP MySQL client library -- version 4.1.22. I've googled exhaustively but can't find any good documentation as to whether or not this will cause problems. PHPMyAdmin seems to think so -- it warns me that "Your PHP MySQL library version 4.1.22 differs from your MySQL server version 5.0.54. This may cause unpredictable behavior." Thus far I've run some simple tests on the final server and haven't seen any problems. But I'm still concerned. My gut feeling is that the MySQL version and the PHP client library should be the same major version... or am I just being paranoid? Has anyone any experience / thoughts? thanks! - Don -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Sun Jan 6 13:47:18 2008 From: jonbaer at jonbaer.com (Jon Baer) Date: Sun, 6 Jan 2008 13:47:18 -0500 Subject: [nycphp-talk] version mismatch - MySQL vs. PHP MySQL client In-Reply-To: <34BEE64C-198F-43A0-8D32-B04C05BEA942@donpavlish.com> References: <34BEE64C-198F-43A0-8D32-B04C05BEA942@donpavlish.com> Message-ID: Ive had this come up a few times ... for the most part if your SQL is simple joins it will not really cause problems, the real problems are if you are using anything like prepared statements or something meant for mysqli extension. http://us.php.net/mysqli (requires 4.1.3) However since the advantages of using prepared statements (for you and your ISP) pretty much outweigh everything else it's probably good to be even more paranoid and use them :-) Im sure you will get bit by something else down the road but if you test w/ a command line 4.1.x MySQL client and it chokes on one of your queries it would pretty much show you what will work + what will not. Since PHPMyAdmin is more of a tool it will probably throw more admin related queries for info and bail out. This type of situation is where it's nice to get a VPS setup vs. a normal ISP / shared hosting deal since you can compile and install this yourself. - Jon On Jan 6, 2008, at 12:06 PM, Don Pavlish wrote: > Hi everyone, > > Longtime lurker, posting for the first time. :) > > I'm coding a LAMP site now where the development server is running > MySQL Server version 5.0.45 and PHP MySQL client library 5.0.41. > Everything is working great. > > However, the final server we'll be deploying the site on is through > a different hosting provider. They're also running MySQL 5.0.45, > but an older version of the PHP MySQL client library -- version > 4.1.22. > > I've googled exhaustively but can't find any good documentation as > to whether or not this will cause problems. PHPMyAdmin seems to > think so -- it warns me that "Your PHP MySQL library version 4.1.22 > differs from your MySQL server version 5.0.54. This may cause > unpredictable behavior." > > Thus far I've run some simple tests on the final server and haven't > seen any problems. But I'm still concerned. My gut feeling is that > the MySQL version and the PHP client library should be the same > major version... or am I just being paranoid? > > Has anyone any experience / thoughts? > > thanks! > - Don > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Sun Jan 6 13:48:03 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Sun, 6 Jan 2008 13:48:03 -0500 Subject: [nycphp-talk] version mismatch - MySQL vs. PHP MySQL client In-Reply-To: <34BEE64C-198F-43A0-8D32-B04C05BEA942@donpavlish.com> References: <34BEE64C-198F-43A0-8D32-B04C05BEA942@donpavlish.com> Message-ID: <617841CA-030A-4628-A687-391628E2222E@beaffinitive.com> While it should basically work, I have had odd things happen in the past that seemed to be corrected by getting the client and server version to match. 4.1 is better than 4.0... I think it at least uses the same password encryption method as 5.0. Still... your host should upgrade. I think that's worthy of a support request to them. Congrats on the first post :) -Rob From arlo at icall.com Sun Jan 6 14:13:13 2008 From: arlo at icall.com (Arlo Gilbert) Date: Sun, 6 Jan 2008 14:13:13 -0500 Subject: [nycphp-talk] PHP Developer/Analyst Opportunity in Greenwich, CT In-Reply-To: <11403511.1199552512614.JavaMail.root@m06> References: <11403511.1199552512614.JavaMail.root@m06> Message-ID: <92FE7650-702E-499A-B7A9-8B9C04E07A1E@icall.com> Hey Guys & Gals, I've posted this once previously a few months ago but received an underwhelming response :-/ iCall, a Greenwich, CT based edge VoIP service provider is looking for a talented "jack of all trades" developer/analyst to work full time in our Greenwich office. PHP & MySQL are the two core skill sets that we require. For more detail on this really fun & cool job please visit: http://www.icall.com/jobs.php Even if you're not personally interested, if you do know of an individual who might qualify for this position and we hire them, we will pay a handsome referral fee. Thanks everybody, Arlo Arlo C. Gilbert, CEO iCall, Inc. Two Sound View Drive Greenwich, CT 06830 From lists at zaunere.com Sun Jan 6 14:30:45 2008 From: lists at zaunere.com (Hans Zaunere) Date: Sun, 6 Jan 2008 14:30:45 -0500 Subject: [nycphp-talk] PHP Developer/Analyst Opportunity in Greenwich, CT In-Reply-To: <92FE7650-702E-499A-B7A9-8B9C04E07A1E@icall.com> References: <11403511.1199552512614.JavaMail.root@m06> <92FE7650-702E-499A-B7A9-8B9C04E07A1E@icall.com> Message-ID: <02a001c8509a$a22a5c90$e67f15b0$@com> Hi Arlo, Your best bet is to post to our Jobs list. http://lists.nyphp.org/mailman/listinfo/jobs Thanks, --- Hans Zaunere / President / New York PHP www.nyphp.org ?/ ?www.nyphp.com > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] On Behalf Of Arlo Gilbert > Sent: Sunday, January 06, 2008 2:13 PM > To: talk at lists.nyphp.org > Subject: [nycphp-talk] PHP Developer/Analyst Opportunity in Greenwich, > CT > > Hey Guys & Gals, > > I've posted this once previously a few months ago but received an > underwhelming response :-/ > > iCall, a Greenwich, CT based edge VoIP service provider is looking for > a talented "jack of all trades" developer/analyst to work full time in > our Greenwich office. > > PHP & MySQL are the two core skill sets that we require. > > For more detail on this really fun & cool job please visit: > http://www.icall.com/jobs.php > > Even if you're not personally interested, if you do know of an > individual who might qualify for this position and we hire them, we > will pay a handsome referral fee. > > Thanks everybody, > Arlo > > Arlo C. Gilbert, CEO > iCall, Inc. > Two Sound View Drive > Greenwich, CT 06830 > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 jmcgraw1 at gmail.com Sun Jan 6 16:47:19 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Sun, 6 Jan 2008 16:47:19 -0500 Subject: [nycphp-talk] version mismatch - MySQL vs. PHP MySQL client In-Reply-To: <617841CA-030A-4628-A687-391628E2222E@beaffinitive.com> References: <34BEE64C-198F-43A0-8D32-B04C05BEA942@donpavlish.com> <617841CA-030A-4628-A687-391628E2222E@beaffinitive.com> Message-ID: I've had the same issue, and it has caused issues with mysqli, but only once, specifically when I tried to use the "SUM" command... if you can fix this and get the library in sync with the server I'd do it. - jake On Jan 6, 2008 1:48 PM, Rob Marscher wrote: > While it should basically work, I have had odd things happen in the > past that seemed to be corrected by getting the client and server > version to match. 4.1 is better than 4.0... I think it at least uses > the same password encryption method as 5.0. Still... your host should > upgrade. I think that's worthy of a support request to them. > > Congrats on the first post :) > -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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nynj.tech at hotmail.com Mon Jan 7 17:22:17 2008 From: nynj.tech at hotmail.com (chad qian) Date: Mon, 7 Jan 2008 17:22:17 -0500 Subject: [nycphp-talk] email verification Message-ID: Hi, When people register,they will have their own username and password.In order to active their account,they have to go to their email acct to click the link to active pages. Here is my source code: // send a message to the user's email account with a verification link $subject = 'BarterJunk.com account activation for ' . $username; // header of the verification email message $header = 'From: AccountActivation at barterjunk.com' . "\r\n" . 'Reply-To: webmaster at barterjunk.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); // text of the verification email message $verification_message = "{$username},\n\n" . "Please visit the link below to activate your new BarterJunk.com account.\n\n" . "http://www.barterjunk.com/?activation_code=" . $user_data['activation_hash'] . "\n"; // send the message mail( $email, $subject, $verification_message, $header ); It works,but it takes very long time.After people submit all their information,they will get verification email after 20-30 minutes.I use hotmail to test Any better solution? Thanks! chad _________________________________________________________________ Make distant family not so distant with Windows Vista? + Windows Live?. http://www.microsoft.com/windows/digitallife/keepintouch.mspx?ocid=TXT_TAGLM_CPC_VideoChat_distantfamily_012008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Mon Jan 7 18:14:36 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Mon, 07 Jan 2008 18:14:36 -0500 Subject: [nycphp-talk] email verification In-Reply-To: References: Message-ID: <4782B25C.4080609@beezifies.com> It's not your code, it's the underlying email system. Most likely, hotmail is greylisting your domain, so it has to wait until the retry occurs to deliver it. chad qian wrote: > Hi, > When people register,they will have their own username and password.In > order to active their account,they have to go to their email acct to > click the link to active pages. > Here is my source code: > // send a message to the user's email account with a verification link > $subject = 'BarterJunk.com account activation for ' . $username; > > // header of the verification email message > $header = 'From: AccountActivation at barterjunk.com' . "\r\n" . > 'Reply-To: webmaster at barterjunk.com' . "\r\n" . > 'X-Mailer: PHP/' . _phpversion_ > (); > > // text of the verification email message > $verification_message = > "{$username},\n\n" . > "Please visit the link below to activate your new > BarterJunk.com account.\n\n" . > "http://www.barterjunk.com/?activation_code=" . > $user_data['activation_hash'] . "\n"; > > // send the message > _mail_ ( $email, $subject, > $verification_message, $header ); > > It works,but it takes very long time.After people submit all their > information,they will get verification email after 20-30 minutes.I use > hotmail to test > > Any better solution? > > Thanks! > > chad > > > ------------------------------------------------------------------------ > Make distant family not so distant with Windows Vista? + Windows > Live?. Start now! > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From mitch.pirtle at gmail.com Tue Jan 8 12:02:42 2008 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 8 Jan 2008 12:02:42 -0500 Subject: [nycphp-talk] combining forum and list (Joomla / SMF) In-Reply-To: <477E6C96.40002@polymerdb.org> References: <477E5467.2040606@polymerdb.org> <477E5A5E.6030009@beezifies.com> <477E6C96.40002@polymerdb.org> Message-ID: <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> On Jan 4, 2008 12:27 PM, Allen Shaw wrote: > Gary Mort wrote: > > FUDforum - you can subscribe forums to email lists and crosspost > > between the two. > > > > It has a simple API for logon, so integration with Joomla should be > > fairly simple. > Great, thanks. Any leads on an existing Joomla or SMF plugin that would > facilitate easy email subscription to all messages in a forum? There's an incompatibility between the GPL of Joomla and the license they chose for SMF - so most efforts (at least on the Joomla side, AFAICT) switched over to PHPBB - which, amazingly enough, has picked up really rapid development as of late. You might want to check that out. -- Mitch From rotsen at gmail.com Tue Jan 8 12:08:11 2008 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Tue, 8 Jan 2008 09:08:11 -0800 Subject: [nycphp-talk] combining forum and list (Joomla / SMF) In-Reply-To: <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> References: <477E5467.2040606@polymerdb.org> <477E5A5E.6030009@beezifies.com> <477E6C96.40002@polymerdb.org> <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> Message-ID: Hey, I just install phpbb3. What is SMF? :-) On Jan 8, 2008 9:02 AM, Mitch Pirtle wrote: > On Jan 4, 2008 12:27 PM, Allen Shaw wrote: > > Gary Mort wrote: > > > FUDforum - you can subscribe forums to email lists and crosspost > > > between the two. > > > > > > It has a simple API for logon, so integration with Joomla should be > > > fairly simple. > > Great, thanks. Any leads on an existing Joomla or SMF plugin that would > > facilitate easy email subscription to all messages in a forum? > > There's an incompatibility between the GPL of Joomla and the license > they chose for SMF - so most efforts (at least on the Joomla side, > AFAICT) switched over to PHPBB - which, amazingly enough, has picked > up really rapid development as of late. You might want to check that > out. > > -- 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashaw at polymerdb.org Tue Jan 8 12:27:29 2008 From: ashaw at polymerdb.org (Allen Shaw) Date: Tue, 08 Jan 2008 11:27:29 -0600 Subject: [nycphp-talk] combining forum and list (Joomla / SMF) In-Reply-To: <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> References: <477E5467.2040606@polymerdb.org> <477E5A5E.6030009@beezifies.com> <477E6C96.40002@polymerdb.org> <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> Message-ID: <4783B281.9010303@polymerdb.org> Mitch Pirtle wrote: > There's an incompatibility between the GPL of Joomla and the license > they chose for SMF - Right, I remember something about that. There was quite a bit of ire, in some discussions, about a perceived lack of OS-friendly intentions among the SMF developers. > so most efforts (at least on the Joomla side, > AFAICT) switched over to PHPBB - which, amazingly enough, has picked > up really rapid development as of late. You might want to check that > out. I'm not sure why this site's admins picked SMF over anything else in particular -- I'm betting it was the usual haphazard "google around until you find something that mostly works" method. If they start looking for a new board, I'll recommend they look at PHPBB. Thanks, Allen -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From mitch.pirtle at gmail.com Tue Jan 8 12:38:07 2008 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 8 Jan 2008 12:38:07 -0500 Subject: [nycphp-talk] combining forum and list (Joomla / SMF) In-Reply-To: <4783B281.9010303@polymerdb.org> References: <477E5467.2040606@polymerdb.org> <477E5A5E.6030009@beezifies.com> <477E6C96.40002@polymerdb.org> <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> <4783B281.9010303@polymerdb.org> Message-ID: <330532b60801080938s272771e9y3442513cd0688984@mail.gmail.com> On Jan 8, 2008 12:27 PM, Allen Shaw wrote: > I'm not sure why this site's admins picked SMF over anything else in > particular -- I'm betting it was the usual haphazard "google around > until you find something that mostly works" method. If they start > looking for a new board, I'll recommend they look at PHPBB. I can comment if "this site" means Joomla. Not commenting about the gnashing of teeth and whatnot, but I can say that the frustration about licensing was on both sides of that story... Back in the Mambo years, we had a license for VBB, and used it exclusively. Knowing there was support, and having a relatively scalable forum was critical to us. However, when we relaunched ourselves as Joomla, we had an opportunity to get off the commercial forum treadmill of license update$. At the time, SMF was fast and secure, and PHPBB was bloated and security was a train wreck. Today, I'd have to revise that harsh review of PHPBB as a *ton* of activity has been going on over there. As well, the licensing compatibility - and eagerness of the PHPBB team to help us Joomloids - I can see a lot of integration between the two, if not already then real soon now. -- Mitch From ashaw at polymerdb.org Tue Jan 8 12:57:09 2008 From: ashaw at polymerdb.org (Allen Shaw) Date: Tue, 08 Jan 2008 11:57:09 -0600 Subject: [nycphp-talk] combining forum and list (Joomla / SMF) In-Reply-To: <330532b60801080938s272771e9y3442513cd0688984@mail.gmail.com> References: <477E5467.2040606@polymerdb.org> <477E5A5E.6030009@beezifies.com> <477E6C96.40002@polymerdb.org> <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> <4783B281.9010303@polymerdb.org> <330532b60801080938s272771e9y3442513cd0688984@mail.gmail.com> Message-ID: <4783B975.8050800@polymerdb.org> An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Tue Jan 8 13:04:27 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Tue, 08 Jan 2008 13:04:27 -0500 Subject: [nycphp-talk] combining forum and list (Joomla / SMF) In-Reply-To: <330532b60801080938s272771e9y3442513cd0688984@mail.gmail.com> References: <477E5467.2040606@polymerdb.org> <477E5A5E.6030009@beezifies.com> <477E6C96.40002@polymerdb.org> <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> <4783B281.9010303@polymerdb.org> <330532b60801080938s272771e9y3442513cd0688984@mail.gmail.com> Message-ID: <4783BB2B.2050508@beezifies.com> Mitch Pirtle wrote: > Today, I'd have to revise that harsh review of PHPBB as a *ton* of > activity has been going on over there. As well, the licensing > compatibility - and eagerness of the PHPBB team to help us Joomloids - > I can see a lot of integration between the two, if not already then > real soon now. > Eh, my wife doesn't like PHPBB. Also, purely personal, but the PHPBB team, or at least their forum moderator, believes that when you submit a post on a PHPBB powered forum run by someone else, that the person running the forum is given exclusive copyright to the material you post(as in copying your post from that forum and posting it somewhere else is illegal and a copyright violation). From ashaw at polymerdb.org Tue Jan 8 13:15:09 2008 From: ashaw at polymerdb.org (Allen Shaw) Date: Tue, 08 Jan 2008 12:15:09 -0600 Subject: [nycphp-talk] combining forum and list (Joomla / SMF) In-Reply-To: <4783BB2B.2050508@beezifies.com> References: <477E5467.2040606@polymerdb.org> <477E5A5E.6030009@beezifies.com> <477E6C96.40002@polymerdb.org> <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> <4783B281.9010303@polymerdb.org> <330532b60801080938s272771e9y3442513cd0688984@mail.gmail.com> <4783BB2B.2050508@beezifies.com> Message-ID: <4783BDAD.5030406@polymerdb.org> Gary Mort wrote: > Also, purely personal, but the PHPBB team, or at least their forum > moderator, believes that when you submit a post on a PHPBB powered > forum run by someone else, that the person running the forum is given > exclusive copyright to the material you post(as in copying your post > from that forum and posting it somewhere else is illegal and a > copyright violation). Dang it, IANAL. I'll bite: Does it matter what one forum moderator believes about other forums? - A. -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From bz-gmort at beezifies.com Tue Jan 8 13:24:21 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Tue, 08 Jan 2008 13:24:21 -0500 Subject: [nycphp-talk] combining forum and list (Joomla / SMF) In-Reply-To: <4783BDAD.5030406@polymerdb.org> References: <477E5467.2040606@polymerdb.org> <477E5A5E.6030009@beezifies.com> <477E6C96.40002@polymerdb.org> <330532b60801080902m4745f84fmd0f0542d4b543989@mail.gmail.com> <4783B281.9010303@polymerdb.org> <330532b60801080938s272771e9y3442513cd0688984@mail.gmail.com> <4783BB2B.2050508@beezifies.com> <4783BDAD.5030406@polymerdb.org> Message-ID: <4783BFD5.1030602@beezifies.com> Allen Shaw wrote: > Gary Mort wrote: >> Also, purely personal, but the PHPBB team, or at least their forum >> moderator, believes that when you submit a post on a PHPBB powered >> forum run by someone else, that the person running the forum is given >> exclusive copyright to the material you post(as in copying your post >> from that forum and posting it somewhere else is illegal and a >> copyright violation). > Dang it, IANAL. I'll bite: Does it matter what one forum moderator > believes about other forums? It does when your trying to find a way for a group of people to save 5 years of posts from one private forum when the forum owner has gone a little off his rocker and is threatening to shut down the forum if everyone doesn't cater to his ego needs. :-) However, in the end, they copy and pasted every single post into large zip files on their new forum before I got any spidering solution in place, so their happy. It did make me reluctant to post code fixes to the PHPBB forum in the future if they felt my posting there means I can't use the same code elsewhere without their permission. Now, it may be that they felt that since the same methods used to copy your own posts from a forum could be used to copy others posts from another forum, and that was what they wanted to discourage. But since that isn't what the moderator said, and he didn't reply to my request for clarification, I have to go by his word not a guess at what he means. From radalapsker at yahoo.com Tue Jan 8 17:08:44 2008 From: radalapsker at yahoo.com (-- rada --) Date: Tue, 8 Jan 2008 14:08:44 -0800 (PST) Subject: [nycphp-talk] Re: email verification (Gary Mort) Message-ID: <727335.6849.qm@web54105.mail.re2.yahoo.com> Gary, I noticed that your From header and your Reply-to headers are different. In my experience, hotmail (and many others) will penalize you and stick your email in the spam folder, or delay delivery. You are not doing anything "illegal" per say but nevertheless, it's a red flag to a lot of free email providers. Cheers, Rada ----- Original Message ---- From: "talk-request at lists.nyphp.org" To: talk at lists.nyphp.org Sent: Tuesday, January 8, 2008 12:01:46 PM Subject: talk Digest, Vol 15, Issue 14 Send talk mailing list submissions to talk at lists.nyphp.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.nyphp.org/mailman/listinfo/talk or, via email, send a message with subject or body 'help' to talk-request at lists.nyphp.org You can reach the person managing the list at talk-owner at lists.nyphp.org When replying, please edit your Subject line so it is more specific than "Re: Contents of talk digest..." Today's Topics: 1. email verification (chad qian) 2. Re: email verification (Gary Mort) -----Inline Message Follows----- .hmmessage P { margin:0px;padding:0px;} body.hmmessage { FONT-SIZE:10pt;FONT-FAMILY:Tahoma;} Hi, When people register,they will have their own username and password.In order to active their account,they have to go to their email acct to click the link to active pages. Here is my source code: // send a message to the user's email account with a verification link $subject = 'BarterJunk.com account activation for ' . $username; // header of the verification email message $header = 'From: AccountActivation at barterjunk.com' . "\r\n" . 'Reply-To: webmaster at barterjunk.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); // text of the verification email message $verification_message = "{$username},\n\n" . "Please visit the link below to activate your new BarterJunk.com account.\n\n" . "http://www.barterjunk.com/?activation_code=" . $user_data['activation_hash'] . "\n"; // send the message mail( $email, $subject, $verification_message, $header ); It works,but it takes very long time.After people submit all their information,they will get verification email after 20-30 minutes.I use hotmail to test Any better solution? Thanks! chad Make distant family not so distant with Windows Vista? + Windows Live?. Start now! .hmmessage P { margin:0px;padding:0px;} body.hmmessage { FONT-SIZE:10pt;FONT-FAMILY:Tahoma;} Hi, When people register,they will have their own username and password.In order to active their account,they have to go to their email acct to click the link to active pages. Here is my source code: // send a message to the user's email account with a verification link $subject = 'BarterJunk.com account activation for ' . $username; // header of the verification email message $header = 'From: AccountActivation at barterjunk.com' . "\r\n" . 'Reply-To: webmaster at barterjunk.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); // text of the verification email message $verification_message = "{$username},\n\n" . "Please visit the link below to activate your new BarterJunk.com account.\n\n" . "http://www.barterjunk.com/?activation_code=" . $user_data['activation_hash'] . "\n"; // send the message mail( $email, $subject, $verification_message, $header ); It works,but it takes very long time.After people submit all their information,they will get verification email after 20-30 minutes.I use hotmail to test Any better solution? Thanks! chad Make distant family not so distant with Windows Vista? + Windows Live?. Start now! -----Inline Message Follows----- It's not your code, it's the underlying email system. Most likely, hotmail is greylisting your domain, so it has to wait until the retry occurs to deliver it. chad qian wrote: > Hi, > When people register,they will have their own username and password.In > order to active their account,they have to go to their email acct to > click the link to active pages. > Here is my source code: > // send a message to the user's email account with a verification link > $subject = 'BarterJunk.com account activation for ' . $username; > > // header of the verification email message > $header = 'From: AccountActivation at barterjunk.com' . "\r\n" . > 'Reply-To: webmaster at barterjunk.com' . "\r\n" . > 'X-Mailer: PHP/' . _phpversion_ > (); > > // text of the verification email message > $verification_message = > "{$username},\n\n" . > "Please visit the link below to activate your new > BarterJunk.com account.\n\n" . > "http://www.barterjunk.com/?activation_code=" . > $user_data['activation_hash'] . "\n"; > > // send the message > _mail_ ( $email, $subject, > $verification_message, $header ); > > It works,but it takes very long time.After people submit all their > information,they will get verification email after 20-30 minutes.I use > hotmail to test > > Any better solution? > > Thanks! > > chad > > > ------------------------------------------------------------------------ > Make distant family not so distant with Windows Vista? + Windows > Live?. Start now! > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php It's not your code, it's the underlying email system. Most likely, hotmail is greylisting your domain, so it has to wait until the retry occurs to deliver it. chad qian wrote: > Hi, > When people register,they will have their own username and password.In > order to active their account,they have to go to their email acct to > click the link to active pages. > Here is my source code: > // send a message to the user's email account with a verification link > $subject = 'BarterJunk.com account activation for ' . $username; > > // header of the verification email message > $header = 'From: AccountActivation at barterjunk.com' . "\r\n" . > 'Reply-To: webmaster at barterjunk.com' . "\r\n" . > 'X-Mailer: PHP/' . _phpversion_ > (); > > // text of the verification email message > $verification_message = > "{$username},\n\n" . > "Please visit the link below to activate your new > BarterJunk.com account.\n\n" . > "http://www.barterjunk.com/?activation_code=" . > $user_data['activation_hash'] . "\n"; > > // send the message > _mail_ ( $email, $subject, > $verification_message, $header ); > > It works,but it takes very long time.After people submit all their > information,they will get verification email after 20-30 minutes.I use > hotmail to test > > Any better solution? > > Thanks! > > chad > > > ------------------------------------------------------------------------ > Make distant family not so distant with Windows Vista? + Windows > Live?. Start now! > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Tue Jan 8 17:16:49 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Tue, 08 Jan 2008 17:16:49 -0500 Subject: [nycphp-talk] Re: email verification (Gary Mort) In-Reply-To: <727335.6849.qm@web54105.mail.re2.yahoo.com> References: <727335.6849.qm@web54105.mail.re2.yahoo.com> Message-ID: <4783F651.6090202@beezifies.com> Hmm, I just sent a test email to myself and the headers are being formatted correctly on that one. Are you referring to the reply-to on list email being talk at lists.nyphp.org ? That's set by the nyphp email list when it relays the email. (Mind you, there are many times when those 2 addresses don't match for me, since I use specific email addresses for different lists) -- rada -- wrote: > Gary, > > I noticed that your From header and your Reply-to headers are > different. In my experience, hotmail (and many others) will penalize > you and stick your email in the spam folder, or delay delivery. You > are not doing anything "illegal" per say but nevertheless, it's a red > flag to a lot of free email providers. > > Cheers, > Rada > > ----- Original Message ---- > From: "talk-request at lists.nyphp.org" > To: talk at lists.nyphp.org > Sent: Tuesday, January 8, 2008 12:01:46 PM > Subject: talk Digest, Vol 15, Issue 14 > > Send talk mailing list submissions to > talk at lists.nyphp.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.nyphp.org/mailman/listinfo/talk > or, via email, send a message with subject or body 'help' to > talk-request at lists.nyphp.org > > You can reach the person managing the list at > talk-owner at lists.nyphp.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of talk digest..." > Today's Topics: > > 1. email verification (chad qian) > 2. Re: email verification (Gary Mort) > > > -----Inline Message Follows----- > > Hi, > When people register,they will have their own username and password.In > order to active their account,they have to go to their email acct to > click the link to active pages. > Here is my source code: > // send a message to the user's email account with a verification link > $subject = 'BarterJunk.com account activation for ' . $username; > > // header of the verification email message > $header = 'From: AccountActivation at barterjunk.com' . "\r\n" . > 'Reply-To: webmaster at barterjunk.com' . "\r\n" . > 'X-Mailer: PHP/' . _phpversion_ > (); > > // text of the verification email message > $verification_message = > "{$username},\n\n" . > "Please visit the link below to activate your new > BarterJunk.com account.\n\n" . > "http://www.barterjunk.com/?activation_code=" . > $user_data['activation_hash'] . "\n"; > > // send the message > _mail_ ( $email, $subject, > $verification_message, $header ); > > It works,but it takes very long time.After people submit all their > information,they will get verification email after 20-30 minutes.I use > hotmail to test > > Any better solution? > > Thanks! > > chad > > > Make distant family not so distant with Windows Vista? + Windows > Live?. Start now! > > Hi, > When people register,they will have their own username and password.In > order to active their account,they have to go to their email acct to > click the link to active pages. > Here is my source code: > // send a message to the user's email account with a verification link > $subject = 'BarterJunk.com account activation for ' . $username; > > // header of the verification email message > $header = 'From: AccountActivation at barterjunk.com' . "\r\n" . > 'Reply-To: webmaster at barterjunk.com' . "\r\n" . > 'X-Mailer: PHP/' . _phpversion_ > (); > > // text of the verification email message > $verification_message = > "{$username},\n\n" . > "Please visit the link below to activate your new > BarterJunk.com account.\n\n" . > "http://www.barterjunk.com/?activation_code=" . > $user_data['activation_hash'] . "\n"; > > // send the message > _mail_ ( $email, $subject, > $verification_message, $header ); > > It works,but it takes very long time.After people submit all their > information,they will get verification email after 20-30 minutes.I use > hotmail to test > > Any better solution? > > Thanks! > > chad > > > Make distant family not so distant with Windows Vista? + Windows > Live?. Start now! > > > > > -----Inline Message Follows----- > > It's not your code, it's the underlying email system. > > Most likely, hotmail is greylisting your domain, so it has to wait until > the retry occurs to deliver it. > > chad qian wrote: > > Hi, > > When people register,they will have their own username and password.In > > order to active their account,they have to go to their email acct to > > click the link to active pages. > > Here is my source code: > > // send a message to the user's email account with a verification link > > $subject = 'BarterJunk.com account activation for ' . $username; > > > > // header of the verification email message > > $header = 'From: AccountActivation at barterjunk.com > ' . "\r\n" . > > 'Reply-To: webmaster at barterjunk.com > ' . "\r\n" . > > 'X-Mailer: PHP/' . _phpversion_ > > (); > > > > // text of the verification email message > > $verification_message = > > "{$username},\n\n" . > > "Please visit the link below to activate your new > > BarterJunk.com account.\n\n" . > > "http://www.barterjunk.com/?activation_code=" . > > $user_data['activation_hash'] . "\n"; > > > > // send the message > > _mail_ ( $email, $subject, > > $verification_message, $header ); > > > > It works,but it takes very long time.After people submit all their > > information,they will get verification email after 20-30 minutes.I use > > hotmail to test > > > > Any better solution? > > > > Thanks! > > > > chad > > > > > > ------------------------------------------------------------------------ > > Make distant family not so distant with Windows Vista? + Windows > > Live?. Start now! > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > It's not your code, it's the underlying email system. > > Most likely, hotmail is greylisting your domain, so it has to wait until > the retry occurs to deliver it. > > chad qian wrote: > > Hi, > > When people register,they will have their own username and password.In > > order to active their account,they have to go to their email acct to > > click the link to active pages. > > Here is my source code: > > // send a message to the user's email account with a verification link > > $subject = 'BarterJunk.com account activation for ' . $username; > > > > // header of the verification email message > > $header = 'From: AccountActivation at barterjunk.com > ' . "\r\n" . > > 'Reply-To: webmaster at barterjunk.com > ' . "\r\n" . > > 'X-Mailer: PHP/' . _phpversion_ > > (); > > > > // text of the verification email message > > $verification_message = > > "{$username},\n\n" . > > "Please visit the link below to activate your new > > BarterJunk.com account.\n\n" . > > "http://www.barterjunk.com/?activation_code=" . > > $user_data['activation_hash'] . "\n"; > > > > // send the message > > _mail_ ( $email, $subject, > > $verification_message, $header ); > > > > It works,but it takes very long time.After people submit all their > > information,they will get verification email after 20-30 minutes.I use > > hotmail to test > > > > Any better solution? > > > > Thanks! > > > > chad > > > > > > ------------------------------------------------------------------------ > > Make distant family not so distant with Windows Vista? + Windows > > Live?. Start now! > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > > ------------------------------------------------------------------------ > Looking for last minute shopping deals? Find them fast with Yahoo! > Search. > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 bz-gmort at beezifies.com Tue Jan 8 17:19:35 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Tue, 08 Jan 2008 17:19:35 -0500 Subject: Apologies, was Re: [nycphp-talk] email verification In-Reply-To: <4782B25C.4080609@beezifies.com> References: <4782B25C.4080609@beezifies.com> Message-ID: <4783F6F7.5080805@beezifies.com> I apologise to the list, it wasn't until I saw the reply to me that I realised I had failed to trim the quoted text from the email I responded to. From rahmin at insite-out.com Tue Jan 8 18:34:52 2008 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Tue, 08 Jan 2008 18:34:52 -0500 Subject: [nycphp-talk] Suhosin In-Reply-To: <477E9E85.8030407@beezifies.com> Message-ID: Anyone here install Suhosin? Pluses, minuses? From urb at e-government.com Tue Jan 8 21:27:46 2008 From: urb at e-government.com (Urb LeJeune) Date: Tue, 08 Jan 2008 21:27:46 -0500 Subject: [nycphp-talk] WYSIWYG editors In-Reply-To: References: <477E9E85.8030407@beezifies.com> Message-ID: <7.0.1.0.2.20080108212255.02b2e290@e-government.com> I have been using the TinyMCE WYSIWYG editor. I not happy with it because it mangles anything that is cut and pasted from MS Word. Does anyone have an alternative suggestion? Thanks Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. From dorgan at donaldorgan.com Tue Jan 8 21:37:11 2008 From: dorgan at donaldorgan.com (Donald J Organ IV) Date: Tue, 08 Jan 2008 21:37:11 -0500 Subject: [nycphp-talk] WYSIWYG editors In-Reply-To: <7.0.1.0.2.20080108212255.02b2e290@e-government.com> References: <477E9E85.8030407@beezifies.com> <7.0.1.0.2.20080108212255.02b2e290@e-government.com> Message-ID: <47843357.2050903@donaldorgan.com> http://www.extjs.org has a htmleditor. Urb LeJeune wrote: > I have been using the TinyMCE WYSIWYG editor. I not happy with it > because it mangles anything that is cut and pasted from MS Word. > Does anyone have an alternative suggestion? > > Thanks > > Urb > > Dr. Urban A. LeJeune, President > E-Government.com > 609-294-0320 800-204-9545 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > E-Government.com lowers you costs while increasing your expectations. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ramons at gmx.net Tue Jan 8 22:27:43 2008 From: ramons at gmx.net (David Krings) Date: Tue, 08 Jan 2008 22:27:43 -0500 Subject: [nycphp-talk] WYSIWYG editors In-Reply-To: <7.0.1.0.2.20080108212255.02b2e290@e-government.com> References: <477E9E85.8030407@beezifies.com> <7.0.1.0.2.20080108212255.02b2e290@e-government.com> Message-ID: <47843F2F.7080608@gmx.net> Urb LeJeune wrote: > I have been using the TinyMCE WYSIWYG editor. I not happy with it > because it mangles anything that is cut and pasted from MS Word. > Does anyone have an alternative suggestion? I tried FCKEditor some time ago and was quite impressed, but I don't recall pasting anything from Word. I don't use Word. David From ka at kacomputerconsulting.com Tue Jan 8 22:42:50 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Tue, 8 Jan 2008 19:42:50 -0800 Subject: [nycphp-talk] Another Apostrophe-related issue Message-ID: <1199850170.12679@coral.he.net> I'm having yet another apostrophe-related issue. It seems that the slashes are being added automatically by the HTML form and inserted into the database on save. Magic quotes is on (get_magic_quotes_gpc (); returns 1) and I have removed any addslashes() functions from my code. The slashes seem to be spawning, i.e. the first round after entering 's and saving, I get back /'s in the text box, the next round ///'s, etc. Soon enough I have a text box full of //////////////////////////////// Apparently I'm missing something here.... Thanks, Kristina. From kenrbnsn at rbnsn.com Tue Jan 8 23:06:12 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Tue, 08 Jan 2008 23:06:12 -0500 Subject: [nycphp-talk] Another Apostrophe-related issue In-Reply-To: <1199850170.12679@coral.he.net> References: <1199850170.12679@coral.he.net> Message-ID: At 10:42 PM 1/8/2008, Kristina Anderson wrote: >I'm having yet another apostrophe-related issue. It seems that the >slashes are being added automatically by the HTML form and inserted >into the database on save. Magic quotes is on (get_magic_quotes_gpc >(); returns 1) and I have removed any addslashes() functions from my >code. > >The slashes seem to be spawning, i.e. the first round after >entering 's and saving, I get back /'s in the text box, the next >round ///'s, etc. > >Soon enough I have a text box full of //////////////////////////////// You should be using $var = mysql_real_escape_string(stripslashes($var)); before adding to your database. After you retrieve the value, use $var = htmlentities(stripslashes($var),ENT_QUOTES); when displaying the value back to the screen. Ken From jonbaer at jonbaer.com Tue Jan 8 23:11:45 2008 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 8 Jan 2008 23:11:45 -0500 Subject: [nycphp-talk] WYSIWYG editors In-Reply-To: <47843F2F.7080608@gmx.net> References: <477E9E85.8030407@beezifies.com> <7.0.1.0.2.20080108212255.02b2e290@e-government.com> <47843F2F.7080608@gmx.net> Message-ID: Yes, FCKEditor does have a bunch of special hooks for dealing w/ copy/ paste from Word. "Paste from Word cleanup with auto detection" http://www.fckeditor.net - Jon On Jan 8, 2008, at 10:27 PM, David Krings wrote: > Urb LeJeune wrote: >> I have been using the TinyMCE WYSIWYG editor. I not happy with it >> because it mangles anything that is cut and pasted from MS Word. >> Does anyone have an alternative suggestion? > > I tried FCKEditor some time ago and was quite impressed, but I don't > recall pasting anything from Word. I don't use Word. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From guilhermeblanco at gmail.com Wed Jan 9 06:40:44 2008 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Wed, 9 Jan 2008 09:40:44 -0200 Subject: [nycphp-talk] WYSIWYG editors In-Reply-To: References: <477E9E85.8030407@beezifies.com> <7.0.1.0.2.20080108212255.02b2e290@e-government.com> <47843F2F.7080608@gmx.net> Message-ID: The best one I've ever seen is Xinha: http://xinha.webfactional.com/ Regards, On Jan 9, 2008 2:11 AM, Jon Baer wrote: > Yes, FCKEditor does have a bunch of special hooks for dealing w/ copy/ > paste from Word. "Paste from Word cleanup with auto detection" > > http://www.fckeditor.net > > - Jon > > > On Jan 8, 2008, at 10:27 PM, David Krings wrote: > > > Urb LeJeune wrote: > >> I have been using the TinyMCE WYSIWYG editor. I not happy with it > >> because it mangles anything that is cut and pasted from MS Word. > >> Does anyone have an alternative suggestion? > > > > I tried FCKEditor some time ago and was quite impressed, but I don't > > recall pasting anything from Word. I don't use Word. > > > > David > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Carlos - SP/Brazil From jmcgraw1 at gmail.com Wed Jan 9 10:06:17 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 9 Jan 2008 10:06:17 -0500 Subject: [nycphp-talk] WYSIWYG editors In-Reply-To: References: <477E9E85.8030407@beezifies.com> <7.0.1.0.2.20080108212255.02b2e290@e-government.com> <47843F2F.7080608@gmx.net> Message-ID: Recently did a pretty exhaustive survey of JavaScript HTML editors, I found that YUI-editor to be the best and most actively developed, I'm not sure if it natively supports Word Cut + Paste though: http://developer.yahoo.com/yui/editor/ A note: All JS HTML editors have different quirks for each browser. Before moving anything to production, I highly recommend doing an exhaustive round of testing and allowing your users to try the editor out as an "In Testing" feature. - jake On Jan 9, 2008 6:40 AM, Guilherme Blanco wrote: > The best one I've ever seen is Xinha: http://xinha.webfactional.com/ > > > Regards, > > > On Jan 9, 2008 2:11 AM, Jon Baer wrote: > > Yes, FCKEditor does have a bunch of special hooks for dealing w/ copy/ > > paste from Word. "Paste from Word cleanup with auto detection" > > > > http://www.fckeditor.net > > > > - Jon > > > > > > On Jan 8, 2008, at 10:27 PM, David Krings wrote: > > > > > Urb LeJeune wrote: > > >> I have been using the TinyMCE WYSIWYG editor. I not happy with it > > >> because it mangles anything that is cut and pasted from MS Word. > > >> Does anyone have an alternative suggestion? > > > > > > I tried FCKEditor some time ago and was quite impressed, but I don't > > > recall pasting anything from Word. I don't use Word. > > > > > > David > > > _______________________________________________ > > > New York PHP Community Talk Mailing List > > > http://lists.nyphp.org/mailman/listinfo/talk > > > > > > NYPHPCon 2006 Presentations Online > > > http://www.nyphpcon.com > > > > > > Show Your Participation in New York PHP > > > http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > > -- > Guilherme Blanco - Web Developer > CBC - Certified Bindows Consultant > Cell Phone: +55 (16) 9166-6902 > MSN: guilhermeblanco at hotmail.com > URL: http://blog.bisna.com > S?o Carlos - SP/Brazil > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From danielc at analysisandsolutions.com Wed Jan 9 10:55:07 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 9 Jan 2008 10:55:07 -0500 Subject: [nycphp-talk] Another Apostrophe-related issue In-Reply-To: <20080109040650.B4BE23481E@mail2.panix.com> References: <1199850170.12679@coral.he.net> <20080109040650.B4BE23481E@mail2.panix.com> Message-ID: <20080109155507.GA557@panix.com> On Tue, Jan 08, 2008 at 11:06:12PM -0500, Ken Robinson wrote: > > $var = mysql_real_escape_string(stripslashes($var)); The best approach is to turn off the magic quotes and use mysql_real_escape_string() directly without doing stripslashes(). > After you retrieve the value, use > $var = htmlentities(stripslashes($var),ENT_QUOTES); If you do things right going in to the database you should not have to strip slashes on the way out. --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 dcech at phpwerx.net Wed Jan 9 12:40:09 2008 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 09 Jan 2008 12:40:09 -0500 Subject: [nycphp-talk] Another Apostrophe-related issue In-Reply-To: <20080109173312.A12DE141C075@mail.lansmash.com> References: <1199850170.12679@coral.he.net> <20080109173312.A12DE141C075@mail.lansmash.com> Message-ID: <478506F9.1040600@phpwerx.net> Ken Robinson wrote: > At 10:42 PM 1/8/2008, Kristina Anderson wrote: >> I'm having yet another apostrophe-related issue. It seems that the >> slashes are being added automatically by the HTML form and inserted >> into the database on save. Magic quotes is on (get_magic_quotes_gpc >> (); returns 1) and I have removed any addslashes() functions from my >> code. >> >> The slashes seem to be spawning, i.e. the first round after >> entering 's and saving, I get back /'s in the text box, the next >> round ///'s, etc. >> >> Soon enough I have a text box full of //////////////////////////////// > > You should be using > > $var = mysql_real_escape_string(stripslashes($var)); > > before adding to your database. > > After you retrieve the value, use > $var = htmlentities(stripslashes($var),ENT_QUOTES); > > when displaying the value back to the screen. > > Ken Umm, no. Lose both invocations of stripslashes and it will work properly. You should be using $var = mysql_real_escape_string($var); before adding to your database. After you retrieve the value, use $var = htmlentities($var,ENT_QUOTES); when displaying the value back to the screen. See http://nyphp.org/phundamentals/storingretrieving.php for more details. Dan From ka at kacomputerconsulting.com Wed Jan 9 20:07:37 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Wed, 9 Jan 2008 17:07:37 -0800 Subject: [nycphp-talk] Another Apostrophe-related issue Message-ID: <1199927257.21325@coral.he.net> Thanks! And this will result in it being saved into the database with no escape characters, which is the proper way to do it as I can see. > Ken Robinson wrote: > > At 10:42 PM 1/8/2008, Kristina Anderson wrote: > >> I'm having yet another apostrophe-related issue. It seems that the > >> slashes are being added automatically by the HTML form and inserted > >> into the database on save. Magic quotes is on (get_magic_quotes_gpc > >> (); returns 1) and I have removed any addslashes() functions from my > >> code. > >> > >> The slashes seem to be spawning, i.e. the first round after > >> entering 's and saving, I get back /'s in the text box, the next > >> round ///'s, etc. > >> > >> Soon enough I have a text box full of //////////////////////////////// > > > > You should be using > > > > $var = mysql_real_escape_string(stripslashes($var)); > > > > before adding to your database. > > > > After you retrieve the value, use > > $var = htmlentities(stripslashes($var),ENT_QUOTES); > > > > when displaying the value back to the screen. > > > > Ken > > Umm, no. > > Lose both invocations of stripslashes and it will work properly. > > You should be using > > $var = mysql_real_escape_string($var); > > before adding to your database. > > After you retrieve the value, use > $var = htmlentities($var,ENT_QUOTES); > > when displaying the value back to the screen. > > See http://nyphp.org/phundamentals/storingretrieving.php for more details. > > Dan > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > ------------------- Kristina D. H. Anderson Senior Application Developer/Consultant "Building a Better Tomorrow, One Line of Code at a Time" 646-247-4987 From ka at kacomputerconsulting.com Wed Jan 9 20:44:37 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Wed, 9 Jan 2008 17:44:37 -0800 Subject: [nycphp-talk] Another Apostrophe-related issue Message-ID: <1199929477.1227@coral.he.net> What was really strange was that this wasn't happening with any of the other forms...I think that existing escape characters in the data caused the initial issue? > Thanks! And this will result in it being saved into the database with > no escape characters, which is the proper way to do it as I can see. > > > > Ken Robinson wrote: > > > At 10:42 PM 1/8/2008, Kristina Anderson wrote: > > >> I'm having yet another apostrophe-related issue. It seems that > the > > >> slashes are being added automatically by the HTML form and > inserted > > >> into the database on save. Magic quotes is on > (get_magic_quotes_gpc > > >> (); returns 1) and I have removed any addslashes() functions from > my > > >> code. > > >> > > >> The slashes seem to be spawning, i.e. the first round after > > >> entering 's and saving, I get back /'s in the text box, the next > > >> round ///'s, etc. > > >> > > >> Soon enough I have a text box full > of //////////////////////////////// > > > > > > You should be using > > > > > > $var = mysql_real_escape_string(stripslashes($var)); > > > > > > before adding to your database. > > > > > > After you retrieve the value, use > > > $var = htmlentities(stripslashes($var),ENT_QUOTES); > > > > > > when displaying the value back to the screen. > > > > > > Ken > > > > Umm, no. > > > > Lose both invocations of stripslashes and it will work properly. > > > > You should be using > > > > $var = mysql_real_escape_string($var); > > > > before adding to your database. > > > > After you retrieve the value, use > > $var = htmlentities($var,ENT_QUOTES); > > > > when displaying the value back to the screen. > > > > See http://nyphp.org/phundamentals/storingretrieving.php for more > details. > > > > Dan > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > > ------------------- > Kristina D. H. Anderson > Senior Application Developer/Consultant > "Building a Better Tomorrow, One Line of Code at a Time" > 646-247-4987 > > > > ------------------- Kristina D. H. Anderson Senior Application Developer/Consultant "Building a Better Tomorrow, One Line of Code at a Time" 646-247-4987 From randalrust at gmail.com Thu Jan 10 08:09:05 2008 From: randalrust at gmail.com (Randal Rust) Date: Thu, 10 Jan 2008 08:09:05 -0500 Subject: [nycphp-talk] Joomla and SE Friendly URLs Message-ID: These should be pretty easy questions for the Joomla experts. I have a meeting with a potential client this afternoon who had the current version of their site built by a turnkey service using Joomla. The meeting is all about SEO and SEM, and I noticed two things right away when I looked at their site. 1. The keywords are not at the beginning of the TITLE. How difficult is it to switch the site name and the title of the page? So instead of 'R2 Joomla Test - Columbus Ohio Web Design' I can have 'Columbus Ohio Web Design - R2 Joomla Test.' 2. The URLs do not contain keywords. Rather than.... http://rrjoomla.com/content/view/12/2/ ...I need to have.... http://rrjoomla.com/content/view/columbus-ohio-web-design/ Can I do that out of the box? -- Randal Rust R.Squared Communications www.r2communications.com From paul at gubavision.com Thu Jan 10 08:23:07 2008 From: paul at gubavision.com (Paul Guba) Date: Thu, 10 Jan 2008 08:23:07 -0500 Subject: [nycphp-talk] Joomla and SE Friendly URLs In-Reply-To: References: Message-ID: I would be interested in what others say as well as I am about to implement a solution. What I am looking at is ARTIO JoomSEF. Installed but not configured yet. Think I'll wait a bit to hear what you all say. Paul Guba On Jan 10, 2008, at 8:09 AM, Randal Rust wrote: > These should be pretty easy questions for the Joomla experts. I have a > meeting with a potential client this afternoon who had the current > version of their site built by a turnkey service using Joomla. The > meeting is all about SEO and SEM, and I noticed two things right away > when I looked at their site. > > 1. The keywords are not at the beginning of the TITLE. How difficult > is it to switch the site name and the title of the page? So instead of > 'R2 Joomla Test - Columbus Ohio Web Design' I can have 'Columbus Ohio > Web Design - R2 Joomla Test.' > > 2. The URLs do not contain keywords. Rather than.... > > http://rrjoomla.com/content/view/12/2/ > > ...I need to have.... > > http://rrjoomla.com/content/view/columbus-ohio-web-design/ > > Can I do that out of the box? > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From ramons at gmx.net Thu Jan 10 12:38:15 2008 From: ramons at gmx.net (David Krings) Date: Thu, 10 Jan 2008 12:38:15 -0500 Subject: [nycphp-talk] Namespaces Message-ID: <47865807.6090700@gmx.net> Hi! I got sucked into a (probably pointless) discussion about ASP vs. PHP. One of the arguments against using PHP was that there is only a single namespace. Uhm, that took the wind out of my sail as I have no clue what a namespace is and why having only one is really bad. Anyone can explain that to me in laymen terms? David From guilhermeblanco at gmail.com Thu Jan 10 13:11:29 2008 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Thu, 10 Jan 2008 16:11:29 -0200 Subject: [nycphp-talk] Namespaces In-Reply-To: <47865807.6090700@gmx.net> References: <47865807.6090700@gmx.net> Message-ID: In a few words, one namespace is a way to organize code into scopes. By doing this, you prevent collisions when mixing libraries. One example... Packages Creole, Doctrine and PEAR_DB. All of them has one class named Connection (Ok, I know they already differ in names, but this is just one example). Instead of control the class name by prefixing it the lib (like Doctrine_Connection, Creole_Connection, DB_Connection), you can declare your classes normally (Connection to all) and use them without care about conflicts. This organization brings to you less letters to type, preventing you to call for example... Doctrine_Collection_Iterator_Expandable and just care about Expandable in your calls, by importing the Doctrine::Collection::Iterator namespace. Also, the entire discussion of "single" namespace is wrong. What is being discussed there is the possibility to define only one namespace per file or more then that. I am +1 in more than 1, but it has some serious performance issues by doing this. Currently, this is impossible in PHP: namespace MyNS; class Foo {} class Bar {} namespace MyNS2; class Foo2 {} In this case, you should move the MyNS2 into a different file. This is bad, since there are some libraries (example: Doctrine) that has a compiler which compiles the entire source into a single file. Doctrine is the best ORM for PHP today, and it has more than 100 possible namespaces. Compiler then is unable to pack into a single file if it is ported to 5.3. Also, ASP (read as .NET) allows you to define inner namespaces. namespace MyNS { namespace SubNS1 { class Foo {} class Bar {} } class Foo2 {} } PHP does not have this support directly. You should do this: file1.php namespace MyNS; class Foo2 {} file2.php namespace MyNS::SubNS1; class Foo {} class Bar {} Everything evolving namespaces in PHP is a delicate subject and must be dealt with care. Dev team is working hard to improve performance, and allowing some constructions that users want can slow down execution (since it'll move from compile time into runtime). Is everything clear for you now? If not, just reply to message and I can answer, without any problem.... =) Regards, On Jan 10, 2008 3:38 PM, David Krings wrote: > Hi! > > I got sucked into a (probably pointless) discussion about ASP vs. PHP. One of > the arguments against using PHP was that there is only a single namespace. > Uhm, that took the wind out of my sail as I have no clue what a namespace is > and why having only one is really bad. > > Anyone can explain that to me in laymen terms? > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Carlos - SP/Brazil From tgales at tgaconnect.com Thu Jan 10 13:21:28 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Thu, 10 Jan 2008 13:21:28 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <47865807.6090700@gmx.net> References: <47865807.6090700@gmx.net> Message-ID: <47866228.7090100@tgaconnect.com> David Krings wrote: > Hi! > > I got sucked into a (probably pointless) discussion about ASP vs. PHP. > One of the arguments against using PHP was that there is only a single > namespace. Uhm, that took the wind out of my sail as I have no clue what > a namespace is and why having only one is really bad. > > Anyone can explain that to me in laymen terms? The meaning of an identifier, such as a variable or a function name, can depend on where it is mentioned in the program. (for an example about variables see: http://www.php.net/manual/en/language.variables.scope.php) Sometimes it is difficult for a language's compiler or interpreter to distinguish between two identifiers with the same name. In other words, when two identifiers are in the same scope and have the same name, they clash. Some computer languages have keywords which produce namespaces. Differing namespaces can be used to resolve (i.e. distinguish) variables, functions, etc. which have the same name. (see: http://en.wikipedia.org/wiki/Namespace_%28programming%29 for more) -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From ioplex at gmail.com Thu Jan 10 13:49:38 2008 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 10 Jan 2008 13:49:38 -0500 Subject: [nycphp-talk] Writing large files to client efficiently Message-ID: <78c6bd860801101049n6b9403a1q6d09b0a730ab886@mail.gmail.com> What is the most efficient way to write large files to the client? I want to control download access to uploaded files (and dodge all the security issues associated with allowing access to uploaded files) so I can't just serve it as static content - it has to be under script control. fpassthru? Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jcampbell1 at gmail.com Thu Jan 10 14:55:43 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 10 Jan 2008 14:55:43 -0500 Subject: [nycphp-talk] Writing large files to client efficiently In-Reply-To: <78c6bd860801101049n6b9403a1q6d09b0a730ab886@mail.gmail.com> References: <78c6bd860801101049n6b9403a1q6d09b0a730ab886@mail.gmail.com> Message-ID: <8f0676b40801101155m564ae78foe57b8957eaa28c71@mail.gmail.com> On Jan 10, 2008 1:49 PM, Michael B Allen wrote: > What is the most efficient way to write large files to the client? > > fpassthru? > > Mike Yes. Make sure you are not output buffering, and don't forget to call session_write_close() before running fpassthru() if you are using php's default session handler. I have done this with fpassthru, and i have also used 302 redirects to hashed file names. The latter isn't as secure but it is more flexible and faster. Just as a heads up, fpassthru is going to be a problem if you have mutiple servers. Regards, John Campbell From ioplex at gmail.com Thu Jan 10 15:16:26 2008 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 10 Jan 2008 15:16:26 -0500 Subject: [nycphp-talk] Writing large files to client efficiently In-Reply-To: <8f0676b40801101155m564ae78foe57b8957eaa28c71@mail.gmail.com> References: <78c6bd860801101049n6b9403a1q6d09b0a730ab886@mail.gmail.com> <8f0676b40801101155m564ae78foe57b8957eaa28c71@mail.gmail.com> Message-ID: <78c6bd860801101216g1805fdf2ma7a8d09b6c478142@mail.gmail.com> On 1/10/08, John Campbell wrote: > On Jan 10, 2008 1:49 PM, Michael B Allen wrote: > > What is the most efficient way to write large files to the client? > > > > fpassthru? > > > > Mike > > Yes. Make sure you are not output buffering, and don't forget to call > session_write_close() before running fpassthru() if you are using > php's default session handler. > > I have done this with fpassthru, and i have also used 302 redirects to > hashed file names. The latter isn't as secure but it is more flexible > and faster. Just as a heads up, fpassthru is going to be a problem if > you have mutiple servers. Hi John, Excellent answer. In your experience, how much slower is fpassthru compared to serving static content? Is it twice as slow? Also, regarding fpassthru on multiple servers, do you mean that with static files you can redirect to other servers and distribute the load? I'm starting to think I should do the hashed filename redirect thing. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jcampbell1 at gmail.com Thu Jan 10 16:14:47 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 10 Jan 2008 16:14:47 -0500 Subject: [nycphp-talk] Writing large files to client efficiently In-Reply-To: <78c6bd860801101216g1805fdf2ma7a8d09b6c478142@mail.gmail.com> References: <78c6bd860801101049n6b9403a1q6d09b0a730ab886@mail.gmail.com> <8f0676b40801101155m564ae78foe57b8957eaa28c71@mail.gmail.com> <78c6bd860801101216g1805fdf2ma7a8d09b6c478142@mail.gmail.com> Message-ID: <8f0676b40801101314k4ed7743k4b682db9f03adce9@mail.gmail.com> > In your experience, how much slower is fpassthru compared to serving > static content? Is it twice as slow? Well, I just tested it and it doesn't appear to make much difference. You have to fire up the php interpreter either way. I am running PHP+APC, and I see 4.2 ms for both requests with the redirect method and 4.7ms per request using fpassthru. (I am testing with ab on the local machine). Bandwidth and storage will bite you first anyway. > Also, regarding fpassthru on multiple servers, do you mean that with > static files you can redirect to other servers and distribute the > load? Yeah that was what I was getting at. You have a lot of options, but I recommend designing your system so it separates the "what" from the "where". E.g. you get a request for an asset, determine all of the places it lives (Amazon S3, Akamai, local server, etc) and then redirect the request to the best location. How you design the security is up to you. Hashed file names are one way to go. Some sort of token system would be another option if you need more security. Regards, John Campbell From ioplex at gmail.com Thu Jan 10 17:44:54 2008 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 10 Jan 2008 17:44:54 -0500 Subject: [nycphp-talk] Writing large files to client efficiently In-Reply-To: <8f0676b40801101314k4ed7743k4b682db9f03adce9@mail.gmail.com> References: <78c6bd860801101049n6b9403a1q6d09b0a730ab886@mail.gmail.com> <8f0676b40801101155m564ae78foe57b8957eaa28c71@mail.gmail.com> <78c6bd860801101216g1805fdf2ma7a8d09b6c478142@mail.gmail.com> <8f0676b40801101314k4ed7743k4b682db9f03adce9@mail.gmail.com> Message-ID: <78c6bd860801101444v5bbaa0aay4c8c5465ca56e48a@mail.gmail.com> On 1/10/08, John Campbell wrote: > > In your experience, how much slower is fpassthru compared to serving > > static content? Is it twice as slow? > > Well, I just tested it and it doesn't appear to make much difference. > You have to fire up the php interpreter either way. I am running > PHP+APC, and I see 4.2 ms for both requests with the redirect method > and 4.7ms per request using fpassthru. (I am testing with ab on the > local machine). > > Bandwidth and storage will bite you first anyway. > > > Also, regarding fpassthru on multiple servers, do you mean that with > > static files you can redirect to other servers and distribute the > > load? > > Yeah that was what I was getting at. You have a lot of options, but I > recommend designing your system so it separates the "what" from the > "where". Sound advice. Thanks, Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ka at kacomputerconsulting.com Thu Jan 10 19:00:28 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Thu, 10 Jan 2008 16:00:28 -0800 Subject: [nycphp-talk] Namespaces Message-ID: <1200009628.12442@coral.he.net> I think this has something to do with variable scope? Such as, in ASP (like VB), if you declare a variable i within a function, it loses scope after the function executes and you can have another variable i outside a function which stays in scope (this is NOT necessarily a good thing, either). Whereas in PHP, if you declare $i, no matter where, it will be in scope throughout your entire script....right? As someone who used ASP for many, many years....after using PHP for 5 months I can pretty much state that, for me at least, it's NOT better than PHP, and it was a hell of a lot less fun to write. --Kristina > Hi! > > I got sucked into a (probably pointless) discussion about ASP vs. PHP. One of > the arguments against using PHP was that there is only a single namespace. > Uhm, that took the wind out of my sail as I have no clue what a namespace is > and why having only one is really bad. > > Anyone can explain that to me in laymen terms? > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From ramons at gmx.net Thu Jan 10 20:07:30 2008 From: ramons at gmx.net (David Krings) Date: Thu, 10 Jan 2008 20:07:30 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <1200009628.12442@coral.he.net> References: <1200009628.12442@coral.he.net> Message-ID: <4786C152.5040204@gmx.net> Kristina Anderson wrote: > I think this has something to do with variable scope? Such as, in ASP > (like VB), if you declare a variable i within a function, it loses > scope after the function executes and you can have another variable i > outside a function which stays in scope (this is NOT necessarily a > good thing, either). > > Whereas in PHP, if you declare $i, no matter where, it will be in > scope throughout your entire script....right? I don't think that is the case. That is how it used to be in the PHP 4.x installations that I've used early one, but with switching to PHP5 that went away (and all my function calls failed). I think it is possible to configure it either way in PHP4 or PHP5 > As someone who used ASP for many, many years....after using PHP for 5 > months I can pretty much state that, for me at least, it's NOT better > than PHP, and it was a hell of a lot less fun to write. I've never tried ASP, but I work with an application that uses ASP/NET/IIS/MSSQL and not only is it a royal pain the you know where to install, the entire application is dog slow on a P4-3GHz with 1GB RAM. I get better performance with PHP on my P3-1GHz while pulling everything through the debugger and that with less RAM. Thanks also for all the other very informative explanations of namespace. I really don't see the single namespace to be an issue. When there are multiple namespaces I have to keep track of them as well. With multiple namespaces everyone starts calling their functions ini() and A(), because they are too lazy to type longer names. But then again, I don't really see the reason why one needs objects either.... David From urb at e-government.com Thu Jan 10 20:32:54 2008 From: urb at e-government.com (Urb LeJeune) Date: Thu, 10 Jan 2008 20:32:54 -0500 Subject: [nycphp-talk] WYSIWYG editors In-Reply-To: <47843F2F.7080608@gmx.net> References: <477E9E85.8030407@beezifies.com> <7.0.1.0.2.20080108212255.02b2e290@e-government.com> <47843F2F.7080608@gmx.net> Message-ID: <7.0.1.0.2.20080110203219.029c12e0@e-government.com> Thanks to all who responded to my request for suggestions on WYSIWYG editors. Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. From jonbaer at jonbaer.com Thu Jan 10 21:30:37 2008 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 10 Jan 2008 21:30:37 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <4786C152.5040204@gmx.net> References: <1200009628.12442@coral.he.net> <4786C152.5040204@gmx.net> Message-ID: <649AE559-CE09-4930-A8D0-07EE7A284467@jonbaer.com> Its also good to scan the last php-internals list and grep for Namespaces discussions as things can automagically change on you :-) http://marc.info/?l=php-internals&m=118355320225178&w=2 http://marc.info/?l=php-internals&m=119308858512331&w=2 - Jon On Jan 10, 2008, at 8:07 PM, David Krings wrote: > Kristina Anderson wrote: >> I think this has something to do with variable scope? Such as, in >> ASP (like VB), if you declare a variable i within a function, it >> loses scope after the function executes and you can have another >> variable i outside a function which stays in scope (this is NOT >> necessarily a good thing, either). >> Whereas in PHP, if you declare $i, no matter where, it will be in >> scope throughout your entire script....right? > > I don't think that is the case. That is how it used to be in the PHP > 4.x installations that I've used early one, but with switching to > PHP5 that went away (and all my function calls failed). I think it > is possible to configure it either way in PHP4 or PHP5 > >> As someone who used ASP for many, many years....after using PHP for >> 5 months I can pretty much state that, for me at least, it's NOT >> better than PHP, and it was a hell of a lot less fun to write. > > I've never tried ASP, but I work with an application that uses ASP/ > NET/IIS/MSSQL and not only is it a royal pain the you know where to > install, the entire application is dog slow on a P4-3GHz with 1GB > RAM. I get better performance with PHP on my P3-1GHz while pulling > everything through the debugger and that with less RAM. > > > Thanks also for all the other very informative explanations of > namespace. I really don't see the single namespace to be an issue. > When there are multiple namespaces I have to keep track of them as > well. With multiple namespaces everyone starts calling their > functions ini() and A(), because they are too lazy to type longer > names. But then again, I don't really see the reason why one needs > objects either.... > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From randalrust at gmail.com Thu Jan 10 21:45:23 2008 From: randalrust at gmail.com (Randal Rust) Date: Thu, 10 Jan 2008 21:45:23 -0500 Subject: [nycphp-talk] MySQL Issue Message-ID: I installed MySQL 5 on a machine, and had nothing but problems with it. So I rolled back to MySQL 4.0.24. Now I can't create new databases through PHPMyAdmin. When I look at the PHPMyAdmin home page, it says I'm connected to: MySQL 4.0.24-nt running on localhost as ODBC at localhost It should be 'root at localhost.' How do I change that? -- Randal Rust R.Squared Communications www.r2communications.com From ramons at gmx.net Thu Jan 10 22:00:20 2008 From: ramons at gmx.net (David Krings) Date: Thu, 10 Jan 2008 22:00:20 -0500 Subject: [nycphp-talk] MySQL Issue In-Reply-To: References: Message-ID: <4786DBC4.6@gmx.net> Randal Rust wrote: > I installed MySQL 5 on a machine, and had nothing but problems with > it. So I rolled back to MySQL 4.0.24. Now I can't create new databases > through PHPMyAdmin. When I look at the PHPMyAdmin home page, it says > I'm connected to: > > MySQL 4.0.24-nt running on localhost as ODBC at localhost > > It should be 'root at localhost.' How do I change that? I gave up on phpMyAdmin a long time ago and use the tools from the MySQL website. I'd give those a try and see if that gives you more command. David From randalrust at gmail.com Thu Jan 10 22:04:27 2008 From: randalrust at gmail.com (Randal Rust) Date: Thu, 10 Jan 2008 22:04:27 -0500 Subject: [nycphp-talk] MySQL Issue In-Reply-To: <4786DBC4.6@gmx.net> References: <4786DBC4.6@gmx.net> Message-ID: On Jan 10, 2008 10:00 PM, David Krings wrote: > I gave up on phpMyAdmin a long time ago and use the tools from the MySQL > website. I'd give those a try and see if that gives you more command. i figured it out. it was something really dumb. i didn't have the right username/password in the config file. -- Randal Rust R.Squared Communications www.r2communications.com From bz-gmort at beezifies.com Fri Jan 11 08:09:43 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Fri, 11 Jan 2008 08:09:43 -0500 Subject: [nycphp-talk] Joomla and SE Friendly URLs In-Reply-To: References: Message-ID: <47876A97.1080404@beezifies.com> Well, first off as the local organizer for the NYC Joomla User Group, I'd point you over to the Joomla mailling list also sponsored and maintained by NYPHP(you can subscribe to it from their site). As to your question, SEF in the Joomla world works in 1 of 2 ways: 1) The ugly way. Using native Joomla SEF, all it does is convert keywords to the url, so http://www.mysite.com/index.php?options=content&task=view&id=5 becomees http://www.mysite.com/options/content/task/view/id/5 2) The "smart" way = you use a 3rd party Joomla component that can create pretty urls. These components typically have a default way of doing things. They also are extendable for each component, a component author or consultant working on the project can create a specific file(for example, if your component is called books, the file would be sef_books.php) and that file implements a class with 2 functions. One function takes a Joomla url and prettifies it, and the other takes a pretty url and Joomlafies it. They generally do this is a very simple way, they are called with the url, and return an array to prettify it. The SEF component than pops the array and builds the url. For example: books showbook php_hacks Would become: http://www.mydomain.com/books/showbook/php_hacks.html This means as a /user/ your at the mercy of what configuration options were created by the author of the sef class for the components your using used. As a developer, you are free to edit that very very small file and completely rearrange the ordering to suit your fancy. From ken at secdat.com Fri Jan 11 09:11:37 2008 From: ken at secdat.com (Kenneth Downs) Date: Fri, 11 Jan 2008 09:11:37 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <47865807.6090700@gmx.net> References: <47865807.6090700@gmx.net> Message-ID: <47877919.2080807@secdat.com> Namespaces are an organizing mechanism, usually associated with classes. Think: Class::functions as Namespaces::classes So let's begin with functions. David Krings writes a nifty function called "ValidateEmail()" and puts in a library. Then Ken Downs writes the same function in a different library. Somebody tries to use both libraries but gets an error on a naming collision. If each of us put our functions into classes, and the classes had different names, then the collision would be avoided. But what if we have the same name for our classes, such as "EmailUtils?" You have a class called EmailUtils and so do I, and somebody wants to use a little of yours and little of mine, but there is a naming collision. Namespaces can solve that. In this example, my classes might all be in a "kendowns" namespace and yours might be in a "davidkrings" namespace. For a more rigorous look, take a look at Java and how its functions are organized. All functions are organized into classes and the classes are grouped together into namespaces. If Java needs a function to trim spaces off the right side of a string, they won't call it "RTrim()", they will call it: string.valueChangers.Reducers.Trimmers.Right() I'm sure a disciple of object orientation would point out all of the flaws in the above explanation, but it does portray the practical reality. David Krings wrote: > Hi! > > I got sucked into a (probably pointless) discussion about ASP vs. PHP. > One of the arguments against using PHP was that there is only a single > namespace. Uhm, that took the wind out of my sail as I have no clue > what a namespace is and why having only one is really bad. > > Anyone can explain that to me in laymen terms? > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From ramons at gmx.net Fri Jan 11 10:03:24 2008 From: ramons at gmx.net (David Krings) Date: Fri, 11 Jan 2008 10:03:24 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <47877919.2080807@secdat.com> References: <47865807.6090700@gmx.net> <47877919.2080807@secdat.com> Message-ID: <4787853C.1010305@gmx.net> Kenneth Downs wrote: > Namespaces are an organizing mechanism, usually associated with classes. > > Think: Class::functions as Namespaces::classes > > So let's begin with functions. David Krings writes a nifty function > called "ValidateEmail()" and puts in a library. Then Ken Downs writes > the same function in a different library. Somebody tries to use both > libraries but gets an error on a naming collision. If each of us put > our functions into classes, and the classes had different names, then > the collision would be avoided. > > But what if we have the same name for our classes, such as > "EmailUtils?" You have a class called EmailUtils and so do I, and > somebody wants to use a little of yours and little of mine, but there is > a naming collision. Namespaces can solve that. In this example, my > classes might all be in a "kendowns" namespace and yours might be in a > "davidkrings" namespace. > For a more rigorous look, take a look at Java and how its functions are > organized. All functions are organized into classes and the classes are > grouped together into namespaces. If Java needs a function to trim > spaces off the right side of a string, they won't call it "RTrim()", > they will call it: string.valueChangers.Reducers.Trimmers.Right() > > I'm sure a disciple of object orientation would point out all of the > flaws in the above explanation, but it does portray the practical reality. Thank you for the great explanation. It triggers yet another question: What to do if two namespaces are identical? Doesn't that end up to be the same problem? And if one changes the namespace for one, doesn't that require to change code referencing functions and classes from that namespace as well? Sure, it makes collisions less likely, but it really doesn't fix the ultimate problem, does it? David From tonyf at buffnet.net Fri Jan 11 10:39:46 2008 From: tonyf at buffnet.net (Tony Furnivall) Date: Fri, 11 Jan 2008 09:39:46 -0600 Subject: [nycphp-talk] Problem with MySQL UPDATE syntax Message-ID: Hi! I'm having a problem with the UPDATE syntax for MySQL (aside - I hate products that tell me I have a syntax problem, but don't tell me what it is - and then suggest that I go RTFM which is equally uninformative:-() I'm replacing the entire set of fields, WHERE a condition exists for some of the fields, ie UPDATE table_name SET field1 = ' value1', field2 = ' value2', field3 = ' value3, field4 = ' value4' WHERE field1 = ' value1' AND field2 = ' value2'; MySQL says that I have error 1064 'near WHERE field1 = ' value1' AND field2 = ' value2' but it doesn't say what therror is (grrr!) My questions: My question is what is the appropriate way to expand the syntactic construct of "where_condition", which is not otherwise explained! Help! Tony -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.0/1218 - Release Date: 1/10/2008 1:32 PM From yitzchas at touro.edu Fri Jan 11 10:33:42 2008 From: yitzchas at touro.edu (Yitzchak Schaffer) Date: Fri, 11 Jan 2008 10:33:42 -0500 Subject: [nycphp-talk] Problem with MySQL UPDATE syntax In-Reply-To: References: Message-ID: <47878C56.2020705@touro.edu> Did you copy that query directly? You're missing a quote to close value3. Yitzchak Schaffer Systems Librarian Touro College Libraries 33 West 23rd Street New York, NY 10010 Tel (212) 463-0400 x230 Fax (212) 627-3197 yitzchas at touro.edu Tony Furnivall wrote: > Hi! > > I'm having a problem with the UPDATE syntax for MySQL > > (aside - I hate products that tell me I have a syntax problem, but > don't tell me what it is - and then suggest that I go RTFM which is > equally uninformative:-() > > I'm replacing the entire set of fields, WHERE a condition exists for > some of the fields, ie > > UPDATE table_name SET field1 = ' value1', field2 = ' value2', field3 = > ' value3, field4 = ' value4' WHERE field1 = ' value1' AND field2 = ' > value2'; > > MySQL says that I have error 1064 'near WHERE field1 = ' value1' AND > field2 = ' value2' > > but it doesn't say what therror is (grrr!) > > My questions: > > My question is what is the appropriate way to expand the syntactic > construct of "where_condition", which is not otherwise explained! > > Help! > > Tony > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rotsen at gmail.com Fri Jan 11 10:53:01 2008 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Fri, 11 Jan 2008 07:53:01 -0800 Subject: [nycphp-talk] WYSIWYG editors In-Reply-To: <7.0.1.0.2.20080110203219.029c12e0@e-government.com> References: <477E9E85.8030407@beezifies.com> <7.0.1.0.2.20080108212255.02b2e290@e-government.com> <47843F2F.7080608@gmx.net> <7.0.1.0.2.20080110203219.029c12e0@e-government.com> Message-ID: Urb, Perhaps you can comeback and gives us recap of what you find out and what you have decide to go with and why. :-) On Jan 10, 2008 5:32 PM, Urb LeJeune wrote: > Thanks to all who responded to my request for suggestions on > WYSIWYG editors. > > Urb > > Dr. Urban A. LeJeune, President > E-Government.com > 609-294-0320 800-204-9545 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > E-Government.com lowers you costs while increasing your expectations. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken at secdat.com Fri Jan 11 11:06:20 2008 From: ken at secdat.com (Kenneth Downs) Date: Fri, 11 Jan 2008 11:06:20 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <4787853C.1010305@gmx.net> References: <47865807.6090700@gmx.net> <47877919.2080807@secdat.com> <4787853C.1010305@gmx.net> Message-ID: <478793FC.6080802@secdat.com> David Krings wrote: > > > Thank you for the great explanation. It triggers yet another question: > What to do if two namespaces are identical? Doesn't that end up to be > the same problem? And if one changes the namespace for one, doesn't > that require to change code referencing functions and classes from > that namespace as well? Sure, it makes collisions less likely, but it > really doesn't fix the ultimate problem, does it? Yes, it's true that the ultimate problem of collisions is not solved. That would require world-wide coordination of all programmers. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From jim at bizcomputinginc.com Fri Jan 11 11:23:43 2008 From: jim at bizcomputinginc.com (Jim Hendricks) Date: Fri, 11 Jan 2008 11:23:43 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <478793FC.6080802@secdat.com> References: <47865807.6090700@gmx.net> <47877919.2080807@secdat.com> <4787853C.1010305@gmx.net> <478793FC.6080802@secdat.com> Message-ID: <4787980F.5040704@bizcomputinginc.com> When Palm opened up the platform for 3rd party programming, they created a registration page for the database type id's. This allowed for global registration which would eliminate namespace collissions so long as programmers registered the id's they were using prior to distro. Don't know how effective it was, but thot it was a good idea. How crazy would it be if PHP had namespaces and a namespace registration. Kenneth Downs wrote: > David Krings wrote: >> >> >> Thank you for the great explanation. It triggers yet another >> question: What to do if two namespaces are identical? Doesn't that >> end up to be the same problem? And if one changes the namespace for >> one, doesn't that require to change code referencing functions and >> classes from that namespace as well? Sure, it makes collisions less >> likely, but it really doesn't fix the ultimate problem, does it? > > Yes, it's true that the ultimate problem of collisions is not solved. > That would require world-wide coordination of all programmers. >> >> David >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > From tonyf at buffnet.net Fri Jan 11 11:34:03 2008 From: tonyf at buffnet.net (Tony Furnivall) Date: Fri, 11 Jan 2008 10:34:03 -0600 Subject: [nycphp-talk] re: Problem with MySQL UPDATE syntax - Update Message-ID: Yitzchak suggested adding a quote to delimit a value - and it turns out the solution was equally trivial. I'm using a whole load of copied lines to build the query string, and each one (one/field) had a comma at the end. I didn't notice it, buried in the clutter, until I started adding a \n to each line. Then, of course it stood out like a sore thumb on my trace. Certainly my fault - but the gripe about the extremely useless syntax message stands! Thanks, as before, for the incredible support offered by this group! Tony -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.0/1218 - Release Date: 1/10/2008 1:32 PM From jmcgraw1 at gmail.com Fri Jan 11 11:29:00 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Fri, 11 Jan 2008 11:29:00 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <4787980F.5040704@bizcomputinginc.com> References: <47865807.6090700@gmx.net> <47877919.2080807@secdat.com> <4787853C.1010305@gmx.net> <478793FC.6080802@secdat.com> <4787980F.5040704@bizcomputinginc.com> Message-ID: UDDI is trying to do the same thing (with limited success, I've only looked at their Web Services registration)... check out: http://en.wikipedia.org/wiki/Universal_Description_Discovery_and_Integration Additionally, if you'd like to release software that won't have a namespace conflict, purchase a domain and use it as the opening namespace for all you software, ala: As an example, if I own www.jakemcgraw.com, I release software under the namespace: com.jakemcgraw.* com.jakemcgraw.SuperDatabaseDriver.ConnectionClass - jake On Jan 11, 2008 11:23 AM, Jim Hendricks wrote: > When Palm opened up the platform for 3rd party programming, they created > a registration page for the database type id's. This allowed for global > registration which would eliminate namespace collissions so long as > programmers registered the id's they were using prior to distro. > > Don't know how effective it was, but thot it was a good idea. > > How crazy would it be if PHP had namespaces and a namespace registration. > > > Kenneth Downs wrote: > > David Krings wrote: > >> > >> > >> Thank you for the great explanation. It triggers yet another > >> question: What to do if two namespaces are identical? Doesn't that > >> end up to be the same problem? And if one changes the namespace for > >> one, doesn't that require to change code referencing functions and > >> classes from that namespace as well? Sure, it makes collisions less > >> likely, but it really doesn't fix the ultimate problem, does it? > > > > Yes, it's true that the ultimate problem of collisions is not solved. > > That would require world-wide coordination of all programmers. > >> > >> David > >> _______________________________________________ > >> New York PHP Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> NYPHPCon 2006 Presentations Online > >> http://www.nyphpcon.com > >> > >> Show Your Participation in New York PHP > >> http://www.nyphp.org/show_participation.php > > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From ramons at gmx.net Fri Jan 11 11:39:15 2008 From: ramons at gmx.net (David Krings) Date: Fri, 11 Jan 2008 11:39:15 -0500 Subject: [nycphp-talk] re: Problem with MySQL UPDATE syntax - Update In-Reply-To: References: Message-ID: <47879BB3.9020004@gmx.net> Tony Furnivall wrote: > Certainly my fault - but the gripe about the extremely useless syntax > message stands! I agree that those error messages are really worth improving. MySQL knows exactly why it failed, it may not be able to determine the exact spot, but missing quotes or a mistyped command are probably the most common query syntax errors. With a little bit of effort the MySQL developers could put better error messages in. I yet have to find an application that has decent error handling/messaging. Nobody wants to spend time and effort on it. It doesn't add functionality and developer arrogance leads to putting this on the shoulders of support to deal with. Then again, MySQL could just give out some even less useless error message. I once ran into a problem with MS Access and the error message text was "There is no message for this error." David From jcampbell1 at gmail.com Fri Jan 11 12:08:05 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Fri, 11 Jan 2008 12:08:05 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <478793FC.6080802@secdat.com> References: <47865807.6090700@gmx.net> <47877919.2080807@secdat.com> <4787853C.1010305@gmx.net> <478793FC.6080802@secdat.com> Message-ID: <8f0676b40801110908o18d742ceg22d3b6d10e9af64d@mail.gmail.com> Namespaces are supposed to be analogous to folders in the file system. Folders are how we prevent file name collisions, and namespaces are how we prevent function/classname collisions. If you have a bunch of files that might have the same names as an existing file, then you just create a new folder. If you are importing code that may have function/class collision, then you import it into a different namespace. Unfortunately I think the php devs don't think of namespaces in the same way, and it looks like the 5.3 namespace implementation will lack the ability to rename the namespace and relies on everyone using a unique namespace. The domain convention is okay, but I would much rather be able to do something like: include 'dkSuperClass.php' into namespace 'foo' It looks like the php devs are going the Java route, which ain't great because it relies on every library being changed which will never happen for compatibility reasons. I would much rather have a tool that lets me solve collisions today than a tool that requires libraries to be rewritten and agreement on a naming convention in order for it to work. Regards, John Campbell From christiandailey at gmail.com Fri Jan 11 12:45:28 2008 From: christiandailey at gmail.com (Tod Dailey) Date: Fri, 11 Jan 2008 12:45:28 -0500 Subject: [nycphp-talk] Question about explicit returns Message-ID: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> The validity of one of my coding practices that I've used for awhile has recently come under question. I've tried to listen to arguments on both sides, and there seems to be good points on both ends, but my question still hasn't been answered to my satisfaction. When I'm writing a function that returns a Boolean that indicates that the given process failed or succeeded, I declare the Boolean as a variable at the top of the function. I feel that this makes the code easier to read whenever/if-ever I need to come back and add further logic conditions to that function. When I come back to the function, I have a short list of accept by exception where I more-or-less just need to find the point that I return true to understand the function. Verse inline returns, such as "if ($condition !== true) return false;" that builds a list of failure by exception. It may just be in my head that the first method is easier to read, but that's why I'm asking for input/options. Here are two examples. They should both return the same value, but by different means. Please don't be side-track by the over-all quality of code/lack-thereof. Thanks! public function checkForSomething($record_id) { $result = false; $yourObj = new SomeObject; $result = $yourObj->loadObjectByRecordId($record_id); if ($result === true) {as $restrictedItems = $yourObj->getUnrestictedItems(); if (is_array($restrictedItems)) { $result = $yourObj->updateUnrestrictedItems(self::ObjectItemStatus); if ($result === true) { $this->setRecordStatusId($yourObj->getRecordStatusId()); $this->setRestrictedItemList($restrictedItems); $result = true; } } else { $result = false; } } } public function checkForSomething($record_id) { $yourObj = new SomeObject; if ($yourObj->loadObjectByRecordId($record_id) !== true) { return false; } if (!is_array($restrictedItems = $yourObj->getUnrestrictedItems())) { return false; } if ($yourObj->updateUnrestrictedItems(self::ObjectItemStatus) !== true) { return false; } $this->setRecordStatusId($yourObj->getRecordStatusId()); $this->setRestrictedItemList($restrictedItems); return true; } Once again, this is pseudo-code... Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Fri Jan 11 13:02:43 2008 From: ramons at gmx.net (David Krings) Date: Fri, 11 Jan 2008 13:02:43 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> Message-ID: <4787AF43.5030409@gmx.net> Tod Dailey wrote: > The validity of one of my coding practices that I've used for awhile has > recently come under question. I've tried to listen to arguments on both > sides, and there seems to be good points on both ends, but my question > still hasn't been answered to my satisfaction. I use version 1 (can it be that you forgot to return $result at the end?) where I declare anything that is used in the function at the top, including booleans. I then do whatever I want/need to do in that function and set the flag accordingly and then return the result at the very end of the function I see the benefits of the second version as there is a direct return of the state and it saves a variable. Without having it tried out any other way, I find version 1 to be easier to debug. In v1 you can evaluate $result before retruning it, can't do that with v2. V2 is potentially faster as it doesn't have to go through who knows how many lines of code first before it reaches the return at the end. As soon as a return is hit in the function the function exits and sends back the return values. I'd develop using v1 and then see later if optimizing using v2 makes sense. It would be interesting to know the pros and cons for either version that you have heard so far. David From christiandailey at gmail.com Fri Jan 11 13:23:15 2008 From: christiandailey at gmail.com (Tod Dailey) Date: Fri, 11 Jan 2008 13:23:15 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <4787AF43.5030409@gmx.net> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> <4787AF43.5030409@gmx.net> Message-ID: <6232fa7e0801111023u156b0297w7fbfa63dd1b5f4fa@mail.gmail.com> That's part of the reason I'm asking here, as the replies I've received weren't that informative. I've heard that method #1 is a left-over practice from C/Java programmers, and isn't necessary with PHP (??). I've also heard the argument that returning inline values is faster, and easier to see exactly what is being returned. That pretty much sums up what I've heard so-far. Christian On Jan 11, 2008 1:02 PM, David Krings wrote: > Tod Dailey wrote: > > The validity of one of my coding practices that I've used for awhile has > > recently come under question. I've tried to listen to arguments on both > > sides, and there seems to be good points on both ends, but my question > > still hasn't been answered to my satisfaction. > > I use version 1 (can it be that you forgot to return $result at the end?) > where I declare anything that is used in the function at the top, > including > booleans. I then do whatever I want/need to do in that function and set > the > flag accordingly and then return the result at the very end of the > function > I see the benefits of the second version as there is a direct return of > the > state and it saves a variable. Without having it tried out any other way, > I > find version 1 to be easier to debug. In v1 you can evaluate $result > before > retruning it, can't do that with v2. V2 is potentially faster as it > doesn't > have to go through who knows how many lines of code first before it > reaches > the return at the end. As soon as a return is hit in the function the > function > exits and sends back the return values. > > I'd develop using v1 and then see later if optimizing using v2 makes > sense. It > would be interesting to know the pros and cons for either version that you > have heard so far. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Fri Jan 11 13:37:51 2008 From: ben at projectskyline.com (Ben Sgro) Date: Fri, 11 Jan 2008 13:37:51 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <6232fa7e0801111023u156b0297w7fbfa63dd1b5f4fa@mail.gmail.com> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> <4787AF43.5030409@gmx.net> <6232fa7e0801111023u156b0297w7fbfa63dd1b5f4fa@mail.gmail.com> Message-ID: <4787B77F.1090601@projectskyline.com> Hello, Word, I immediately feel version 2 is easier to understand. Yeah you can't check the result, but you could step through with a debugger and then check the *result* $result just adds extra complexity; no need to copy the value and then return it. Just return it at the first point you can return it. In something more complex, maybe having 50 places you could exit that function, in that case, save the result and do a return $result; at the bottom. That's fine, and makes sense. I can't comment on speed but I'd guess both these methods run pretty close to the same speed. I would never waste time optimizing something like this (unless I knew it was causing a bottleneck). - Ben Tod Dailey wrote: > That's part of the reason I'm asking here, as the replies I've > received weren't that informative. I've heard that method #1 is a > left-over practice from C/Java programmers, and isn't necessary with > PHP (??). I've also heard the argument that returning inline values is > faster, and easier to see exactly what is being returned. That pretty > much sums up what I've heard so-far. > > Christian > > > On Jan 11, 2008 1:02 PM, David Krings > wrote: > > Tod Dailey wrote: > > The validity of one of my coding practices that I've used for > awhile has > > recently come under question. I've tried to listen to arguments > on both > > sides, and there seems to be good points on both ends, but my > question > > still hasn't been answered to my satisfaction. > > I use version 1 (can it be that you forgot to return $result at > the end?) > where I declare anything that is used in the function at the top, > including > booleans. I then do whatever I want/need to do in that function > and set the > flag accordingly and then return the result at the very end of the > function > I see the benefits of the second version as there is a direct > return of the > state and it saves a variable. Without having it tried out any > other way, I > find version 1 to be easier to debug. In v1 you can evaluate > $result before > retruning it, can't do that with v2. V2 is potentially faster as > it doesn't > have to go through who knows how many lines of code first before > it reaches > the return at the end. As soon as a return is hit in the function > the function > exits and sends back the return values. > > I'd develop using v1 and then see later if optimizing using v2 > makes sense. It > would be interesting to know the pros and cons for either version > that you > have heard so far. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 ioplex at gmail.com Fri Jan 11 13:56:35 2008 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 11 Jan 2008 13:56:35 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> Message-ID: <78c6bd860801111056h2af89e00tac0fe4e0fc2c7c6a@mail.gmail.com> On 1/11/08, Tod Dailey wrote: > When I'm writing a function that returns a Boolean that indicates that the > given process failed or Verse inline returns, such as "if > ($condition !== true) return false;" that builds a list of failure by > exception. Hi Tod, I don't think it matters that much. I would rather spend time thinking about the overall design. Just pick one technique that makes you happy and stick to it. This is how I would write it: public function checkForSomething($record_id) { $yourObj = new SomeObject; if ($yourObj->loadObjectByRecordId($record_id)) { if (is_array($restrictedItems = $yourObj->getUnrestrictedItems())) { if ($yourObj->updateUnrestrictedItems(self::ObjectItemStatus)) { $this->setRecordStatusId($yourObj->getRecordStatusId()); $this->setRestrictedItemList($restrictedItems); return true; } } } return false; } -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From brian at realm3.com Fri Jan 11 14:11:58 2008 From: brian at realm3.com (Brian D.) Date: Fri, 11 Jan 2008 14:11:58 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <78c6bd860801111056h2af89e00tac0fe4e0fc2c7c6a@mail.gmail.com> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> <78c6bd860801111056h2af89e00tac0fe4e0fc2c7c6a@mail.gmail.com> Message-ID: I actually would go with: loadObjectByRecordId($record_id) && is_array($restrictedItems = $yourObj->getUnrestrictedItems() && $yourObj->updateUnrestrictedItems(self::ObjectItemStatus) ) { $this->setRecordStatusId($yourObj->getRecordStatusId()); $this->setRestrictedItemList($restrictedItems); return true; } return false; } Since the && operator is executed in the order you want, extra if()s are unnecessary. I agree with Allen, though, that it doesn't matter so much as just being consistent. Much of it is personal preference or company policy: basically who decides what is more readable. - Brian D. On Jan 11, 2008 1:56 PM, Michael B Allen wrote: > On 1/11/08, Tod Dailey wrote: > > When I'm writing a function that returns a Boolean that indicates that the > > given process failed or Verse inline returns, such as "if > > ($condition !== true) return false;" that builds a list of failure by > > exception. > [snip] -- realm3 web applications [realm3.com] freelance consulting, application development (423) 506-0349 From danielc at analysisandsolutions.com Fri Jan 11 15:55:49 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 11 Jan 2008 15:55:49 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> Message-ID: <20080111205549.GA15748@panix.com> I like returning as soon as possible. This clarifies exactly what's happening. Otherwise you need to read through the whole function. Plus it dramatically cuts down on the amount of nesting. I also try to put the short code bits at the top so you can read it right away and then move on to the big block. For example, you have this block: > if (is_array($restrictedItems)) { > $result = $yourObj->updateUnrestrictedItems(...); > > if ($result === true) { > $this->setRecordStatusId($yourObj->getRecordStatusId()); > $this->setRestrictedItemList($restrictedItems); > $result = true; > } > } else { > $result = false; > } which I'd change the initial test to negate the is_array() test: if (!is_array($restrictedItems)) { $result = false; } else { $result = $yourObj->updateUnrestrictedItems(...); if ($result === true) { $this->setRecordStatusId($yourObj->getRecordStatusId()); $this->setRestrictedItemList($restrictedItems); $result = true; } } Enjoy, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From ioplex at gmail.com Fri Jan 11 17:17:18 2008 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 11 Jan 2008 17:17:18 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> <78c6bd860801111056h2af89e00tac0fe4e0fc2c7c6a@mail.gmail.com> Message-ID: <78c6bd860801111417p6ae8b871vc1a082889aa25d15@mail.gmail.com> On 1/11/08, Brian D. wrote: > if ( > $yourObj->loadObjectByRecordId($record_id) > && is_array($restrictedItems = $yourObj->getUnrestrictedItems() > && $yourObj->updateUnrestrictedItems(self::ObjectItemStatus) > ) { > $this->setRecordStatusId($yourObj->getRecordStatusId()); > $this->setRestrictedItemList($restrictedItems); > return true; > } > > return false; > } > > Since the && operator is executed in the order you want, extra if()s > are unnecessary. I see three problems with this: 1) Eliminating a few if()s does not make the code better and in this case I think it actually makes it more difficult to understand at a glance. 2) If you have a new block for each successful step, any "undo" code will fit gracefully: public function checkForSomething($record_id) { $yourObj = new SomeObject; if ($yourObj->loadObjectByRecordId($record_id)) { if (is_array($restrictedItems = $yourObj->getUnrestrictedItems())) { if ($yourObj->updateUnrestrictedItems(self::ObjectItemStatus)) { $this->setRecordStatusId($yourObj->getRecordStatusId()); $this->setRestrictedItemList($restrictedItems); return true; } // undo something from getUnrestrictedItems() } // undo sometihng from loadObjectByRecordId() } return false; } 3) If you're trying to debug using a few log statements you might have to breakup the condition. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ioplex at gmail.com Fri Jan 11 17:23:35 2008 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 11 Jan 2008 17:23:35 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <20080111205549.GA15748@panix.com> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> <20080111205549.GA15748@panix.com> Message-ID: <78c6bd860801111423o41c28878hbcd6dbb268ded0fd@mail.gmail.com> On 1/11/08, Daniel Convissor wrote: > I like returning as soon as possible. This clarifies exactly what's > happening. Otherwise you need to read through the whole function. Plus > it dramatically cuts down on the amount of nesting. I think the nesting helps you understand the code. You know the more indented you are the deeper the success of the overall operation. If the nesting get's to it's easy move that block into a new function without thinking about the logic. Regarding the number of returns, it's better to minimize the number of exit points because it simplifies the function contract. If you have to modify the code later, there are fewer exit points to consider. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jonathanw at amoeba.co.za Fri Jan 11 17:44:35 2008 From: jonathanw at amoeba.co.za (Jonathan Wagener) Date: Sat, 12 Jan 2008 00:44:35 +0200 Subject: [nycphp-talk] Whats the difference between an apostrophe and a quotation In-Reply-To: References: Message-ID: Hi, whats the difference between an apostrophe and a quotation in php? Jonathan Wagener Web Developer / Architect Amoeba Business Solutions Cell: +27 72 928 0513 Office: +27 21 785 1424 Web: www.amoeba.co.za Blog: www.espresso-online.info -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of talk-request at lists.nyphp.org Sent: 11 January 2008 21:16 To: talk at lists.nyphp.org Subject: talk Digest, Vol 15, Issue 22 Send talk mailing list submissions to talk at lists.nyphp.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.nyphp.org/mailman/listinfo/talk or, via email, send a message with subject or body 'help' to talk-request at lists.nyphp.org You can reach the person managing the list at talk-owner at lists.nyphp.org When replying, please edit your Subject line so it is more specific than "Re: Contents of talk digest..." Today's Topics: 1. Re: Namespaces (John Campbell) 2. Question about explicit returns (Tod Dailey) 3. Re: Question about explicit returns (David Krings) 4. Re: Question about explicit returns (Tod Dailey) 5. Re: Question about explicit returns (Ben Sgro) 6. Re: Question about explicit returns (Michael B Allen) ---------------------------------------------------------------------- Message: 1 Date: Fri, 11 Jan 2008 12:08:05 -0500 From: "John Campbell" Subject: Re: [nycphp-talk] Namespaces To: "NYPHP Talk" Message-ID: <8f0676b40801110908o18d742ceg22d3b6d10e9af64d at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Namespaces are supposed to be analogous to folders in the file system. Folders are how we prevent file name collisions, and namespaces are how we prevent function/classname collisions. If you have a bunch of files that might have the same names as an existing file, then you just create a new folder. If you are importing code that may have function/class collision, then you import it into a different namespace. Unfortunately I think the php devs don't think of namespaces in the same way, and it looks like the 5.3 namespace implementation will lack the ability to rename the namespace and relies on everyone using a unique namespace. The domain convention is okay, but I would much rather be able to do something like: include 'dkSuperClass.php' into namespace 'foo' It looks like the php devs are going the Java route, which ain't great because it relies on every library being changed which will never happen for compatibility reasons. I would much rather have a tool that lets me solve collisions today than a tool that requires libraries to be rewritten and agreement on a naming convention in order for it to work. Regards, John Campbell ------------------------------ Message: 2 Date: Fri, 11 Jan 2008 12:45:28 -0500 From: "Tod Dailey" Subject: [nycphp-talk] Question about explicit returns To: talk at lists.nyphp.org Message-ID: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4 at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" The validity of one of my coding practices that I've used for awhile has recently come under question. I've tried to listen to arguments on both sides, and there seems to be good points on both ends, but my question still hasn't been answered to my satisfaction. When I'm writing a function that returns a Boolean that indicates that the given process failed or succeeded, I declare the Boolean as a variable at the top of the function. I feel that this makes the code easier to read whenever/if-ever I need to come back and add further logic conditions to that function. When I come back to the function, I have a short list of accept by exception where I more-or-less just need to find the point that I return true to understand the function. Verse inline returns, such as "if ($condition !== true) return false;" that builds a list of failure by exception. It may just be in my head that the first method is easier to read, but that's why I'm asking for input/options. Here are two examples. They should both return the same value, but by different means. Please don't be side-track by the over-all quality of code/lack-thereof. Thanks! public function checkForSomething($record_id) { $result = false; $yourObj = new SomeObject; $result = $yourObj->loadObjectByRecordId($record_id); if ($result === true) {as $restrictedItems = $yourObj->getUnrestictedItems(); if (is_array($restrictedItems)) { $result = $yourObj->updateUnrestrictedItems(self::ObjectItemStatus); if ($result === true) { $this->setRecordStatusId($yourObj->getRecordStatusId()); $this->setRestrictedItemList($restrictedItems); $result = true; } } else { $result = false; } } } public function checkForSomething($record_id) { $yourObj = new SomeObject; if ($yourObj->loadObjectByRecordId($record_id) !== true) { return false; } if (!is_array($restrictedItems = $yourObj->getUnrestrictedItems())) { return false; } if ($yourObj->updateUnrestrictedItems(self::ObjectItemStatus) !== true) { return false; } $this->setRecordStatusId($yourObj->getRecordStatusId()); $this->setRestrictedItemList($restrictedItems); return true; } Once again, this is pseudo-code... Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.nyphp.org/pipermail/talk/attachments/20080111/d7b10f23/atta chment-0001.html ------------------------------ Message: 3 Date: Fri, 11 Jan 2008 13:02:43 -0500 From: David Krings Subject: Re: [nycphp-talk] Question about explicit returns To: NYPHP Talk Message-ID: <4787AF43.5030409 at gmx.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Tod Dailey wrote: > The validity of one of my coding practices that I've used for awhile > has recently come under question. I've tried to listen to arguments on > both sides, and there seems to be good points on both ends, but my > question still hasn't been answered to my satisfaction. I use version 1 (can it be that you forgot to return $result at the end?) where I declare anything that is used in the function at the top, including booleans. I then do whatever I want/need to do in that function and set the flag accordingly and then return the result at the very end of the function I see the benefits of the second version as there is a direct return of the state and it saves a variable. Without having it tried out any other way, I find version 1 to be easier to debug. In v1 you can evaluate $result before retruning it, can't do that with v2. V2 is potentially faster as it doesn't have to go through who knows how many lines of code first before it reaches the return at the end. As soon as a return is hit in the function the function exits and sends back the return values. I'd develop using v1 and then see later if optimizing using v2 makes sense. It would be interesting to know the pros and cons for either version that you have heard so far. David ------------------------------ Message: 4 Date: Fri, 11 Jan 2008 13:23:15 -0500 From: "Tod Dailey" Subject: Re: [nycphp-talk] Question about explicit returns To: "NYPHP Talk" Message-ID: <6232fa7e0801111023u156b0297w7fbfa63dd1b5f4fa at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" That's part of the reason I'm asking here, as the replies I've received weren't that informative. I've heard that method #1 is a left-over practice from C/Java programmers, and isn't necessary with PHP (??). I've also heard the argument that returning inline values is faster, and easier to see exactly what is being returned. That pretty much sums up what I've heard so-far. Christian On Jan 11, 2008 1:02 PM, David Krings wrote: > Tod Dailey wrote: > > The validity of one of my coding practices that I've used for awhile > > has recently come under question. I've tried to listen to arguments > > on both sides, and there seems to be good points on both ends, but > > my question still hasn't been answered to my satisfaction. > > I use version 1 (can it be that you forgot to return $result at the > end?) where I declare anything that is used in the function at the > top, including booleans. I then do whatever I want/need to do in that > function and set the flag accordingly and then return the result at > the very end of the function I see the benefits of the second version > as there is a direct return of the state and it saves a variable. > Without having it tried out any other way, I find version 1 to be > easier to debug. In v1 you can evaluate $result before retruning it, > can't do that with v2. V2 is potentially faster as it doesn't have to > go through who knows how many lines of code first before it reaches > the return at the end. As soon as a return is hit in the function the > function exits and sends back the return values. > > I'd develop using v1 and then see later if optimizing using v2 makes > sense. It would be interesting to know the pros and cons for either > version that you have heard so far. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.nyphp.org/pipermail/talk/attachments/20080111/80fff8f9/atta chment-0001.html ------------------------------ Message: 5 Date: Fri, 11 Jan 2008 13:37:51 -0500 From: Ben Sgro Subject: Re: [nycphp-talk] Question about explicit returns To: NYPHP Talk Message-ID: <4787B77F.1090601 at projectskyline.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hello, Word, I immediately feel version 2 is easier to understand. Yeah you can't check the result, but you could step through with a debugger and then check the *result* $result just adds extra complexity; no need to copy the value and then return it. Just return it at the first point you can return it. In something more complex, maybe having 50 places you could exit that function, in that case, save the result and do a return $result; at the bottom. That's fine, and makes sense. I can't comment on speed but I'd guess both these methods run pretty close to the same speed. I would never waste time optimizing something like this (unless I knew it was causing a bottleneck). - Ben Tod Dailey wrote: > That's part of the reason I'm asking here, as the replies I've > received weren't that informative. I've heard that method #1 is a > left-over practice from C/Java programmers, and isn't necessary with > PHP (??). I've also heard the argument that returning inline values is > faster, and easier to see exactly what is being returned. That pretty > much sums up what I've heard so-far. > > Christian > > > On Jan 11, 2008 1:02 PM, David Krings > wrote: > > Tod Dailey wrote: > > The validity of one of my coding practices that I've used for > awhile has > > recently come under question. I've tried to listen to arguments > on both > > sides, and there seems to be good points on both ends, but my > question > > still hasn't been answered to my satisfaction. > > I use version 1 (can it be that you forgot to return $result at > the end?) > where I declare anything that is used in the function at the top, > including > booleans. I then do whatever I want/need to do in that function > and set the > flag accordingly and then return the result at the very end of the > function > I see the benefits of the second version as there is a direct > return of the > state and it saves a variable. Without having it tried out any > other way, I > find version 1 to be easier to debug. In v1 you can evaluate > $result before > retruning it, can't do that with v2. V2 is potentially faster as > it doesn't > have to go through who knows how many lines of code first before > it reaches > the return at the end. As soon as a return is hit in the function > the function > exits and sends back the return values. > > I'd develop using v1 and then see later if optimizing using v2 > makes sense. It > would be interesting to know the pros and cons for either version > that you > have heard so far. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > ---------------------------------------------------------------------- > -- > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php ------------------------------ Message: 6 Date: Fri, 11 Jan 2008 13:56:35 -0500 From: "Michael B Allen" Subject: Re: [nycphp-talk] Question about explicit returns To: "NYPHP Talk" Message-ID: <78c6bd860801111056h2af89e00tac0fe4e0fc2c7c6a at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On 1/11/08, Tod Dailey wrote: > When I'm writing a function that returns a Boolean that indicates that > the given process failed or Verse inline returns, such as "if > ($condition !== true) return false;" that builds a list of failure by > exception. Hi Tod, I don't think it matters that much. I would rather spend time thinking about the overall design. Just pick one technique that makes you happy and stick to it. This is how I would write it: public function checkForSomething($record_id) { $yourObj = new SomeObject; if ($yourObj->loadObjectByRecordId($record_id)) { if (is_array($restrictedItems = $yourObj->getUnrestrictedItems())) { if ($yourObj->updateUnrestrictedItems(self::ObjectItemStatus)) { $this->setRecordStatusId($yourObj->getRecordStatusId()); $this->setRestrictedItemList($restrictedItems); return true; } } } return false; } -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ ------------------------------ _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk End of talk Digest, Vol 15, Issue 22 ************************************ From ajai at bitblit.net Fri Jan 11 17:47:43 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 11 Jan 2008 17:47:43 -0500 (EST) Subject: [nycphp-talk] Whats the difference between an apostrophe and a quotation In-Reply-To: Message-ID: On Sat, 12 Jan 2008, Jonathan Wagener wrote: > Hi, whats the difference between an apostrophe and a quotation in php? We have single quotes, double quotes and back quotes - which do you mean? I would say apostrophe == single quote. > > > Jonathan Wagener > Web Developer / Architect > Amoeba Business Solutions > Cell: +27 72 928 0513 > Office: +27 21 785 1424 > Web: www.amoeba.co.za > Blog: www.espresso-online.info > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of talk-request at lists.nyphp.org > Sent: 11 January 2008 21:16 > To: talk at lists.nyphp.org > Subject: talk Digest, Vol 15, Issue 22 > > Send talk mailing list submissions to > talk at lists.nyphp.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.nyphp.org/mailman/listinfo/talk > or, via email, send a message with subject or body 'help' to > talk-request at lists.nyphp.org > > You can reach the person managing the list at > talk-owner at lists.nyphp.org > > When replying, please edit your Subject line so it is more specific than > "Re: Contents of talk digest..." > > > Today's Topics: > > 1. Re: Namespaces (John Campbell) > 2. Question about explicit returns (Tod Dailey) > 3. Re: Question about explicit returns (David Krings) > 4. Re: Question about explicit returns (Tod Dailey) > 5. Re: Question about explicit returns (Ben Sgro) > 6. Re: Question about explicit returns (Michael B Allen) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 11 Jan 2008 12:08:05 -0500 > From: "John Campbell" > Subject: Re: [nycphp-talk] Namespaces > To: "NYPHP Talk" > Message-ID: > <8f0676b40801110908o18d742ceg22d3b6d10e9af64d at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Namespaces are supposed to be analogous to folders in the file system. > Folders are how we prevent file name collisions, and namespaces are how > we prevent function/classname collisions. If you have a bunch of files > that might have the same names as an existing file, then you just create > a new folder. If you are importing code that may have function/class > collision, then you import it into a different namespace. Unfortunately > I think the php devs don't think of namespaces in the same way, and it > looks like the 5.3 namespace implementation will lack the ability to > rename the namespace and relies on everyone using a unique namespace. > The domain convention is okay, but I would much rather be able to do > something like: > > include 'dkSuperClass.php' into namespace 'foo' > > It looks like the php devs are going the Java route, which ain't great > because it relies on every library being changed which will never happen > for compatibility reasons. > > I would much rather have a tool that lets me solve collisions today than > a tool that requires libraries to be rewritten and agreement on a naming > convention in order for it to work. > > > > Regards, > John Campbell > > > ------------------------------ > > Message: 2 > Date: Fri, 11 Jan 2008 12:45:28 -0500 > From: "Tod Dailey" > Subject: [nycphp-talk] Question about explicit returns > To: talk at lists.nyphp.org > Message-ID: > <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > The validity of one of my coding practices that I've used for awhile has > recently come under question. I've tried to listen to arguments on both > sides, and there seems to be good points on both ends, but my question > still hasn't been answered to my satisfaction. > > When I'm writing a function that returns a Boolean that indicates that > the given process failed or succeeded, I declare the Boolean as a > variable at the top of the function. I feel that this makes the code > easier to read whenever/if-ever I need to come back and add further > logic conditions to that function. When I come back to the function, I > have a short list of accept by exception where I more-or-less just need > to find the point that I return true to understand the function. Verse > inline returns, such as "if ($condition !== true) return false;" that > builds a list of failure by exception. It may just be in my head that > the first method is easier to read, but that's why I'm asking for > input/options. Here are two examples. > They should both return the same value, but by different means. Please > don't be side-track by the over-all quality of code/lack-thereof. > Thanks! > > > public function checkForSomething($record_id) { > $result = false; > > $yourObj = new SomeObject; > > $result = $yourObj->loadObjectByRecordId($record_id); > if ($result === true) {as > $restrictedItems = $yourObj->getUnrestictedItems(); > > if (is_array($restrictedItems)) { > $result = > $yourObj->updateUnrestrictedItems(self::ObjectItemStatus); > > if ($result === true) { > $this->setRecordStatusId($yourObj->getRecordStatusId()); > $this->setRestrictedItemList($restrictedItems); > $result = true; > } > } else { > $result = false; > } > } > } > > > public function checkForSomething($record_id) { > $yourObj = new SomeObject; > > if ($yourObj->loadObjectByRecordId($record_id) !== true) { > return false; > } > > if (!is_array($restrictedItems = $yourObj->getUnrestrictedItems())) > { > return false; > } > > if ($yourObj->updateUnrestrictedItems(self::ObjectItemStatus) !== > true) { > return false; > } > > $this->setRecordStatusId($yourObj->getRecordStatusId()); > $this->setRestrictedItemList($restrictedItems); > return true; > } > > Once again, this is pseudo-code... > Christian > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://lists.nyphp.org/pipermail/talk/attachments/20080111/d7b10f23/atta > chment-0001.html > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jan 2008 13:02:43 -0500 > From: David Krings > Subject: Re: [nycphp-talk] Question about explicit returns > To: NYPHP Talk > Message-ID: <4787AF43.5030409 at gmx.net> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Tod Dailey wrote: > > The validity of one of my coding practices that I've used for awhile > > has recently come under question. I've tried to listen to arguments on > > > both sides, and there seems to be good points on both ends, but my > > question still hasn't been answered to my satisfaction. > > I use version 1 (can it be that you forgot to return $result at the > end?) where I declare anything that is used in the function at the top, > including booleans. I then do whatever I want/need to do in that > function and set the flag accordingly and then return the result at the > very end of the function > I see the benefits of the second version as there is a direct return > of the state and it saves a variable. Without having it tried out any > other way, I find version 1 to be easier to debug. In v1 you can > evaluate $result before retruning it, can't do that with v2. V2 is > potentially faster as it doesn't have to go through who knows how many > lines of code first before it reaches the return at the end. As soon as > a return is hit in the function the function exits and sends back the > return values. > > I'd develop using v1 and then see later if optimizing using v2 makes > sense. It would be interesting to know the pros and cons for either > version that you have heard so far. > > David > > > ------------------------------ > > Message: 4 > Date: Fri, 11 Jan 2008 13:23:15 -0500 > From: "Tod Dailey" > Subject: Re: [nycphp-talk] Question about explicit returns > To: "NYPHP Talk" > Message-ID: > <6232fa7e0801111023u156b0297w7fbfa63dd1b5f4fa at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > That's part of the reason I'm asking here, as the replies I've received > weren't that informative. I've heard that method #1 is a left-over > practice from C/Java programmers, and isn't necessary with PHP (??). > I've also heard the argument that returning inline values is faster, and > easier to see exactly what is being returned. That pretty much sums up > what I've heard so-far. > > Christian > > > On Jan 11, 2008 1:02 PM, David Krings wrote: > > > Tod Dailey wrote: > > > The validity of one of my coding practices that I've used for awhile > > > > has recently come under question. I've tried to listen to arguments > > > on both sides, and there seems to be good points on both ends, but > > > my question still hasn't been answered to my satisfaction. > > > > I use version 1 (can it be that you forgot to return $result at the > > end?) where I declare anything that is used in the function at the > > top, including booleans. I then do whatever I want/need to do in that > > function and set the flag accordingly and then return the result at > > the very end of the function I see the benefits of the second version > > > as there is a direct return of the state and it saves a variable. > > Without having it tried out any other way, I find version 1 to be > > easier to debug. In v1 you can evaluate $result before retruning it, > > can't do that with v2. V2 is potentially faster as it doesn't have to > > go through who knows how many lines of code first before it reaches > > the return at the end. As soon as a return is hit in the function the > > function exits and sends back the return values. > > > > I'd develop using v1 and then see later if optimizing using v2 makes > > sense. It would be interesting to know the pros and cons for either > > version that you have heard so far. > > > > David > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://lists.nyphp.org/pipermail/talk/attachments/20080111/80fff8f9/atta > chment-0001.html > > ------------------------------ > > Message: 5 > Date: Fri, 11 Jan 2008 13:37:51 -0500 > From: Ben Sgro > Subject: Re: [nycphp-talk] Question about explicit returns > To: NYPHP Talk > Message-ID: <4787B77F.1090601 at projectskyline.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hello, > > Word, I immediately feel version 2 is easier to understand. Yeah you > can't check the result, but you could step through with a debugger and > then check the *result* > > $result just adds extra complexity; no need to copy the value and then > return it. Just return it at the first point you can return it. > In something more complex, maybe having 50 places you could exit that > function, in that case, save the result and do a return $result; at the > bottom. That's fine, and makes sense. > > I can't comment on speed but I'd guess both these methods run pretty > close to the same speed. > I would never waste time optimizing something like this (unless I knew > it was causing a bottleneck). > > - Ben > > Tod Dailey wrote: > > That's part of the reason I'm asking here, as the replies I've > > received weren't that informative. I've heard that method #1 is a > > left-over practice from C/Java programmers, and isn't necessary with > > PHP (??). I've also heard the argument that returning inline values is > > > faster, and easier to see exactly what is being returned. That pretty > > much sums up what I've heard so-far. > > > > Christian > > > > > > On Jan 11, 2008 1:02 PM, David Krings > > wrote: > > > > Tod Dailey wrote: > > > The validity of one of my coding practices that I've used for > > awhile has > > > recently come under question. I've tried to listen to arguments > > on both > > > sides, and there seems to be good points on both ends, but my > > question > > > still hasn't been answered to my satisfaction. > > > > I use version 1 (can it be that you forgot to return $result at > > the end?) > > where I declare anything that is used in the function at the top, > > including > > booleans. I then do whatever I want/need to do in that function > > and set the > > flag accordingly and then return the result at the very end of the > > function > > I see the benefits of the second version as there is a direct > > return of the > > state and it saves a variable. Without having it tried out any > > other way, I > > find version 1 to be easier to debug. In v1 you can evaluate > > $result before > > retruning it, can't do that with v2. V2 is potentially faster as > > it doesn't > > have to go through who knows how many lines of code first before > > it reaches > > the return at the end. As soon as a return is hit in the function > > the function > > exits and sends back the return values. > > > > I'd develop using v1 and then see later if optimizing using v2 > > makes sense. It > > would be interesting to know the pros and cons for either version > > that you > > have heard so far. > > > > David > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > > ---------------------------------------------------------------------- > > -- > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > ------------------------------ > > Message: 6 > Date: Fri, 11 Jan 2008 13:56:35 -0500 > From: "Michael B Allen" > Subject: Re: [nycphp-talk] Question about explicit returns > To: "NYPHP Talk" > Message-ID: > <78c6bd860801111056h2af89e00tac0fe4e0fc2c7c6a at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On 1/11/08, Tod Dailey wrote: > > When I'm writing a function that returns a Boolean that indicates that > > > the given process failed or Verse inline returns, such as "if > > ($condition !== true) return false;" that builds a list of failure by > > exception. > > Hi Tod, > > I don't think it matters that much. I would rather spend time thinking > about the overall design. Just pick one technique that makes you happy > and stick to it. > > This is how I would write it: > > public function checkForSomething($record_id) { > $yourObj = new SomeObject; > > if ($yourObj->loadObjectByRecordId($record_id)) { > if (is_array($restrictedItems = > $yourObj->getUnrestrictedItems())) { > if > ($yourObj->updateUnrestrictedItems(self::ObjectItemStatus)) { > $this->setRecordStatusId($yourObj->getRecordStatusId()); > $this->setRestrictedItemList($restrictedItems); > return true; > } > } > } > > return false; > } > > -- > Michael B Allen > PHP Active Directory SPNEGO SSO > http://www.ioplex.com/ > > > ------------------------------ > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > End of talk Digest, Vol 15, Issue 22 > ************************************ > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Aj. (ajai at bitblit.net) From dorgan at donaldorgan.com Fri Jan 11 17:59:09 2008 From: dorgan at donaldorgan.com (Donald J Organ IV) Date: Fri, 11 Jan 2008 17:59:09 -0500 Subject: [nycphp-talk] Whats the difference between an apostrophe and a quotation In-Reply-To: References: Message-ID: <4787F4BD.3010907@donaldorgan.com> Yes single quotes only look like apostrophe's in specific fonts, but that is what they are. Ajai Khattri wrote: > On Sat, 12 Jan 2008, Jonathan Wagener wrote: > > >> Hi, whats the difference between an apostrophe and a quotation in php? >> > > We have single quotes, double quotes and back quotes - which do you mean? > > I would say apostrophe == single quote. > > > >> Jonathan Wagener >> Web Developer / Architect >> Amoeba Business Solutions >> Cell: +27 72 928 0513 >> Office: +27 21 785 1424 >> Web: www.amoeba.co.za >> Blog: www.espresso-online.info >> >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On Behalf Of talk-request at lists.nyphp.org >> Sent: 11 January 2008 21:16 >> To: talk at lists.nyphp.org >> Subject: talk Digest, Vol 15, Issue 22 >> >> Send talk mailing list submissions to >> talk at lists.nyphp.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://lists.nyphp.org/mailman/listinfo/talk >> or, via email, send a message with subject or body 'help' to >> talk-request at lists.nyphp.org >> >> You can reach the person managing the list at >> talk-owner at lists.nyphp.org >> >> When replying, please edit your Subject line so it is more specific than >> "Re: Contents of talk digest..." >> >> >> Today's Topics: >> >> 1. Re: Namespaces (John Campbell) >> 2. Question about explicit returns (Tod Dailey) >> 3. Re: Question about explicit returns (David Krings) >> 4. Re: Question about explicit returns (Tod Dailey) >> 5. Re: Question about explicit returns (Ben Sgro) >> 6. Re: Question about explicit returns (Michael B Allen) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Fri, 11 Jan 2008 12:08:05 -0500 >> From: "John Campbell" >> Subject: Re: [nycphp-talk] Namespaces >> To: "NYPHP Talk" >> Message-ID: >> <8f0676b40801110908o18d742ceg22d3b6d10e9af64d at mail.gmail.com> >> Content-Type: text/plain; charset=ISO-8859-1 >> >> Namespaces are supposed to be analogous to folders in the file system. >> Folders are how we prevent file name collisions, and namespaces are how >> we prevent function/classname collisions. If you have a bunch of files >> that might have the same names as an existing file, then you just create >> a new folder. If you are importing code that may have function/class >> collision, then you import it into a different namespace. Unfortunately >> I think the php devs don't think of namespaces in the same way, and it >> looks like the 5.3 namespace implementation will lack the ability to >> rename the namespace and relies on everyone using a unique namespace. >> The domain convention is okay, but I would much rather be able to do >> something like: >> >> include 'dkSuperClass.php' into namespace 'foo' >> >> It looks like the php devs are going the Java route, which ain't great >> because it relies on every library being changed which will never happen >> for compatibility reasons. >> >> I would much rather have a tool that lets me solve collisions today than >> a tool that requires libraries to be rewritten and agreement on a naming >> convention in order for it to work. >> >> >> >> Regards, >> John Campbell >> >> >> ------------------------------ >> >> Message: 2 >> Date: Fri, 11 Jan 2008 12:45:28 -0500 >> From: "Tod Dailey" >> Subject: [nycphp-talk] Question about explicit returns >> To: talk at lists.nyphp.org >> Message-ID: >> <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4 at mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> The validity of one of my coding practices that I've used for awhile has >> recently come under question. I've tried to listen to arguments on both >> sides, and there seems to be good points on both ends, but my question >> still hasn't been answered to my satisfaction. >> >> When I'm writing a function that returns a Boolean that indicates that >> the given process failed or succeeded, I declare the Boolean as a >> variable at the top of the function. I feel that this makes the code >> easier to read whenever/if-ever I need to come back and add further >> logic conditions to that function. When I come back to the function, I >> have a short list of accept by exception where I more-or-less just need >> to find the point that I return true to understand the function. Verse >> inline returns, such as "if ($condition !== true) return false;" that >> builds a list of failure by exception. It may just be in my head that >> the first method is easier to read, but that's why I'm asking for >> input/options. Here are two examples. >> They should both return the same value, but by different means. Please >> don't be side-track by the over-all quality of code/lack-thereof. >> Thanks! >> >> >> public function checkForSomething($record_id) { >> $result = false; >> >> $yourObj = new SomeObject; >> >> $result = $yourObj->loadObjectByRecordId($record_id); >> if ($result === true) {as >> $restrictedItems = $yourObj->getUnrestictedItems(); >> >> if (is_array($restrictedItems)) { >> $result = >> $yourObj->updateUnrestrictedItems(self::ObjectItemStatus); >> >> if ($result === true) { >> $this->setRecordStatusId($yourObj->getRecordStatusId()); >> $this->setRestrictedItemList($restrictedItems); >> $result = true; >> } >> } else { >> $result = false; >> } >> } >> } >> >> >> public function checkForSomething($record_id) { >> $yourObj = new SomeObject; >> >> if ($yourObj->loadObjectByRecordId($record_id) !== true) { >> return false; >> } >> >> if (!is_array($restrictedItems = $yourObj->getUnrestrictedItems())) >> { >> return false; >> } >> >> if ($yourObj->updateUnrestrictedItems(self::ObjectItemStatus) !== >> true) { >> return false; >> } >> >> $this->setRecordStatusId($yourObj->getRecordStatusId()); >> $this->setRestrictedItemList($restrictedItems); >> return true; >> } >> >> Once again, this is pseudo-code... >> Christian >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> http://lists.nyphp.org/pipermail/talk/attachments/20080111/d7b10f23/atta >> chment-0001.html >> >> ------------------------------ >> >> Message: 3 >> Date: Fri, 11 Jan 2008 13:02:43 -0500 >> From: David Krings >> Subject: Re: [nycphp-talk] Question about explicit returns >> To: NYPHP Talk >> Message-ID: <4787AF43.5030409 at gmx.net> >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> >> Tod Dailey wrote: >> >>> The validity of one of my coding practices that I've used for awhile >>> has recently come under question. I've tried to listen to arguments on >>> >>> both sides, and there seems to be good points on both ends, but my >>> question still hasn't been answered to my satisfaction. >>> >> I use version 1 (can it be that you forgot to return $result at the >> end?) where I declare anything that is used in the function at the top, >> including booleans. I then do whatever I want/need to do in that >> function and set the flag accordingly and then return the result at the >> very end of the function >> I see the benefits of the second version as there is a direct return >> of the state and it saves a variable. Without having it tried out any >> other way, I find version 1 to be easier to debug. In v1 you can >> evaluate $result before retruning it, can't do that with v2. V2 is >> potentially faster as it doesn't have to go through who knows how many >> lines of code first before it reaches the return at the end. As soon as >> a return is hit in the function the function exits and sends back the >> return values. >> >> I'd develop using v1 and then see later if optimizing using v2 makes >> sense. It would be interesting to know the pros and cons for either >> version that you have heard so far. >> >> David >> >> >> ------------------------------ >> >> Message: 4 >> Date: Fri, 11 Jan 2008 13:23:15 -0500 >> From: "Tod Dailey" >> Subject: Re: [nycphp-talk] Question about explicit returns >> To: "NYPHP Talk" >> Message-ID: >> <6232fa7e0801111023u156b0297w7fbfa63dd1b5f4fa at mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> That's part of the reason I'm asking here, as the replies I've received >> weren't that informative. I've heard that method #1 is a left-over >> practice from C/Java programmers, and isn't necessary with PHP (??). >> I've also heard the argument that returning inline values is faster, and >> easier to see exactly what is being returned. That pretty much sums up >> what I've heard so-far. >> >> Christian >> >> >> On Jan 11, 2008 1:02 PM, David Krings wrote: >> >> >>> Tod Dailey wrote: >>> >>>> The validity of one of my coding practices that I've used for awhile >>>> >>>> has recently come under question. I've tried to listen to arguments >>>> on both sides, and there seems to be good points on both ends, but >>>> my question still hasn't been answered to my satisfaction. >>>> >>> I use version 1 (can it be that you forgot to return $result at the >>> end?) where I declare anything that is used in the function at the >>> top, including booleans. I then do whatever I want/need to do in that >>> function and set the flag accordingly and then return the result at >>> the very end of the function I see the benefits of the second version >>> >>> as there is a direct return of the state and it saves a variable. >>> Without having it tried out any other way, I find version 1 to be >>> easier to debug. In v1 you can evaluate $result before retruning it, >>> can't do that with v2. V2 is potentially faster as it doesn't have to >>> go through who knows how many lines of code first before it reaches >>> the return at the end. As soon as a return is hit in the function the >>> function exits and sends back the return values. >>> >>> I'd develop using v1 and then see later if optimizing using v2 makes >>> sense. It would be interesting to know the pros and cons for either >>> version that you have heard so far. >>> >>> David >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >>> >>> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> http://lists.nyphp.org/pipermail/talk/attachments/20080111/80fff8f9/atta >> chment-0001.html >> >> ------------------------------ >> >> Message: 5 >> Date: Fri, 11 Jan 2008 13:37:51 -0500 >> From: Ben Sgro >> Subject: Re: [nycphp-talk] Question about explicit returns >> To: NYPHP Talk >> Message-ID: <4787B77F.1090601 at projectskyline.com> >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> >> Hello, >> >> Word, I immediately feel version 2 is easier to understand. Yeah you >> can't check the result, but you could step through with a debugger and >> then check the *result* >> >> $result just adds extra complexity; no need to copy the value and then >> return it. Just return it at the first point you can return it. >> In something more complex, maybe having 50 places you could exit that >> function, in that case, save the result and do a return $result; at the >> bottom. That's fine, and makes sense. >> >> I can't comment on speed but I'd guess both these methods run pretty >> close to the same speed. >> I would never waste time optimizing something like this (unless I knew >> it was causing a bottleneck). >> >> - Ben >> >> Tod Dailey wrote: >> >>> That's part of the reason I'm asking here, as the replies I've >>> received weren't that informative. I've heard that method #1 is a >>> left-over practice from C/Java programmers, and isn't necessary with >>> PHP (??). I've also heard the argument that returning inline values is >>> >>> faster, and easier to see exactly what is being returned. That pretty >>> much sums up what I've heard so-far. >>> >>> Christian >>> >>> >>> On Jan 11, 2008 1:02 PM, David Krings >> > wrote: >>> >>> Tod Dailey wrote: >>> > The validity of one of my coding practices that I've used for >>> awhile has >>> > recently come under question. I've tried to listen to arguments >>> on both >>> > sides, and there seems to be good points on both ends, but my >>> question >>> > still hasn't been answered to my satisfaction. >>> >>> I use version 1 (can it be that you forgot to return $result at >>> the end?) >>> where I declare anything that is used in the function at the top, >>> including >>> booleans. I then do whatever I want/need to do in that function >>> and set the >>> flag accordingly and then return the result at the very end of the >>> function >>> I see the benefits of the second version as there is a direct >>> return of the >>> state and it saves a variable. Without having it tried out any >>> other way, I >>> find version 1 to be easier to debug. In v1 you can evaluate >>> $result before >>> retruning it, can't do that with v2. V2 is potentially faster as >>> it doesn't >>> have to go through who knows how many lines of code first before >>> it reaches >>> the return at the end. As soon as a return is hit in the function >>> the function >>> exits and sends back the return values. >>> >>> I'd develop using v1 and then see later if optimizing using v2 >>> makes sense. It >>> would be interesting to know the pros and cons for either version >>> that you >>> have heard so far. >>> >>> David >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >>> >>> >>> ---------------------------------------------------------------------- >>> -- >>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >>> >> ------------------------------ >> >> Message: 6 >> Date: Fri, 11 Jan 2008 13:56:35 -0500 >> From: "Michael B Allen" >> Subject: Re: [nycphp-talk] Question about explicit returns >> To: "NYPHP Talk" >> Message-ID: >> <78c6bd860801111056h2af89e00tac0fe4e0fc2c7c6a at mail.gmail.com> >> Content-Type: text/plain; charset=ISO-8859-1 >> >> On 1/11/08, Tod Dailey wrote: >> >>> When I'm writing a function that returns a Boolean that indicates that >>> >>> the given process failed or Verse inline returns, such as "if >>> ($condition !== true) return false;" that builds a list of failure by >>> exception. >>> >> Hi Tod, >> >> I don't think it matters that much. I would rather spend time thinking >> about the overall design. Just pick one technique that makes you happy >> and stick to it. >> >> This is how I would write it: >> >> public function checkForSomething($record_id) { >> $yourObj = new SomeObject; >> >> if ($yourObj->loadObjectByRecordId($record_id)) { >> if (is_array($restrictedItems = >> $yourObj->getUnrestrictedItems())) { >> if >> ($yourObj->updateUnrestrictedItems(self::ObjectItemStatus)) { >> $this->setRecordStatusId($yourObj->getRecordStatusId()); >> $this->setRestrictedItemList($restrictedItems); >> return true; >> } >> } >> } >> >> return false; >> } >> >> -- >> Michael B Allen >> PHP Active Directory SPNEGO SSO >> http://www.ioplex.com/ >> >> >> ------------------------------ >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk >> >> End of talk Digest, Vol 15, Issue 22 >> ************************************ >> >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/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 mikesz at qualityadvantages.com Sat Jan 12 00:48:31 2008 From: mikesz at qualityadvantages.com (mikesz at qualityadvantages.com) Date: Sat, 12 Jan 2008 13:48:31 +0800 Subject: [nycphp-talk] PHP5 upgrade and suPHP ? Message-ID: <301748250.20080112134831@qualityadvantages.com> Hello nyphptalk colleagues, I have a client who has been upgraded to PHP5 and the ISP has also implemented suPHP in the process. The core application that my client is using had/has a write requirement on certain folders that do things like temporary image creation and document generation/storage as well as a cache that stores profiles settings. Well, as you might have already guessed, everything broke that had folders set to 777. I got Server 500 errors on most of the folders that were set to 777 and an error about the Directory being writable by group. The ISP has temporarily switched off the suPHP and is looking for me to provide a solution to the write permissions requirement of the app. I look through the documentation and, of course, its as clear as mud. I am thinking that this should work now without the group permissions being set if the owner has write permissions which it does. Any one run into this issue and can shed a little light on it for me? I found a few things that mention using .htaccess and local php.ini files but that doesn't address the permissions issue. TIA for any assistance on this, regards, mikesz -- Best regards, mikesz mailto:mikesz at qualityadvantages.com From erharold at gmail.com Sat Jan 12 08:37:56 2008 From: erharold at gmail.com (Elliotte Harold) Date: Sat, 12 Jan 2008 08:37:56 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <477C2AC6.2060203@nyphp.com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> Message-ID: <4788C2B4.2010803@metalab.unc.edu> Michael Southwell wrote: > ah, no, these answers are exactly right, given that $a is an integer, $b > and $c are strings, and $d is unset. $b and $c when converted to > integers for the purpose of comparison in #1 and #3 turn into 0 (zero) > so the comparisons are true. #2 compares two different strings and so is > false. #4 compares 0 to the integer of unset and so is true. #5 and #6 > compare strings to the string of unset and so are false. >> Yes, this is what PHP does. It's just that what PHP does is insane. It does not match any normal, logical thought process. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From erharold at gmail.com Sat Jan 12 08:50:16 2008 From: erharold at gmail.com (Elliotte Harold) Date: Sat, 12 Jan 2008 08:50:16 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <002401c84e12$ef88b1b0$ce9a1510$@com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477CB572.5040200@beezifies.com> <002401c84e12$ef88b1b0$ce9a1510$@com> Message-ID: <4788C598.7090800@metalab.unc.edu> Anthony Wlodarski wrote: > Zesty Ping never learned === apparently. This one's for you Zesty: > > http://www.php.net/manual/en/language.operators.comparison.php > > "===" introduced type facing in php4 so it is a moot point or just poor reading skills on some developers parts if they missed this essential comparison operator... > That's a bug, not a feature. Adding multiple equality operators makes the whole language still more complex and confusing and full of special cases one has to remember. It adds yet another way for programmers to enbug their programs. Adding an operator with correct semantics is only a solution if you remove the broken one at the same time. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From ramons at gmx.net Sat Jan 12 09:43:03 2008 From: ramons at gmx.net (David Krings) Date: Sat, 12 Jan 2008 09:43:03 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <4788C598.7090800@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477CB572.5040200@beezifies.com> <002401c84e12$ef88b1b0$ce9a1510$@com> <4788C598.7090800@metalab.unc.edu> Message-ID: <4788D1F7.2070302@gmx.net> Elliotte Harold wrote: > Anthony Wlodarski wrote: >> Zesty Ping never learned === apparently. This one's for you Zesty: >> >> http://www.php.net/manual/en/language.operators.comparison.php >> >> "===" introduced type facing in php4 so it is a moot point or just >> poor reading skills on some developers parts if they missed this >> essential comparison operator... >> > > That's a bug, not a feature. Adding multiple equality operators makes > the whole language still more complex and confusing and full of special > cases one has to remember. It adds yet another way for programmers to > enbug their programs. Adding an operator with correct semantics is only > a solution if you remove the broken one at the same time. > And doing so will break 99.999% of all PHP scripts currently in use. That is crap that Microsoft pulls off, but others are a bit more careful with the changes that they implement. I think this is one way to do it and if PHP's masterminds would have decided to do it differently some folks would jump up and down about that as well. Just look at Commodore BASIC V2, it only knows the = doing all three things of =, ==, and === in PHP depending on context. For example, writing IF A = 10 doesn't do a value assignment, but since it is in an IF clause it is always a comparison. In regards to IF really the only thing that makes sense, otherwise the condition is always true and you won't need the IF. But all modern languages do it that way and that is equally dumb. And it is pretty difficult to make a language to be dumber than Commodore BASIC V2. No matter how something is done it always has disadvantages. And in reagrds to PHP the disadvantages are acceptable compared to other supposedly better programming languages. Just look at the language we use to have this discussion. Most of English doesn't make any sense at all. Why is natrium called sodium in English? Why is repipe pronounced differently than recipe? Why is every greek or latin name mispronounced in English? Why is there no reliable set of rules for use of commata in English? Based on your arguments, we should all start speaking Latin, which is known for its rigid rules and very very few exceptions, which is the main reason why it is taught in schools. Teaches how to follow a strict rule set and is a very nice tool to learn how to learn complex things. David From danielc at analysisandsolutions.com Sat Jan 12 10:18:00 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 12 Jan 2008 10:18:00 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <78c6bd860801111423o41c28878hbcd6dbb268ded0fd@mail.gmail.com> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> <20080111205549.GA15748@panix.com> <78c6bd860801111423o41c28878hbcd6dbb268ded0fd@mail.gmail.com> Message-ID: <20080112151800.GA3578@panix.com> On Fri, Jan 11, 2008 at 05:23:35PM -0500, Michael B Allen wrote: > I think the nesting helps you understand the code. But things get harder to understand if you're nested so far that half of the code on the line flies off the right hand side of the screen (or wraps). Plus to figure out what the code is actually doing you need to jump back and forth between the appropriate if's and else's. The deeper this gets the harder this gets. Then theres the issue of having to read the ENTIRE function in order to figure out what happens in a given case, even if the function resolves your issue near the top. > You know the more > indented you are the deeper the success of the overall operation. The same could be said about how many lines down you are into the function. > Regarding the number of returns, it's better to minimize the number of > exit points because it simplifies the function contract. If you have > to modify the code later, there are fewer exit points to consider. Yeah, I've heard that point of view before. Sure, you can design only one exit point but then you have to use more time considering more code and ensuring all your code doesn't inadvertently change the result before returning. Guess our minds work differently. :) --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 tedd at sperling.com Sat Jan 12 10:20:04 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Jan 2008 10:20:04 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <4787980F.5040704@bizcomputinginc.com> References: <47865807.6090700@gmx.net> <47877919.2080807@secdat.com> <4787853C.1010305@gmx.net> <478793FC.6080802@secdat.com> <4787980F.5040704@bizcomputinginc.com> Message-ID: At 11:23 AM -0500 1/11/08, Jim Hendricks wrote: >When Palm opened up the platform for 3rd party programming, they >created a registration page for the database type id's. This >allowed for global registration which would eliminate namespace >collissions so long as programmers registered the id's they were >using prior to distro. > >Don't know how effective it was, but thot it was a good idea. > >How crazy would it be if PHP had namespaces and a namespace registration. URL's are unique and that's the reason why xml uses them for namespace. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tgales at tgaconnect.com Sat Jan 12 10:34:22 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Sat, 12 Jan 2008 10:34:22 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <4788C2B4.2010803@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> Message-ID: <4788DDFE.1070100@tgaconnect.com> Elliotte Harold wrote: > Michael Southwell wrote: > >> ah, no, these answers are exactly right, given that $a is an integer, >> $b and $c are strings, and $d is unset. $b and $c when converted to >> integers for the purpose of comparison in #1 and #3 turn into 0 (zero) >> so the comparisons are true. #2 compares two different strings and so >> is false. #4 compares 0 to the integer of unset and so is true. #5 and >> #6 compare strings to the string of unset and so are false. >>> > > > Yes, this is what PHP does. It's just that what PHP does is insane. It > does not match any normal, logical thought process. > Insane may be overly harsh -- how about 'unorthodox'? It does strike me, though, that there are an awfully large number of questions to the internals list asking whether a certain behavior is expected or not. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From tedd at sperling.com Sat Jan 12 10:45:53 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Jan 2008 10:45:53 -0500 Subject: [nycphp-talk] Problem with MySQL UPDATE syntax In-Reply-To: References: Message-ID: At 9:39 AM -0600 1/11/08, Tony Furnivall wrote: >Hi! > >I'm having a problem with the UPDATE syntax for MySQL > >(aside - I hate products that tell me I have a syntax problem, but >don't tell me what it is - and then suggest that I go RTFM which is >equally uninformative:-() > >I'm replacing the entire set of fields, WHERE a condition exists for >some of the fields, ie > >UPDATE table_name SET field1 = ' value1', field2 = ' value2', field3 >= ' value3, field4 = ' value4' WHERE field1 = ' value1' AND field2 >= ' value2'; > >MySQL says that I have error 1064 'near WHERE field1 = ' value1' AND >field2 = ' value2' > >but it doesn't say what therror is (grrr!) Why the extra space before value1 (i.e., field1 = ' value1') ? And where are the variables? Shouldn't you be using something like: UPDATE table_name SET field1 = '$value1', That works for me. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Sat Jan 12 10:52:40 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Jan 2008 10:52:40 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> Message-ID: At 12:45 PM -0500 1/11/08, Tod Dailey wrote: >The validity of one of my coding practices that I've used for awhile >has recently come under question. I've tried to listen to arguments >on both sides, and there seems to be good points on both ends, but >my question still hasn't been answered to my satisfaction. > >When I'm writing a function that returns a Boolean that indicates >that the given process failed or succeeded, I declare the Boolean as >a variable at the top of the function. I feel that this makes the >code easier to read whenever/if-ever I need to come back and add >further logic conditions to that function. When I come back to the >function, I have a short list of accept by exception where I >more-or-less just need to find the point that I return true to >understand the function. Verse inline returns, such as "if >($condition !== true) return false;" that builds a list of failure >by exception. It may just be in my head that the first method is >easier to read, but that's why I'm asking for input/options. Here >are two examples. They should both return the same value, but by >different means. Number 1. One way into and out of a function. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Sat Jan 12 11:13:00 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Jan 2008 11:13:00 -0500 Subject: [nycphp-talk] Whats the difference between an apostrophe and a quotation In-Reply-To: References: Message-ID: At 12:44 AM +0200 1/12/08, Jonathan Wagener wrote: >Hi, whats the difference between an apostrophe and a quotation in php? What's the difference? "This $string is evaluated by the compiler" 'and this $string isn't' Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tgales at tgaconnect.com Sat Jan 12 11:23:45 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Sat, 12 Jan 2008 11:23:45 -0500 Subject: [nycphp-talk] Question about explicit returns In-Reply-To: <20080112151800.GA3578@panix.com> References: <6232fa7e0801110945k6a993f2eiab6b7e0ec6861cf4@mail.gmail.com> <20080111205549.GA15748@panix.com> <78c6bd860801111423o41c28878hbcd6dbb268ded0fd@mail.gmail.com> <20080112151800.GA3578@panix.com> Message-ID: <4788E991.1050206@tgaconnect.com> Daniel Convissor wrote: [...] > >> Regarding the number of returns, it's better to minimize the number of >> exit points because it simplifies the function contract. If you have >> to modify the code later, there are fewer exit points to consider. > > Yeah, I've heard that point of view before. Sure, you can design only > one exit point but then you have to use more time considering more code > and ensuring all your code doesn't inadvertently change the result before > returning. > > Guess our minds work differently. :) > Yeah, and from that code fragment it looks like the work of two different people with different mindsets. Programmer A wrote a SomeObject class with a loadObjectByRecordId($record_id) method. Now we don't see the definition of the class. But there might be an isValid member. If there isn't, there probably should be one -- you could just extend the class and add it. Programmer B comes along and want to reuse the class, but with a procedural mindset. So he uses the $result variable to decide which path to take in his procedural code. Testing ($result === true) before calling $yourObj->getUnrestictedItems() should be totally unnecessary -- the class should be designed to report back an error if you try try a 'getUnrestictedItems' when 'isValid' is false. Without considering adding another method to the class to take advantage of an isValid member (whether preexisting or extended) Progammer B merrily continues along his procedural path. The result is a 'reverse data abstraction', which takes the innards of an object and brings them up where they don't belong -- rather messy. To me, discussing where to test the validation variable in order to make the resultant proceural code cleaner is moot. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From guilhermeblanco at gmail.com Sat Jan 12 12:06:29 2008 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Sat, 12 Jan 2008 15:06:29 -0200 Subject: [nycphp-talk] Whats the difference between an apostrophe and a quotation In-Reply-To: References: Message-ID: There are 3 types of quotes. $var = 'test'; Single quotes: Not parsed by PHP compiler... echo 'Some $var'; // Will print: Some $var Double quotes: Parsed by compiler... echo "Some $var"; // Will print: Some test Backtick: Processed by console echo `ps -aux`; // Will print running processes I hope this info helps you... Regards, On Jan 12, 2008 2:13 PM, tedd wrote: > At 12:44 AM +0200 1/12/08, Jonathan Wagener wrote: > >Hi, whats the difference between an apostrophe and a quotation in php? > > What's the difference? > > "This $string is evaluated by the compiler" > > 'and this $string isn't' > > Cheers, > > tedd > > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.com > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Carlos - SP/Brazil From ramons at gmx.net Sun Jan 13 19:56:53 2008 From: ramons at gmx.net (David Krings) Date: Sun, 13 Jan 2008 19:56:53 -0500 Subject: [nycphp-talk] Licensing open source software Message-ID: <478AB355.9090509@gmx.net> Hi! I wrote two small PHP functions that allow for easily adding context sensitive help (CSH) calls to MadCap Flare's WebHelp (and potentially others). I am a MadCap MVP and plan on cross-publishing the code on NYPHP-Talk (this list) as well as in the MadCap Flare Forum. Now that I am about to put the finishing touches on it by completing a wrapper function that makes CSH calls easier (only need to specify an ID to make the call later on) I wondered under which license (if any) I should release the code. None if it is anything special, there are maybe 50 lines of code if that, but it is the first code that I think is good enough to get published and really has some benefit for the general (Flare using) public. Here are some things that I want to get out of the licensing: - get credited (have my name mentioned in code) when the functions are used, the same way as I credited NYPHP for helping me out with the JavaScript stuff a few weeks ago - mandate that any changes or improvements are sent to me, but not for the sake of approval, but for making my own code better (If I like the change or enhancement) and potentially communicate with users when I make changes - prohibit commercial use without my written consent, meaning that I am not against a company using it in their web app, but I want to know about it and most likely get into agreement on special terms such as not getting sued for the case that my few lines of code don't work under some circumstances that I never encountered. The special terms aren't meant to get compensation (I won't complain about getting something, but I doubt anyone would pay for it). And that is pretty much it. Now, I could just create my own license and call it a day, but I think there are already wayyyyyyyyyyy toooooo maaaannnyyyy open source licenses that I really don't think that I have to add yet another one. I first thought about GPL 2.0 or 3.0, but honestly, I haven't read that license and I have no idea if it does what I want. So, again, I turn to NYPHP and ask for advice. I know that you will start your replies with "IANAL...", but some of you published code before or contribute to projects or may have a way better understanding of licensing than I have. I plan to use that license then later on for my gettext alternative (which may come in handy for those who can't just restart a web server to update string files) and then again later on for my PiViViewer that I am working on now for three years (I use the tortoise development method, hehe). Any proposal is greatly appreciated. David From tom at supertom.com Sun Jan 13 23:49:28 2008 From: tom at supertom.com (Tom Melendez) Date: Sun, 13 Jan 2008 20:49:28 -0800 Subject: [nycphp-talk] Licensing open source software In-Reply-To: <478AB355.9090509@gmx.net> References: <478AB355.9090509@gmx.net> Message-ID: <117286890801132049k5eafb938s853eb27862940958@mail.gmail.com> Hi David, Items 2 and 3 on your list are not GPL compatible (although, IANAL), but I think you might find Creative Commons Attribution-Noncommercial-Share Alike 3.0 close to what you want. It doesn't mandate that people have to give their changes back to you (I don't believe any of the licenses do) but keeps the code changes they make in same or similar license that you've chosen. So, if you give it away, they will too (assuming that they actually distribute the code). With that said, I would think again about your requirements, especially item 3. I myself would probably choose the LGPL for your code - it gives flexibility and gives you credit. Or, really, if we're just talking about a couple of functions, public domain is fine too. If it is *really* that valuable, you'll get credit (look at SQLite) and if commercial entities want to use it, let them, as that is your best path to adoption of your work and even possible gigs/jobs/riches/whatever later on. Tom http://www.liphp.org On Jan 13, 2008 4:56 PM, David Krings wrote: > Hi! > > I wrote two small PHP functions that allow for easily adding context sensitive > help (CSH) calls to MadCap Flare's WebHelp (and potentially others). I am a > MadCap MVP and plan on cross-publishing the code on NYPHP-Talk (this list) as > well as in the MadCap Flare Forum. Now that I am about to put the finishing > touches on it by completing a wrapper function that makes CSH calls easier > (only need to specify an ID to make the call later on) I wondered under which > license (if any) I should release the code. None if it is anything special, > there are maybe 50 lines of code if that, but it is the first code that I > think is good enough to get published and really has some benefit for the > general (Flare using) public. Here are some things that I want to get out of > the licensing: > - get credited (have my name mentioned in code) when the functions are used, > the same way as I credited NYPHP for helping me out with the JavaScript stuff > a few weeks ago > - mandate that any changes or improvements are sent to me, but not for the > sake of approval, but for making my own code better (If I like the change or > enhancement) and potentially communicate with users when I make changes > - prohibit commercial use without my written consent, meaning that I am not > against a company using it in their web app, but I want to know about it and > most likely get into agreement on special terms such as not getting sued for > the case that my few lines of code don't work under some circumstances that I > never encountered. The special terms aren't meant to get compensation (I won't > complain about getting something, but I doubt anyone would pay for it). > > And that is pretty much it. Now, I could just create my own license and call > it a day, but I think there are already wayyyyyyyyyyy toooooo maaaannnyyyy > open source licenses that I really don't think that I have to add yet another > one. I first thought about GPL 2.0 or 3.0, but honestly, I haven't read that > license and I have no idea if it does what I want. So, again, I turn to NYPHP > and ask for advice. I know that you will start your replies with "IANAL...", > but some of you published code before or contribute to projects or may have a > way better understanding of licensing than I have. > I plan to use that license then later on for my gettext alternative (which may > come in handy for those who can't just restart a web server to update string > files) and then again later on for my PiViViewer that I am working on now for > three years (I use the tortoise development method, hehe). > > Any proposal is greatly appreciated. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From jcampbell1 at gmail.com Mon Jan 14 01:45:24 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 14 Jan 2008 01:45:24 -0500 Subject: [nycphp-talk] Licensing open source software In-Reply-To: <478AB355.9090509@gmx.net> References: <478AB355.9090509@gmx.net> Message-ID: <8f0676b40801132245r19235291pc276b5f2cf6c1289@mail.gmail.com> > - get credited (have my name mentioned in code) [snip] Fair enough. > - mandate that any changes or improvements are sent to me [snip] Are you kidding? One of the principals of open source is that people are free to modify the code. Adding such a restriction to modifying the code would be a non-starter for most everyone. Don't bother releasing the code if you include this restriction. I suggest relaxing this requirement and putting a comment, "send bug fixes/ patches to your at emal.com." > - prohibit commercial use without my written consent, meaning that I am not > against a company using it in their web app, but I want to know about it and > most likely get into agreement on special terms such as not getting sued... [snip] Do you want to prohibit commercial use, or do you want to prevent yourself from getting sued? These are separate issues. Keep in mind that preventing commercial use means no one will use your code. Just as an FYI, open source licenses don't specify what others can do with code, but instead they specify what others must do when (re)distributing the code. The distinction is subtle, but very important. I suggest dropping 2,3 and use the LGPL. That will get you 1 plus legal indemnity. or just use the MIT license (public domain + legal indemnity) Regards, John Campbell From ramons at gmx.net Mon Jan 14 07:01:53 2008 From: ramons at gmx.net (David Krings) Date: Mon, 14 Jan 2008 07:01:53 -0500 Subject: [nycphp-talk] Licensing open source software In-Reply-To: <8f0676b40801132245r19235291pc276b5f2cf6c1289@mail.gmail.com> References: <478AB355.9090509@gmx.net> <8f0676b40801132245r19235291pc276b5f2cf6c1289@mail.gmail.com> Message-ID: <478B4F31.5040800@gmx.net> Hi! Ton's comments were along the lines of these as well. John Campbell wrote: >> - get credited (have my name mentioned in code) [snip] > Fair enough. Good. > >> - mandate that any changes or improvements are sent to me [snip] > Are you kidding? One of the principals of open source is that people > are free to modify the code. Adding such a restriction to modifying > the code would be a non-starter for most everyone. Don't bother > releasing the code if you include this restriction. I suggest > relaxing this requirement and putting a comment, "send bug fixes/ > patches to your at emal.com." I obviously worded it wrong. That is exactly what I want. I can't enforce a mandate anyway, so why put one in. I shouldn't have used the word "mandate". I also don't want to put restrictions on modifications, I just have an interest in knowing about those for making the code better at the source. >> - prohibit commercial use without my written consent, meaning that I am not >> against a company using it in their web app, but I want to know about it and >> most likely get into agreement on special terms such as not getting sued... [snip] > > Do you want to prohibit commercial use, or do you want to prevent > yourself from getting sued? These are separate issues. Keep in mind > that preventing commercial use means no one will use your code. I don't want to prohibit commercial use per s? and for this point as well, my intentions didn't make it into proper wording. My main concern here is that I don't want to get into legal trouble for being a bad coder or have someone drag me in front of some court demanding that I make 534 fixes within a week or else. I also want to have something in hand that gives some leverage if someone wants to patent "Programmatic connectivity between PHP Hypertext Preprocessor applications and MadCap Flare WebHelp outputs" or claim it as their own, obfuscate, and sell it. With the way I want to put it out I should cover that by the "poor man's patent": write it down and mail it to yourself, but don't open the envelope when you get it back. I think the handful of lines of code are just too unimportant for court cases or patents. But this is the USA, you can get sued for everything and you can patent and trademark everything. > Just as an FYI, open source licenses don't specify what others can do > with code, but instead they specify what others must do when > (re)distributing the code. The distinction is subtle, but very > important. That is why I ask you all as you know more about this than I do. > I suggest dropping 2,3 and use the LGPL. That will get you 1 plus > legal indemnity. > or just use the MIT license (public domain + legal indemnity) Tom proposed the LGPL as well. So that is two recommendations for that. I will take a look at the LGPL and see what it states. John, Tom, thanks for your very helpful advice! :) David From ken at secdat.com Mon Jan 14 08:17:06 2008 From: ken at secdat.com (Kenneth Downs) Date: Mon, 14 Jan 2008 08:17:06 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <4788C2B4.2010803@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> Message-ID: <478B60D2.20107@secdat.com> Elliotte Harold wrote: > Michael Southwell wrote: > >> ah, no, these answers are exactly right, given that $a is an integer, >> $b and $c are strings, and $d is unset. $b and $c when converted to >> integers for the purpose of comparison in #1 and #3 turn into 0 >> (zero) so the comparisons are true. #2 compares two different strings >> and so is false. #4 compares 0 to the integer of unset and so is >> true. #5 and #6 compare strings to the string of unset and so are false. >>> > > > Yes, this is what PHP does. It's just that what PHP does is insane. It > does not match any normal, logical thought process. > A content-free emotive statement. It would be more accurate to say that it follows a set of principles you do not share, namely, weak typing. We would expect you as a java dude to prefer strong typing. Strong typing to me is inappropriate in a web layer, and reduces my productivity. Is it insane? No, just incompatible with my design goals and methods. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From jcampbell1 at gmail.com Mon Jan 14 11:22:44 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 14 Jan 2008 11:22:44 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <478B60D2.20107@secdat.com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> Message-ID: <8f0676b40801140822s5d592dcfx3d9075e43147117@mail.gmail.com> On Jan 14, 2008 8:17 AM, Kenneth Downs wrote: > Elliotte Harold wrote: > > Michael Southwell wrote: > > > >> ah, no, these answers are exactly right, given that $a is an integer, > >> $b and $c are strings, and $d is unset. $b and $c when converted to > >> integers for the purpose of comparison in #1 and #3 turn into 0 > >> (zero) so the comparisons are true. #2 compares two different strings > >> and so is false. #4 compares 0 to the integer of unset and so is > >> true. #5 and #6 compare strings to the string of unset and so are false. > >>> > > > > > > Yes, this is what PHP does. It's just that what PHP does is insane. It > > does not match any normal, logical thought process. > > > > A content-free emotive statement. > > It would be more accurate to say that it follows a set of principles you > do not share, namely, weak typing. We would expect you as a java dude > to prefer strong typing. Strong typing to me is inappropriate in a web > layer, and reduces my productivity. Is it insane? No, just > incompatible with my design goals and methods. I am with Rusty on this one. PHP is insane in this regard. Consider the following statements: 1+1=2 if a < b and b < c then a < c if a=b and b=c then a=c I am a bit of a purist, and I hold these three rules to be self-evident and violations of these rules put one outside the realm of a normal logical thought process. PHP violates #2 and #3, therefore PHP is insane. Other weakly typed languages do not violate these rules. This is not about weak vs strong typing, although it is much easier to get basic logic right in a strongly typed language. If you still don't understand the problem, then take this quiz: what is the output of the following statements? var_dump(true + true); var_dump(null < 0); var_dump(null < -1); var_dump(null < 1); Regards, John Campbell From paul at gubavision.com Mon Jan 14 11:39:51 2008 From: paul at gubavision.com (paul at gubavision.com) Date: Mon, 14 Jan 2008 11:39:51 -0500 Subject: [nycphp-talk] OT: Shopping Cart that schedules bookings Message-ID: <20080114113951.7xib0bny80gc48wk@mail.fluidhosting.com> Does anyone know of a shopping cart that would allow the user to book time with a service provider? Much like buying a product but in this case book time and date. Paul From rmarscher at beaffinitive.com Mon Jan 14 14:32:12 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 14 Jan 2008 14:32:12 -0500 Subject: [nycphp-talk] PHP5 upgrade and suPHP ? In-Reply-To: <301748250.20080112134831@qualityadvantages.com> References: <301748250.20080112134831@qualityadvantages.com> Message-ID: On Jan 12, 2008, at 12:48 AM, mikesz at qualityadvantages.com wrote: > I have a client who has been upgraded to PHP5 and the ISP has also > implemented suPHP in the process. The core application that my client > is using had/has a write requirement on certain folders that do things > like temporary image creation and document generation/storage as well > as a cache that stores profiles settings. Well, as you might have > already guessed, everything broke that had folders set to 777. I got > Server 500 errors on most of the folders that were set to 777 and an > error about the Directory being writable by group. Mike, There should be a config file for suPHP. For me, it's located at /usr/ local/etc/suphp.conf. This file has a number of security settings. These are most closely tied to your problem: ; Security options allow_file_group_writeable=true allow_file_others_writeable=true allow_directory_group_writeable=true allow_directory_others_writeable=true Let me know if you still have trouble after they change these settings. It might require a webserver reboot... can't remember. -Rob From cliff at pinestream.com Mon Jan 14 17:25:30 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 14 Jan 2008 17:25:30 -0500 Subject: [nycphp-talk] Affilitate marketing question Message-ID: This is outside the php realm, but this group always has interesting insights. Did anyone see this article in Sunday?s Times? http://www.nytimes.com/2008/01/13/business/13digi.html?_r=1&ref=business&ore f=slogin What struck me as interesting is that most of the revenue comes from affiliate marketing links, not adsense, according to the site owner. I?m curious about advertising/affiliate link revenue sources other than the obvious adsense. Where do I go about learning about these alternative advertising/affiliate link revenue sources? Conferences, good tutorials, web sites (free or commercial), industry rags, etc. Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at nopersonal.info Mon Jan 14 17:37:00 2008 From: lists at nopersonal.info (A.) Date: Mon, 14 Jan 2008 17:37:00 -0500 Subject: [nycphp-talk] Emails not being received when using mail() Message-ID: <478BE40C.2040407@nopersonal.info> Hi Everyone, I'm having trouble with my form processing script for the first time; some of the email addresses I'm sending the results to aren't receiving anything. The server sending the mail is Linux, in a shared hosting environment. I've googled for a solution and understand that this probably has to do with spam filters on some mail servers flagging the mail as junk and/or the PHP ini directive sendmail_from either being set incorrectly or not matching the "From:" header in the email headers. For the record, sendmail_from on the server I'm using has "no value" according to phpinfo(). Can anyone advise me on the best work-round? Would I be better of using the Pear Mail package or maybe trying a PHP class like PHPMailer? TIA, Bev From ben at projectskyline.com Mon Jan 14 17:47:02 2008 From: ben at projectskyline.com (Ben Sgro) Date: Mon, 14 Jan 2008 17:47:02 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478BE40C.2040407@nopersonal.info> References: <478BE40C.2040407@nopersonal.info> Message-ID: <478BE666.9070900@projectskyline.com> Hello, Out the box, PHPMailer works pretty good. I know there is a bug in the install I used where you have to explicitly set the language variable or else it doesn't work. I'd suggest further debugging your current situation before switching to PHPMailer. - Ben A. wrote: > Hi Everyone, > > I'm having trouble with my form processing script for the first time; > some of the email addresses I'm sending the results to aren't > receiving anything. The server sending the mail is Linux, in a shared > hosting environment. > > I've googled for a solution and understand that this probably has to > do with spam filters on some mail servers flagging the mail as junk > and/or the PHP ini directive sendmail_from either being set > incorrectly or not matching the "From:" header in the email headers. > For the record, sendmail_from on the server I'm using has "no value" > according to phpinfo(). > > Can anyone advise me on the best work-round? Would I be better of > using the Pear Mail package or maybe trying a PHP class like PHPMailer? > > TIA, > Bev > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From lists at nopersonal.info Mon Jan 14 18:02:48 2008 From: lists at nopersonal.info (B.A.S.) Date: Mon, 14 Jan 2008 18:02:48 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478BE666.9070900@projectskyline.com> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> Message-ID: <478BEA18.40307@nopersonal.info> Ben Sgro wrote: > Hello, > > Out the box, PHPMailer works pretty good. I know there is a bug in the > install I used where you have to explicitly > set the language variable or else it doesn't work. > > I'd suggest further debugging your current situation before switching to > PHPMailer. > > - Ben Hi Ben, Thanks for the bug warning. I've only been programming PHP in earnest for a little under a year, so I'm not entirely sure what else I should be looking for when I attempt to debug. I've tried setting "Return-path" and "Reply-to" headers, but that doesn't help. The emails are received on some servers, but not on others--i.e. on one of my accounts they come through fine, but on another (hosted elsewhere) they don't. Ditto when I try mailing to GMail, Hotmail and Verizon accounts--they don't even make it to the spam folder. Bev From ben at projectskyline.com Mon Jan 14 18:12:12 2008 From: ben at projectskyline.com (Ben Sgro) Date: Mon, 14 Jan 2008 18:12:12 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478BEA18.40307@nopersonal.info> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> Message-ID: <478BEC4C.6000106@projectskyline.com> Hello, Gosh, who knows. I have a problem like that w/an app that runs PHPMailer; yahoo users never see the emails. It really sucks, and there isn't anything I can do about it. Yahoo just decides to block this particular domain, or whatever. Maybe someone with more email knowledge can chime in. - Ben B.A.S. wrote: > Ben Sgro wrote: >> Hello, >> >> Out the box, PHPMailer works pretty good. I know there is a bug in >> the install I used where you have to explicitly >> set the language variable or else it doesn't work. >> >> I'd suggest further debugging your current situation before switching >> to PHPMailer. >> >> - Ben > > Hi Ben, > > Thanks for the bug warning. > > I've only been programming PHP in earnest for a little under a year, > so I'm not entirely sure what else I should be looking for when I > attempt to debug. > > I've tried setting "Return-path" and "Reply-to" headers, but that > doesn't help. The emails are received on some servers, but not on > others--i.e. on one of my accounts they come through fine, but on > another (hosted elsewhere) they don't. Ditto when I try mailing to > GMail, Hotmail and Verizon accounts--they don't even make it to the > spam folder. > > Bev > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From jcampbell1 at gmail.com Mon Jan 14 18:13:22 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 14 Jan 2008 18:13:22 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478BEA18.40307@nopersonal.info> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> Message-ID: <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> Sending mail from a shared host is always problematic. Do you have your own ip? A shared ip address is a disaster because if there is one spammer on the host, you are SOL and there is nothing you can do about it. If you care about emails going through, get your own ip and make sure your dns has a SPF record. Regards, John Campbell From lists at nopersonal.info Mon Jan 14 18:40:55 2008 From: lists at nopersonal.info (B.A.S.) Date: Mon, 14 Jan 2008 18:40:55 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> Message-ID: <478BF307.30401@nopersonal.info> John Campbell wrote: > Sending mail from a shared host is always problematic. Do you have > your own ip? A shared ip address is a disaster because if there is > one spammer on the host, you are SOL and there is nothing you can do > about it. If you care about emails going through, get your own ip and > make sure your dns has a SPF record. > > Regards, > John Campbell No, the client in question doesn't have their own (dedicated) IP and AFAIK the only thing available is a static IP, which I'm guessing wouldn't help since (as I understand it) several domains could be using the same static IP. It doesn't have an SPF record either. Thanks for the advice. Bev From lists at nopersonal.info Mon Jan 14 18:49:43 2008 From: lists at nopersonal.info (B.A.S.) Date: Mon, 14 Jan 2008 18:49:43 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478BEC4C.6000106@projectskyline.com> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <478BEC4C.6000106@projectskyline.com> Message-ID: <478BF517.9000104@nopersonal.info> Ben Sgro wrote: > Hello, > > Gosh, who knows. I have a problem like that w/an app that runs > PHPMailer; yahoo users never see the emails. > It really sucks, and there isn't anything I can do about it. Yahoo just > decides to block this particular domain, or > whatever. > > Maybe someone with more email knowledge can chime in. > > - Ben Hi Ben, Well, luckily the mail server's IP address doesn't appear to be on any blacklists according to http://www.mxtoolbox.com/blacklists.aspx, so I guess that's some consolation. Thanks for trying to help. I'll eventually work it out one way or another. Bev From kenrbnsn at rbnsn.com Mon Jan 14 18:59:05 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Mon, 14 Jan 2008 18:59:05 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478BF307.30401@nopersonal.info> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> <478BF307.30401@nopersonal.info> Message-ID: At 06:40 PM 1/14/2008, B.A.S. wrote: >No, the client in question doesn't have their own (dedicated) IP and >AFAIK the only thing available is a static IP, which I'm guessing >wouldn't help since (as I understand it) several domains could be >using the same static IP. It doesn't have an SPF record either. Get a SPF record on the DNS Zone for the domain. A PTR record is also good, but the hosting company usually has to do that one. As for the mail() function itself, use the "optional" 5th parameter to set the "Return-path:" header. Set it to "-f username at the.domain.in.question". The username doesn't have to exist. Some domains like AOL will throw away email where domain in the "Return-path:" header doesn't match the domain in the "From:" header. Ken From sjmci at optonline.net Mon Jan 14 18:58:20 2008 From: sjmci at optonline.net (Steve Solomon) Date: Mon, 14 Jan 2008 18:58:20 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websitesinstead of Java In-Reply-To: <8f0676b40801140822s5d592dcfx3d9075e43147117@mail.gmail.com> Message-ID: <000b01c85709$575c0630$6601a8c0@T1400> Well, OK, so you are complaining about PHP when your code isn't even aware that it is comparing integers with strings and comparing variables that have no value? On second thought you are correct in that PHP should be smart enough to realize your code has no idea what it is doing. Java would surely pick that up instantly. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of John Campbell Sent: Monday, January 14, 2008 11:23 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websitesinstead of Java On Jan 14, 2008 8:17 AM, Kenneth Downs wrote: > Elliotte Harold wrote: > > Michael Southwell wrote: > > > >> ah, no, these answers are exactly right, given that $a is an > >> integer, $b and $c are strings, and $d is unset. $b and $c when > >> converted to integers for the purpose of comparison in #1 and #3 > >> turn into 0 > >> (zero) so the comparisons are true. #2 compares two different strings > >> and so is false. #4 compares 0 to the integer of unset and so is > >> true. #5 and #6 compare strings to the string of unset and so are false. > >>> > > > > > > Yes, this is what PHP does. It's just that what PHP does is insane. > > It does not match any normal, logical thought process. > > > > A content-free emotive statement. > > It would be more accurate to say that it follows a set of principles > you do not share, namely, weak typing. We would expect you as a java > dude to prefer strong typing. Strong typing to me is inappropriate in > a web layer, and reduces my productivity. Is it insane? No, just > incompatible with my design goals and methods. I am with Rusty on this one. PHP is insane in this regard. Consider the following statements: 1+1=2 if a < b and b < c then a < c if a=b and b=c then a=c I am a bit of a purist, and I hold these three rules to be self-evident and violations of these rules put one outside the realm of a normal logical thought process. PHP violates #2 and #3, therefore PHP is insane. Other weakly typed languages do not violate these rules. This is not about weak vs strong typing, although it is much easier to get basic logic right in a strongly typed language. If you still don't understand the problem, then take this quiz: what is the output of the following statements? var_dump(true + true); var_dump(null < 0); var_dump(null < -1); var_dump(null < 1); Regards, John Campbell _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.2/1224 - Release Date: 1/14/2008 5:39 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.2/1224 - Release Date: 1/14/2008 5:39 PM From lists at nopersonal.info Mon Jan 14 19:21:20 2008 From: lists at nopersonal.info (B.A.S.) Date: Mon, 14 Jan 2008 19:21:20 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478BF307.30401@nopersonal.info> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> <478BF307.30401@nopersonal.info> Message-ID: <478BFC80.5010700@nopersonal.info> Ken Robinson wrote: > Get a SPF record on the DNS Zone for the domain. A PTR record is also > good, but the hosting company usually has to do that one. > > As for the mail() function itself, use the "optional" 5th parameter to > set the "Return-path:" header. Set it to "-f > username at the.domain.in.question". The username doesn't have to exist. > Some domains like AOL will throw away email where domain in the > "Return-path:" header doesn't match the domain in the "From:" header. > > Ken I've heard of SPF records before, but not PTR, so I'll go educate myself more on both counts to see if I can remedy the situation. The hosting company in question is pretty accommodating, so they may be willing to help. I'll try that 5th parameter and see what happens. Luckily, for this particular script the "From:" header is hard-coded. Thanks, Bev From hans at cyberxdesigns.com Mon Jan 14 20:11:34 2008 From: hans at cyberxdesigns.com (Hans Kaspersetz) Date: Mon, 14 Jan 2008 19:11:34 -0600 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478BFC80.5010700@nopersonal.info> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> <478BF307.30401@nopersonal.info> <478BFC80.5010700@nopersonal.info> Message-ID: <478C0846.2060909@cyberxdesigns.com> So my guess is that the address the mail is coming from doesn't exist or the headers are malformed. Send us the complete headers for on of your generated emails. It should look like: Subject: foo bar From: blah blah Date: Mon, 14 Jan 2008 19:09:03 -0600 To: "Blah blah" Return-path: Envelope-to: blahblah at cyberxdesigns.com Delivery-date: Mon, 14 Jan 2008 20:09:01 -0500 Received: from [189.149.170.20] (helo=[192.168.0.198]) by host.cxdhosting.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1JEaIR-0006mC-1b for blahblah at cyberxdesigns.com; Mon, 14 Jan 2008 20:08:55 -0500 Message-ID: <478C07AF.9 at cyberxdesigns.com> User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) That will start to help us pin point what the problem is. Hans B.A.S. wrote: > Ken Robinson wrote: >> Get a SPF record on the DNS Zone for the domain. A PTR record is also >> good, but the hosting company usually has to do that one. >> >> As for the mail() function itself, use the "optional" 5th parameter >> to set the "Return-path:" header. Set it to "-f >> username at the.domain.in.question". The username doesn't have to exist. >> Some domains like AOL will throw away email where domain in the >> "Return-path:" header doesn't match the domain in the "From:" header. >> >> Ken > > I've heard of SPF records before, but not PTR, so I'll go educate > myself more on both counts to see if I can remedy the situation. The > hosting company in question is pretty accommodating, so they may be > willing to help. > > I'll try that 5th parameter and see what happens. Luckily, for this > particular script the "From:" header is hard-coded. > > Thanks, > Bev > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From rick at click-rick.net Mon Jan 14 20:17:00 2008 From: rick at click-rick.net (Rick Retzko) Date: Mon, 14 Jan 2008 20:17:00 -0500 Subject: [nycphp-talk] xls output: localhost works, www doesn't In-Reply-To: References: <475F318F.7060104@projectskyline.com> Message-ID: <000b01c85714$5559a580$0501a8c0@adam> Hi all - Hopefully one of you have seen this and can quickly point me to the error of my ways. I need to output small files from mysql database to the user via excel files. I'm using the following class to do this: private function output_file(){ //output the file to the user header("Content-Type: application/vnd.ms-excel; name='excel'"); header("Content-Disposition: attachment; filename={$this->_file_name}"); header("Pragma: no-cache"); header("Expires:0"); echo "{$this->_export_string}"; exit(); } This works perfectly on localhost, but when I move it to my www site, it outputs the data onto the screen. I've tried using "header('Content-Type: application/octet-stream');" as well, with the same results. All help is appreciated! Best Regards - Rick ============ MFR Holdings, LLC rick at click-rick.net 201.755.4083 From ramons at gmx.net Mon Jan 14 21:18:13 2008 From: ramons at gmx.net (David Krings) Date: Mon, 14 Jan 2008 21:18:13 -0500 Subject: [nycphp-talk] Announcement: Flare CSH Calls for PHP Message-ID: <478C17E5.8080601@gmx.net> Attached is version 1.0 of Flare CSH Calls for PHP. The included PHP file allows for easily adding WebHelp CSH calls to any PHP application. The file includes two functions, one is the main function generating the link for accessing the help. The second function is a wrapper for the first function to make CSH calls easier by setting system wide variables, such as the one storing the location of the Default_CSH.htm file. The functions are published under the GNU Lesser General Public License. This announcement is also made on the MadCap Flare Forums. I hope you will like it. David -------------- next part -------------- A non-text attachment was scrubbed... Name: Flare CSH for PHP.zip Type: application/octet-stream Size: 18206 bytes Desc: not available URL: From lists at nopersonal.info Mon Jan 14 21:24:28 2008 From: lists at nopersonal.info (B.A.S.) Date: Mon, 14 Jan 2008 21:24:28 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478C0846.2060909@cyberxdesigns.com> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> <478BF307.30401@nopersonal.info> <478BFC80.5010700@nopersonal.info> <478C0846.2060909@cyberxdesigns.com> Message-ID: <478C195C.1060303@nopersonal.info> Hans Kaspersetz wrote: > So my guess is that the address the mail is coming from doesn't exist or > the headers are malformed. Send us the complete headers for on of your > generated emails. > > It should look like: > > Subject: foo bar > From: blah blah > Date: Mon, 14 Jan 2008 19:09:03 -0600 > To: "Blah blah" > Return-path: > Envelope-to: blahblah at cyberxdesigns.com > Delivery-date: Mon, 14 Jan 2008 20:09:01 -0500 > Received: from [189.149.170.20] (helo=[192.168.0.198]) by > host.cxdhosting.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) > (envelope-from ) id 1JEaIR-0006mC-1b for > blahblah at cyberxdesigns.com; Mon, 14 Jan 2008 20:08:55 -0500 > Message-ID: <478C07AF.9 at cyberxdesigns.com> > User-Agent: > Thunderbird 2.0.0.9 (Windows/20071031) > > > That will start to help us pin point what the problem is. > > Hans Thanks, Hans. Here are the headers: Return-path: Envelope-to: recipient3 at example.com Delivery-date: Mon, 14 Jan 2008 19:49:12 -0600 Received: from nobody by hosting.company.com with local (Exim 4.68) (envelope-from ) id 1JEavQ-0007T3-9u; Mon, 14 Jan 2008 19:49:12 -0600 To: recipient1 at example.com Subject: Newsletter Request From: me at example.com To: recipient2 at example.com Cc: recipient3 at example.com Reply-To: me at example.com Message-Id: Date: Mon, 14 Jan 2008 19:49:12 -0600 Hmmm, I wonder why "Envelope-to:" is the same as "Cc:" in the headers? Anyway, here's my code for creating the headers & sending the mail: /* code to initialize other variables, validate & filter incoming data, etc. */ // initialize variables $to = 'recipient1 at example.com'; $subject = 'Newsletter Request'; // build message $message = "\nName: $name\n\n"; $message .= "E-mail: $email\n\n"; $message .= "Received from IP: $ip on $timestamp\n\n"; $message .= "-----------------\n\n"; $message .= "This e-mail was automatically generated by your form processing script. The submitted data was also written to a CSV file on your server.\n"; // build additional headers $additionalHeaders = "From: me at example.com\r\n"; $additionalHeaders .= "To: recipient2 at example.com\r\n"; $additionalHeaders .= "Cc: recipient3 at example.com\r\n"; $additionalHeaders .= "Return-Path: -f me at example.com\r\n"; $additionalHeaders .= "Reply-To: me at example.com\r\n"; if (!isset($error)) { $mailSent = mail($to, $subject, $message, $additionalHeaders); /* code to write to csv file */ } /* a few more lines of code to handle errors & close script */ Regards, Bev From ramons at gmx.net Mon Jan 14 21:29:28 2008 From: ramons at gmx.net (David Krings) Date: Mon, 14 Jan 2008 21:29:28 -0500 Subject: [nycphp-talk] Concatenation Message-ID: <478C1A88.9040001@gmx.net> Hi! I saw this in email thread going on: $message = "\nName: $name\n\n"; $message .= "E-mail: $email\n\n"; Is that doing the same as $message = "\nName: $name\n\n"; $message = $message."E-mail: $email\n\n"; ??? David From kenrbnsn at rbnsn.com Mon Jan 14 21:53:24 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Mon, 14 Jan 2008 21:53:24 -0500 Subject: [nycphp-talk] Concatenation In-Reply-To: <478C1A88.9040001@gmx.net> References: <478C1A88.9040001@gmx.net> Message-ID: At 09:29 PM 1/14/2008, David Krings wrote: >Hi! > >I saw this in email thread going on: > >$message = "\nName: $name\n\n"; >$message .= "E-mail: $email\n\n"; > >Is that doing the same as >$message = "\nName: $name\n\n"; >$message = $message."E-mail: $email\n\n"; Yes. It's similar to using the "+=" or "-=" operator combinations: $i = 1; $i += 2; echo $i; will print 3. Ken From lists at nopersonal.info Mon Jan 14 21:59:17 2008 From: lists at nopersonal.info (B.A.S.) Date: Mon, 14 Jan 2008 21:59:17 -0500 Subject: [nycphp-talk] Installing PHP/MySQL on in-house MS server Message-ID: <478C2185.2010600@nopersonal.info> I have a potential client referred to me by their network guy. The client wants a simple CMS, which I'm comfortable doing. I'm basically subbing as the network guy will handle the paper and mark up my rate by a certain number of percentage points. The client is running Windows Server 2003 in-house. Neither PHP nor MySQL is installed, and those are the only things I know. The network guy is aware of this and says he prefers to keep their server in-house, but can get outside hosting if necessary. He said I'm welcome to install PHP/MySQL on the in-house server, but I'd have to configure them myself. That prospect terrifies me as I'm not that far past past newbie stage. I've been reading up on PHP security, but don't feel the least bit qualified to _securely_ set up & configure things up in a production environment as the only installations I've done have been on my home LAN for testing purposes. I'd love to learn how to do it, but not the expense of potentially exposing the client to a massive security breach and making myself look like a fool. I _do_ need to tell the network guy to just go ahead and find a hosting company, right? TIA, Bev From hans at cyberxdesigns.com Mon Jan 14 22:29:20 2008 From: hans at cyberxdesigns.com (Hans Kaspersetz) Date: Mon, 14 Jan 2008 21:29:20 -0600 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478C195C.1060303@nopersonal.info> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> <478BF307.30401@nopersonal.info> <478BFC80.5010700@nopersonal.info> <478C0846.2060909@cyberxdesigns.com> <478C195C.1060303@nopersonal.info> Message-ID: <478C2890.30009@cyberxdesigns.com> > > Thanks, Hans. Here are the headers: > > Return-path: > Envelope-to: recipient3 at example.com > Delivery-date: Mon, 14 Jan 2008 19:49:12 -0600 > Received: from nobody by hosting.company.com with local (Exim 4.68) > (envelope-from ) > id 1JEavQ-0007T3-9u; Mon, 14 Jan 2008 19:49:12 -0600 > To: recipient1 at example.com > Subject: Newsletter Request > From: me at example.com > To: recipient2 at example.com > Cc: recipient3 at example.com > Reply-To: me at example.com > Message-Id: > Date: Mon, 14 Jan 2008 19:49:12 -0600 > > > > // build additional headers > $additionalHeaders = "From: me at example.com\r\n"; > $additionalHeaders .= "To: recipient2 at example.com\r\n"; > $additionalHeaders .= "Cc: recipient3 at example.com\r\n"; > $additionalHeaders .= "Return-Path: -f me at example.com\r\n"; > $additionalHeaders .= "Reply-To: me at example.com\r\n"; > > Well, as I suspected you definitely have some problems in your header and the address the mail is coming from doesn't exist in the real world. The first thing to correct is the line: $additionalHeaders .= "Return-Path: -f me at example.com\r\n"; It is non-sense drop it all together. Then make your mail() call something like this: $mailSent = mail($to, $subject, $message, $additionalHeaders, "-f me at example.com"). It is a little late any my eyes are dry, but that should go a long way to fixing you up. However, this will only work if your host allows you to override with the -f flag. Make the changes and send us the new headers. In any event, you mail is not being routed by Google and the like because your Return-Path is not being set to an address that exists in the real world. Hans From lists at nopersonal.info Mon Jan 14 23:15:02 2008 From: lists at nopersonal.info (B.A.S.) Date: Mon, 14 Jan 2008 23:15:02 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478C2890.30009@cyberxdesigns.com> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> <478BF307.30401@nopersonal.info> <478BFC80.5010700@nopersonal.info> <478C0846.2060909@cyberxdesigns.com> <478C195C.1060303@nopersonal.info> <478C2890.30009@cyberxdesigns.com> Message-ID: <478C3346.2070001@nopersonal.info> Hans Kaspersetz wrote: >> // build additional headers >> $additionalHeaders = "From: me at example.com\r\n"; >> $additionalHeaders .= "To: recipient2 at example.com\r\n"; >> $additionalHeaders .= "Cc: recipient3 at example.com\r\n"; >> $additionalHeaders .= "Return-Path: -f me at example.com\r\n"; >> $additionalHeaders .= "Reply-To: me at example.com\r\n"; >> >> > Well, as I suspected you definitely have some problems in your header > and the address the mail is coming from doesn't exist in the real > world. The first thing to correct is the line: $additionalHeaders .= > "Return-Path: -f me at example.com\r\n"; It is non-sense drop it all > together. Done. > Then make your mail() call something like this: $mailSent = mail($to, > $subject, $message, $additionalHeaders, "-f me at example.com"). It is a > little late any my eyes are dry, but that should go a long way to fixing > you up. However, this will only work if your host allows you to > override with the -f flag. Make the changes and send us the new headers. Done. All emails bounced with the following msg: A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: recipient1 at example.com Mail sent by user nobody being discarded due to sender restrictions in WHM->Tweak Settings recipient2 at example.com Mail sent by user nobody being discarded due to sender restrictions in WHM->Tweak Settings recipient3 at example.com Mail sent by user nobody being discarded due to sender restrictions in WHM->Tweak Settings New headers from bounce msg: Return-path: <> Envelope-to: me at example.com Delivery-date: Mon, 14 Jan 2008 21:54:45 -0600 Received: from mailnull by mercury.hostspectrum.com with local (Exim 4.68) id 1JEcsv-0000He-LN for me at example.com; Mon, 14 Jan 2008 21:54:45 -0600 X-Failed-Recipients: recipient1 at example.com, recipient2 at example.com, recipient3 at example.com Auto-Submitted: auto-replied From: Mail Delivery System To: me at example.com Subject: Mail delivery failed: returning message to sender Message-Id: Date: Mon, 14 Jan 2008 21:54:45 -0600 > In any event, you mail is not being routed by Google and the like > because your Return-Path is not being set to an address that exists in > the real world. Duly noted; thanks. Regards, Bev From elharo at metalab.unc.edu Mon Jan 14 23:40:09 2008 From: elharo at metalab.unc.edu (Elliotte Rusty Harold) Date: Mon, 14 Jan 2008 23:40:09 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <478B60D2.20107@secdat.com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> Message-ID: <478C3929.4050300@metalab.unc.edu> Kenneth Downs wrote: > A content-free emotive statement. > It would be more accurate to say that it follows a set of principles you > do not share, namely, weak typing. We would expect you as a java dude > to prefer strong typing. Strong typing to me is inappropriate in a web > layer, and reduces my productivity. Is it insane? No, just > incompatible with my design goals and methods. > The issue is neither strong nor weak typing. The issue is the violation of basic Aristotelian logic. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From anoland at indigente.net Tue Jan 15 08:18:07 2008 From: anoland at indigente.net (Adrian Noland) Date: Tue, 15 Jan 2008 08:18:07 -0500 Subject: [nycphp-talk] xls output: localhost works, www doesn't In-Reply-To: <000b01c85714$5559a580$0501a8c0@adam> References: <475F318F.7060104@projectskyline.com> <000b01c85714$5559a580$0501a8c0@adam> Message-ID: <1d8a0e930801150518t35d76f4bg92522f9b8e12f418@mail.gmail.com> Try an ob_clean() before sending the header. That way you make sure there are no extra LF/CR in your output. On 1/14/08, Rick Retzko wrote: > > Hi all - Hopefully one of you have seen this and can quickly point me to > the > error of my ways. > > I need to output small files from mysql database to the user via excel > files. I'm using the following class to do this: > > private function output_file(){ > //output the file to the user > header("Content-Type: application/vnd.ms-excel; > name='excel'"); > header("Content-Disposition: attachment; > filename={$this->_file_name}"); > header("Pragma: no-cache"); > header("Expires:0"); > echo "{$this->_export_string}"; > exit(); > } > > This works perfectly on localhost, but when I move it to my www site, it > outputs the data onto the screen. > > I've tried using "header('Content-Type: application/octet-stream');" as > well, with the same results. > > All help is appreciated! > > Best Regards - > > Rick > ============ > MFR Holdings, LLC > rick at click-rick.net > 201.755.4083 > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 tgales at tgaconnect.com Tue Jan 15 08:41:02 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 15 Jan 2008 08:41:02 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <478C3929.4050300@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> <478C3929.4050300@metalab.unc.edu> Message-ID: <478CB7EE.7000203@tgaconnect.com> Elliotte Rusty Harold wrote: > Kenneth Downs wrote: > >> A content-free emotive statement. >> It would be more accurate to say that it follows a set of principles >> you do not share, namely, weak typing. We would expect you as a java >> dude to prefer strong typing. Strong typing to me is inappropriate in >> a web layer, and reduces my productivity. Is it insane? No, just >> incompatible with my design goals and methods. >> > > The issue is neither strong nor weak typing. The issue is the violation > of basic Aristotelian logic. > I confess I am somewhat confused by what you mean by "violation of basic Aristotelian logic". Aristotle argues (in 'On Interpretation') that a single assertion must always either affirm or deny a single predicate of a single subject. (cf: http://plato.stanford.edu/entries/aristotle-logic/#PreStrAss ) That is to say (according to Aristotle) assertions (apophanseis) are either 'True' or 'Not True'. That logic is the basis of two-valued first order predicate calculus. (which is the fancy way of saying Boolean Algebra) Michael Southwell says: "these answers are exactly right, given that $a is an integer, $b and $c are strings, and $d is unset..." That is there are three possible states: 'True', 'Not True', and 'Undefined' And,we are dealing with three-valued first order predicate calculus. Now if you are saying Aristotelian logic doesn't apply here, then I would heartily agree. But if you are saying Aristotelian logic should apply here then I don't understand how you get to that conclusion. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From jmcgraw1 at gmail.com Tue Jan 15 09:43:53 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Tue, 15 Jan 2008 09:43:53 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478C3346.2070001@nopersonal.info> References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> <478BF307.30401@nopersonal.info> <478BFC80.5010700@nopersonal.info> <478C0846.2060909@cyberxdesigns.com> <478C195C.1060303@nopersonal.info> <478C2890.30009@cyberxdesigns.com> <478C3346.2070001@nopersonal.info> Message-ID: Not to get off the topic of debugging your particular problem, but I've always used SwiftMailer (http://www.swiftmailer.org/), which is all OO and has many tips on correct usage. - jake On Jan 14, 2008 11:15 PM, B.A.S. wrote: > Hans Kaspersetz wrote: > >> // build additional headers > >> $additionalHeaders = "From: me at example.com\r\n"; > >> $additionalHeaders .= "To: recipient2 at example.com\r\n"; > >> $additionalHeaders .= "Cc: recipient3 at example.com\r\n"; > >> $additionalHeaders .= "Return-Path: -f me at example.com\r\n"; > >> $additionalHeaders .= "Reply-To: me at example.com\r\n"; > >> > >> > > Well, as I suspected you definitely have some problems in your header > > and the address the mail is coming from doesn't exist in the real > > world. The first thing to correct is the line: $additionalHeaders .= > > "Return-Path: -f me at example.com\r\n"; It is non-sense drop it all > > together. > > Done. > > > Then make your mail() call something like this: $mailSent = mail($to, > > $subject, $message, $additionalHeaders, "-f me at example.com"). It is a > > little late any my eyes are dry, but that should go a long way to fixing > > you up. However, this will only work if your host allows you to > > override with the -f flag. Make the changes and send us the new headers. > > Done. All emails bounced with the following msg: > > A message that you sent could not be delivered to one or more of its > recipients. This is a permanent error. The following address(es) failed: > > recipient1 at example.com > Mail sent by user nobody being discarded due to sender restrictions > in WHM->Tweak Settings > recipient2 at example.com > Mail sent by user nobody being discarded due to sender restrictions > in WHM->Tweak Settings > recipient3 at example.com > Mail sent by user nobody being discarded due to sender restrictions > in WHM->Tweak Settings > > New headers from bounce msg: > > Return-path: <> > Envelope-to: me at example.com > Delivery-date: Mon, 14 Jan 2008 21:54:45 -0600 > Received: from mailnull by mercury.hostspectrum.com with local (Exim 4.68) > id 1JEcsv-0000He-LN > for me at example.com; Mon, 14 Jan 2008 21:54:45 -0600 > X-Failed-Recipients: recipient1 at example.com, > recipient2 at example.com, > recipient3 at example.com > Auto-Submitted: auto-replied > From: Mail Delivery System > To: me at example.com > Subject: Mail delivery failed: returning message to sender > Message-Id: > Date: Mon, 14 Jan 2008 21:54:45 -0600 > > > In any event, you mail is not being routed by Google and the like > > because your Return-Path is not being set to an address that exists in > > the real world. > > Duly noted; thanks. > > Regards, > Bev > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From danielc at analysisandsolutions.com Tue Jan 15 10:15:26 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 15 Jan 2008 10:15:26 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <478C3929.4050300@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> <478C3929.4050300@metalab.unc.edu> Message-ID: <20080115151526.GA17461@panix.com> Hi Elliotte: On Mon, Jan 14, 2008 at 11:40:09PM -0500, Elliotte Rusty Harold wrote: > > The issue is neither strong nor weak typing. The issue is the violation > of basic Aristotelian logic. There is logic to the process. You just need to know what the logic is. And you have to keep in mind that algebraic equations don't apply when comparing apples and oranges. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Tue Jan 15 10:20:18 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 15 Jan 2008 10:20:18 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <8f0676b40801140822s5d592dcfx3d9075e43147117@mail.gmail.com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> <8f0676b40801140822s5d592dcfx3d9075e43147117@mail.gmail.com> Message-ID: <20080115152018.GB17461@panix.com> Hey John: On Mon, Jan 14, 2008 at 11:22:44AM -0500, John Campbell wrote: > > If you still don't understand the problem, then take this quiz: > what is the output of the following statements? > var_dump(true + true); > var_dump(null < 0); > var_dump(null < -1); > var_dump(null < 1); The third one tripped me up. It's TRUE. I expected it to be false under the assumption that null == 0 in most PHP contexts. But it seems like it's really nothing/null in this context. Since null is nothing and a negative number is something, it makes some sort of sense. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Tue Jan 15 10:29:39 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 15 Jan 2008 10:29:39 -0500 Subject: [nycphp-talk] Installing PHP/MySQL on in-house MS server In-Reply-To: <478C2185.2010600@nopersonal.info> References: <478C2185.2010600@nopersonal.info> Message-ID: <20080115152939.GC17461@panix.com> On Mon, Jan 14, 2008 at 09:59:17PM -0500, B.A.S. wrote: > but can get outside hosting if necessary. He said I'm welcome to install > PHP/MySQL on the in-house server, but I'd have to configure them myself. Installing MySQL on Windows is pretty easy and can be done securely. An important factor is setting it up the MySQL service to run as a non-privileged user. My MySQL Basics tutorial page gives you step by step instructions on how to do that: http://www.analysisandsolutions.com/code/mysql-tutorial.htm Same kind of drill with Apache -- run the service under a non-privileged user. Though you _can_ skip Apache by running PHP under IIS if they're crazy enough to use that. But I'm a fan of getting someone else to manage the servers. One less thing for me to worry about. --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 nopersonal.info Tue Jan 15 10:34:43 2008 From: lists at nopersonal.info (B.A.S.) Date: Tue, 15 Jan 2008 10:34:43 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: References: <478BE40C.2040407@nopersonal.info> <478BE666.9070900@projectskyline.com> <478BEA18.40307@nopersonal.info> <8f0676b40801141513s1181f945v87d19bc0f2600a96@mail.gmail.com> <478BF307.30401@nopersonal.info> <478BFC80.5010700@nopersonal.info> <478C0846.2060909@cyberxdesigns.com> <478C195C.1060303@nopersonal.info> <478C2890.30009@cyberxdesigns.com> <478C3346.2070001@nopersonal.info> Message-ID: <478CD293.4030902@nopersonal.info> Jake McGraw wrote: > Not to get off the topic of debugging your particular problem, but > I've always used SwiftMailer (http://www.swiftmailer.org/), which is > all OO and has many tips on correct usage. Thanks, Jake, I'll take a look at it. Bev From lists at nopersonal.info Tue Jan 15 10:43:11 2008 From: lists at nopersonal.info (B.A.S.) Date: Tue, 15 Jan 2008 10:43:11 -0500 Subject: [nycphp-talk] Installing PHP/MySQL on in-house MS server In-Reply-To: <20080115152939.GC17461@panix.com> References: <478C2185.2010600@nopersonal.info> <20080115152939.GC17461@panix.com> Message-ID: <478CD48F.6010107@nopersonal.info> Daniel Convissor wrote: > Installing MySQL on Windows is pretty easy and can be done securely. An > important factor is setting it up the MySQL service to run as a > non-privileged user. My MySQL Basics tutorial page gives you step by > step instructions on how to do that: > > http://www.analysisandsolutions.com/code/mysql-tutorial.htm > > Same kind of drill with Apache -- run the service under a non-privileged > user. Though you _can_ skip Apache by running PHP under IIS if they're > crazy enough to use that. > > But I'm a fan of getting someone else to manage the servers. One less > thing for me to worry about. Great info--thanks! Bev From elharo at metalab.unc.edu Tue Jan 15 10:53:18 2008 From: elharo at metalab.unc.edu (Elliotte Rusty Harold) Date: Tue, 15 Jan 2008 10:53:18 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <20080115151526.GA17461@panix.com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> <478C3929.4050300@metalab.unc.edu> <20080115151526.GA17461@panix.com> Message-ID: <478CD6EE.1090709@metalab.unc.edu> Daniel Convissor wrote: > There is logic to the process. You just need to know what the logic is. > And you have to keep in mind that algebraic equations don't apply when > comparing apples and oranges. > Yes, they do. 1 Apple != 1 orange The problem arises when a = b and b = c, but a != c or b != a. Violation of commutativity and/or transitivity of equality is a major problem that makes PHP (and some other languages) confusing and unsuitable for teaching. In fact, most languages have this problem to greater or lesser degrees, but PHP is tilting strongly toward the greater end of that scale. There certainly is logic to PHP, but it's insane troll logic. It is not a clean and elegant human logic like any normal person would expect and understand without years of reeducation. Of course to those of us who have had our brains rewired, this may seem normal, but it's not. We are the ones marching out of step with the band. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From paul at devonianfarm.com Tue Jan 15 11:09:03 2008 From: paul at devonianfarm.com (paul at devonianfarm.com) Date: Tue, 15 Jan 2008 11:09:03 -0500 (EST) Subject: [nycphp-talk] Boolean evaluation (PHP vs Java) Message-ID: <48489.192.168.1.35.1200413343.webmail@192.168.1.35> I've thought about this for a long time -- and a lot lately since I've been doing mostly Java and ASP.NET to earn my bread in the last six months. One of the most controversial features of languages such as PHP and Perl is the lax evaluation of boolean values, if you write print $a ? "True" : "False"; You'll find that many different things evaluate false such as integer and float zero, the empty string, an empty array, a null, etc. Often this is a convenient behavior. For instance, if a function returns an empty array, it's often reasonable to interpret this as a failure, or a false value. C++ and Java programmers express a lot of anxiety that programs written this way will have lots of problems. My experience is that, coding in PHP, I run into a boolean problem once every couple of weeks. On the other hand, I find that I run into trouble with boolean values much more often when working in Java or C# -- the "false" value is different in every situation, so I need to think about every if() I write and I sometimes make a decision that's wrong in a subtle way -- no wonder why they worry. In PHP, however, you do end up with a "==" operator that's a little too permissive that thinks that "0"==false and also that "0"="" (empty string). That is a PITB when you're searching for a substring which might be at the start of the string (position 0) or not in the string at all (false). Then you need to use the "===" operator which is a little stricter than people often want -- the language probably could have been better designed. From tgales at tgaconnect.com Tue Jan 15 11:29:25 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 15 Jan 2008 11:29:25 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <478CD6EE.1090709@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> <478C3929.4050300@metalab.unc.edu> <20080115151526.GA17461@panix.com> <478CD6EE.1090709@metalab.unc.edu> Message-ID: <478CDF65.1090000@tgaconnect.com> Elliotte Rusty Harold wrote: > There certainly is logic to PHP, but it's insane troll logic. Consider a table in a database like name color ----- ------- bananas yellow apples red kumquats NULL lemons yellow When you select where color is not yellow you get kumquats with your apples. Some people claim that the (Boolean) algebra in a database is insane because it produces results which are sometimes unexpected. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From tgales at tgaconnect.com Tue Jan 15 12:14:25 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 15 Jan 2008 12:14:25 -0500 Subject: [nycphp-talk] Boolean evaluation (PHP vs Java) In-Reply-To: <48489.192.168.1.35.1200413343.webmail@192.168.1.35> References: <48489.192.168.1.35.1200413343.webmail@192.168.1.35> Message-ID: <478CE9F1.5000003@tgaconnect.com> paul at devonianfarm.com wrote: >[...] > One of the most controversial features of languages such > as PHP and Perl is the lax evaluation of boolean values If you look at http://nyphp.org/phundamentals/variableevaluation.php You will see a table which shows how variables can be tested. Beneath the table the article says: "This table demonstrates somewhat surprising results..." It talks about "... 0 (the integer), FALSE, and NULL..." The article also mentions that you have to take into account variables which are unset (even though unset is not a variable in a strict sense) To me this is somewhat like in a database query which selects from a column (attribute) which can contain nulls. You have to add 'and column != NULL' in order to take into account the fact that the data is not guaranteed to be a strictly 'either/or' situation. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From ioplex at gmail.com Tue Jan 15 12:14:31 2008 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 15 Jan 2008 12:14:31 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <478CD6EE.1090709@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> <478C3929.4050300@metalab.unc.edu> <20080115151526.GA17461@panix.com> <478CD6EE.1090709@metalab.unc.edu> Message-ID: <78c6bd860801150914ub135ac3hf20c2125c9a28c03@mail.gmail.com> On 1/15/08, Elliotte Rusty Harold wrote: > Daniel Convissor wrote: > > > There is logic to the process. You just need to know what the logic is. > > And you have to keep in mind that algebraic equations don't apply when > > comparing apples and oranges. > > > > Yes, they do. > > 1 Apple != 1 orange > > The problem arises when a = b and b = c, but a != c or b != a. Violation > of commutativity and/or transitivity of equality is a major problem that > makes PHP (and some other languages) confusing and unsuitable for > teaching. In fact, most languages have this problem to greater or lesser > degrees, but PHP is tilting strongly toward the greater end of that scale. > > There certainly is logic to PHP, but it's insane troll logic. It is not > a clean and elegant human logic like any normal person would expect and > understand without years of reeducation. Of course to those of us who > have had our brains rewired, this may seem normal, but it's not. We are > the ones marching out of step with the band. PHP is not Mathematica. It's primarily a template based system for emitting text so much of the logical details you're describing are optimized for that purpose. > Java I/O 2nd Edition Just Published! > http://www.cafeaulait.org/books/javaio2/ > http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ This is funny because I think one of the biggest warts with Java is bloated poorly designed libs like NIO. As the author of JCIFS (the Java CIFS networking client), which is pretty sophisticated about multiplexing requests, I have some experience in this area and I have found that Java is rather bad for writing efficient networking clients. The limitations in the synchronized primitive is a problem for us. We really need a simple condition variable but the concurrency API bloated to the point where I want to implement a simple condvar using synchronized but that's a non-trivial error prone exercise. It's all very disappointing really since the language by itself is great. Mike > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From tgales at tgaconnect.com Tue Jan 15 12:42:37 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 15 Jan 2008 12:42:37 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <78c6bd860801150914ub135ac3hf20c2125c9a28c03@mail.gmail.com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> <478C3929.4050300@metalab.unc.edu> <20080115151526.GA17461@panix.com> <478CD6EE.1090709@metalab.unc.edu> <78c6bd860801150914ub135ac3hf20c2125c9a28c03@mail.gmail.com> Message-ID: <478CF08D.50609@tgaconnect.com> Michael B Allen wrote: [...] > PHP is not Mathematica. It's primarily a template based system for > emitting text... Peter Yared (who gave a presentation back in '05) says many application servers are basically 'text pumps' http://peteryared.blogspot.com/2003/09/application-servers-2004-big-muffin-in.html -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From ramons at gmx.net Tue Jan 15 13:14:26 2008 From: ramons at gmx.net (David Krings) Date: Tue, 15 Jan 2008 13:14:26 -0500 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <478CD6EE.1090709@metalab.unc.edu> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> <478C3929.4050300@metalab.unc.edu> <20080115151526.GA17461@panix.com> <478CD6EE.1090709@metalab.unc.edu> Message-ID: <478CF802.8000007@gmx.net> Elliotte Rusty Harold wrote: > There certainly is logic to PHP, but it's insane troll logic. It is not > a clean and elegant human logic like any normal person would expect and > understand without years of reeducation. Of course to those of us who > have had our brains rewired, this may seem normal, but it's not. We are > the ones marching out of step with the band. Ah, come on, I must be some sick dude then. Here is the list of programming languages that I dealth with in the past 20 years: 1 Commodore BASIC V2 (hobby) 2 Simon's BASIC (hobby) 3 Commodre 64 assembler (hobby) 4 Logo (on the C 64 and the Apple IIe) (high school) 5 QBASIC (x86) (hobby) 6 ANSI C (university) 7 Delphi (hobby) 8 VB 6 (work) 9 VB .NET (hobby) 10 Paradox ObjectPAL (work) 11 C++ (hobby) 12 C Sharp (hobby) 13 Java (university, hobby) 14 8088 / Z80 Assembler (work, hobby) That is when I stopped and decided that I hate programming and programming hates me. And then I came across PHP and got hooked for the following reasons a) the other languages are way too primitive or too outdated to do something useful with these days (1-5, 10) b) the other languages are way too cumbersome and complicated for me to understand them (6, 11-14) c) the other languages aren't in a) or b), but don't lend themselves well for web development (8,9) Leaves Delphi out, which honestly didn't stick in my mind as neither good or bad. Oh, and I did some TurboPascal some long time ago, but I only recall that I did, but not when and why. I also tried Curl when it came out first (the language, not the PHP cURL module), but couldn't get that one either and ditched it quickly. And what is particularly interesting is that I don't get the logic of C or Java. In my opinion, there is no single human factor to these languages, neither in their logic nor in their commands. In PHP, if you want to do something think of an English word that best describes the action and look it up in the function list. I often did well with this approach as it isbased on human logic. Same applies to the way I develop my scripts. I first write the commentary, then translate the spoken language into PHP code, which isn't at all a far stretch. I never managed to pull that off in Java as hard as I tried. I read books, took classes, looked at code, dug through tutorials - no matter what I can't make any sense on why Java demands things to be done in a particular way. OK, maybe it doesn't go against all human logic, but it goes against my logic which I think is of average quality. I think it isn't accurate to state that PHP defies any logic, human or not. Look at bright minds like Gallileo, he was outcast for not marching with the band. And in the end he was damn right. The only beef that I have with PHP is that whenever it comes to something that has to do with time or date the functions coded by apparently american developers screw the rest of the world over. David From ioplex at gmail.com Tue Jan 15 13:21:56 2008 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 15 Jan 2008 13:21:56 -0500 Subject: [nycphp-talk] Web Services Message-ID: <78c6bd860801151021m45befd19ie280db62ff9b078c@mail.gmail.com> On 1/15/08, Tim Gales wrote: > Michael B Allen wrote: > [...] > > PHP is not Mathematica. It's primarily a template based system for > > emitting text... > > Peter Yared (who gave a presentation back in '05) says many application > servers are basically 'text pumps' > http://peteryared.blogspot.com/2003/09/application-servers-2004-big-muffin-in.html There's one major issue with "The Donut Architecture" being web services which is that without a single lock to coordinate the efforts of everyone you have a race-condition nightmare. It's very important to realize that each service must check a state variable with a single authority. A database is ideal for that because it implicitly provides a lock. Meaning, if you have web servers A, B and C and A does some work and indicates to B that it can do some work and then B sends C some work ... etc then it becomes very difficult to stop or move things in the workflow. The key is to use a state variable in the database and always check it before performing the next job. Unfortunately most people do not realize this and end up with systems that are very difficult to control. Application server technology is one big game of Whac-A-Mole. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From tgales at tgaconnect.com Tue Jan 15 13:47:47 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 15 Jan 2008 13:47:47 -0500 Subject: [nycphp-talk] Web Services In-Reply-To: <78c6bd860801151021m45befd19ie280db62ff9b078c@mail.gmail.com> References: <78c6bd860801151021m45befd19ie280db62ff9b078c@mail.gmail.com> Message-ID: <478CFFD3.909@tgaconnect.com> Michael B Allen wrote: [...] > Application server technology is one big game of Whac-A-Mole. LOL -- This has a definite 'voice of experience' ring to it. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From paulcheung at tiscali.co.uk Tue Jan 15 15:56:05 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Tue, 15 Jan 2008 20:56:05 -0000 Subject: [nycphp-talk] Can PHP be wraqpped around HTML?? Message-ID: <004701c857b9$0be6f1f0$0200a8c0@X9183> This might seem quite trivial or rather silly; But it is causing me absolute havoc. However, each time I update a MySQL record I set an "update indicator" on, the idea being, So as not to update the record more than once. I am trying to wrap PHP coding around HTML coding and not the usual other way around. the question is, is it possible?? If so, what am I doing wrong? here is what I want to do, If update_ind != "u" submit update ; } ?> Thanks Paul From dorgan at donaldorgan.com Tue Jan 15 15:58:18 2008 From: dorgan at donaldorgan.com (Donald J Organ IV) Date: Tue, 15 Jan 2008 15:58:18 -0500 Subject: [nycphp-talk] Can PHP be wraqpped around HTML?? In-Reply-To: <004701c857b9$0be6f1f0$0200a8c0@X9183> References: <004701c857b9$0be6f1f0$0200a8c0@X9183> Message-ID: <478D1E6A.1020001@donaldorgan.com> Yes you can do this: PaulCheung wrote: > This might seem quite trivial or rather silly; But it is causing me > absolute > havoc. However, each time I update a MySQL record I set an "update > indicator" on, the idea being, So as not to update the record more > than once. > I am trying to wrap PHP coding around HTML coding and not the usual other > way around. the question is, is it possible?? If so, what am I doing > wrong? > > here is what I want to do, If update_ind != "u" submit update > > > if (update_ind != "u") > { ; } > ?> > > Thanks > > Paul > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From sean712 at gmail.com Tue Jan 15 16:01:07 2008 From: sean712 at gmail.com (Sean) Date: Tue, 15 Jan 2008 16:01:07 -0500 Subject: [nycphp-talk] Can PHP be wraqpped around HTML?? In-Reply-To: <004701c857b9$0be6f1f0$0200a8c0@X9183> References: <004701c857b9$0be6f1f0$0200a8c0@X9183> Message-ID: This should work -Sean On Jan 15, 2008 3:56 PM, PaulCheung wrote: > This might seem quite trivial or rather silly; But it is causing me > absolute > havoc. However, each time I update a MySQL record I set an "update > indicator" on, the idea being, So as not to update the record more than > once. > I am trying to wrap PHP coding around HTML coding and not the usual other > way around. the question is, is it possible?? If so, what am I doing > wrong? > > here is what I want to do, If update_ind != "u" submit update > > > if (update_ind != "u") > { ; } > ?> > > Thanks > > Paul > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Tue Jan 15 16:56:40 2008 From: ramons at gmx.net (David Krings) Date: Tue, 15 Jan 2008 16:56:40 -0500 Subject: [nycphp-talk] Can PHP be wraqpped around HTML?? In-Reply-To: <004701c857b9$0be6f1f0$0200a8c0@X9183> References: <004701c857b9$0be6f1f0$0200a8c0@X9183> Message-ID: <478D2C18.3030701@gmx.net> PaulCheung wrote: > This might seem quite trivial or rather silly; But it is causing me > absolute > havoc. However, each time I update a MySQL record I set an "update > indicator" on, the idea being, So as not to update the record more than > once. > I am trying to wrap PHP coding around HTML coding and not the usual other > way around. the question is, is it possible?? If so, what am I doing wrong? > > here is what I want to do, If update_ind != "u" submit update > > > if (update_ind != "u") > { ; } > ?> I know others pointed out different (better?) ways, but I use an echo in cases like that. That always works. David From kenrbnsn at rbnsn.com Tue Jan 15 17:31:00 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Tue, 15 Jan 2008 17:31:00 -0500 Subject: [nycphp-talk] Can PHP be wraqpped around HTML?? In-Reply-To: <004701c857b9$0be6f1f0$0200a8c0@X9183> References: <004701c857b9$0be6f1f0$0200a8c0@X9183> Message-ID: <20080115173100.544c7fo80gkgo0cs@www.rbnsn.com> Quoting PaulCheung : > This might seem quite trivial or rather silly; But it is causing me absolute > havoc. However, each time I update a MySQL record I set an "update > indicator" on, the idea being, So as not to update the record more than once. > I am trying to wrap PHP coding around HTML coding and not the usual other > way around. the question is, is it possible?? If so, what am I doing wrong? > > here is what I want to do, If update_ind != "u" submit update > > > if (update_ind != "u") > { ; } > ?> You want to echo the HTML: '; ?> Ken From edwardpotter at gmail.com Tue Jan 15 20:03:16 2008 From: edwardpotter at gmail.com (Edward Potter) Date: Tue, 15 Jan 2008 20:03:16 -0500 Subject: [nycphp-talk] Can PHP be wraqpped around HTML?? In-Reply-To: <20080115173100.544c7fo80gkgo0cs@www.rbnsn.com> References: <004701c857b9$0be6f1f0$0200a8c0@X9183> <20080115173100.544c7fo80gkgo0cs@www.rbnsn.com> Message-ID: this is where php gets a bit ugly. Use echo, print, single quotes, double quotes, escape those backslashes, use print <<<_EOT_, but now now you have an ugly indent. I think perl has a bit better sytax for handling the embedding of html code: qq|put all my ugly code here, variables, double quotes, you name it|; Why can't we do something similar in php after all these years? Maybe you can? I just don't know about it. :-) ed On Jan 15, 2008 5:31 PM, Ken Robinson wrote: > Quoting PaulCheung : > > > This might seem quite trivial or rather silly; But it is causing me absolute > > havoc. However, each time I update a MySQL record I set an "update > > indicator" on, the idea being, So as not to update the record more than once. > > I am trying to wrap PHP coding around HTML coding and not the usual other > > way around. the question is, is it possible?? If so, what am I doing wrong? > > > > here is what I want to do, If update_ind != "u" submit update > > > > > > > if (update_ind != "u") > > { ; } > > ?> > > You want to echo the HTML: > > if if (update_ind != "u") > echo ' onclick="window.print()"> value="UPDATE" type="submit">'; > ?> > > 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 > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Blog: http://www.utopiaparkway.com Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com Projects: http://flickr.com/photos/86842405 at N00/ Store: http://astore.amazon.com/httpwwwutopic-20 From max at neuropunks.org Tue Jan 15 21:53:36 2008 From: max at neuropunks.org (max at neuropunks.org) Date: Tue, 15 Jan 2008 21:53:36 -0500 Subject: [nycphp-talk] Can PHP be wraqpped around HTML?? Message-ID: <20080116025323.B2A78284C8@finn.neuropunks.org> Well, what about smarty? You can have different functions output to different templates,etc, and smarty can do its own functions on the input or call yours... -----Original Message----- From: Edward Potter Sent: Tuesday, January 15, 2008 8:03 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Can PHP be wraqpped around HTML?? this is where php gets a bit ugly. Use echo, print, single quotes, double quotes, escape those backslashes, use print <<<_EOT_, but now now you have an ugly indent. I think perl has a bit better sytax for handling the embedding of html code: qq|put all my ugly code here, variables, double quotes, you name it|; Why can't we do something similar in php after all these years? Maybe you can? I just don't know about it. :-) ed On Jan 15, 2008 5:31 PM, Ken Robinson wrote: > Quoting PaulCheung : > > > This might seem quite trivial or rather silly; But it is causing me absolute > > havoc. However, each time I update a MySQL record I set an "update > > indicator" on, the idea being, So as not to update the record more than once. > > I am trying to wrap PHP coding around HTML coding and not the usual other > > way around. the question is, is it possible?? If so, what am I doing wrong? > > > > here is what I want to do, If update_ind != "u" submit update > > > > > > > if (update_ind != "u") > > { ; } > > ?> > > You want to echo the HTML: > > if if (update_ind != "u") > echo ' onclick="window.print()"> value="UPDATE" type="submit">'; > ?> > > 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 > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Blog: http://www.utopiaparkway.com Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com Projects: http://flickr.com/photos/86842405 at N00/ Store: http://astore.amazon.com/httpwwwutopic-20 _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From 1j0lkq002 at sneakemail.com Wed Jan 16 03:36:44 2008 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Wed, 16 Jan 2008 00:36:44 -0800 Subject: [nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java In-Reply-To: <20080115152018.GB17461@panix.com> References: <477BB7B2.7090101@tgaconnect.com> <477BC92D.1020009@tgaconnect.com> <477C19A6.9020109@metalab.unc.edu> <477C2AC6.2060203@nyphp.com> <4788C2B4.2010803@metalab.unc.edu> <478B60D2.20107@secdat.com> <8f0676b40801140822s5d592dcfx3d9075e43147117@mail.gmail.com> <20080115152018.GB17461@panix.com> Message-ID: <17982-87660@sneakemail.com> Daniel Convissor danielc-at-analysisandsolutions.com |nyphp dev/internal group use| wrote: >Hey John: > >On Mon, Jan 14, 2008 at 11:22:44AM -0500, John Campbell wrote: > > >>If you still don't understand the problem, then take this quiz: >>what is the output of the following statements? >>var_dump(true + true); >>var_dump(null < 0); >>var_dump(null < -1); >>var_dump(null < 1); >> >> > >The third one tripped me up. It's TRUE. I expected it to be false under >the assumption that null == 0 in most PHP contexts. But it seems like >it's really nothing/null in this context. > > Since null is nothing and a >negative number is something, it makes some sort of sense. > > ^^^^^^^^^^^^^^^ gotta love that commitment to PHP! From rick at click-rick.net Wed Jan 16 06:25:30 2008 From: rick at click-rick.net (Rick Retzko) Date: Wed, 16 Jan 2008 06:25:30 -0500 Subject: [nycphp-talk] xls output: localhost works, www doesn't In-Reply-To: <1d8a0e930801150518t35d76f4bg92522f9b8e12f418@mail.gmail.com> References: <475F318F.7060104@projectskyline.com><000b01c85714$5559a580$0501a8c0@adam> <1d8a0e930801150518t35d76f4bg92522f9b8e12f418@mail.gmail.com> Message-ID: <002701c85832$81858740$0501a8c0@adam> Thanks for the recommendation! I've got it working now (pointing the form action directly to the file doing the processing, then exit() at the end of the process), but I'd like to be A LOT more confident that I understand why its working! Can anyone point me to books/articles/tutorial that focus on how PHP interprets headers or what's happening in the background when you download from the server? Thanks - Rick ============ MFR Holdings, LLC rick at click-rick.net 201.755.4083 _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Adrian Noland Sent: Tuesday, January 15, 2008 8:18 AM To: NYPHP Talk Subject: Re: [nycphp-talk] xls output: localhost works, www doesn't Try an ob_clean() before sending the header. That way you make sure there are no extra LF/CR in your output. On 1/14/08, Rick Retzko < rick at click-rick.net > wrote: Hi all - Hopefully one of you have seen this and can quickly point me to the error of my ways. I need to output small files from mysql database to the user via excel files. I'm using the following class to do this: private function output_file(){ //output the file to the user header("Content-Type: application/vnd.ms-excel; name='excel'"); header("Content-Disposition: attachment; filename={$this->_file_name}"); header("Pragma: no-cache"); header("Expires:0"); echo "{$this->_export_string}"; exit(); } This works perfectly on localhost, but when I move it to my www site, it outputs the data onto the screen. I've tried using "header('Content-Type: application/octet-stream');" as well, with the same results. All help is appreciated! Best Regards - Rick ============ MFR Holdings, LLC rick at click-rick.net 201.755.4083 _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/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 bz-gmort at beezifies.com Wed Jan 16 07:05:16 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Wed, 16 Jan 2008 07:05:16 -0500 Subject: [nycphp-talk] OT: Shopping Cart that schedules bookings In-Reply-To: <20080114113951.7xib0bny80gc48wk@mail.fluidhosting.com> References: <20080114113951.7xib0bny80gc48wk@mail.fluidhosting.com> Message-ID: <478DF2FC.5020703@beezifies.com> paul at gubavision.com wrote: > Does anyone know of a shopping cart that would allow the user to book > time with a service provider? Much like buying a product but in this > case book time and date. > There are a number of open source projects for doing this, not sure about a shopping cart per se, they generally have more functionality than that(calendars to display the data, etc) If you are still looking for this and those are acceptable, let me know and I'll pull up my past research. From bz-gmort at beezifies.com Wed Jan 16 07:09:51 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Wed, 16 Jan 2008 07:09:51 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478BE40C.2040407@nopersonal.info> References: <478BE40C.2040407@nopersonal.info> Message-ID: <478DF40F.8020107@beezifies.com> A bandaid workaround is to use one of the PHP mail packages that supports sending through authenticated external SMTP servers. The same way your PC's mail client sends. I know Swiftmail supports this, I don't know about others. It's slower to send that way, however you gain the ability to route the mail through multiple mail servers for testing to see if it is your local server that is causing the problem, or the program. You will need SMTP servers that support some form of authentication. My recollection is Swiftmail was one of the better packages because it supported "pop before send" verification, which is what many providers setup when they don't have the time to learn the intricacies of configuring their email server. From hans at cyberxdesigns.com Wed Jan 16 08:28:38 2008 From: hans at cyberxdesigns.com (Hans Kaspersetz) Date: Wed, 16 Jan 2008 07:28:38 -0600 Subject: [nycphp-talk] MySQL bought by SUN. Message-ID: <478E0686.7090102@cyberxdesigns.com> Note sure if any of you have seen this yet, http://blogs.mysql.com/kaj/sun-acquires-mysql.html/. MySQL AB was purchased by Sun Microsystems. Hans From lists at zaunere.com Wed Jan 16 08:31:26 2008 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 16 Jan 2008 08:31:26 -0500 Subject: [nycphp-talk] Sun acquires MySQL Message-ID: <08c501c85844$185b34b0$49119e10$@com> Good morning, Just saw this coming across the wires... http://blogs.mysql.com/kaj/sun-acquires-mysql.html/ Should make for an interesting day... and year... --- Hans Zaunere / President / New York PHP www.nyphp.org / ?www.nyphp.com From lists at zaunere.com Wed Jan 16 08:33:57 2008 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 16 Jan 2008 08:33:57 -0500 Subject: [nycphp-talk] MySQL bought by SUN. In-Reply-To: <478E0686.7090102@cyberxdesigns.com> References: <478E0686.7090102@cyberxdesigns.com> Message-ID: <08cc01c85844$720c2c80$56248580$@com> Heh, damn you Hans - beat me to the punch... > Note sure if any of you have seen this yet, > http://blogs.mysql.com/kaj/sun-acquires-mysql.html/. MySQL AB was > purchased by Sun Microsystems. Yeah, this is verrry interesting... H From anoland at indigente.net Wed Jan 16 08:42:00 2008 From: anoland at indigente.net (Adrian Noland) Date: Wed, 16 Jan 2008 08:42:00 -0500 Subject: [nycphp-talk] xls output: localhost works, www doesn't In-Reply-To: <002701c85832$81858740$0501a8c0@adam> References: <475F318F.7060104@projectskyline.com> <000b01c85714$5559a580$0501a8c0@adam> <1d8a0e930801150518t35d76f4bg92522f9b8e12f418@mail.gmail.com> <002701c85832$81858740$0501a8c0@adam> Message-ID: <1d8a0e930801160542p4165a02djaf82a86c343a2df9@mail.gmail.com> On 1/16/08, Rick Retzko wrote: > > Thanks for the recommendation! I've got it working now (pointing the > form action directly to the file doing the processing, then exit() at the > end of the process), but I'd like to be A LOT more confident that I > understand why its working! > > Can anyone point me to books/articles/tutorial that focus on how PHP > interprets headers or what's happening in the background when you download > from the server? > > Thanks - > > You should read up on output buffering and PHP's session handling, specifically as it pertains to cookies. Since Cookies are sent via header() the same applies to what you are doing by sending the XLS header. Look here: http://www.google.com/search?hl=en&q=php+output+buffering+cookie&btnG=Google+Search and here: http://guide.opendns.com/?url=php+output+buffering+cookie -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at realm3.com Wed Jan 16 09:17:22 2008 From: brian at realm3.com (Brian D.) Date: Wed, 16 Jan 2008 09:17:22 -0500 Subject: [nycphp-talk] MySQL bought by SUN. In-Reply-To: <08cc01c85844$720c2c80$56248580$@com> References: <478E0686.7090102@cyberxdesigns.com> <08cc01c85844$720c2c80$56248580$@com> Message-ID: Yes, indeed it is very interesting. I wonder what you think about this, Hans Z, having worked for MySQL. :D Slashdot commentary here: http://developers.slashdot.org/article.pl?sid=08/01/16/135243&from=rss On Jan 16, 2008 8:33 AM, Hans Zaunere wrote: > Heh, damn you Hans - beat me to the punch... > > > Note sure if any of you have seen this yet, > > http://blogs.mysql.com/kaj/sun-acquires-mysql.html/. MySQL AB was > > purchased by Sun Microsystems. > > Yeah, this is verrry interesting... > > > 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 > -- realm3 web applications [realm3.com] freelance consulting, application development (423) 506-0349 From jusheehy at vassar.edu Wed Jan 16 10:32:44 2008 From: jusheehy at vassar.edu (Julia Sheehy) Date: Wed, 16 Jan 2008 10:32:44 -0500 Subject: [nycphp-talk] Re: xls output: -- from talk Digest, Vol 15, Issue 31 In-Reply-To: <63i186$1m2lqv@ironport02.vassar.edu> References: <63i186$1m2lqv@ironport02.vassar.edu> Message-ID: <478E239C.9090309@vassar.edu> Dear Rick, Adrian's suggestion is a good one. I had this problem in a project (my first) summer before last. Just in case it would help, this is what worked for me: header("Content-Disposition: inline; filename={$this->_file_name}"); header("Content-type: application/vnd.ms-excel; name='excel'"); header('Pragma: private'); header('Cache-control: private, must-revalidate'); header("Expires: 0"); Message: 8 Date: Tue, 15 Jan 2008 08:18:07 -0500 From: "Adrian Noland" Subject: Re: [nycphp-talk] xls output: localhost works, www doesn't To: "NYPHP Talk" Message-ID: <1d8a0e930801150518t35d76f4bg92522f9b8e12f418 at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Try an ob_clean() before sending the header. That way you make sure there are no extra LF/CR in your output. On 1/14/08, Rick Retzko wrote: > > > > Hi all - Hopefully one of you have seen this and can quickly point me to > > the > > error of my ways. > > > > I need to output small files from mysql database to the user via excel > > files. I'm using the following class to do this: > > > > private function output_file(){ > > //output the file to the user > > header("Content-Type: application/vnd.ms-excel; > > name='excel'"); > > header("Content-Disposition: attachment; > > filename={$this->_file_name}"); > > header("Pragma: no-cache"); > > header("Expires:0"); > > echo "{$this->_export_string}"; > > exit(); > > } > > > > This works perfectly on localhost, but when I move it to my www site, it > > outputs the data onto the screen. > > > > I've tried using "header('Content-Type: application/octet-stream');" as > > well, with the same results. > > > > All help is appreciated! > > > > Best Regards - > > > > Rick > > ============ > > MFR Holdings, LLC > > rick at click-rick.net > > 201.755.4083 -------------- next part -------------- A non-text attachment was scrubbed... Name: jusheehy.vcf Type: text/x-vcard Size: 474 bytes Desc: not available URL: From lists at zaunere.com Wed Jan 16 10:39:08 2008 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 16 Jan 2008 10:39:08 -0500 Subject: [nycphp-talk] MySQL bought by SUN. In-Reply-To: References: <478E0686.7090102@cyberxdesigns.com> <08cc01c85844$720c2c80$56248580$@com> Message-ID: <005301c85855$ef212390$cd636ab0$@com> > Yes, indeed it is very interesting. I wonder what you think about > this, Hans Z, having worked for MySQL. :D That I missed out on SUNW, err, JAVA: http://finance.yahoo.com/q?s=JAVA > Slashdot commentary here: > http://developers.slashdot.org/article.pl?sid=08/01/16/135243&from=rss And here's the take from the Sun side: http://blogs.sun.com/jonathan/ Pretty interesting stuff... OpenSolaris/MySQL could be a powerful duo - in addition, of course, to the existing de-facto Solaris/Oracle duo. Maybe we'll learn more at March's meeting, when Sun is expected to present... From jcampbell1 at gmail.com Wed Jan 16 11:01:44 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 16 Jan 2008 11:01:44 -0500 Subject: [nycphp-talk] MySQL bought by SUN. In-Reply-To: <005301c85855$ef212390$cd636ab0$@com> References: <478E0686.7090102@cyberxdesigns.com> <08cc01c85844$720c2c80$56248580$@com> <005301c85855$ef212390$cd636ab0$@com> Message-ID: <8f0676b40801160801v3ce7305i9468cefaaa45d971@mail.gmail.com> > Pretty interesting stuff... OpenSolaris/MySQL could be a powerful duo - > in addition, of course, to the existing de-facto Solaris/Oracle duo. I think this is more about attaching a brand like Sun to the MySQL database rather than trying to create a better Solaris MySQL stack. "MySQL from Sun" has more credibility with enterprise customers than "MySQL from MySQL AB". It should be good news for LAMP developers, because it will lead to more acceptance of MySQL in the enterprise which increases demand for LAMP coders. The best news here is that we no longer have to worry about Oracle buying MySQL. Regards, John Campbell From aw at sap8.com Wed Jan 16 11:43:51 2008 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 16 Jan 2008 11:43:51 -0500 Subject: [nycphp-talk] MySQL bought by SUN. In-Reply-To: <8f0676b40801160801v3ce7305i9468cefaaa45d971@mail.gmail.com> References: <478E0686.7090102@cyberxdesigns.com> <08cc01c85844$720c2c80$56248580$@com> <005301c85855$ef212390$cd636ab0$@com> <8f0676b40801160801v3ce7305i9468cefaaa45d971@mail.gmail.com> Message-ID: <007701c8585e$f9cc6030$ed652090$@com> They didn't buy MySQL but they bought BEA: http://www.mercurynews.com/ci_7986939?nclick_check=1 Anthony Wlodarski 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of John Campbell Sent: Wednesday, January 16, 2008 11:02 AM To: NYPHP Talk Subject: Re: [nycphp-talk] MySQL bought by SUN. > Pretty interesting stuff... OpenSolaris/MySQL could be a powerful duo - > in addition, of course, to the existing de-facto Solaris/Oracle duo. I think this is more about attaching a brand like Sun to the MySQL database rather than trying to create a better Solaris MySQL stack. "MySQL from Sun" has more credibility with enterprise customers than "MySQL from MySQL AB". It should be good news for LAMP developers, because it will lead to more acceptance of MySQL in the enterprise which increases demand for LAMP coders. The best news here is that we no longer have to worry about Oracle buying MySQL. Regards, John Campbell _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From brian at realm3.com Wed Jan 16 11:46:06 2008 From: brian at realm3.com (Brian D.) Date: Wed, 16 Jan 2008 11:46:06 -0500 Subject: [nycphp-talk] MySQL bought by SUN. In-Reply-To: <8f0676b40801160801v3ce7305i9468cefaaa45d971@mail.gmail.com> References: <478E0686.7090102@cyberxdesigns.com> <08cc01c85844$720c2c80$56248580$@com> <005301c85855$ef212390$cd636ab0$@com> <8f0676b40801160801v3ce7305i9468cefaaa45d971@mail.gmail.com> Message-ID: "The best news here is that we no longer have to worry about Oracle buying MySQL." Preach on, Brother John. I really, really hope they work out their licensing problems, too. Just yesterday I was attempting to use mod_authn_dbd with MySQL, only to discover that MySQL support was removed due to "licensing issues", and to fix it one would have to recompile everything. It's not the only time I've run into problems like that. On Jan 16, 2008 11:01 AM, John Campbell wrote: > > Pretty interesting stuff... OpenSolaris/MySQL could be a powerful duo - > > in addition, of course, to the existing de-facto Solaris/Oracle duo. > > I think this is more about attaching a brand like Sun to the MySQL > database rather than trying to create a better Solaris MySQL stack. > "MySQL from Sun" has more credibility with enterprise customers than > "MySQL from MySQL AB". It should be good news for LAMP developers, > because it will lead to more acceptance of MySQL in the enterprise > which increases demand for LAMP coders. The best news here is that > we no longer have to worry about Oracle buying MySQL. > > Regards, > John Campbell > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594 From lists at zaunere.com Wed Jan 16 13:06:56 2008 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 16 Jan 2008 13:06:56 -0500 Subject: [nycphp-talk] MySQL bought by SUN. In-Reply-To: <8f0676b40801160801v3ce7305i9468cefaaa45d971@mail.gmail.com> References: <478E0686.7090102@cyberxdesigns.com> <08cc01c85844$720c2c80$56248580$@com> <005301c85855$ef212390$cd636ab0$@com> <8f0676b40801160801v3ce7305i9468cefaaa45d971@mail.gmail.com> Message-ID: <00a501c8586a$94de6680$be9b3380$@com> > > Pretty interesting stuff... OpenSolaris/MySQL could be a powerful duo - > > in addition, of course, to the existing de-facto Solaris/Oracle duo. > > I think this is more about attaching a brand like Sun to the MySQL > database rather than trying to create a better Solaris MySQL stack. > "MySQL from Sun" has more credibility with enterprise customers than > "MySQL from MySQL AB". It should be good news for LAMP developers, > because it will lead to more acceptance of MySQL in the enterprise > which increases demand for LAMP coders. The best news here is Oh sure, but with Sun's OpenSolaris, one has to wonder if the more attractive flavor of AMP could become OSAMP... > that we no longer have to worry about Oracle buying MySQL. And from the who-me-worry department, this quote sums it up: > If MySQL goes the way of Java, maybe there isn't too > much to worry about. >From the PostgreSQL-General List... H From rmarscher at beaffinitive.com Wed Jan 16 13:12:50 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 16 Jan 2008 13:12:50 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <4787980F.5040704@bizcomputinginc.com> References: <47865807.6090700@gmx.net> <47877919.2080807@secdat.com> <4787853C.1010305@gmx.net> <478793FC.6080802@secdat.com> <4787980F.5040704@bizcomputinginc.com> Message-ID: <9F4B00B9-6F8E-4B3B-B61D-A57C03579BEB@beaffinitive.com> On Jan 11, 2008, at 11:23 AM, Jim Hendricks wrote: > How crazy would it be if PHP had namespaces and a namespace > registration. Jon Baer posted some good links about namespaces in php... but I'm surprised no one posted this link: http://php.net/manual/en/language.namespaces.php From rmarscher at beaffinitive.com Wed Jan 16 13:22:19 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 16 Jan 2008 13:22:19 -0500 Subject: [nycphp-talk] Can PHP be wraqpped around HTML?? In-Reply-To: <004701c857b9$0be6f1f0$0200a8c0@X9183> References: <004701c857b9$0be6f1f0$0200a8c0@X9183> Message-ID: <58D89769-3859-4296-B6C7-279E579D6800@beaffinitive.com> On Jan 15, 2008, at 3:56 PM, PaulCheung wrote: > I am trying to wrap PHP coding around HTML coding and not the usual > other way around. Actually... this is what php was originally designed to do (10+ years ago). The other responses are all valid... but hmy favorite way of writing php that's enclosed by html is to use the alternative syntax for control structures (http://php.net/manual/en/control-structures.alternative-syntax.php ):
I think that's the most readable way of doing it. Often files like this are given a .phtml extension -- the Zend Framework defaults to this way of templating. If you look at the compiled templates for Smarty, they also use this way of writing control structures. It reminds me of Basic/VB. If you use short tags, you can echo stuff like this:

which is nice because of how compact it is. However, short tags don't play well with XML/XHTML files so I (and many other people) turn them off and must instead use the following:

FYI... found this little snippet in the php documentation: "for outputting large blocks of text, dropping out of PHP parsing mode is generally more efficient than sending all of the text through echo() or print()." http://php.net/manual/en/language.basic-syntax.php However, those kinds of little optimizations don't usually end up affecting performance by much... usually there's much larger fish to fry -- like database queries. From rmarscher at beaffinitive.com Wed Jan 16 13:27:01 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 16 Jan 2008 13:27:01 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478DF40F.8020107@beezifies.com> References: <478BE40C.2040407@nopersonal.info> <478DF40F.8020107@beezifies.com> Message-ID: On Jan 16, 2008, at 7:09 AM, Gary Mort wrote: > [snip]... use one of the PHP mail packages that supports sending > through authenticated external SMTP servers... > [snip...It's slower to send that way...[snip] It was my understanding that it's better to send via SMTP though because it taxes your system resources less than using mail() -- especially when you're managing a large email list. From lists at nopersonal.info Wed Jan 16 18:11:51 2008 From: lists at nopersonal.info (B.A.S.) Date: Wed, 16 Jan 2008 18:11:51 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: <478DF40F.8020107@beezifies.com> References: <478BE40C.2040407@nopersonal.info> <478DF40F.8020107@beezifies.com> Message-ID: <478E8F37.6080805@nopersonal.info> Gary Mort wrote: > A bandaid workaround is to use one of the PHP mail packages that > supports sending through authenticated external SMTP servers. > > The same way your PC's mail client sends. > > I know Swiftmail supports this, I don't know about others. > > It's slower to send that way, however you gain the ability to route the > mail through multiple mail servers for testing to see if it is your > local server that is causing the problem, or the program. > > You will need SMTP servers that support some form of authentication. > > My recollection is Swiftmail was one of the better packages because it > supported "pop before send" verification, which is what many providers > setup when they don't have the time to learn the intricacies of > configuring their email server. I've downloaded both Swift & PHPMailer (both provide pop before send), but since you're the second person to mention Swift I think I'll try it first. Thanks for the advice. Bev From lists at nopersonal.info Wed Jan 16 20:00:32 2008 From: lists at nopersonal.info (B.A.S.) Date: Wed, 16 Jan 2008 20:00:32 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP Message-ID: <478EA8B0.2090408@nopersonal.info> Hi Everyone, I'm trying to move from being a rank beginner to an intermediate level of programming PHP. While practicing & trying to learn something new every day, I'm also reading up on security (Essential PHP Security by O'Reilly & Pro PHP Security by Apress). Unfortunately, I still have a really tough time trying to work out the logic of what I want a script to do, and my code is pretty primitive & verbose because of that (I have to painstakingly step through each little bit of logic in order to wrap my head around anything). What I should be doing to get to the next level? Should I read up on web application design? OOP? Just keep plugging away? What do you guys use when working out the logic of an application you're building? I'm guessing that would be some kind of flow chart? What about IDEs? Because of my HTML coding & graphic design background, I'm still using Dreamweaver--would I perhaps learn faster or be more productive using Zend Studio (or even something less expensive like phpDesigner)? Please forgive the numerous questions, but I'm 40+ years old and want to approach this professionally, not just be some hack who writes sloppy code for for beer & pizza money and doesn't care about the client. TIA, Bev From jmcgraw1 at gmail.com Wed Jan 16 20:30:55 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 16 Jan 2008 20:30:55 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <478EA8B0.2090408@nopersonal.info> References: <478EA8B0.2090408@nopersonal.info> Message-ID: Couple of suggestions: 1. Really read the documentation available at php.net, it is the best resource available online. At the very least, go through the the Language Reference section (although you can ignore the sections pertaining to PHP4). Additionally, anytime you're doing something with a string or array, see if there is a function available for what you're doing. I'd say 90% of the time someone has already done the hard work and all you need to do is read the documentation. As a short cut, typing "http://www.php.net/foobar" into the address bar will automatically search the PHP function list for any functions like "foobar". 2. Learn a templateing system, my personal favorite is Smarty [smarty.php.net] and get all of your HTML out of your PHP code. This ties into a larger lesson for all programmers, that is learning Model-View-Controller pattern [wikpedia.org/wiki/Model-view-controller]. 3. See how the pros do it, download Drupal [drupal.org/download] or Vanilla [getvanilla.com] or some other Open Source PHP project and look at some of the conventions these developers employ. You need not review every line, but get an idea for how these people organize their code. Install the framework and see how things work. That is how I've done things and I feel like I'm getting there. FYI, I started using PHP professionally about 2 years ago, but most of what I learned, I've accumulated in the last 6 months working as the sole developer for a major PHP application. You won't necessary move on from a noob to pro by just reading the documentation and doing the exercises, find something to work on (maybe write your own database driven blog) and throw yourself into it. Good luck! - jake On Jan 16, 2008 8:00 PM, B.A.S. wrote: > Hi Everyone, > > I'm trying to move from being a rank beginner to an intermediate level > of programming PHP. While practicing & trying to learn something new > every day, I'm also reading up on security (Essential PHP Security by > O'Reilly & Pro PHP Security by Apress). > > Unfortunately, I still have a really tough time trying to work out the > logic of what I want a script to do, and my code is pretty primitive & > verbose because of that (I have to painstakingly step through each > little bit of logic in order to wrap my head around anything). > > What I should be doing to get to the next level? Should I read up on web > application design? OOP? Just keep plugging away? What do you guys use > when working out the logic of an application you're building? I'm > guessing that would be some kind of flow chart? > > What about IDEs? Because of my HTML coding & graphic design background, > I'm still using Dreamweaver--would I perhaps learn faster or be more > productive using Zend Studio (or even something less expensive like > phpDesigner)? > > Please forgive the numerous questions, but I'm 40+ years old and want to > approach this professionally, not just be some hack who writes sloppy > code for for beer & pizza money and doesn't care about the client. > > TIA, > Bev > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From jmcgraw1 at gmail.com Wed Jan 16 20:30:55 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 16 Jan 2008 20:30:55 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <478EA8B0.2090408@nopersonal.info> References: <478EA8B0.2090408@nopersonal.info> Message-ID: Couple of suggestions: 1. Really read the documentation available at php.net, it is the best resource available online. At the very least, go through the the Language Reference section (although you can ignore the sections pertaining to PHP4). Additionally, anytime you're doing something with a string or array, see if there is a function available for what you're doing. I'd say 90% of the time someone has already done the hard work and all you need to do is read the documentation. As a short cut, typing "http://www.php.net/foobar" into the address bar will automatically search the PHP function list for any functions like "foobar". 2. Learn a templateing system, my personal favorite is Smarty [smarty.php.net] and get all of your HTML out of your PHP code. This ties into a larger lesson for all programmers, that is learning Model-View-Controller pattern [wikpedia.org/wiki/Model-view-controller]. 3. See how the pros do it, download Drupal [drupal.org/download] or Vanilla [getvanilla.com] or some other Open Source PHP project and look at some of the conventions these developers employ. You need not review every line, but get an idea for how these people organize their code. Install the framework and see how things work. That is how I've done things and I feel like I'm getting there. FYI, I started using PHP professionally about 2 years ago, but most of what I learned, I've accumulated in the last 6 months working as the sole developer for a major PHP application. You won't necessary move on from a noob to pro by just reading the documentation and doing the exercises, find something to work on (maybe write your own database driven blog) and throw yourself into it. Good luck! - jake On Jan 16, 2008 8:00 PM, B.A.S. wrote: > Hi Everyone, > > I'm trying to move from being a rank beginner to an intermediate level > of programming PHP. While practicing & trying to learn something new > every day, I'm also reading up on security (Essential PHP Security by > O'Reilly & Pro PHP Security by Apress). > > Unfortunately, I still have a really tough time trying to work out the > logic of what I want a script to do, and my code is pretty primitive & > verbose because of that (I have to painstakingly step through each > little bit of logic in order to wrap my head around anything). > > What I should be doing to get to the next level? Should I read up on web > application design? OOP? Just keep plugging away? What do you guys use > when working out the logic of an application you're building? I'm > guessing that would be some kind of flow chart? > > What about IDEs? Because of my HTML coding & graphic design background, > I'm still using Dreamweaver--would I perhaps learn faster or be more > productive using Zend Studio (or even something less expensive like > phpDesigner)? > > Please forgive the numerous questions, but I'm 40+ years old and want to > approach this professionally, not just be some hack who writes sloppy > code for for beer & pizza money and doesn't care about the client. > > TIA, > Bev > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From lists at nopersonal.info Wed Jan 16 20:54:38 2008 From: lists at nopersonal.info (B.A.S.) Date: Wed, 16 Jan 2008 20:54:38 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: References: <478EA8B0.2090408@nopersonal.info> Message-ID: <478EB55E.9040608@nopersonal.info> Jake, those are exactly the sort of tips I was looking for--thanks so much for the advice and for wishing me luck. Bev Jake McGraw wrote: > Couple of suggestions: > > 1. Really read the documentation available at php.net, it is the best > resource available online. At the very least, go through the the > Language Reference section (although you can ignore the sections > pertaining to PHP4). Additionally, anytime you're doing something with > a string or array, see if there is a function available for what > you're doing. I'd say 90% of the time someone has already done the > hard work and all you need to do is read the documentation. As a short > cut, typing "http://www.php.net/foobar" into the address bar will > automatically search the PHP function list for any functions like > "foobar". > > 2. Learn a templateing system, my personal favorite is Smarty > [smarty.php.net] and get all of your HTML out of your PHP code. This > ties into a larger lesson for all programmers, that is learning > Model-View-Controller pattern > [wikpedia.org/wiki/Model-view-controller]. > > 3. See how the pros do it, download Drupal [drupal.org/download] or > Vanilla [getvanilla.com] or some other Open Source PHP project and > look at some of the conventions these developers employ. You need not > review every line, but get an idea for how these people organize their > code. Install the framework and see how things work. > > That is how I've done things and I feel like I'm getting there. FYI, I > started using PHP professionally about 2 years ago, but most of what I > learned, I've accumulated in the last 6 months working as the sole > developer for a major PHP application. You won't necessary move on > from a noob to pro by just reading the documentation and doing the > exercises, find something to work on (maybe write your own database > driven blog) and throw yourself into it. > > Good luck! > - jake From gatzby3jr at gmail.com Wed Jan 16 21:24:17 2008 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Wed, 16 Jan 2008 21:24:17 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <478EB55E.9040608@nopersonal.info> References: <478EA8B0.2090408@nopersonal.info> <478EB55E.9040608@nopersonal.info> Message-ID: <29da5d150801161824j3e1b62fduea860ba9f0e6b222@mail.gmail.com> The best way I learned was just to do something that was relevant. Even today when learning new things, if I am just learning the theory and not actually putting it into place I don't grasp it as well. Make yourself a homepage, and put the things you want on there. Like sports? Figure out how to make a sports blog with predictions or whatever. When I was learning, I created my homepage with a blog, calendar, and a gallery because that's what I wanted to create, and I learned the most from that. Things start to click when you're more engaged. On Jan 16, 2008 8:54 PM, B.A.S. wrote: > Jake, those are exactly the sort of tips I was looking for--thanks so > much for the advice and for wishing me luck. > > Bev > > Jake McGraw wrote: > > Couple of suggestions: > > > > 1. Really read the documentation available at php.net, it is the best > > resource available online. At the very least, go through the the > > Language Reference section (although you can ignore the sections > > pertaining to PHP4). Additionally, anytime you're doing something with > > a string or array, see if there is a function available for what > > you're doing. I'd say 90% of the time someone has already done the > > hard work and all you need to do is read the documentation. As a short > > cut, typing "http://www.php.net/foobar" into the address bar will > > automatically search the PHP function list for any functions like > > "foobar". > > > > 2. Learn a templateing system, my personal favorite is Smarty > > [smarty.php.net] and get all of your HTML out of your PHP code. This > > ties into a larger lesson for all programmers, that is learning > > Model-View-Controller pattern > > [wikpedia.org/wiki/Model-view-controller]. > > > > 3. See how the pros do it, download Drupal [drupal.org/download] or > > Vanilla [getvanilla.com] or some other Open Source PHP project and > > look at some of the conventions these developers employ. You need not > > review every line, but get an idea for how these people organize their > > code. Install the framework and see how things work. > > > > That is how I've done things and I feel like I'm getting there. FYI, I > > started using PHP professionally about 2 years ago, but most of what I > > learned, I've accumulated in the last 6 months working as the sole > > developer for a major PHP application. You won't necessary move on > > from a noob to pro by just reading the documentation and doing the > > exercises, find something to work on (maybe write your own database > > driven blog) and throw yourself into it. > > > > Good luck! > > - jake > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 ben at projectskyline.com Wed Jan 16 22:23:00 2008 From: ben at projectskyline.com (Ben Sgro) Date: Wed, 16 Jan 2008 22:23:00 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <29da5d150801161824j3e1b62fduea860ba9f0e6b222@mail.gmail.com> References: <478EA8B0.2090408@nopersonal.info> <478EB55E.9040608@nopersonal.info> <29da5d150801161824j3e1b62fduea860ba9f0e6b222@mail.gmail.com> Message-ID: <478ECA14.9020001@projectskyline.com> Hello, Yeah +1 on that. Find some stuff that interests you, and dig in. Keep reading of course and in between projects create a sandbox and experiment with new stuff, with the goal that some of that will be used in your next project. Try experimenting with smarty outside a customers application, and on the next job you get, employ it (if needed). I think smarty is an excellent tool, that really helps remove html from php logic. Use it if you don't already. I can think of more stuff later. I'm tired, heh. Good luck! - Ben Brian O'Connor wrote: > The best way I learned was just to do something that was relevant. > Even today when learning new things, if I am just learning the theory > and not actually putting it into place I don't grasp it as well. Make > yourself a homepage, and put the things you want on there. Like > sports? Figure out how to make a sports blog with predictions or > whatever. When I was learning, I created my homepage with a blog, > calendar, and a gallery because that's what I wanted to create, and I > learned the most from that. Things start to click when you're more > engaged. > > On Jan 16, 2008 8:54 PM, B.A.S. > wrote: > > Jake, those are exactly the sort of tips I was looking for--thanks so > much for the advice and for wishing me luck. > > Bev > > Jake McGraw wrote: > > Couple of suggestions: > > > > 1. Really read the documentation available at php.net > , it is the best > > resource available online. At the very least, go through the the > > Language Reference section (although you can ignore the sections > > pertaining to PHP4). Additionally, anytime you're doing > something with > > a string or array, see if there is a function available for what > > you're doing. I'd say 90% of the time someone has already done the > > hard work and all you need to do is read the documentation. As a > short > > cut, typing "http://www.php.net/foobar" into the address bar will > > automatically search the PHP function list for any functions like > > "foobar". > > > > 2. Learn a templateing system, my personal favorite is Smarty > > [ smarty.php.net ] and get all of your > HTML out of your PHP code. This > > ties into a larger lesson for all programmers, that is learning > > Model-View-Controller pattern > > [ wikpedia.org/wiki/Model-view-controller > ]. > > > > 3. See how the pros do it, download Drupal [drupal.org/download > ] or > > Vanilla [ getvanilla.com ] or some other > Open Source PHP project and > > look at some of the conventions these developers employ. You > need not > > review every line, but get an idea for how these people organize > their > > code. Install the framework and see how things work. > > > > That is how I've done things and I feel like I'm getting there. > FYI, I > > started using PHP professionally about 2 years ago, but most of > what I > > learned, I've accumulated in the last 6 months working as the sole > > developer for a major PHP application. You won't necessary move on > > from a noob to pro by just reading the documentation and doing the > > exercises, find something to work on (maybe write your own database > > driven blog) and throw yourself into it. > > > > Good luck! > > - jake > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 nopersonal.info Wed Jan 16 22:30:34 2008 From: lists at nopersonal.info (B.A.S.) Date: Wed, 16 Jan 2008 22:30:34 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <29da5d150801161824j3e1b62fduea860ba9f0e6b222@mail.gmail.com> References: <478EA8B0.2090408@nopersonal.info> <478EB55E.9040608@nopersonal.info> <29da5d150801161824j3e1b62fduea860ba9f0e6b222@mail.gmail.com> Message-ID: <478ECBDA.5090609@nopersonal.info> Brian O'Connor wrote: > The best way I learned was just to do something that was relevant. Even > today when learning new things, if I am just learning the theory and not > actually putting it into place I don't grasp it as well. Make yourself > a homepage, and put the things you want on there. Like sports? Figure > out how to make a sports blog with predictions or whatever. When I was > learning, I created my homepage with a blog, calendar, and a gallery > because that's what I wanted to create, and I learned the most from > that. Things start to click when you're more engaged. You know, last year I got the opportunity to take over a custom built CMS that had been abandoned halfway through by the original programmer and that was a great (but harrowing) learning experience. I've also done a few login systems and have gotten pretty good with processing forms, but, you're right, I really should do more. I mean I should try something that I've never done before. I already have a web site for my graphic & web design work, but I've always wanted to create a secure area where clients can review their project assets and such, so maybe I'll do that. A blog and/or photo gallery could be interesting too. Calendars scare me. :) Thanks for the feedback, Bev From lists at nopersonal.info Wed Jan 16 22:46:30 2008 From: lists at nopersonal.info (B.A.S.) Date: Wed, 16 Jan 2008 22:46:30 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <478ECA14.9020001@projectskyline.com> References: <478EA8B0.2090408@nopersonal.info> <478EB55E.9040608@nopersonal.info> <29da5d150801161824j3e1b62fduea860ba9f0e6b222@mail.gmail.com> <478ECA14.9020001@projectskyline.com> Message-ID: <478ECF96.1060109@nopersonal.info> Ben Sgro wrote: > Hello, > > Yeah +1 on that. Find some stuff that interests you, and dig in. Keep > reading of course and in between projects > create a sandbox and experiment with new stuff, with the goal that some > of that will be used in your next project. Hi Ben, Reading, yes. I keep a copy of the PHP functions reference on my nightstand and try to read about at least one new function per night. Hopefully more will seep in by osmosis. ;) I do have a sandbox set up with a bunch of basic stuff that I go back and refer to as needed, but I really should the bar a little. > Try experimenting with smarty outside a customers application, and on > the next job you get, employ it (if needed). > > I think smarty is an excellent tool, that really helps remove html from > php logic. Use it if you don't already. I've downloaded Smarty a couple of times, but never got around to installing it. Since you're the 2nd person to mention it, I guess I need to buckle down and get busy with it. > I can think of more stuff later. I'm tired, heh. If you do think of anything, let me know--I'm all ears. > Good luck! Thanks! Bev From ramons at gmx.net Wed Jan 16 23:36:23 2008 From: ramons at gmx.net (David Krings) Date: Wed, 16 Jan 2008 23:36:23 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <478EA8B0.2090408@nopersonal.info> References: <478EA8B0.2090408@nopersonal.info> Message-ID: <478EDB47.7040203@gmx.net> B.A.S. wrote: > Hi Everyone, > > I'm trying to move from being a rank beginner to an intermediate level > of programming PHP. While practicing & trying to learn something new > every day, I'm also reading up on security (Essential PHP Security by > O'Reilly & Pro PHP Security by Apress). That is never bad. > Unfortunately, I still have a really tough time trying to work out the > logic of what I want a script to do, and my code is pretty primitive & > verbose because of that (I have to painstakingly step through each > little bit of logic in order to wrap my head around anything). Welcome to my world, you are not alone. > What I should be doing to get to the next level? Should I read up on web > application design? OOP? Just keep plugging away? What do you guys use > when working out the logic of an application you're building? I'm > guessing that would be some kind of flow chart? What I do is write the commentary first. I write down each step that I know or think needs to be done in the respective sequence. It isn't as formal as a flow chart, but it does the same job: first think about what you need to do and then do it. Of course there will be changes while writing the code and when testing and fixing bugs, but that will happen no matter what you do. If you rather make a flow chart, go ahead, but you do want to add plenty of commentary anyway. > What about IDEs? Because of my HTML coding & graphic design background, > I'm still using Dreamweaver--would I perhaps learn faster or be more > productive using Zend Studio (or even something less expensive like > phpDesigner)? Well, I went through the odysee of IDEs and still plan on finishing my review of all the ones that I tested out. My three recommendations are LuckaSoft's EnginSite Editor for PHP, Waterproof's PHP Editor, and NuSphere's PHPEd. I use PHPEd as it has the best debugger implementation, not surprisingly as Dmitri ???, the creator of dbg, works for NuSphere. NuSpehere costs money and they do show that they are a business quite drastically. You buy a license and get support and updates until the next version comes out, which is typically 6 months later, so your benefits fade quickly. I find that a bit asanine, but they do put out a product that I think is work the money. See if they have some introductory deal. I got the smallest package for under 60 bucks. I used LuckaSoft's IDE before and think it is a great IDE and even as good or better than PHPEd if it wasn't for the debugger. It uses dbg as well, but in debug mode you have to stop at the beginning of each script and that turns old very quickly. I got a free license for EnginSite PHP because I did the German GUI translation for them. SO if you know a second language and they don't have that as GUI language then spend the two days translating and get a nice IDE in return. Waterproof's IDE has less features, but for the general development work it is on par with EnginSite. If you write to Waterproof and tell them that you do PHP as a hobby and that your projects are for yourself as well as friends and family to look at then they will give you a free private license. They are really nice about that. Uh, one more thing about Luckasoft, see that you get their MySQL client with the IDE if you decide to use Enginsite. It is the best MySQL client that I have seen so far. They also sell it as a standalone tool and it really is nicely done. I'd get the Standard package from NuSphere and the Luckasoft MySQL client. NuSphere's Pro package has a MySQL client built in, but I haven't had a chance to check it out. Now, some may recommend the Eclipse based IDEs. I found them to be horrible and truely not designed for PHP. Just syntax highlighting doesn't cut it. I also found those bolted on packages difficult to install and lacking a lot of features. I also tried Numega, but that didn't do it for me. I also tried Zend and I think that IDE was designed by a bunch of drunken monkeys. It is among the worst pieces of crapware that I ever came across. Unbelievable that they charge money for that. I guess some people like it, otherwise it wouldn't be so popular. > Please forgive the numerous questions, but I'm 40+ years old and want to > approach this professionally, not just be some hack who writes sloppy > code for for beer & pizza money and doesn't care about the client. Don't underestimate beer and pizza! I think the best approach is to schedule a lot of time and come up with a few projects that you are interested in. Then pick one, write specs for it, establish milestones, create the outline (either as comments or as flow chart), then star coding, and finally do a lot of testing. When you are done, take the project and put it somewhere in the corner of your hard drive and start over again. You will be amazed how much better you are now and how much better your code is. I work on a project now for three years and found myself in the position to write code for a task that I coded before in a different context. I didn't use the old code, but created new scripts. Turns out that the new ones are half the size, run more stable, use less variables and flags, require less db queries, and are just much much better designed and written. I ditched the old code and used the new code. And don't get hung up on creating something that isn't there yet. I work on a picture and video archiver/viewer and there are tons available that are probably much better than mine. But with that approach you will quickly find out that everything was already coded before. Other than that, I completed an MP3 archiving/player system, started a bug tracking and CRM tool (was too big of a task for me), and spend some time writing a custom CMS for eLearning, but quit the job due to budget cuts (the feds needed the money for the useless wars rather than for social services for children and families). And by all means ask as many questions as you can. Ask tons of questions. The answers that you will get will propel you to the next level. I don't think I'd be on the level I am at now if it wasn't for relentless asking on NYPHP Talk. David From kenrbnsn at rbnsn.com Wed Jan 16 23:38:36 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Wed, 16 Jan 2008 23:38:36 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <478EA8B0.2090408@nopersonal.info> References: <478EA8B0.2090408@nopersonal.info> Message-ID: At 08:00 PM 1/16/2008, B.A.S. wrote: >Hi Everyone, > >I'm trying to move from being a rank beginner to an intermediate >level of programming PHP. While practicing & trying to learn >something new every day, I'm also reading up on security (Essential >PHP Security by O'Reilly & Pro PHP Security by Apress). > >Unfortunately, I still have a really tough time trying to work out >the logic of what I want a script to do, and my code is pretty >primitive & verbose because of that (I have to painstakingly step >through each little bit of logic in order to wrap my head around anything). > >What I should be doing to get to the next level? Should I read up on >web application design? OOP? Just keep plugging away? What do you >guys use when working out the logic of an application you're >building? I'm guessing that would be some kind of flow chart? I would join one of the on-line PHP related forums. I joined the PHPFreaks forum 2.5 years ago and found it very helpful. >What about IDEs? Because of my HTML coding & graphic design >background, I'm still using Dreamweaver--would I perhaps learn >faster or be more productive using Zend Studio (or even something >less expensive like phpDesigner)? I've never used Dreamweaver, so I can't tell you anything pro or con. I've used TopStyle Pro, since it's very good at HTML, CSS, & PHP editing. I would also recommend installing a local copy of Apache/PHP/MySQL on your everyday computer, so you have a place to experiment. I use xampp on my Windows XP laptop. I've been able to develop code on Windows and upload to my Linux host with no problems. >Please forgive the numerous questions, but I'm 40+ years old and >want to approach this professionally, not just be some hack who >writes sloppy code for for beer & pizza money and doesn't care about >the client. Questions are one of the best ways to learn. And don't worry about being older, I didn't start to learn PHP until I was almost 50 (47 or 48 to be almost exact). Ken From jsia18 at yahoo.com Wed Jan 16 23:48:20 2008 From: jsia18 at yahoo.com (Jason Sia) Date: Wed, 16 Jan 2008 20:48:20 -0800 (PST) Subject: [nycphp-talk] PHP HTTP POST not working Message-ID: <263347.23838.qm@web37906.mail.mud.yahoo.com> I am transferring to a new server, my code in php using curl with http post works very well. However, when I transferred the file to the new server it does not work anymore. I tried if php curl is working by simply accessing a webpage and displaying its contents but with no http post, it works fine and it displays the webpage however if I tried adding a http post it does not work anymore. I've checked the phpinfo() and here is the output: CURL support enabled CURL Information libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Here is the sample source code: $url = 'http://www.example.com'; $csv= 'username=user&password=password'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $csv); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result=curl_exec ($ch); curl_close ($ch); I use the same file in my old server and until now its working fine there but in my new server it does not work anymore. Does this need any additional configuration in my httpd.conf or php.ini? Send instant messages to your online friends http://uk.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Thu Jan 17 02:36:24 2008 From: bz-gmort at beezifies.com (Gary Mort) Date: Thu, 17 Jan 2008 02:36:24 -0500 Subject: [nycphp-talk] Emails not being received when using mail() In-Reply-To: References: <478BE40C.2040407@nopersonal.info> <478DF40F.8020107@beezifies.com> Message-ID: <478F0578.207@beezifies.com> Rob Marscher wrote: > On Jan 16, 2008, at 7:09 AM, Gary Mort wrote: >> [snip]... use one of the PHP mail packages that supports sending >> through authenticated external SMTP servers... >> [snip...It's slower to send that way...[snip] > > It was my understanding that it's better to send via SMTP though > because it taxes your system resources less than using mail() -- > especially when you're managing a large email list. > Well, that really depends on your environment. mail() can be configured to use SMTP or invoke sendmail directly. Personally, for a really large email list, I'd prefer to invoke sendmail directly and dump all the messages into the queue at once. Than I'd tackle deliverability from the email server side, not from PHP. But that assumes a dedicated box where you can finetune postfix to your hearts content. If your on a shared host, they don't like big sudden dumps of email because the outgoing mail from one person can clog the connection for someone else. So instead, they prefer SMTP, especially authenticated SMTP so they can go scream at whoever dumped the big load of email on the server. Also mail libraries like Swiftmail can be setup to throttle the link, ie send 10 messages, than wait a second, send 10 messages, wait a second, or send no more than 3 messages a second. My personal feeling is if your going to be dumping huge amounts of email out on the net, get a VPS somewhere and set it up as a dedicated outgoing email server, and send through it with authenticated SMTP. Than you can manage and grow your VPN until you need a dedicated box. Alternatively, there are tons of companies out there that already do this service for you, and many of them have API's you can access via REST, SOAP, or FTP. So why not use them? From tgales at tgaconnect.com Thu Jan 17 07:13:32 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Thu, 17 Jan 2008 07:13:32 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <478EA8B0.2090408@nopersonal.info> References: <478EA8B0.2090408@nopersonal.info> Message-ID: <478F466C.9080008@tgaconnect.com> B.A.S. wrote: > Hi Everyone, > > I'm trying to move from being a rank beginner to an intermediate level > of programming PHP. While practicing & trying to learn something new > every day There are a number of subscribers to this list who are knowledgeable and have projects. One idea is to join a project which uses some technique you want to learn. Chances are good that the developers will help you -- especially when you consider that they already help people with their understanding of PHP (and related subjects) on this list. NYPHP also has meetings. I would also suggest that you consider attending (if you don't already) the meetings. There you can talk with peers and exchange ideas and understanding. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From yitzchas at touro.edu Thu Jan 17 10:08:52 2008 From: yitzchas at touro.edu (Yitzchak Schaffer) Date: Thu, 17 Jan 2008 10:08:52 -0500 Subject: [nycphp-talk] Templating engines Message-ID: <478F6F84.5040305@touro.edu> Greetings all -- The current thread on beginner to intermediate has brought up Smarty; I have been wondering about the relative advantanges of PHP templating engines. The only two I'm familiar with (superficially) are Smarty and PHPTAL. I didn't find much discussion about them, but it seems to me that PHPTAL is a more pure templating environment, with greater separation of logic and content. On the other hand, I think I've read that Smarty is particularly strong in terms of performance, given its template compiling. Though I haven't heard much discussion, it seems like whenever I hear about templating, it's using Smarty. Does anyone have any thoughts on Smarty/PHPTAL/other engines that may be out there? Thanks, -- Yitzchak Schaffer Systems Librarian Touro College Libraries 33 West 23rd Street New York, NY 10010 Tel (212) 463-0400 x230 Fax (212) 627-3197 yitzchas at touro.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at supertom.com Thu Jan 17 11:43:46 2008 From: tom at supertom.com (Tom Melendez) Date: Thu, 17 Jan 2008 08:43:46 -0800 Subject: [nycphp-talk] PHP HTTP POST not working In-Reply-To: <263347.23838.qm@web37906.mail.mud.yahoo.com> References: <263347.23838.qm@web37906.mail.mud.yahoo.com> Message-ID: <117286890801170843p21d7f569g3965a7c10c52505b@mail.gmail.com> So what is in $result? Anything in your error log? Tom http://www.liphp.org On Jan 16, 2008 8:48 PM, Jason Sia wrote: > > I am transferring to a new server, my code in php using curl with http post > works very well. However, when I transferred the file to the new server it > does not work anymore. I tried if php curl is working by simply accessing a > webpage and displaying its contents but with no http post, it works fine and > it displays the webpage however if I tried adding a http post it does not > work anymore. I've checked the phpinfo() and here is the output: > > CURL support enabled > CURL Information libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 > Here is the sample source code: > > $url = 'http://www.example.com'; > $csv= 'username=user&password=password'; > > $ch = curl_init(); > > curl_setopt($ch, CURLOPT_URL, $url); > > curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); > > curl_setopt($ch, CURLOPT_HEADER, 0); > > curl_setopt($ch, CURLOPT_POST, 1); > > curl_setopt($ch, CURLOPT_POSTFIELDS, $csv); > > curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); > > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > > $result=curl_exec ($ch); > curl_close ($ch); > > > > I use the same file in my old server and until now its working fine there > but in my new server it does not work anymore. Does this need any > additional configuration in my httpd.conf or php.ini? > > Send instant messages to your online friends http://uk.messenger.yahoo.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 lists at nopersonal.info Thu Jan 17 14:45:12 2008 From: lists at nopersonal.info (B.A.S.) Date: Thu, 17 Jan 2008 14:45:12 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <478EDB47.7040203@gmx.net> References: <478EA8B0.2090408@nopersonal.info> <478EDB47.7040203@gmx.net> Message-ID: <478FB048.5030106@nopersonal.info> David Krings wrote: >> Unfortunately, I still have a really tough time trying to work out the >> logic of what I want a script to do, and my code is pretty primitive & >> verbose because of that (I have to painstakingly step through each >> little bit of logic in order to wrap my head around anything). > > Welcome to my world, you are not alone. That's always good to know. ;) >> What do you guys use when working out the logic of an application >> you're building? I'm guessing that would be some kind of flow chart? > > What I do is write the commentary first. I write down each step that I > know or think needs to be done in the respective sequence. It isn't as > formal as a flow chart, but it does the same job: first think about what > you need to do and then do it. Of course there will be changes while > writing the code and when testing and fixing bugs, but that will happen > no matter what you do. If you rather make a flow chart, go ahead, but > you do want to add plenty of commentary anyway. Commentary is paramount--got it. > Well, I went through the odysee of IDEs and still plan on finishing my > review of all the ones that I tested out. My three recommendations are > LuckaSoft's EnginSite Editor for PHP, Waterproof's PHP Editor, and > NuSphere's PHPEd. Thanks for the thorough reviews; that helps tremendously! >> Please forgive the numerous questions, but I'm 40+ years old and want >> to approach this professionally, not just be some hack who writes >> sloppy code for for beer & pizza money and doesn't care about the client. > > Don't underestimate beer and pizza! I think the best approach is to > schedule a lot of time and come up with a few projects that you are > interested in. Then pick one, write specs for it, establish milestones, > create the outline (either as comments or as flow chart), then star > coding, and finally do a lot of testing. When you are done, take the > project and put it somewhere in the corner of your hard drive and start > over again. You will be amazed how much better you are now and how much > better your code is. I work on a project now for three years and found > myself in the position to write code for a task that I coded before in a > different context. I didn't use the old code, but created new scripts. > Turns out that the new ones are half the size, run more stable, use less > variables and flags, require less db queries, and are just much much > better designed and written. I ditched the old code and used the new code. > And don't get hung up on creating something that isn't there yet. I work > on a picture and video archiver/viewer and there are tons available that > are probably much better than mine. But with that approach you will > quickly find out that everything was already coded before. Other than > that, I completed an MP3 archiving/player system, started a bug tracking > and CRM tool (was too big of a task for me), and spend some time writing > a custom CMS for eLearning, but quit the job due to budget cuts (the > feds needed the money for the useless wars rather than for social > services for children and families). I'm not a drinker, but, yeah, pizza is not to be underestimated! What you're saying here is key to what I've been doing wrong: When I'm working on a web or print design project I document & organize everything and I have very specific methodologies I follow (worked out over years of trial & error), yet when I work with PHP I tend to approach things in a haphazard manner--i.e. I just dive head-first into the code and then splash around wildly trying not to drown. That's not good. If I want to do this professionally then I need to treat even test/learning projects as if they were the real thing, just like my other projects. Thanks for helping me see that. > And by all means ask as many questions as you can. Ask tons of > questions. The answers that you will get will propel you to the next > level. I don't think I'd be on the level I am at now if it wasn't for > relentless asking on NYPHP Talk. I absolutely will do that. Regards, Bev From lists at nopersonal.info Thu Jan 17 15:17:06 2008 From: lists at nopersonal.info (B.A.S.) Date: Thu, 17 Jan 2008 15:17:06 -0500 Subject: [nycphp-talk] Transitioning from Beginner to Intermediate PHP In-Reply-To: <478EA8B0.2090408@nopersonal.info> References: <478EA8B0.2090408@nopersonal.info> Message-ID: <478FB7C2.1030907@nopersonal.info> Ken Robinson wrote: > I would join one of the on-line PHP related forums. I joined the > PHPFreaks forum 2.5 years > ago and found it very helpful. Thanks. I've visited the site before but not the forum--I'll definitely take a look. >> What about IDEs? Because of my HTML coding & graphic design >> background, I'm still using Dreamweaver--would I perhaps learn faster >> or be more productive using Zend Studio (or even something less >> expensive like phpDesigner)? > > I've never used Dreamweaver, so I can't tell you anything pro or con. > I've used TopStyle Pro, since it's very good at HTML, CSS, & PHP > editing. I would also recommend installing a local copy of > Apache/PHP/MySQL on your everyday computer, so you have a place to > experiment. I use xampp on > my Windows XP laptop. I've been able to develop code on Windows and > upload to my Linux host with no problems. I've got PHP installed on my primary computer and Apache/PHP/MySQL installed on a secondary one on my home network for testing purposes. The only problem I've run into is a situation where the server was running an old version of MySQL that caused a problem with importing tables. It was relatively easy to fix though. >> Please forgive the numerous questions, but I'm 40+ years old and want >> to approach this professionally, not just be some hack who writes >> sloppy code for for beer & pizza money and doesn't care about the client. > > Questions are one of the best ways to learn. Indeed they are. It's good to know you guys are tolerant of them. I was a little intimidated by the level of experience & knowledge I noticed here, but I figured as long as I asked reasonable questions no one would bite my head off. IOW not like some of the questions I often see in web-related forums like, "hI gUyZ! I just got a copy of Dreamweaver and I wanna build my first web site. I want it to be like YouTube. Can u tell me how to do it? BTW, can u also tell me how to set up a site in Dreamweaver?" Ummmm... to answer question #1, NO. To answer question #2, press F1. > And don't worry about being older, I didn't start to learn PHP until > I was almost 50 (47 or 48 to be almost exact). Well I'm 45, so I guess there's hope for me yet. ;-) Regards, Bev From paul at devonianfarm.com Thu Jan 17 15:30:23 2008 From: paul at devonianfarm.com (paul at devonianfarm.com) Date: Thu, 17 Jan 2008 15:30:23 -0500 (EST) Subject: [nycphp-talk] Templating engines Message-ID: <35022.192.168.1.71.1200601823.webmail@192.168.1.71> I've been all over the map. Years ago I was against templating systems, then I was a big fan of smarty, now my templating strategy is the one that's used in symfony: don't use a separate templating system, but impose some discipline on the way you use PHP. My answer would be different in languages that aren't as facile as PHP... I would use a templating system in Perl, Java or Ruby, but in a systems PHP, ColdFusion or ASP.NET, which were designed from the beginning to build web apps, it's hard to develop a templating system which is better than the one the language gives you. Study the "view" part of the symfony docs if you want to get a good picture of how do this, but you don't need a heavyweight framework to get the benefits... I built an MVC "microframework" in 80 lines of PHP and wrote another 120 lines worth of helper functions that dealt with common annoyances such as populating

Password:


      

So, if you now want to add an exit feature I'd add this
and in order to make all the buttons show in the same row, it should look like this for the sequence Submit - Reset - Exit (stick this into the same spot where the
... section is above):

User Name:

Password:


           

You see that you can have more than just one form on a page. All this is plain standard XHTML and if a browser cannot handle that, uninstall it immediately (I know, impossible with IE). If you want to read up, a quick reference is always http://w3schools.com/ otherwise see that you can get the XHTML Definitie Guide from O'Reilly. That is what I use since years and it worked out well. If you can get the book bundled with the CSS Defintie Guide, go for it. If all this doesn't work out, post your code so that one can take a look at it. David From mikesz at qualityadvantages.com Sun Jan 20 22:46:24 2008 From: mikesz at qualityadvantages.com (mikesz at qualityadvantages.com) Date: Mon, 21 Jan 2008 11:46:24 +0800 Subject: [nycphp-talk] Delaying form submit In-Reply-To: <7.0.1.0.2.20080120091503.032aae18@e-government.com> References: <263347.23838.qm@web37906.mail.mud.yahoo.com> <7.0.1.0.2.20080120091503.032aae18@e-government.com> Message-ID: <999594835.20080121114624@qualityadvantages.com> Hello Urb, Sunday, January 20, 2008, 10:17:45 PM, you wrote: > This pertains to a CMS but the effect can be seen in PHPmyAdmin. > If the form is large and someone click on Submit before the form has > fully downloaded the contents in the unloaded portion are truncated. I had a similar problem with a long form and through an idea I got from here was able to use $_REQUEST to see if the form has been filled in and with what content. I use a foreach loop to test for badguy content but I think you could use a similar technique to see if the form fields are populated and do a data verification test too. You could add a hidden field with content to the end of the form and test for the hidden content as well. I think that would tell you the form was loaded, I think. -- Best regards, mikesz mailto:mikesz at qualityadvantages.com From ramons at gmx.net Mon Jan 21 06:45:57 2008 From: ramons at gmx.net (David Krings) Date: Mon, 21 Jan 2008 06:45:57 -0500 Subject: [nycphp-talk] Delaying form submit In-Reply-To: <999594835.20080121114624@qualityadvantages.com> References: <263347.23838.qm@web37906.mail.mud.yahoo.com> <7.0.1.0.2.20080120091503.032aae18@e-government.com> <999594835.20080121114624@qualityadvantages.com> Message-ID: <479485F5.9070809@gmx.net> mikesz at qualityadvantages.com wrote: > You could add a hidden field with content to the end of the form and > test for the hidden content as well. I think that would tell you the > form was loaded, I think. But shouldn't it then be sufficient to put the Submit button at the end of the form? Without a submit the form entries cannot be sent and having the Submit button show up last should make sure that the rest of the form is loaded. David From dcech at phpwerx.net Mon Jan 21 06:51:30 2008 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 21 Jan 2008 06:51:30 -0500 Subject: [nycphp-talk] Delaying form submit In-Reply-To: <479485F5.9070809@gmx.net> References: <263347.23838.qm@web37906.mail.mud.yahoo.com> <7.0.1.0.2.20080120091503.032aae18@e-government.com> <999594835.20080121114624@qualityadvantages.com> <479485F5.9070809@gmx.net> Message-ID: <47948742.3010706@phpwerx.net> David Krings wrote: > mikesz at qualityadvantages.com wrote: >> You could add a hidden field with content to the end of the form and >> test for the hidden content as well. I think that would tell you the >> form was loaded, I think. > > But shouldn't it then be sufficient to put the Submit button at the end > of the form? Without a submit the form entries cannot be sent and having > the Submit button show up last should make sure that the rest of the > form is loaded. Not exactly. You can submit a form multiple ways, one example is by hitting 'Enter' while the cursor is in a text input field. Dan From lists at zaunere.com Mon Jan 21 08:03:28 2008 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 21 Jan 2008 08:03:28 -0500 Subject: [nycphp-talk] FW: [ANNOUNCE] NYPUG Inaugural Meeting Message-ID: <00ef01c85c2e$04247bd0$0c6d7370$@com> FYI - unfortunately it conflicts with our monthly meeting tomorrow. I've talked with Josh offline and I'll pass on any new developments that come out of the meeting. --- Hans Zaunere / President / New York PHP www.nyphp.org ?/ ?www.nyphp.com > Subject: [ANNOUNCE] NYPUG Inaugural Meeting > > Several PostgreSQL users in the New York area will be meeting for the first > time at the Skylight Diner (http://www.skylightdinernyc.com/), where we will > discuss launching NYPUG. The meeting and eating will start on Tuesday night, > January 22nd, at 7:30pm. > > Also, Core Team member Josh Berkus, MyYearbook.com CTO Gavin Roy and Open > Technology Group president Chander Gaesan will be visiting for Q&A on the > upcoming PostgreSQL 8.3 release. > > Come, join us! RSVP to josh at postgresql.org. > > -- > Josh Berkus > PostgreSQL Project > Core Team Member > (any opinions expressed are my own) From cahoyos at us.ibm.com Sun Jan 20 18:40:09 2008 From: cahoyos at us.ibm.com (Carlos A Hoyos) Date: Sun, 20 Jan 2008 18:40:09 -0500 Subject: [nycphp-talk] [OT] Asian Font Display Issue in Firefox Web Browser In-Reply-To: <002701c85b16$3a536090$aefa21b0$@com> References: <002701c85b16$3a536090$aefa21b0$@com> Message-ID: > Certain web pages and/or web sites will display all or some Asian characters > instead of Western English in my on screen, inside the browser display only. > View source shows that the actual HTML web page, of course, does > contain regular > Western English characters. Your browser is interpreting your page in a different encoding than the one it was written / transmitted in. There are 3 ways how the browser knows what encoding to use: The first one (takes precedence) is any encoding that was sent in the http headers. These headers are sent by your web server.. If there's no encoding info in the headers, the browser will look for a "content-type" in the html meta data (head) section. Finally, if neither one is present, the browser will try to guess the encoding based on certain character frequencies, or use the default used in the preferences. My guess is your server is sending in the headers a different encoding than the one used to create your page. If using apache, look in the httpd.conf file for addcharset and defaultcharset. You can also examine the headers in FF using a tool like livehttpheaders. If this is only happening in FF3, it might be a bug for that specific browser. Your best bet to fix this is to make sure your web server is sending the correct encoding. You can do this by tweaking your httpd.conf or .htaccess file in apache, or in php sending a header request like this: header('Content-type: text/html; charset=ISO-8859-1); Carlos Hoyos From cliff at pinestream.com Mon Jan 21 14:21:56 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 21 Jan 2008 14:21:56 -0500 Subject: [nycphp-talk] Ruby gets another framework Message-ID: See: http://merbivore.com/index.html Interesting. So Rails isn?t the be all and end all within the Ruby community. Makes me feel so much better. Just think, maybe in a year or two, ruby will have 20 ? 40 frameworks to chose from! -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Mon Jan 21 15:48:23 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 21 Jan 2008 15:48:23 -0500 (EST) Subject: [nycphp-talk] Ruby gets another framework In-Reply-To: Message-ID: On Mon, 21 Jan 2008, Cliff Hirsch wrote: > See: http://merbivore.com/index.html > > Interesting. So Rails isn?t the be all and end all within the Ruby > community. Makes me feel so much better. Just think, maybe in a year or two, > ruby will have 20 ? 40 frameworks to chose from! There's also the Camping (micro)framework: http://code.whytheluckystiff.net/camping/ (Not that this is news in the NYC Ruby/Rails community). As I said to a friend recently, there's really not much you can't do in PHP too. A lot of Rails' ideas have flowed back into various PHP frameworks (which is a Good Thing). You could also read Zed Shaw's "Rails is a Ghetto" rant for some community insight (just ignore the bit where he says PHP programmers are morons!). -- Aj. From cliff at pinestream.com Mon Jan 21 20:52:44 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 21 Jan 2008 20:52:44 -0500 Subject: [nycphp-talk] What with you do with 4Gig of RAM? Message-ID: Have I asked this already? If so, my apologies. First the vision went, now perhaps the memory ? I?m not sure, can?t remember... So I negotiated 4Gig of memory in my server. Hey, ya always got to ask for a little ?extra.? I got 15K scsci drives and know what to do with them. The question is, what do I do with all that memory? Throw a few more shims at apc? Set up memcached? Allocate some to an mysql cache, if there is such a thing. Other ideas? I got it, so may as well start working on making the best use of it. Suggestions? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Mon Jan 21 21:16:16 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 21 Jan 2008 21:16:16 -0500 Subject: [nycphp-talk] What with you do with 4Gig of RAM? In-Reply-To: References: Message-ID: <827E6FC0-DD03-447A-9264-0152EE2D187E@beaffinitive.com> On Jan 21, 2008, at 8:52 PM, Cliff Hirsch wrote: > Have I asked this already? I don't think so :) > So I negotiated 4Gig of memory in my server. Hey, ya always got to > ask for a little ?extra.? I got 15K scsci drives and know what to do > with them. The question is, what do I do with all that memory? I have a similar server that I increased all of the mysql buffers on, gave 1GB to memcached (amazing how much you can fit in 1GB... especially compressed data), and then have a sphinx search server running on it as well. Those three apps have been running pretty happily for 6 months now. This server is strictly mysql, memcached, and searchd -- no apache... so there wasn't a real need for increasing apc's cache -- but if you are running a web server on yours... increasing APC is definitely a good thing to do. In fact... if your app is entirely contained to this server, I'd recommend using APC over memcache because it's faster. The main benefit of memcached is that you can access it over the network and it can be spread among a bunch of servers. If you have multiple front-end servers, they can all use the same memcache -- the cache doesn't need to be repeated on multiple servers. A side note about the mysql cache... I've learned that it's best to use it only on demand when you know that a query is cachable. The cache gets invalidated every time an update/insert is made on one of the underlying tables (that's my primary reason for using a different cache solution -- I actually use a combo of APC, memcache, and sqlite). Because of the way the cache gets invalidated, your wasting a lot of effort if you enable the query cache on sql statements for tables that change frequently. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Mon Jan 21 23:07:00 2008 From: chsnyder at gmail.com (csnyder) Date: Mon, 21 Jan 2008 23:07:00 -0500 Subject: [nycphp-talk] Securing memcached Message-ID: Based on the buzz about how great memcached is, I'm considering using it to provide session support across multiple front ends. But I'm a little troubled by the lack of application-level access control. As in, no passwords. If you use memcached, how do you secure it against unauthorized access by some other application? Do you use some sort of TCP wrapper? Do you sign or encrypt values? Or are firewall rules the only answer? -- Chris Snyder http://chxo.com/ From lists at zaunere.com Mon Jan 21 23:27:44 2008 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 21 Jan 2008 23:27:44 -0500 Subject: [nycphp-talk] What with you do with 4Gig of RAM? In-Reply-To: References: Message-ID: <003001c85caf$22b09850$6811c8f0$@com> > So I negotiated 4Gig of memory in my server. Hey, ya always got to ask for a > little "extra." I got 15K scsci drives and know what to do with them. The I'm curious as to what you'll be doing with the 15k SCSIs - that would help shed some light on how the RAM would be best used. > question is, what do I do with all that memory? What type of CPU(s)? > Throw a few more shims at apc? Set up memcached? Allocate some to an mysql > cache, if there is such a thing. Other ideas? I got it, so may as well start > working on making the best use of it. Suggestions? Typically large amounts of RAM are best thrown in the database's direction. In MySQL, it's probably not at the query cache so much, but rather at buffers. Which buffers? That of course depends on your table types, general schema layout, and query pattern. If the database is very heavy on reads, then the query cache might actually make sense. If you have a lot of rows, or a competitive read/write ratio, then it's probably more likely that the query cache will always get invalidated, and thus you want to support the indexes and tables themselves. Or maybe the application would be best behooved by memory/heap tables? I take it this box will host the full AMP stack. Unless you have tons of code, throwing the RAM at APC probably won't help much. If you already have MySQL running on the same server, then I'd question the need for memcached. If nothing else, you'll have a nice big filesystem/kernel cache - maybe you're serving a lot of media or static files? H From ramons at gmx.net Tue Jan 22 06:40:49 2008 From: ramons at gmx.net (David Krings) Date: Tue, 22 Jan 2008 06:40:49 -0500 Subject: [nycphp-talk] What with you do with 4Gig of RAM? In-Reply-To: References: Message-ID: <4795D641.9010506@gmx.net> Cliff Hirsch wrote: > Have I asked this already? If so, my apologies. First the vision went, > now perhaps the memory ? I?m not sure, can?t remember... > > So I negotiated 4Gig of memory in my server. Hey, ya always got to ask > for a little ?extra.? I got 15K scsci drives and know what to do with > them. The question is, what do I do with all that memory? > > Throw a few more shims at apc? Set up memcached? Allocate some to an > mysql cache, if there is such a thing. Other ideas? I got it, so may as > well start working on making the best use of it. Suggestions? I got $GB in my big box and it comes in handy for virtualization (so does the second CPU core). Other than that, I'd put the db tables that get most hit or that run the slowest queries into RAM. I once read that you can specify where a table is supposed to reside (memory, disk, others?). I put a 15k disk into my server box as well. It is a refubished Fujitsu and I got it for cheap at a surplus store. Not only doubled that the storage capacity, that drive is really really fast...especially after I finally terminated the SCSI chain properly. Other than that, you could see to get Vista on your box, that will take care of using the 4GB RAM and you don't even have to run any applications to fill it up. David From cliff at pinestream.com Tue Jan 22 08:03:51 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 22 Jan 2008 08:03:51 -0500 Subject: [nycphp-talk] What with you do with 4Gig of RAM? In-Reply-To: <003001c85caf$22b09850$6811c8f0$@com> Message-ID: On 1/21/08 11:27 PM, "Hans Zaunere" wrote: > I'm curious as to what you'll be doing with the 15k SCSIs - that would help > shed some light on how the RAM would be best used. I'm just using them in a RAID 1 configuration, hoping that they will help a database intensive application riddled with inefficiencies such as little caching. > What type of CPU(s)? Single processor, dual core XEON 5148LV, 2.33GHz > In MySQL, it's probably not at the query cache so much, but rather at > buffers. Which buffers? That of course depends on your table types, > general schema layout, and query pattern. > If you have a lot of rows, or a competitive read/write ratio, then it's > probably more likely that the query cache will always get invalidated I'm thinking a query cache sounds useless for a highly dynamic application. So big buffers sound like a better strategy. Also sounds like I simply need to collect data to see what the actual read/write ration turns out to be over time. Thanks, Cliff From ken at secdat.com Tue Jan 22 08:53:09 2008 From: ken at secdat.com (Kenneth Downs) Date: Tue, 22 Jan 2008 08:53:09 -0500 Subject: [nycphp-talk] What with you do with 4Gig of RAM? In-Reply-To: References: Message-ID: <4795F545.3040805@secdat.com> Run vmware? (that's what we're planning to do...) Cliff Hirsch wrote: > Have I asked this already? If so, my apologies. First the vision went, > now perhaps the memory --- I'm not sure, can't remember... > > So I negotiated 4Gig of memory in my server. Hey, ya always got to ask > for a little "extra." I got 15K scsci drives and know what to do with > them. The question is, what do I do with all that memory? > > Throw a few more shims at apc? Set up memcached? Allocate some to an > mysql cache, if there is such a thing. Other ideas? I got it, so may > as well start working on making the best use of it. Suggestions? > > Cliff > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nate at cakephp.org Tue Jan 22 10:36:25 2008 From: nate at cakephp.org (Nate Abele) Date: Tue, 22 Jan 2008 10:36:25 -0500 Subject: [nycphp-talk] Re: Templating engines In-Reply-To: <20080120161616.2D72A50808@mail.cakephp.org> References: <20080120161616.2D72A50808@mail.cakephp.org> Message-ID: > Date: Sat, 19 Jan 2008 11:38:05 -0800 > From: "Tom Melendez" > > Hi Nate, > > Could you supply us with the benchmarks you've cited? I'm curious to > see them and I'm sure others are as well. > > Thanks, > > Tom > http://www.liphp.org > Symfony vs. Rails: http://wiki.rubyonrails.org/rails/pages/Framework+Performance Symfony vs. other PHP frameworks: http://paul-m-jones.com/?p=238 From rmarscher at beaffinitive.com Tue Jan 22 12:05:44 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 22 Jan 2008 12:05:44 -0500 Subject: [nycphp-talk] Namespaces In-Reply-To: <1200832840.2883.60.camel@leam> References: <47865807.6090700@gmx.net> <47877919.2080807@secdat.com> <4787853C.1010305@gmx.net> <478793FC.6080802@secdat.com> <4787980F.5040704@bizcomputinginc.com> <9F4B00B9-6F8E-4B3B-B61D-A57C03579BEB@beaffinitive.com> <1200832840.2883.60.camel@leam> Message-ID: On Jan 20, 2008, at 7:40 AM, leam wrote: > How does the require in: > > require 'MyProject/Db/Connection.php'; > > from http://www.php.net/manual/en/language.namespaces.using.php > know that it's a namespace and not a filepath? Hi Leam, It still is a path. It's including the file MyProject/Db/ Connection.php... but at the top of that file that gets included is this: I check out the facebook blog from time to time... this is interesting: http://blog.facebook.com/blog.php?post=7899307130 They added a second datacenter in Virginia for mysql reads... but they put tons of data in memcache servers. So they claim that they modified mysql replication to include replicating memcache. I wonder if they'll release the code... From ps at sun-code.com Tue Jan 22 08:07:13 2008 From: ps at sun-code.com (Peter Sawczynec) Date: Tue, 22 Jan 2008 08:07:13 -0500 Subject: [nycphp-talk] What with you do with 4Gig of RAM? In-Reply-To: <4795D641.9010506@gmx.net> References: <4795D641.9010506@gmx.net> Message-ID: <005701c85cf7$b4f93e90$1eebbbb0$@com> Word. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Krings Sent: Tuesday, January 22, 2008 6:41 AM To: NYPHP Talk Subject: Re: [nycphp-talk] What with you do with 4Gig of RAM? Cliff Hirsch wrote: > Have I asked this already? If so, my apologies. First the vision went, > now perhaps the memory - I'm not sure, can't remember... > > So I negotiated 4Gig of memory in my server. Hey, ya always got to ask > for a little "extra." I got 15K scsci drives and know what to do with > them. The question is, what do I do with all that memory? > > Throw a few more shims at apc? Set up memcached? Allocate some to an > mysql cache, if there is such a thing. Other ideas? I got it, so may as > well start working on making the best use of it. Suggestions? I got $GB in my big box and it comes in handy for virtualization (so does the second CPU core). Other than that, I'd put the db tables that get most hit or that run the slowest queries into RAM. I once read that you can specify where a table is supposed to reside (memory, disk, others?). I put a 15k disk into my server box as well. It is a refubished Fujitsu and I got it for cheap at a surplus store. Not only doubled that the storage capacity, that drive is really really fast...especially after I finally terminated the SCSI chain properly. Other than that, you could see to get Vista on your box, that will take care of using the 4GB RAM and you don't even have to run any applications to fill it up. David _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From cliff at pinestream.com Tue Jan 22 16:11:46 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 22 Jan 2008 16:11:46 -0500 Subject: [nycphp-talk] htmlentities charset bug Message-ID: Just an FYI to people for an obscure bug to be aware of -- one I though I licked months ago. Escaping output with htmlentities threw a warning and returned an empty string. Reason: Invalid multibyte sequence in argument Root cause: cut and pasting text from MS Word in XP. You have been warned. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Tue Jan 22 23:40:47 2008 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 22 Jan 2008 23:40:47 -0500 Subject: [nycphp-talk] [OT] facebook figures out memcache replication In-Reply-To: References: Message-ID: <56E29D4D-C267-4C04-8177-90204B0A46F2@jonbaer.com> Pretty nice, I wonder if it is a fork of Brian Aker's original work ... http://tangent.org/506/memcache_engine.html http://tangent.org/586/Memcached_Functions_for_MySQL.html - Jon On Jan 22, 2008, at 12:26 PM, Rob Marscher wrote: > I check out the facebook blog from time to time... this is > interesting: > > http://blog.facebook.com/blog.php?post=7899307130 > > They added a second datacenter in Virginia for mysql reads... but > they put tons of data in memcache servers. So they claim that they > modified mysql replication to include replicating memcache. I > wonder if they'll release the > code..._______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Wed Jan 23 10:10:17 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 23 Jan 2008 10:10:17 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: References: Message-ID: On Jan 22, 2008 4:11 PM, Cliff Hirsch wrote: > Reason: Invalid multibyte sequence in argument > > Root cause: cut and pasting text from MS Word in XP. > Neat. Any idea what the offending character or sequence was? From cliff at pinestream.com Wed Jan 23 10:21:49 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 23 Jan 2008 10:21:49 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: Message-ID: On 1/23/08 10:10 AM, "csnyder" wrote: > On Jan 22, 2008 4:11 PM, Cliff Hirsch wrote: > >> Reason: Invalid multibyte sequence in argument >> >> Root cause: cut and pasting text from MS Word in XP. > > Neat. Any idea what the offending character or sequence was? Oh yeah, curly single and double quotes, or whatever the proper name for them is. The sequence was: 1. Wrote FAQ in Word on Windows XP. 2. Cut and pasted entries into database (can't recall whether it was through my app or phpMyAdmin) 3. Errors start appearing. Those curly single and double quotes are killers. From cliff at pinestream.com Wed Jan 23 11:13:31 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 23 Jan 2008 11:13:31 -0500 Subject: [nycphp-talk] Best way to monitor log files? Message-ID: I was about to write a php cli script to monitor my log files for changes and if found, email the file to me. But someone has probably already done this. Are there open source solutions I should be looking at? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmcgraw1 at gmail.com Wed Jan 23 12:22:14 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 23 Jan 2008 12:22:14 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: <47939572.8040406@secdat.com> References: <478F6F84.5040305@touro.edu> <47914374.50901@beezifies.com> <47939572.8040406@secdat.com> Message-ID: Another benefit is you (the programmer) have complete control over what variables get passed from the script to the public facing template. Hopefully, you've hired a designer that knows better than to do the following and reveal your db schema to the world: // Debugging echo ""; But if you don't, you won't have to worry with Smarty templates, if it isn't assign()'ed or append()'ed it won't show up in the template (though you should watch out for {$smarty.*} variables. - jake On Jan 20, 2008 1:39 PM, Kenneth Downs wrote: > Gary Mort wrote: > > Yitzchak Schaffer wrote: > >> Greetings all -- > >> > >> The current thread on beginner to intermediate has brought up Smarty; > >> I have been wondering about the relative advantanges of PHP > >> templating engines. > > > > A templating engine has two purposes. > > > > > > 2) It provides a simplified mechanism for changing the presentation > > logic, without requiring changes to complex code. > > > > People have tried to convince me to use Smarty for Andromeda and I could > never quite swallow why because it seemed to me that PHP *was* the > templating language. I also didn't like what I saw as a lot of > redundancies involved in invoking a smarty template. > > But yesterday Donald Organ convinced me quite thoroughly. The argument > was that your creative person who doesn't know PHP and never will can > put a smarty template into Dreamweaver, play around with it, and hand > you back something that you can just drop in. > > Further, since everything we do assumes the presence of a complete data > dictionary, we can just generate that tedious code that maps smarty > variables to PHP stuff, and it could be quite a win. > > -- > Kenneth Downs > Secure Data Software, Inc. > www.secdat.com www.andromeda-project.org > 631-689-7200 Fax: 631-689-0527 > cell: 631-379-0010 > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 ioplex at gmail.com Wed Jan 23 12:58:17 2008 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 23 Jan 2008 12:58:17 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: References: Message-ID: <78c6bd860801230958w48175f7ewe401741f1be8280a@mail.gmail.com> On 1/23/08, Cliff Hirsch wrote: > On 1/23/08 10:10 AM, "csnyder" wrote: > > On Jan 22, 2008 4:11 PM, Cliff Hirsch wrote: > > > >> Reason: Invalid multibyte sequence in argument > >> > >> Root cause: cut and pasting text from MS Word in XP. > > > > Neat. Any idea what the offending character or sequence was? > Oh yeah, curly single and double quotes, or whatever the proper name for > them is. > > The sequence was: > 1. Wrote FAQ in Word on Windows XP. > 2. Cut and pasted entries into database (can't recall whether it was through > my app or phpMyAdmin) > 3. Errors start appearing. > > Those curly single and double quotes are killers. The problem isn't htmlentities, it's the charset you're pages are emitted in. If you emit an HTML form in ISO-8859-1 and then submit garbage data, the database may store it as garbage and now you have a simple garbage-in / garbage-out scenario. Feed that to htmlentites and tell it it's ISO-8859-1 and you'll get an "Invalid multibyte sequence" error. Technically I think the browser should see that the page is ISO-8859-1 and squash invalid sequences to some default character like '?' when you paste it into the form but accepting the data as-is is more forgiving I suppose. If the browser was really sophisticated about it it could pop-up a dialog that warns you and asks you if you would like to transliterate those characters to ISO-8859-1 equivalent glyphs. Use UTF-8 and the problem will go away. At least you won't get an error. The curly quotes will remain curly quotes which means if you don't see them and fix them and someone swipes that text off the page and pastes it into an email that's ISO-8859-1 then they'll be squashed to '?' or sometimes ugly rectangles. I always use UTF-8. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From cliff at pinestream.com Wed Jan 23 13:16:48 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 23 Jan 2008 13:16:48 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: <78c6bd860801230958w48175f7ewe401741f1be8280a@mail.gmail.com> Message-ID: On 1/23/08 12:58 PM, "Michael B Allen" wrote:>> Reason: >>Invalid multibyte sequence in argument >> Those curly single and double quotes are killers. > > The problem isn't htmlentities, it's the charset you're pages are > emitted in. If you emit an HTML form in ISO-8859-1 and then submit > garbage data, the database may store it as garbage and now you have a > simple garbage-in / garbage-out scenario. Feed that to htmlentites and > tell it it's ISO-8859-1 and you'll get an "Invalid multibyte sequence" > error. > if the browser was really sophisticated about it > it could pop-up a dialog that warns you and asks you if you would like > to transliterate those characters to ISO-8859-1 equivalent glyphs. I wonder if there is any way to detect this on the server side. Htmlentities certainly catches the problem, but returns an empty string. Some sort of friendlier filter that strips characters that are the wrong charset would be very cool. > I always use UTF-8. I think I will too! Seems to be the way to go. From jcampbell1 at gmail.com Wed Jan 23 13:43:44 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 23 Jan 2008 13:43:44 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: References: <78c6bd860801230958w48175f7ewe401741f1be8280a@mail.gmail.com> Message-ID: <8f0676b40801231043n45ecfceck7ef0d4f18238ee73@mail.gmail.com> On Jan 23, 2008 1:16 PM, Cliff Hirsch wrote: > On 1/23/08 12:58 PM, "Michael B Allen" wrote:>> Reason: > >>Invalid multibyte sequence in argument > >> Those curly single and double quotes are killers. > > > > The problem isn't htmlentities, it's the charset you're pages are > > emitted in. If you emit an HTML form in ISO-8859-1 and then submit > > garbage data, the database may store it as garbage and now you have a > > simple garbage-in / garbage-out scenario. Feed that to htmlentites and > > tell it it's ISO-8859-1 and you'll get an "Invalid multibyte sequence" > > error. > > if the browser was really sophisticated about it > > it could pop-up a dialog that warns you and asks you if you would like > > to transliterate those characters to ISO-8859-1 equivalent glyphs. > I wonder if there is any way to detect this on the server side. Htmlentities > certainly catches the problem, but returns an empty string. Some sort of > friendlier filter that strips characters that are the wrong charset would be > very cool. The clipboard on any modern OS automatically takes care of this. Encode your pages in utf-8 and you will never have a problem in the first place. If you still want to check the encoding, use mb_check_encoding() Also, why are you using htmlhentities? It is a useless function. If you want to escape html, the correct function is htmlspecialchars. Htmlentities should never be used... it is slower, adds no security benefit, and it unnecessarily makes the data unreadable. > > I always use UTF-8. > I think I will too! Seems to be the way to go. +1 for utf-8 It is not really optional for modern web development because XMLHTTP auto converts everything to utf8 no matter what encoding you use on your page. If you are not using UTF-8, any data that is not 7-bit ascii will get screwed up if it is submitted using ajax. Regards, John Campbell From cliff at pinestream.com Wed Jan 23 13:53:21 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 23 Jan 2008 13:53:21 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: <8f0676b40801231043n45ecfceck7ef0d4f18238ee73@mail.gmail.com> Message-ID: On 1/23/08 1:43 PM, "John Campbell" wrote: > Also, why are you using htmlhentities? It is a useless function. If > you want to escape html, the correct function is htmlspecialchars. > Htmlentities should never be used... it is slower, adds no security > benefit, and it unnecessarily makes the data unreadable. Because Chris Shiflett touts it! If it works for him... From jcampbell1 at gmail.com Wed Jan 23 13:54:43 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 23 Jan 2008 13:54:43 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: References: <478F6F84.5040305@touro.edu> <47914374.50901@beezifies.com> <47939572.8040406@secdat.com> Message-ID: <8f0676b40801231054i2f998d27r94e2f141a79f238a@mail.gmail.com> On Jan 23, 2008 12:22 PM, Jake McGraw wrote: > Another benefit is you (the programmer) have complete control over > what variables get passed from the script to the public facing > template. If there is a separation between the programmer and the template editor, it presents another problem. Who is responsible for escaping the data? Do you do: {$user.first_name|escape} {$user.last_name|escape} or $tpl->assign('user',array_map("htmlspecialchars",$user); I tend to end up with a mix, and it can get quite confusing. What is the preferred practice? Regards, John Campbell From cliff at pinestream.com Wed Jan 23 14:01:22 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 23 Jan 2008 14:01:22 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: <8f0676b40801231054i2f998d27r94e2f141a79f238a@mail.gmail.com> Message-ID: On 1/23/08 1:54 PM, "John Campbell" wrote: > If there is a separation between the programmer and the template > editor, it presents another problem. Who is responsible for escaping > the data? > I tend to end up with a mix, and it can get quite confusing. Ditto -- and it is infuriating and time consuming to unravel later. I've adopted the practice of adding a comment in the template to any variable that is escaped in the code {*escaped in code*}. Saves a lot of time, 2nd guessing, and code review later on. From jcampbell1 at gmail.com Wed Jan 23 14:13:10 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 23 Jan 2008 14:13:10 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: References: <8f0676b40801231043n45ecfceck7ef0d4f18238ee73@mail.gmail.com> Message-ID: <8f0676b40801231113s123a50a4uaa94d9c3cd091505@mail.gmail.com> > Because Chris Shiflett touts it! If it works for him... Shiftlett touts other goofy things, like storing htmlentities in the database. If it works for him... From ioplex at gmail.com Wed Jan 23 14:20:31 2008 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 23 Jan 2008 14:20:31 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: References: <78c6bd860801230958w48175f7ewe401741f1be8280a@mail.gmail.com> Message-ID: <78c6bd860801231120q4a3c72d7x67462f01178f6a63@mail.gmail.com> On 1/23/08, Cliff Hirsch wrote: > On 1/23/08 12:58 PM, "Michael B Allen" wrote:>> Reason: > > if the browser was really sophisticated about it > > it could pop-up a dialog that warns you and asks you if you would like > > to transliterate those characters to ISO-8859-1 equivalent glyphs. > I wonder if there is any way to detect this on the server side. Htmlentities > certainly catches the problem, but returns an empty string. Some sort of > friendlier filter that strips characters that are the wrong charset would be > very cool. You could do that. You just have to run it through the iconv function with '//TRANSLIT' appened to the output charset. Although one thing to watch out for is to make sure that the form input is really UTF-8 and not some strange Microsoft codepage like CP1250 or CP1252. If it's not really UTF-8 then that's very annoying. You would have to run the input through iconv with various possible input encodings and some unicode encoding just to detect what the encoding really is. Then, you can call iconv: The following example uses iconv with //TRANSLIT to convert CP1252 to ISO-8859-1 and convert the curly quotes to regular quotes: #!/usr/bin/php References: <78c6bd860801230958w48175f7ewe401741f1be8280a@mail.gmail.com> <8f0676b40801231043n45ecfceck7ef0d4f18238ee73@mail.gmail.com> Message-ID: On Jan 23, 2008 1:43 PM, John Campbell wrote: > Also, why are you using htmlhentities? It is a useless function. If > you want to escape html, the correct function is htmlspecialchars. > Htmlentities should never be used... it is slower, adds no security > benefit, and it unnecessarily makes the data unreadable. Interesting advice. The difference between them is that htmlentities() escapes everything, whereas htmlspecialchars() only escapes &, ", ', <, and >. So what you're saying is that if an em dash or a smart quote or a multibyte character exists in the content, it should be delivered to the browser unescaped--or at least, there's no benefit to escaping it. Do your pages validate? What happens in browsers that don't support the characters you're sending? What happens in systems (such as RSS feed processors) that don't support multibyte characters? You may be right, and the use of htmlentities() may be old school, like using web-safe colors. But if so it's not exactly conventional wisdom, yet. -- Chris Snyder http://chxo.com/ From rmarscher at beaffinitive.com Wed Jan 23 14:33:29 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 23 Jan 2008 14:33:29 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: References: Message-ID: <044CC209-DCB9-4C31-BA02-90C408F0992C@beaffinitive.com> On Jan 23, 2008, at 2:01 PM, Cliff Hirsch wrote: > On 1/23/08 1:54 PM, "John Campbell" wrote: >> If there is a separation between the programmer and the template >> editor, it presents another problem. Who is responsible for escaping >> the data? I decided that the view/template has to be responsible for escaping. Imagine you have a controller action for displaying a listing... you could use the same controller action with different templates to provide: an html view, an rss feed, a json/xml/etc webservice result. Some of those will have different requirements for escaping the data. For our company, the programmers do a good amount of the templates - at least provide an initial version. We train any other template editors on escaping.. but usually it's already done for them in the first draft from the programmers and they only need to shuffle things around. Of course... there's the issue of the programmers not remembering to escape things in that first draft of the template. It would be ideal to do peer review and have some kind of testing via Selenium or something similar to make sure everything is escaped properly. From cliff at pinestream.com Wed Jan 23 14:50:48 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 23 Jan 2008 14:50:48 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: <044CC209-DCB9-4C31-BA02-90C408F0992C@beaffinitive.com> Message-ID: On 1/23/08 2:33 PM, "Rob Marscher" wrote: > On Jan 23, 2008, at 2:01 PM, Cliff Hirsch wrote: >> On 1/23/08 1:54 PM, "John Campbell" wrote: >>> If there is a separation between the programmer and the template >>> editor, it presents another problem. Who is responsible for escaping >>> the data? > > I decided that the view/template has to be responsible for escaping. I can't see how it can't be a mix. What if your variable intentionally has markup? Some content may allow, and intentionally have, simple markup like ,
    ,
    etc. Escaping this variable in the template would not be a good thing. From jcampbell1 at gmail.com Wed Jan 23 15:27:51 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 23 Jan 2008 15:27:51 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: References: <78c6bd860801230958w48175f7ewe401741f1be8280a@mail.gmail.com> <8f0676b40801231043n45ecfceck7ef0d4f18238ee73@mail.gmail.com> Message-ID: <8f0676b40801231227o175872dbsf83dd4f6c3859ff2@mail.gmail.com> > Do your pages validate? Yes. The extended HTML entities are not required. Check the source of this page: http://www.w3c.de/ > What happens in browsers that don't support > the characters you're sending? I don't develop for browsers that don't support UTF-8... e.g. IE2. If they don't have a glyph for the character, there is nothing you can do (html entities or otherwise). Most browsers replace unknown characters with a question mark symbol. > What happens in systems (such as RSS > feed processors) that don't support multibyte characters? RSS is XML which requires UTF-8 support. If they don't support utf-8, it is not a legit feed processor. I can't think of a single piece of software that interprets html entities but does not support unicode. Regards, John Campbell From jcampbell1 at gmail.com Wed Jan 23 15:44:34 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 23 Jan 2008 15:44:34 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: <044CC209-DCB9-4C31-BA02-90C408F0992C@beaffinitive.com> References: <044CC209-DCB9-4C31-BA02-90C408F0992C@beaffinitive.com> Message-ID: <8f0676b40801231244q2e32a290ia2532f4ecdd3b99@mail.gmail.com> On Jan 23, 2008 2:33 PM, Rob Marscher wrote: > On Jan 23, 2008, at 2:01 PM, Cliff Hirsch wrote: > > On 1/23/08 1:54 PM, "John Campbell" wrote: > >> If there is a separation between the programmer and the template > >> editor, it presents another problem. Who is responsible for escaping > >> the data? > > I decided that the view/template has to be responsible for escaping. In principal, this has to be the way it must be done. I just get tired of typing escape all the time. Django escapes by default, which makes a lot of sense. I just discovered smarty has default modifiers: http://www.smarty.net/manual/en/variable.default.modifiers.php It seems like a good idea. Does anyone use it? From cliff at pinestream.com Wed Jan 23 15:56:26 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 23 Jan 2008 15:56:26 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: <8f0676b40801231244q2e32a290ia2532f4ecdd3b99@mail.gmail.com> Message-ID: On 1/23/08 3:44 PM, "John Campbell" wrote: > I just discovered smarty has default modifiers: > http://www.smarty.net/manual/en/variable.default.modifiers.php > > It seems like a good idea. Does anyone use it? Not a bad ideas as long as you can override it. I pass plenty of stuff "upstream" that should not be escaped. But I like the default idea. Smarty does have an override: {$var|smarty:nodefaults} to cover the exceptions. From susan_shemin at yahoo.com Wed Jan 23 15:59:26 2008 From: susan_shemin at yahoo.com (Susan Shemin) Date: Wed, 23 Jan 2008 12:59:26 -0800 (PST) Subject: [nycphp-talk] escaping Message-ID: <374199.43237.qm@web50209.mail.re2.yahoo.com> Is this "escaping" that you guys have been talking about what you use to filter acceptable data into textbox form? If so, can you explain exactly what is being used (e.g., htmlentities) and how to use it? Actually I need to filter out nonpermitted characters since someone put a Viagra advertisement into the php blog I created! (Caught it quite quickly and deleted the entry from the database.) I'd like to exclude "www." from being entered into a form. Susan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Wed Jan 23 16:09:25 2008 From: ben at projectskyline.com (Ben Sgro) Date: Wed, 23 Jan 2008 16:09:25 -0500 Subject: [nycphp-talk] escaping In-Reply-To: <374199.43237.qm@web50209.mail.re2.yahoo.com> References: <374199.43237.qm@web50209.mail.re2.yahoo.com> Message-ID: <4797AD05.5080004@projectskyline.com> what about http://myViagra.com? You'll probably need a robust solution for managing all the crap people can stick into your blog comment space. Is it a home made blog? (Your own code?) or an off the shelf thing? - Ben Susan Shemin wrote: > Is this "escaping" that you guys have been talking about what you use > to filter acceptable data into textbox form? > > If so, can you explain exactly what is being used (e.g., htmlentities) > and how to use it? > > Actually I need to filter out nonpermitted characters since someone > put a Viagra advertisement into the php blog I created! (Caught it > quite quickly and deleted the entry from the database.) I'd like to > exclude "www." from being entered into a form. > > Susan > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From david at davidmintz.org Wed Jan 23 16:42:12 2008 From: david at davidmintz.org (David Mintz) Date: Wed, 23 Jan 2008 16:42:12 -0500 Subject: [nycphp-talk] escaping In-Reply-To: <4797AD05.5080004@projectskyline.com> References: <374199.43237.qm@web50209.mail.re2.yahoo.com> <4797AD05.5080004@projectskyline.com> Message-ID: <721f1cc50801231342n69840780u617bc2d20deb5b69@mail.gmail.com> It sounds like you're talking about input filtering. By escaping I think we generally mean on the output side. If for example you want to display in a form textfield the text John "KIller" Somebody what would happen if you don't replace the quote characters with the corresponding html entity? Premature field termination. That's just one example. If there were evil javascript in there and you didn't escape it, one user could enter something that would allow her/him to steal another user's cookies and hijack her/his session, for example. Cross-site scripting, they call it. http://us2.php.net/manual/en/function.htmlentities.php http://en.wikipedia.org/wiki/Cross-site_scripting On Jan 23, 2008 4:09 PM, Ben Sgro wrote: > what about http://myViagra.com? > > You'll probably need a robust solution for managing all the crap people > can stick into your blog comment space. > Is it a home made blog? (Your own code?) or an off the shelf thing? > > - Ben > > Susan Shemin wrote: > > Is this "escaping" that you guys have been talking about what you use > > to filter acceptable data into textbox form? > > > > If so, can you explain exactly what is being used (e.g., htmlentities) > > and how to use it? > > > > Actually I need to filter out nonpermitted characters since someone > > put a Viagra advertisement into the php blog I created! (Caught it > > quite quickly and deleted the entry from the database.) I'd like to > > exclude "www." from being entered into a form. > > > > Susan > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/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 > -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Wed Jan 23 17:34:01 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 23 Jan 2008 17:34:01 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: <8f0676b40801231054i2f998d27r94e2f141a79f238a@mail.gmail.com> References: <478F6F84.5040305@touro.edu> <47914374.50901@beezifies.com> <47939572.8040406@secdat.com> <8f0676b40801231054i2f998d27r94e2f141a79f238a@mail.gmail.com> Message-ID: <20080123223401.GA26460@panix.com> On Wed, Jan 23, 2008 at 01:54:43PM -0500, John Campbell wrote: > > If there is a separation between the programmer and the template > editor, it presents another problem. Who is responsible for escaping > the data? > > Do you do: > {$user.first_name|escape} {$user.last_name|escape} Here, the folks use a customized class that extends Smarty. Our constructor adds a default_modifier. This way _all_ variables automatically get escaped, unless a given template specifically says to get the variable with nodefaults. http://www.smarty.net/manual/en/variable.default.modifiers.php Here's how we do it, specifically, in the __construct() method: $this->register_modifier('myescape', array($this, 'myescape')); $this->default_modifiers = array('myescape'); Then there's a myescape() method in the class. >From the manual, it seems one could just rely on Smarty's escape mechanism by just doing this in the constuctor: $this->default_modifiers = array('escape:html'); Now there's no guessing, no need to write "|escape" in each variable use and no manually escaping the stuff in your PHP. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From cliff at pinestream.com Wed Jan 23 17:40:33 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 23 Jan 2008 17:40:33 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: <20080123223401.GA26460@panix.com> Message-ID: On 1/23/08 5:34 PM, "Daniel Convissor" > Now there's no guessing, no need to write "|escape" in each variable use > and no manually escaping the stuff in your PHP. Just thought of a potential gotcha. Smarty also has a nl2br function. You would want to escape before nl2br, otherwise your
    tags would be escaped. I wonder what the default order is for the default escape -- first or last. From chsnyder at gmail.com Wed Jan 23 18:33:00 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 23 Jan 2008 18:33:00 -0500 Subject: [nycphp-talk] htmlentities charset bug In-Reply-To: <8f0676b40801231227o175872dbsf83dd4f6c3859ff2@mail.gmail.com> References: <78c6bd860801230958w48175f7ewe401741f1be8280a@mail.gmail.com> <8f0676b40801231043n45ecfceck7ef0d4f18238ee73@mail.gmail.com> <8f0676b40801231227o175872dbsf83dd4f6c3859ff2@mail.gmail.com> Message-ID: On Jan 23, 2008 3:27 PM, John Campbell wrote: > > Do your pages validate? > Yes. The extended HTML entities are not required. Check the source of > this page: http://www.w3c.de/ > > > What happens in browsers that don't support > > the characters you're sending? > > I don't develop for browsers that don't support UTF-8... e.g. IE2. If > they don't have a glyph for the character, there is nothing you can do > (html entities or otherwise). Most browsers replace unknown > characters with a question mark symbol. > > > What happens in systems (such as RSS > > feed processors) that don't support multibyte characters? > > RSS is XML which requires UTF-8 support. If they don't support utf-8, > it is not a legit feed processor. I can't think of a single piece of > software that interprets html entities but does not support unicode. > I put together a test page at http://cs.dots.chxo.com/htmlentities-tests.php Okay, I think I'm convinced. htmlspecialchars() is roughly twice as fast, and sending straight characters conserves bandwidth over sending entities. I haven't found a browser yet that chokes on the un-escaped Word smart quotes. Unicode FTW! Thanks, John. -- Chris Snyder http://chxo.com/ From rolan at omnistep.com Wed Jan 23 21:09:52 2008 From: rolan at omnistep.com (Rolan Yang) Date: Wed, 23 Jan 2008 21:09:52 -0500 Subject: [nycphp-talk] escaping In-Reply-To: <374199.43237.qm@web50209.mail.re2.yahoo.com> References: <374199.43237.qm@web50209.mail.re2.yahoo.com> Message-ID: <4797F370.8080505@omnistep.com> Dropping all submissions with "http://" will eliminate a good amount of spam, however you will end up with thousands of robot submitted messages which contain nonsense messages. I'm not sure how anyone benefits from this, but I see it a lot. Ultimately, you will probably resort to putting a captcha on the form. See http://www.onlamp.com/pub/a/php/2005/03/31/text_captcha.html for examples. ~Rolan Susan Shemin wrote: > Is this "escaping" that you guys have been talking about what you use > to filter acceptable data into textbox form? > > If so, can you explain exactly what is being used (e.g., htmlentities) > and how to use it? > > Actually I need to filter out nonpermitted characters since someone > put a Viagra advertisement into the php blog I created! (Caught it > quite quickly and deleted the entry from the database.) I'd like to > exclude "www." from being entered into a form. > > Susan > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Thu Jan 24 02:17:23 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 24 Jan 2008 02:17:23 -0500 Subject: [nycphp-talk] Templating engines In-Reply-To: References: Message-ID: <450CE222-D53E-4291-890D-F0C0856AB8E2@beaffinitive.com> On Jan 23, 2008, at 3:56 PM, Cliff Hirsch wrote: > On 1/23/08 3:44 PM, "John Campbell" wrote: >> I just discovered smarty has default modifiers: >> http://www.smarty.net/manual/en/variable.default.modifiers.php > Smarty does have an override: {$var|smarty:nodefaults} to cover the > exceptions. That's right... I remember seeing something similar in another templating system and thought it was probably a good idea. I guess it will probably end up escaping more data than it has to... but it might save you from user error leading to xss attacks. I always wondered how much of a blip in the radar all the escaping does to the server and if it would be worth caching some things in their escaped state. On Jan 23, 2008, at 5:40 PM, Cliff Hirsch wrote: > I wonder what the default order is for the default escape -- first > or last. It's got to be first... but I guess I'd have to test to be sure. On Jan 23, 2008, at 2:50 PM, Cliff Hirsch wrote: > On 1/23/08 2:33 PM, "Rob Marscher" wrote: >> I decided that the view/template has to be responsible for escaping. > I can't see how it can't be a mix. What if your variable > intentionally has markup? Some content may allow, and intentionally > have, simple markup like ,
      ,
      etc. Escaping this > variable in the template would not be a good thing. Yeah, I meant that it would be a mix and the template would know to not escape (or to unescape with the nodefault modifier in the Smarty example above) variables that contain markup. Probably a good idea to employ some type of naming scheme for those variables and make sure they are filtered when they coming from user input. From anoland at indigente.net Thu Jan 24 08:05:34 2008 From: anoland at indigente.net (Adrian Noland) Date: Thu, 24 Jan 2008 08:05:34 -0500 Subject: [nycphp-talk] escaping In-Reply-To: <374199.43237.qm@web50209.mail.re2.yahoo.com> References: <374199.43237.qm@web50209.mail.re2.yahoo.com> Message-ID: <1d8a0e930801240505h7ea68f79p64ee4dd2d156eef6@mail.gmail.com> In addition to all the other comments made, strip_tags() is helpful in this situation. http://us.php.net/strip_tags As for excluding "www.", you need to do something like this: $form_data = preg_match("www." "", $form_data); http://us.php.net/manual/en/function.preg-replace.php On 1/23/08, Susan Shemin wrote: > > Is this "escaping" that you guys have been talking about what you use to > filter acceptable data into textbox form? > > If so, can you explain exactly what is being used (e.g., htmlentities) and > how to use it? > > Actually I need to filter out nonpermitted characters since someone put a > Viagra advertisement into the php blog I created! (Caught it quite quickly > and deleted the entry from the database.) I'd like to exclude "www." from > being entered into a form. > > Susan > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 anoland at indigente.net Thu Jan 24 08:22:28 2008 From: anoland at indigente.net (Adrian Noland) Date: Thu, 24 Jan 2008 08:22:28 -0500 Subject: [nycphp-talk] Anyone using Amazon S3 for backup? In-Reply-To: References: Message-ID: <1d8a0e930801240522p5c3845e6gd6d8e225cd23fca7@mail.gmail.com> On 1/18/08, Cliff Hirsch wrote: > > Is anyone using Amazon S3 for backup? Instead of getting another > independent server, setting up rsync, etc. this seems like a good solution > for backing up a server or sql database. Sure, my ISP does daily backups, > but having more control by backing up the database off-site would make me > sleep better. > > Anyone have any experience? Good, bad, suggestions, ideas? Any other > alternatives worth looking at? > My big problem is that it costs more to get data out than to put it in. http://www.amazon.com/S3-AWS-home-page-Money/b?ie=UTF8&node=16427261 *Storage *$0.15 per GB-Month of storage used *Data Transfer *$0.10 per GB - all data transfer in $0.18 per GB - first 10 TB / month data transfer out $0.16 per GB - next 40 TB / month data transfer out $0.13 per GB - data transfer out / month over 50 TB Not a scenario I want to be dealing with during a stressful situation. Take a look at an actual backup provider such as raidarray.net or rsync.net . -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at realm3.com Thu Jan 24 09:16:37 2008 From: brian at realm3.com (Brian D.) Date: Thu, 24 Jan 2008 09:16:37 -0500 Subject: [nycphp-talk] escaping In-Reply-To: <1d8a0e930801240505h7ea68f79p64ee4dd2d156eef6@mail.gmail.com> References: <374199.43237.qm@web50209.mail.re2.yahoo.com> <1d8a0e930801240505h7ea68f79p64ee4dd2d156eef6@mail.gmail.com> Message-ID: If you're using you're own solution, KCaptcha worked pretty well for me. http://www.captcha.ru/en/kcaptcha/ It's fairly simple and it's algorithm is pretty effective. http://www.codinghorror.com/blog/archives/001001.html On Jan 24, 2008 8:05 AM, Adrian Noland wrote: > In addition to all the other comments made, strip_tags() is helpful in this > situation. > > http://us.php.net/strip_tags > > As for excluding "www.", you need to do something like this: > > $form_data = preg_match("www." "", $form_data); > > > http://us.php.net/manual/en/function.preg-replace.php > > > > On 1/23/08, Susan Shemin wrote: > > > > > > > > > > > > > > Is this "escaping" that you guys have been talking about what you use to > filter acceptable data into textbox form? > > > > If so, can you explain exactly what is being used (e.g., htmlentities) and > how to use it? > > > > Actually I need to filter out nonpermitted characters since someone put a > Viagra advertisement into the php blog I created! (Caught it quite quickly > and deleted the entry from the database.) I'd like to exclude "www." from > being entered into a form. > > > > Susan > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/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 > -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594 From rmarscher at beaffinitive.com Thu Jan 24 12:23:19 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 24 Jan 2008 12:23:19 -0500 Subject: [nycphp-talk] Anyone using Amazon S3 for backup? In-Reply-To: References: Message-ID: On Jan 18, 2008, at 1:35 PM, Cliff Hirsch wrote: > Is anyone using Amazon S3 for backup? Here's an oft-referenced article by Jeremy Zawodny: http://jeremy.zawodny.com/blog/archives/007624.html I personally have only used S3 for serving/storing media and haven't done so on a very large scale yet. -------------- next part -------------- An HTML attachment was scrubbed... URL: From susan_shemin at yahoo.com Thu Jan 24 12:40:35 2008 From: susan_shemin at yahoo.com (Susan Shemin) Date: Thu, 24 Jan 2008 09:40:35 -0800 (PST) Subject: [nycphp-talk] escaping Message-ID: <533924.28874.qm@web50201.mail.re2.yahoo.com> Adrian, thank you! Been looking all over for the code. ----- Original Message ---- From: Adrian Noland To: NYPHP Talk Sent: Thursday, January 24, 2008 5:05:34 AM Subject: Re: [nycphp-talk] escaping In addition to all the other comments made, strip_tags() is helpful in this situation. http://us.php.net/strip_tags As for excluding "www.", you need to do something like this: $form_data = preg_match("www." "", $form_data); http://us.php.net/manual/en/function.preg-replace.php On 1/23/08, Susan Shemin wrote: Is this "escaping" that you guys have been talking about what you use to filter acceptable data into textbox form? If so, can you explain exactly what is being used (e.g., htmlentities) and how to use it? Actually I need to filter out nonpermitted characters since someone put a Viagra advertisement into the php blog I created! (Caught it quite quickly and deleted the entry from the database.) I'd like to exclude "www." from being entered into a form. Susan _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/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 rmarscher at beaffinitive.com Thu Jan 24 14:00:25 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 24 Jan 2008 14:00:25 -0500 Subject: [nycphp-talk] escaping In-Reply-To: <533924.28874.qm@web50201.mail.re2.yahoo.com> References: <533924.28874.qm@web50201.mail.re2.yahoo.com> Message-ID: <02DB7F91-FEA3-44EF-B6AF-0A8091B9B86A@beaffinitive.com> > On 1/23/08, Susan Shemin wrote: > Is this "escaping" that you guys have been talking about what you > use to filter acceptable data into textbox form? The filter functions give you many options for filtering and validating user input: http://php.net/filter-var You should have access to the filter extension. It gets built by default in PHP5.2+. All of the different options for the third parameter are on this page: http://php.net/filter Note that they use "SANITIZE" for what we've been calling "filter" -- it's because they have both validation and filtering/sanitizing under the "filter" umbrella term. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at davidmintz.org Fri Jan 25 14:40:41 2008 From: david at davidmintz.org (David Mintz) Date: Fri, 25 Jan 2008 14:40:41 -0500 Subject: [nycphp-talk] Anyone using Amazon S3 for backup? In-Reply-To: References: Message-ID: <721f1cc50801251140l67e9aa90xf2923dfab8803193@mail.gmail.com> I use it to back up my several thousand personal JPEGs and other data, and for under $2/month it is nice to know that my apartment building could burn down and I'd still have my photo collection. I think. There's a rumor out there that Google is planning a data storage service. Don't be surprised if they beat Amazon on price -- and look at your sh*t to see what ads to serve you. On Jan 24, 2008 12:23 PM, Rob Marscher wrote: > On Jan 18, 2008, at 1:35 PM, Cliff Hirsch wrote: > > Is anyone using Amazon S3 for backup? > > > Here's an oft-referenced article by Jeremy Zawodny: > http://jeremy.zawodny.com/blog/archives/007624.html > > I personally have only used S3 for serving/storing media and haven't done > so on a very large scale yet. > -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri Jan 25 15:14:34 2008 From: chsnyder at gmail.com (csnyder) Date: Fri, 25 Jan 2008 15:14:34 -0500 Subject: [nycphp-talk] Anyone using Amazon S3 for backup? In-Reply-To: <721f1cc50801251140l67e9aa90xf2923dfab8803193@mail.gmail.com> References: <721f1cc50801251140l67e9aa90xf2923dfab8803193@mail.gmail.com> Message-ID: On Jan 25, 2008 2:40 PM, David Mintz wrote: > Don't be surprised if they beat Amazon on price -- and look at your sh*t to > see what ads to serve you. The biggest difference between Google and most other ISPs: Google is an advertising company. They aren't in business to sell services to you, they are in business to sell your attention to advertisers. I'd rather pay full price at Amazon and know that I'm the primary customer. Sent via GMail ;-) -- Chris Snyder http://chxo.com/ From tedd at sperling.com Sat Jan 26 13:36:21 2008 From: tedd at sperling.com (tedd) Date: Sat, 26 Jan 2008 13:36:21 -0500 Subject: [nycphp-talk] Ruby gets another framework In-Reply-To: References: Message-ID: At 3:48 PM -0500 1/21/08, Ajai Khattri wrote: >You could also read Zed Shaw's "Rails is a Ghetto" rant for some community >insight (just ignore the bit where he says PHP programmers are morons!). We're not? :-) I have a client who thinks Ruby is the ultimate leading edge of programming. Arrgggg -- I'm getting tired of learning. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From shaijudavis at gmail.com Mon Jan 28 06:37:03 2008 From: shaijudavis at gmail.com (shaiju davis) Date: Mon, 28 Jan 2008 17:07:03 +0530 Subject: [nycphp-talk] IE Error - The security certificate presented by this website was issued for a different website's address Message-ID: <30ce306c0801280337u508d7a4di7d6150951149c4c9@mail.gmail.com> hi All, I'm having problem in IE7, when I try to take the https URL. I get this error " The security certificate presented by this website was issued for a different website's address". I'm using VeriSign SSL. If anyone has idea, please help me. Thanks in advance. Warm Regards Shaiju Davis -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Mon Jan 28 06:47:44 2008 From: ramons at gmx.net (David Krings) Date: Mon, 28 Jan 2008 06:47:44 -0500 Subject: [nycphp-talk] IE Error - The security certificate presented by this website was issued for a different website's address In-Reply-To: <30ce306c0801280337u508d7a4di7d6150951149c4c9@mail.gmail.com> References: <30ce306c0801280337u508d7a4di7d6150951149c4c9@mail.gmail.com> Message-ID: <479DC0E0.5070208@gmx.net> shaiju davis wrote: > > hi All, > > I'm having problem in IE7, when I try to take the https URL. > I get this error " The security certificate presented by this website > was issued for a different website's address". > I'm using VeriSign SSL. > If anyone has idea, please help me. > > Thanks in advance. Well, is it the same website and it gets reported wrong or is it from a different site and the error message is correct? As far as I know you can view the certificate information. Firefox has a function where you can see all the certificates and their parameters. It also allows for deleting a certificate. Maybe IE7 has an old one on file and comparing it to the newly issued one it doesn't match. Then again, crapware like IE should be simply ignored. David From nasir81 at gmail.com Mon Jan 28 06:49:45 2008 From: nasir81 at gmail.com (nasir81 at gmail.com) Date: Mon, 28 Jan 2008 11:49:45 +0000 Subject: [nycphp-talk] IE Error - The security certificate presented by thiswebsite was issued for a different website's address In-Reply-To: <30ce306c0801280337u508d7a4di7d6150951149c4c9@mail.gmail.com> References: <30ce306c0801280337u508d7a4di7d6150951149c4c9@mail.gmail.com> Message-ID: <158133309-1201520994-cardhu_decombobulator_blackberry.rim.net-100263204-@bxe024.bisx.prod.on.blackberry> Hi, The reason for that error message is that you are trying to access the website using a different URL than the certificate. For example, if the certificate is setup for "mydomain.com" and you try to access the website using https://www.mydomain.com As far as SSL is concerned, they are two different hostnames. HTH - Nasir Sent via BlackBerry from T-Mobile -----Original Message----- From: "shaiju davis" Date: Mon, 28 Jan 2008 17:07:03 To:"NYPHP Talk" Subject: [nycphp-talk] IE Error - The security certificate presented by this website was issued for a different website's address hi All, ? ?I'm having problem in IE7, when I try to take the https URL. ?I get this error " The security certificate presented by this website was issued for a different website's address". ?I'm using VeriSign SSL. ?If anyone has idea, please help me. ?Thanks in advance. ? Warm Regards Shaiju Davis _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From radalapsker at yahoo.com Mon Jan 28 12:16:40 2008 From: radalapsker at yahoo.com (-- rada --) Date: Mon, 28 Jan 2008 09:16:40 -0800 (PST) Subject: [nycphp-talk] RE: IE Error - The security certificate presented by this website Message-ID: <126701.11982.qm@web54106.mail.re2.yahoo.com> Most likely, your problem is that you think "something.com" is the same as "www.something.com" and in this case, it's not. Hope that helps! Cheers, Rada Lapsker ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.goldberg at gmail.com Mon Jan 28 16:02:41 2008 From: max.goldberg at gmail.com (max goldberg) Date: Mon, 28 Jan 2008 16:02:41 -0500 Subject: [nycphp-talk] Text versioning/manipulation caching architecture suggestions Message-ID: <87e6ded30801281302k13c26e2fq7d6e56223c86dae1@mail.gmail.com> Hello buds, It's been a while since I've been active on the list but I figured I'd give a holler and see if anyone had any suggestions for an application design problem I've run into. I have a large number of text fields across many tables in a fairly large database all of which can be manipulated in any number of ways. Some common manipulations would be scrubbing strings for display on the web (XHTML compliance and XSS avoidance), censoring of "bad" words, rich-text, etc. All in all, once you mix and match all of the various text manipulations, you end up with a large number of versions of the same chunk of text, and you need access to all of them based on a plethora of variables such as user options, access interface etc. On top of that, some fields can be edited, and I'd like to keep copies of the entire revision history, which adds another level of complexity. Originally I thought of some sort of memory caching solution, but the main goal of this is to come up with a scalable solution and there is currently a few gigabytes of text that this would apply to, so if anything it would probably need to expire. It's possible that I could have some mixture of short-term memory cache and long-term disk cache, as disk/database space isn't a large concern. Another issue is manipulation function versioning, e.g. when a new word is added to the censor function, you want to purge the cache of all of the censored text created by the last version. Maybe I'm just over-complicating the entire thing, but doing this sort of manipulation on a high traffic site seems like a gigantic duplication of CPU-intensive work that could (and should) be avoided. I've come up with a lot of solutions, but none of them seem very elegant. I'm trying to avoid a lot of excess DB queries and SQL joins. I've done some searching around and it seems like anyone who has solved this problem hasn't discussed it publicly. I thought maybe someone dealing with locale on a large scale might have come up with a good solution, but since locale is mostly static, it doesn't seem to apply in most cases. So has anyone dealt with something similar, or is there an obvious solution that I'm missing? I'd be interested in hearing some of the more seasoned NYPHPer's opinions. Thanks for any advice in advance! -Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From nynj.tech at hotmail.com Mon Jan 28 17:12:14 2008 From: nynj.tech at hotmail.com (chad qian) Date: Mon, 28 Jan 2008 17:12:14 -0500 Subject: [nycphp-talk] about check box Message-ID: Hi, Here is my current code: I want: When checkbox is checked,i want to insert the value"1" to mysql database. When checkbox is unchecked,i want to insert the value "0" to mysql database. How to change current code to get what I want ? Thanks! chad _________________________________________________________________ Helping your favorite cause is as easy as instant messaging.?You IM, we give. http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenrbnsn at rbnsn.com Mon Jan 28 17:38:18 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Mon, 28 Jan 2008 17:38:18 -0500 Subject: [nycphp-talk] about check box In-Reply-To: References: Message-ID: <20080128173818.juqcvtxtgcskwkoc@www.rbnsn.com> Quoting chad qian : > > Hi, > > Here is my current code: > > > I want: > When checkbox is checked,i want to insert the value"1" to mysql database. > When checkbox is unchecked,i want to insert the value "0" to mysql database. Only checked checkbox values are returned to your php script, so you have to do something like: Ken From michael.southwell at nyphp.com Mon Jan 28 21:44:36 2008 From: michael.southwell at nyphp.com (Michael Southwell) Date: Mon, 28 Jan 2008 21:44:36 -0500 Subject: [nycphp-talk] deleting cookies Message-ID: <479E9314.8090400@nyphp.com> I'm having trouble getting some cookies deleted. I'm storing login data in the session, and setting a two-week loginID cookie to bypass the need to login again upon later visits. The logout script uses the following code to destroy the session (which works) and to attempt to delete the session and loginID cookies. But that is not working, and those cookies are still alive if the user navigates away from the logout page to another page, so she is automatically logged right back in just as if she were coming back a week later. ================ session_start(); $_SESSION = array(); setcookie( session_id(), '', time() - 3600 ); session_destroy(); setcookie( 'loginID', '', time() - 3600 ); ================ What am I doing wrong? -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From ps at sun-code.com Mon Jan 28 22:34:58 2008 From: ps at sun-code.com (Peter Sawczynec) Date: Mon, 28 Jan 2008 22:34:58 -0500 Subject: [nycphp-talk] deleting cookies In-Reply-To: <479E9314.8090400@nyphp.com> References: <479E9314.8090400@nyphp.com> Message-ID: <000f01c86227$ecaac400$c6004c00$@com> Try setting the cookie cancellation time to something more extreme like: setcookie( 'loginID', '', time() - 31536000 ); ...this issue is vaguely familiar in that it may have something to do with the time(s) at server(s)/desktops(s) being out of synch and that one hour set back of cookie date is not sufficient for all involved to see it as expired(?!)(Hunh?). Peter -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michael Southwell Sent: Monday, January 28, 2008 9:45 PM To: talk - nyphp Subject: [nycphp-talk] deleting cookies I'm having trouble getting some cookies deleted. I'm storing login data in the session, and setting a two-week loginID cookie to bypass the need to login again upon later visits. The logout script uses the following code to destroy the session (which works) and to attempt to delete the session and loginID cookies. But that is not working, and those cookies are still alive if the user navigates away from the logout page to another page, so she is automatically logged right back in just as if she were coming back a week later. ================ session_start(); $_SESSION = array(); setcookie( session_id(), '', time() - 3600 ); session_destroy(); setcookie( 'loginID', '', time() - 3600 ); ================ What am I doing wrong? -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From shaijudavis at gmail.com Tue Jan 29 04:59:08 2008 From: shaijudavis at gmail.com (shaiju davis) Date: Tue, 29 Jan 2008 15:29:08 +0530 Subject: [nycphp-talk] RE: IE Error - The security certificate presented by this website In-Reply-To: <126701.11982.qm@web54106.mail.re2.yahoo.com> References: <126701.11982.qm@web54106.mail.re2.yahoo.com> Message-ID: <30ce306c0801290159ucecb780n12b6ab5dbcf6a8c1@mail.gmail.com> Hi All Thanks for your reply. We use VeriSign Certificate and Certificate type is "Shared". I think I have to use the URL with the servername for the Certificate provider and userid. How can I check it ? Thanks in advance, Shaiju Davis. -------------- next part -------------- An HTML attachment was scrubbed... URL: From karthik.it2004 at gmail.com Tue Jan 29 06:02:40 2008 From: karthik.it2004 at gmail.com (karthik k) Date: Tue, 29 Jan 2008 16:32:40 +0530 Subject: [nycphp-talk] Please help me sir Message-ID: I need to update table2 with data from table1 the mysql4 code would be: update table2,table1 set table2.field = table1.field where table2.id = table1.id how is this done in mysql 3.x ? Don't limit your challenges.Challenge your limits. Urs Always , K.KARTHIK -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Tue Jan 29 06:52:58 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 29 Jan 2008 06:52:58 -0500 Subject: [nycphp-talk] Charsets revisited -- good book Message-ID: Revisiting charset, take a look at ?Building Scalable Website? by Cal Henderson of Flickr fame. He has a good chapter of internationalization & localization, along with another chapter on filtering utf-8, etc. Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.southwell at nyphp.com Tue Jan 29 08:21:23 2008 From: michael.southwell at nyphp.com (Michael Southwell) Date: Tue, 29 Jan 2008 08:21:23 -0500 Subject: [nycphp-talk] deleting cookies In-Reply-To: <000f01c86227$ecaac400$c6004c00$@com> References: <479E9314.8090400@nyphp.com> <000f01c86227$ecaac400$c6004c00$@com> Message-ID: <479F2853.5090308@nyphp.com> Peter Sawczynec wrote: > Try setting the cookie cancellation time to something more extreme like: This sounds promising; it is quite true that there is often a time disparity between the server (which may be geographically distant) and the client. But it still doesn't work. > > setcookie( 'loginID', '', time() - 31536000 ); > -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From ps at sun-code.com Tue Jan 29 08:45:26 2008 From: ps at sun-code.com (Peter Sawczynec) Date: Tue, 29 Jan 2008 08:45:26 -0500 Subject: [nycphp-talk] deleting cookies In-Reply-To: <479F2853.5090308@nyphp.com> References: <479E9314.8090400@nyphp.com> <000f01c86227$ecaac400$c6004c00$@com> <479F2853.5090308@nyphp.com> Message-ID: <002001c8627d$344e4d40$9ceae7c0$@com> You should take a look at php.net setcookie remarks from users. There are other unusual caveats both for Firefox (doesn't like blank/empty string value in setcookie func) and IE (7?) has issues with how a setcookie time is set in the past. There are apparently one or two tricks for expiring a cookie with a bole an value rather than past date, maybe. Meanwhile, are you sure have named your cookie intended to be expired correctly? Is there an issue/difference in double quotes vs single quotes in setcookie func? If you are hiding PHP errors then are u sure that you expire cookie effort is in a valid area of the output and that there is not somewhere in front of the expire call some output already? Peter -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michael Southwell Sent: Tuesday, January 29, 2008 8:21 AM To: NYPHP Talk Subject: Re: [nycphp-talk] deleting cookies Peter Sawczynec wrote: > Try setting the cookie cancellation time to something more extreme like: This sounds promising; it is quite true that there is often a time disparity between the server (which may be geographically distant) and the client. But it still doesn't work. > > setcookie( 'loginID', '', time() - 31536000 ); > -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ben at projectskyline.com Tue Jan 29 09:52:25 2008 From: ben at projectskyline.com (Ben Sgro) Date: Tue, 29 Jan 2008 09:52:25 -0500 Subject: [nycphp-talk] Charsets revisited -- good book In-Reply-To: References: Message-ID: <479F3DA9.9050507@projectskyline.com> +1, yes good book, lots of detail and source provided. Cliff Hirsch wrote: > Revisiting charset, take a look at ?Building Scalable Website? by Cal > Henderson of Flickr fame. He has a good chapter of > internationalization & localization, along with another chapter on > filtering utf-8, etc. > > Cliff > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From rrothe at ana.net Tue Jan 29 13:51:52 2008 From: rrothe at ana.net (Rothe, Robert) Date: Tue, 29 Jan 2008 13:51:52 -0500 Subject: [nycphp-talk] WYSIWYG editors In-Reply-To: <7.0.1.0.2.20080110203219.029c12e0@e-government.com> References: <477E9E85.8030407@beezifies.com><7.0.1.0.2.20080108212255.02b2e290@e-government.com><47843F2F.7080608@gmx.net> <7.0.1.0.2.20080110203219.029c12e0@e-government.com> Message-ID: <57E3058A613A8D45894BC136B27E96F922FE24@anaexch-nyc.ANA.NET> I use tinyMCE. There is a "Paste from Word" plug-in (available as part of the base install), that addresses this issue. Add "paste" to the plugin line and "pasteword" to the theme_advanced_buttons?_add config directive. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Urb LeJeune Sent: Thursday, January 10, 2008 8:33 PM To: NYPHP Talk Subject: Re: [nycphp-talk] WYSIWYG editors Thanks to all who responded to my request for suggestions on WYSIWYG editors. Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From dann at bentobox.net Tue Jan 29 14:49:32 2008 From: dann at bentobox.net (dann) Date: Tue, 29 Jan 2008 14:49:32 -0500 Subject: [nycphp-talk] Text versioning/manipulation caching architecture suggestions Message-ID: <92547AE8-666B-461D-8BE2-E17B15ABD277@bentobox.net> Hi Max, I had a similar situation in the past involving a single table of Content Items which evolved from simple strings to elaborate objects with branching / staging, localization, history, and cached processing. The solution I implemented involved three tables: 1. Content Items: a placeholder for the item and its primary data (id, name, current version, access level, etc.) 2. Content Item Instances: the item value is kept here (id, item_id, version, value, etc.) 3. Content Items Metadata: the caching lives here (id, item_id, key, value, creation date) When a Content Item is updated you'll increment its version number and add a new instance with the new value and version number (be wary of the potential race condition here). That gives you a full item history in the Content Item Instances table. When an item is accessed you'll check its Metadata to see if a cached value for its particular processing key exists. If it does and the creation date is later than the update date of those processors (I use a single site-wide update date for simplicity) show the cached value. Otherwise create the cache and store it in the Metadata table. Some notes: You might be able to store the value directly in the Content Items table if you don't have to deal with i18n, staging, branching and the like. In my case I needed multiple instances per Content Item to begin with, and the history was a simple bonus extension to that implementation. You'd still need something like Table 2 above, but you wouldn't have to check it every time you need the raw value for a Content Item. Likewise my metadata situation is a bit more complicated, as I actually store the caches on a per-instance basis. I still have Table 3, but I also have a fourth table for Content Item Instance Metadata which is where the caches live. You mentioned that you have many tables in your database that need this treatment. You may need to experiment a bit to see if it is more efficient to triple the number of tables in your database (ouch) or to add something like a 'table_name' field to Tables 2 and 3 above and use them for all your data. I suspect this later route may lead to some table size issues, however, as those tables tend to fill up rather rapidly. I've been meaning to write this up for awhile; if the ideas seem useful I can prepare a more rigorous treatment. Let me know what you eventually decide to use, I'd be interested to hear how your particular requirements shape the solution. -- dann > Hello buds, > > It's been a while since I've been active on the list but I figured > I'd give > a holler and see if anyone had any suggestions for an application > design > problem I've run into. > > I have a large number of text fields across many tables in a fairly > large > database all of which can be manipulated in any number of ways. > Some common > manipulations would be scrubbing strings for display on the web (XHTML > compliance and XSS avoidance), censoring of "bad" words, rich-text, > etc. > > All in all, once you mix and match all of the various text > manipulations, > you end up with a large number of versions of the same chunk of > text, and > you need access to all of them based on a plethora of variables > such as user > options, access interface etc. On top of that, some fields can be > edited, > and I'd like to keep copies of the entire revision history, which adds > another level of complexity. > > Originally I thought of some sort of memory caching solution, but > the main > goal of this is to come up with a scalable solution and there is > currently a > few gigabytes of text that this would apply to, so if anything it > would > probably need to expire. It's possible that I could have some > mixture of > short-term memory cache and long-term disk cache, as disk/database > space > isn't a large concern. > > Another issue is manipulation function versioning, e.g. when a new > word is > added to the censor function, you want to purge the cache of all of > the > censored text created by the last version. > > Maybe I'm just over-complicating the entire thing, but doing this > sort of > manipulation on a high traffic site seems like a gigantic > duplication of > CPU-intensive work that could (and should) be avoided. > > I've come up with a lot of solutions, but none of them seem very > elegant. > I'm trying to avoid a lot of excess DB queries and SQL joins. > > I've done some searching around and it seems like anyone who has > solved this > problem hasn't discussed it publicly. I thought maybe someone > dealing with > locale on a large scale might have come up with a good solution, > but since > locale is mostly static, it doesn't seem to apply in most cases. > > So has anyone dealt with something similar, or is there an obvious > solution > that I'm missing? I'd be interested in hearing some of the more > seasoned > NYPHPer's opinions. > > Thanks for any advice in advance! > -Max > From 1j0lkq002 at sneakemail.com Wed Jan 30 00:02:27 2008 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 29 Jan 2008 21:02:27 -0800 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: References: Message-ID: <23865-90360@sneakemail.com> Cliff Hirsch cliff-at-pinestream.com |nyphp dev/internal group use| wrote: >On 9/17/07 11:09 AM, "Mitch Pirtle" wrote: > > >>I can't believe nobody's mentioned Magento yet: >> >>http://www.magentocommerce.com/ >> >>That's the one I'm taking a very very close look at... >> >> > >Not production yet, last time I checked, but looks interesting. > > Can anyone in NYPHP land comment on the code behind MagentoCommerce.com at this point? There is a PR effort pushing that the actual code is exemplary, Open Source leadership stuff, while some observers are saying it's already bloated and very slow for a PHP/MySql shopping cart app. I'm not qualified to say, and I'm not looking for any controversy, but I would appreciate insight that helps me understand how much this Open Source project will be good for implementors vs. good for the for-profit entity set up to provide support when used in production. -- ------------------------------------------------------------- Web publishing has evolved. It's not just competitive, but aggressively competitive. If you don't know that, you're leaving significant profits on the table. If you do know that, aint it fun? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From nynj.tech at hotmail.com Wed Jan 30 11:25:42 2008 From: nynj.tech at hotmail.com (chad qian) Date: Wed, 30 Jan 2008 11:25:42 -0500 Subject: [nycphp-talk] create a 128-bit(32-character) guid Message-ID: Hi, I want to generate random 128-bit(32-character) GUID.When people register,they will get the link in their email inbox: http://www.yourdomain.com/verify.php?username=((username))&validation=((GUID)) How to generate this random 128-bit(32-character) GUID?I thought but I'm lost here. Thanks in advance! chad _________________________________________________________________ Need to know the score, the latest news, or you need your Hotmail?-get your "fix". http://www.msnmobilefix.com/Default.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Wed Jan 30 11:51:04 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 30 Jan 2008 11:51:04 -0500 Subject: [nycphp-talk] create a 128-bit(32-character) guid In-Reply-To: References: Message-ID: On Jan 30, 2008 11:25 AM, chad qian wrote: > How to generate this random 128-bit(32-character) GUID?I thought but I'm > lost here. See http://us2.php.net/uniqid, there is an example there. -- Chris Snyder http://chxo.com/ From radalapsker at yahoo.com Wed Jan 30 16:22:43 2008 From: radalapsker at yahoo.com (-- rada --) Date: Wed, 30 Jan 2008 13:22:43 -0800 (PST) Subject: [nycphp-talk] heredoc help please? Message-ID: <489528.7203.qm@web54103.mail.re2.yahoo.com> Hello all, Can anyone help me with heredoc? I have this code: (I am using PHP5 and zend for editor) and I am expecting to see output with line breaks. Can't see them though, no matter what I do. The heredoc just outputs everything on one line, like this: This is a heredoc test. Test line 2. Test line 3 with tab. Any ideas? I do not have any extraneous characters around the delimiters. I also thought the problem might be the line break style of my editor (Zend) but I tried everything: "\n", "\r\n", and "as-is" (whatever that is..) and still no go. Thanks for any help! Rada Lapsker ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: From gatzby3jr at gmail.com Wed Jan 30 16:37:47 2008 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Wed, 30 Jan 2008 16:37:47 -0500 Subject: [nycphp-talk] heredoc help please? In-Reply-To: <489528.7203.qm@web54103.mail.re2.yahoo.com> References: <489528.7203.qm@web54103.mail.re2.yahoo.com> Message-ID: <29da5d150801301337j49a0ca90n6101b05fbbd5791d@mail.gmail.com> I believe you would need to put the HTML tabs inside the heredoc to see the linebreaks. The heredoc puts it straight into the HTML. I think you would need: This is a heredoc test.

      Test line 2.
      Test line 3 with tab.

      EOD; ?> - Brian O'Connor On Jan 30, 2008 4:22 PM, -- rada -- wrote: > Hello all, > > Can anyone help me with heredoc? > I have this code: > > > echo << > This is a heredoc test. > > Test line 2. > Test line 3 with tab. > > EOD; > ?> > > (I am using PHP5 and zend for editor) and I am expecting to see output > with line breaks. Can't see them though, no matter what I do. The heredoc > just outputs everything on one line, like this: > > This is a heredoc test. Test line 2. Test line 3 with tab. > > Any ideas? I do not have any extraneous characters around the delimiters. > I also thought the problem might be the line break style of my editor (Zend) > but I tried everything: "\n", "\r\n", and "as-is" (whatever that is..) and > still no go. > > Thanks for any help! > Rada Lapsker > > ------------------------------ > Never miss a thing. Make Yahoo your homepage. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 cliff at pinestream.com Wed Jan 30 16:41:55 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 30 Jan 2008 16:41:55 -0500 Subject: [nycphp-talk] heredoc help please? In-Reply-To: <489528.7203.qm@web54103.mail.re2.yahoo.com> Message-ID: On 1/30/08 4:22 PM, "-- rada --" wrote: > Hello all, > > Can anyone help me with heredoc? > I have this code: > > > echo << > This is a heredoc test. > > Test line 2. > Test line 3 with tab. > > EOD; > ?> > > (I am using PHP5 and zend for editor) and I am expecting to see output with > line breaks. Can't see them though, no matter what I do. The heredoc just > outputs everything on one line, like this: > > This is a heredoc test. Test line 2. Test line 3 with tab. > > Any ideas? I do not have any extraneous characters around the delimiters. I > also thought the problem might be the line break style of my editor (Zend) but > I tried everything: "\n", "\r\n", and "as-is" (whatever that is..) and still > no go. > If this is going to a browser, HTML browsers don?t recognize line breaks. Use a fn like nl2br. -------------- next part -------------- An HTML attachment was scrubbed... URL: From urb at e-government.com Wed Jan 30 18:08:03 2008 From: urb at e-government.com (Urb LeJeune) Date: Wed, 30 Jan 2008 18:08:03 -0500 Subject: [nycphp-talk] heredoc help please? In-Reply-To: References: <489528.7203.qm@web54103.mail.re2.yahoo.com> Message-ID: <7.0.1.0.2.20080130180651.02a04c28@e-government.com> At 04:41 PM 1/30/2008, you wrote: >On 1/30/08 4:22 PM, "-- rada --" wrote: > >Hello all, > >Can anyone help me with heredoc? >I have this code: > > >echo << >This is a heredoc test. > >Test line 2. > Test line 3 with tab. > >EOD; >?> > >(I am using PHP5 and zend for editor) and I am expecting to see >output with line breaks. Can't see them though, no matter what I do. >The heredoc just outputs everything on one line, like this: The individual lines, except of the last one, insert a \n not a
      if you want new lines displayed you need
      or the

      tags. >This is a heredoc test. Test line 2. Test line 3 with tab. > >Any ideas? I do not have any extraneous characters around the >delimiters. I also thought the problem might be the line break style >of my editor (Zend) but I tried everything: "\n", "\r\n", and >"as-is" (whatever that is..) and still no go. > >If this is going to a browser, HTML browsers don't recognize line >breaks. Use a fn like nl2br. >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >NYPHPCon 2006 Presentations Online >http://www.nyphpcon.com > >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. -------------- next part -------------- An HTML attachment was scrubbed... URL: From smanes at magpie.com Thu Jan 31 09:26:26 2008 From: smanes at magpie.com (Steve Manes) Date: Thu, 31 Jan 2008 09:26:26 -0500 Subject: [nycphp-talk] heredoc help please? In-Reply-To: <489528.7203.qm@web54103.mail.re2.yahoo.com> References: <489528.7203.qm@web54103.mail.re2.yahoo.com> Message-ID: <47A1DA92.9040106@magpie.com> -- rada -- wrote: > Hello all, > > Can anyone help me with heredoc? > I have this code: > > > echo << > This is a heredoc test. > > Test line 2. > Test line 3 with tab. > > EOD; print nl2br( << References: <489528.7203.qm@web54103.mail.re2.yahoo.com> <47A1DA92.9040106@magpie.com> Message-ID: <7.0.1.0.2.20080131111627.03243cb8@e-government.com> >print nl2br( ><<Here >are >four >lines. >EOD >); Doesn't the closing EOD need a trailing ";"? Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. From smanes at magpie.com Thu Jan 31 12:38:09 2008 From: smanes at magpie.com (Steve Manes) Date: Thu, 31 Jan 2008 12:38:09 -0500 Subject: [nycphp-talk] heredoc help please? In-Reply-To: <7.0.1.0.2.20080131111627.03243cb8@e-government.com> References: <489528.7203.qm@web54103.mail.re2.yahoo.com> <47A1DA92.9040106@magpie.com> <7.0.1.0.2.20080131111627.03243cb8@e-government.com> Message-ID: <47A20781.1050903@magpie.com> Urb LeJeune wrote: > >> print nl2br( >> <<> Here >> are >> four >> lines. >> EOD >> ); > > Doesn't the closing EOD need a trailing ";"? The closing parenthesis apparently takes care of the statement closure. Actually, I believe adding one will throw an error. From urb at e-government.com Thu Jan 31 12:55:45 2008 From: urb at e-government.com (Urb LeJeune) Date: Thu, 31 Jan 2008 12:55:45 -0500 Subject: [nycphp-talk] heredoc help please? In-Reply-To: <47A20781.1050903@magpie.com> References: <489528.7203.qm@web54103.mail.re2.yahoo.com> <47A1DA92.9040106@magpie.com> <7.0.1.0.2.20080131111627.03243cb8@e-government.com> <47A20781.1050903@magpie.com> Message-ID: <7.0.1.0.2.20080131124957.02ed3c98@e-government.com> >>>print nl2br( >>><<>>Here >>>are >>>four >>>lines. >>>EOD >>>); >>Doesn't the closing EOD need a trailing ";"? > >The closing parenthesis apparently takes care of the statement >closure. Actually, I believe adding one will throw an error. You are absolutely correct. I don't understand why however :-) The here doc structure is a parameter for the function nl2br and as such I would think should be self containing. BTW there is no
      after "lines." The fact that there is no nl following the last line of the document has always been a mystery to me. PHP supposedly allows white spaces in most places. I could also never understand why spaces are not allowed after the opening or closing label. Urb Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. From smanes at magpie.com Thu Jan 31 13:19:03 2008 From: smanes at magpie.com (Steve Manes) Date: Thu, 31 Jan 2008 13:19:03 -0500 Subject: [nycphp-talk] heredoc help please? In-Reply-To: <7.0.1.0.2.20080131124957.02ed3c98@e-government.com> References: <489528.7203.qm@web54103.mail.re2.yahoo.com> <47A1DA92.9040106@magpie.com> <7.0.1.0.2.20080131111627.03243cb8@e-government.com> <47A20781.1050903@magpie.com> <7.0.1.0.2.20080131124957.02ed3c98@e-government.com> Message-ID: <47A21117.2030408@magpie.com> Urb LeJeune wrote: > BTW there is no
      after "lines." The fact that there is no > nl following the last line of > the document has always been a mystery to me. PHP supposedly allows > white spaces in most > places. I could also never understand why spaces are not allowed after > the opening or closing > label. In "classic" heredoc syntax, \nTOKEN is treated by the parser as the end-of-doc token, not just TOKEN. In Perl, it's \nTOKEN\n. This actually comes in handy for CLI scripts were you want to use it dump a bunch of text with a closing prompt: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent est libero, rutrum in, viverra vehicula, consequat non, ante. Praesent nibh arcu, congue ac, bibendum eget, consequat vel, nunc. Nullam fermentum cursus magna. Nulla egestas justo vel ipsum. Sed vitae lectus in ipsum tristique ullamcorper. Would you like to play a game of chess (y/n)? _ From dirn at dirnonline.com Thu Jan 31 13:41:17 2008 From: dirn at dirnonline.com (dirn at dirnonline.com) Date: Thu, 31 Jan 2008 11:41:17 -0700 Subject: [nycphp-talk] heredoc help please? Message-ID: <20080131114117.9562cbc3556ac68f081dfda387a9f4ab.e3cd83735f.wbe@email.secureserver.net> An HTML attachment was scrubbed... URL: From ajai at bitblit.net Thu Jan 31 15:54:10 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 31 Jan 2008 15:54:10 -0500 (EST) Subject: [nycphp-talk] Ruby gets another framework In-Reply-To: Message-ID: On Sat, 26 Jan 2008, tedd wrote: > I have a client who thinks Ruby is the ultimate leading edge of programming. Right about now, they all do... There's nothing in Ruby per se that you can't do in PHP but its hip right now. > Arrgggg -- I'm getting tired of learning. Welcome to the "sick-of-learning-another-language" club. But seriously, as the cliche goes, change is the only constant in technology. Sometimes it makes you want to go work on a farm* instead :-) * You might be "Better Off" http://amazon.com/dp/B000FTWAYU -- Aj. From ps at sun-code.com Thu Jan 31 18:20:49 2008 From: ps at sun-code.com (Peter Sawczynec) Date: Thu, 31 Jan 2008 18:20:49 -0500 Subject: [nycphp-talk] Ruby gets another framework In-Reply-To: References: Message-ID: <005001c8645f$ea6e7f80$bf4b7e80$@com> It is absolutely true, you must keep up on your ace primary coding language and you probably should know one or two other primaries quite well. But, try to keep in mind that your career is your job and not your life and you must make efforts to collar your job a bit and meanwhile concurrently get into some of the things you enjoy. Further... Paraphrasing very roughly from the book: Rise of the Creative Class. More and more professionals (true creatives and otherwise) are opting earlier in their lives to make their home base in fresh "creative" community areas like Idaho, Colorado, New Hampshire, South Carolina and New Mexico while still telecommuting their specialized work, and getting to enjoy: i) more generally found gourmet foods, ii) traveling big city entertainment, and iii) most other quality resources and services that for decades have been captive to urban centers ------- Essentially, since the committed for life one job career has become a thing of the past -- one is essentially behooved to take more matters of your personal, medical, financial and career life into your own hands early on. Be more holistic about all your living. Flowing and continuous. Not rigidly compartmentalized. ------- Successfully programming intensely for a living is a very high stress and often isolating experience. At the same time, it is one of the most democratically attainable, portable, and flexible career paths out there today. Yet, I think, it is doubtful that very many people are going to become intensely rich from programming. So if you can, take advantage of the flexibility your programming career offers to you that many other career paths do not offer to others. It is almost your obligation to reap more of the bounty offered via your career. Be flexible, be creative, take small chances. ------ Paraphrasing very roughly again, from the extreme film Turistas, Dr. Zamora advises: "To take the right action is great. To take the wrong action is good. To take no action is unconscionable." Live your life, don't watch it. Warmest regards, ? Peter Sawczynec Technology Dir. Sun-code Interactive Sun-code.com 646.316.3678 ps at sun-code.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Ajai Khattri Sent: Thursday, January 31, 2008 3:54 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Ruby gets another framework On Sat, 26 Jan 2008, tedd wrote: > I have a client who thinks Ruby is the ultimate leading edge of programming. Right about now, they all do... There's nothing in Ruby per se that you can't do in PHP but its hip right now. > Arrgggg -- I'm getting tired of learning. Welcome to the "sick-of-learning-another-language" club. But seriously, as the cliche goes, change is the only constant in technology. Sometimes it makes you want to go work on a farm* instead :-) * You might be "Better Off" http://amazon.com/dp/B000FTWAYU -- Aj. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php