From johnzabroski at yahoo.com Mon Oct 1 00:22:22 2007 From: johnzabroski at yahoo.com (John Zabroski) Date: Sun, 30 Sep 2007 21:22:22 -0700 (PDT) Subject: [nycphp-talk] SPL - Do you use? In-Reply-To: Message-ID: <316368.20703.qm@web60223.mail.yahoo.com> There is nothing "abstract" about what I just said. There is NOTHING pretentious about saving time. Time is money; that is CONCRETE business terms. Rapid, high-quality work is what makes workers more valuable than their peers. I don't know what can be more concrete than saving time, and I also don't understand what's harmful about being abstract. When programming, it's about getting things done correct, explicit, and fast. That might mean you need to be abstract or you need to be concrete. Very few programmers should build a solution from the ground up, and we all use off-the-shelf components somewhere to save time. For example, there's nothing pretentious about using a database to store data. A database is an off-the-shelf program that stores data. If that off-the-shelf solution can pay for itself in three years, then guaranteeing yourself a positive return on investment is a sound, concrete decision. An object-oriented framework saves time, or it sucks and no one would use it. That is the major benefit: saving time. Come to that, most people don't view the language as the time saver but instead view the framework as the time saver. Most people don't "pick OOP", they pick a framework that addresses a problem application domain. There is nothing "abstract" about this benefit. I put myself in the direct pathway of the consequences my decisions have. I find the notion that polymorphism is arbitrarily beneficial to certain projects to be very "abstract" and also forcing a technology instead of a solution. It makes it sound like there is a "Ghost in the Machine", when there is none. Off-topic: Aren't you an adjunct professor at SUNY Potsdam? Edward Potter wrote: When it get to this abstract level, just think of objects as cells & functions as peptides carrying messages (variables) to hungry mitochondria (http://en.wikipedia.org/wiki/Mitochondrion) waiting to be fed to make those cells work for you. If you have all your code working correctly, you'll be able to Interconnect them all and you'll get a Paris Hilton - or something like that. :-) Then take 2 Prozac, and re-boot . . . ed (works for me) On 9/30/07, John Zabroski wrote: > The benefit of object-orientation is message dispatch. Objects are peers. > They define what to do, not how to do it. Delegation of responsibilities is > therefore way more dependable a concept than simply polymorphism. If the > notion of a network of inter-cooperating agents working together to > accomplish a task resembles your task, then objects might make sense. > > Polymorphism isn't why object-oriented frameworks are successful. In > general, frameworks are successful because the problem application domain > was well understood before it was ever translated into code. Frameworks > tend to address a vertical line of business (some ill-defined problem > application domain) or a horizontal line of business (i.e., security). > Frameworks are also successful because they usually glue together > off-the-shelf software in interesting ways that rapidly solve problems. > > Also, if you want to make your code to be very simple, then just obey the > first rule of programming: figure out what you want to say before you figure > out how to say it. Meaningful abstractions can never be crafted in the > absence of a well-defined context. > > Programming language concepts don't make programming simple. Deep, > penetrating knowledge of the problem application domain makes programming > simpler. Having a language that you can easily translate that knowledge > into is also a boon, just as having off-the-shelf software that you can glue > into your architecture is a boon. > > > Michael B Allen wrote: > OOP provides one major benefit - polymorphism. If you don't need > polymorphism, you should not be using OOP. But in some cases > polymorphism can make your code very simple and yet highly extensible. > It *can* be extremely powerful. > > ________________________________ > Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel > and lay it on us. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- the Blog: http://www.utopiaparkway.com the Karma: http://www.coderswithconscience.com the Projects: http://flickr.com/photos/86842405 at N00/ the 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 --------------------------------- Need a vacation? Get great deals to amazing places on Yahoo! Travel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From birgunjp0071 at yahoo.com Mon Oct 1 03:38:49 2007 From: birgunjp0071 at yahoo.com (birgunj birgunj) Date: Mon, 1 Oct 2007 00:38:49 -0700 (PDT) Subject: [nycphp-talk] neeed help In-Reply-To: <002e01c7f08a$bdf8f0f0$0200a8c0@X9183> Message-ID: <783212.41158.qm@web59309.mail.re1.yahoo.com> Dear All, i am uploading ebooks on my website. i want to restrict user from downloading or printing the book.user should only read the document but cant not save or download or printing. how do we do this ? can anybody help me? its very urgent.if any software which can do it, then plz give me the name of that software also. thanks to all in advance. humayoo --------------------------------- Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Mon Oct 1 06:44:13 2007 From: ramons at gmx.net (David Krings) Date: Mon, 01 Oct 2007 06:44:13 -0400 Subject: [nycphp-talk] neeed help In-Reply-To: <783212.41158.qm@web59309.mail.re1.yahoo.com> References: <783212.41158.qm@web59309.mail.re1.yahoo.com> Message-ID: <4700CF7D.30002@gmx.net> birgunj birgunj wrote: > Dear All, > i am uploading ebooks on my website. i want to restrict user from > downloading or printing the book.user should only read the document but > cant not save or download or printing. > how do we do this ? can anybody help me? its very urgent.if any > software which can do it, then plz give me the name of that software also. > > thanks to all in advance. > > humayoo > There were many discussions about this in the past months and they all resulted to this being a futile attempt. In order to display the content in a browser the users have to download the file. This is how the WWW works. Printing is as easy by pressing Print Screen. There are some attempts to stop caching, obfuscating the real source URL of the file, and some tricks disabling the most obvious functions for printing and saving, which may or may not work depending on browser used. As I pointed out back then, you try to solve a management problem with technology and that never works. Your ebooks need to be priced right and be of such a high quality that the users do want to pay you for them. If that doesn't fit your business model, seek out avenues other than online distribution. The only good idea that I have is self-desctructing CDs, which yet have to be invented. Good luck, you will need it for what you want to do. David From paul at devonianfarm.com Mon Oct 1 08:47:53 2007 From: paul at devonianfarm.com (paul at devonianfarm.com) Date: Mon, 1 Oct 2007 08:47:53 -0400 (EDT) Subject: [nycphp-talk] SPL, Container Classes, and all that... Message-ID: <36925.192.168.1.71.1191242873.webmail@192.168.1.71> ??? There's always a tension between creating generic data structure classes (Lists,? Trees,? Maps) and classes that are specific to the task at hand ??? I haven't used container classes much in PHP.? With associative arrays on my fingertips,? I haven't felt motivated. ??? I recently did a stint of programming in Java,? developing a client-side application with the Google Web Toolkit.? GWT is an unorthodox Java environment:? you write Java,? but a special compiler translates the code to Javascript,? which runs in an ordinary web browser.? This lets you write AJAX applications in a style much like writing a desktop app. ??? It might sound crazy,? but it works pretty well. ??? I like the Java containers alot,? particularly the extra container classes from the Apache Commons.? I particularly like there are multiple back-end implementations of the data structures so can choose structures that are appropriate for your particular workload.? Java containers didn't work well with the type system in older versions of Java,? but JDK 1.5 introduces generics, foreach and other syntactic sugar that makes them more fun to work with. ??? Java developers rarely used hashes (associative arrays) when I was doing Java 5 years ago,? but they're much more fashionable now -- they've been learning from the PHP (Perl, Python,...) world. ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulcheung at tiscali.co.uk Mon Oct 1 09:33:28 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Mon, 1 Oct 2007 14:33:28 +0100 Subject: [nycphp-talk] MySQL Monitor V PHP & MySQL References: <008001c7fc88$3e086d80$0200a8c0@X9183> <20070921194129.hrl1k96k0s8kcs4g@webmail.nyphp.com> Message-ID: <001401c8042f$a7162700$0300a8c0@X9183> Hi Michael, I have taken onboard all the comments and research things further and was eventual able to force an error message Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\tp_test.php on line 38 Armed with this info I changed the PHP.INI and used grant all privileges on *.* to ODBC at localhost identified by enter with grant option; both with and without the password and still I cannot move ahead. The error message is a "mysql error 1045". There appears to be one PHP rule for Linux and another for Windows. Apart from the obvious of moving from Windows to Linux does anybody have any ideas or suggestion that will help me overcome this problem. From what I have read on the MySQL website there does not appear to be any help there as what I am trying to accomplish works in MySQL command mode. It only falls over, for me anyway, when trying the same thing using PHP & MySQL. ---- Original Message ----- From: "Michael Southwell" To: Sent: Saturday, September 22, 2007 12:41 AM Subject: Re: [nycphp-talk] MySQL Monitor V PHP & MySQL > Quoting PaulCheung : > >> I have researched, checked and tried everything I can think of and >> still cannot get it to work. > >> SELECT access_code FROM authorised_users WHEN > > I am not familiar with WHEN but that could be my own ignorance > >> $rs = @mysql_select_db( "test_db", $conn ) >> or die( "Could not select database" ); >> >> $rs = @mysql_select_db( "test_db", $conn ) or die( "Could not select >> database" ); > > This line is doubled but that is not your problem. > >> >> $sql = "SELECT access_code >> FROM authorised_users >> user_id = '$userid' AND > > This is the reason that you are getting different results: you left out > the WHEN that you had above (unless this is not an accurate > representation of your code); whether WHEN is a legitimate keyword is a > different issue. > > -- > 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 cliff at pinestream.com Mon Oct 1 12:32:10 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 01 Oct 2007 12:32:10 -0400 Subject: [nycphp-talk] Hosting Choices -- application infrastructure support or 100% security? Message-ID: So I have two ?managed? dedicated hosting choices: The first one claims to manage the entire application infrastructure with ?fanatical? support. Guess who. Very expensive, but it does appear as though they take on the entire sysadmin role (which I define as anything other than code), which looks like a bargain compared to hiring a dedicated sysadmin. The second claims to offer 100% security, but I will need to manage the application stack, meaning AMP, postfix, mysql/InnoDb backup strategy, etc. Never mind the fact that a security breach will result from something stupid like SQL injection, these guys do offer some pretty darn cool security features like intrusion protection, vulnerability scanning, F-Secure anti-virus, DDoS protection, Tripwire, and server hardening. After following NYPhP for the past year or two, I?m not a bad PhP hack, if I do say so. But managing Apache, MySQL, postfix, backups, etc. seems like a big effort and a big learning curve. Heck, I can barely use vi. And there?s only so many hours in the day. So what would you do if you were in my shoes? Go with the wiz-bang security and muddle thorough the application infrastructure learning cure. Or go with the fanatical support and be done with it, know that the security might not be as cutting edge? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From phplists at jellyandcustard.com Mon Oct 1 12:38:14 2007 From: phplists at jellyandcustard.com (Khalid Hanif) Date: Mon, 1 Oct 2007 17:38:14 +0100 Subject: [nycphp-talk] Hosting Choices -- application infrastructure support or 100% security? In-Reply-To: References: Message-ID: On 1 Oct 2007, at 17:32, Cliff Hirsch wrote: > The first one claims to manage the entire application > infrastructure with ?fanatical? support. Guess who. Very expensive, > but it does appear as though they take on the entire sysadmin role > (which I define as anything other than code), which looks like a > bargain compared to hiring a dedicated sysadmin. I have experience of this company on an enterprise level, and they are tip-top. In fact, in my 6-7 years in dealing with datacenters, I've not found one that is helpful as this. (Assuming we're talking about the same company - they begin with R...) Khalid -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Mon Oct 1 12:51:09 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 01 Oct 2007 12:51:09 -0400 Subject: [nycphp-talk] Hosting Choices -- application infrastructure support or 100% security? In-Reply-To: Message-ID: > On 1 Oct 2007, at 17:32, Cliff Hirsch wrote: > >> The first one claims to manage the entire application infrastructure with >> ?fanatical? support. Guess who. Very expensive, but it does appear as though >> they take on the entire sysadmin role (which I define as anything other than >> code), which looks like a bargain compared to hiring a dedicated sysadmin. > > I have experience of this company on an enterprise level, and they are > tip-top. In fact, in my 6-7 years in dealing with datacenters, I've not found > one that is helpful as this. > > (Assuming we're talking about the same company - they begin with R...) > > Khalid: > > Thanks. It is the R guys, although the security-focused provider is also an R > (red..., not rack...). Seems to me all the security in the world won?t make a > difference if I can get my act together for the application infrastructure. > Having a provider take ownership of it is very valuable. > > Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Mon Oct 1 12:59:04 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Mon, 01 Oct 2007 12:59:04 -0400 Subject: [nycphp-talk] Hosting Choices -- application infrastructure support or 100% security? In-Reply-To: References: Message-ID: <47012758.9070401@beezifies.com> Cliff Hirsch wrote: > So I have two ?managed? dedicated hosting choices: > > The first one claims to manage the entire application infrastructure > with ?fanatical? support. Guess who. Very expensive, but it does appear > as though they take on the entire sysadmin role (which I define as > anything other than code), which looks like a bargain compared to hiring > a dedicated sysadmin. > Can you have them install other daemon's on the system? For example, what if you want to run a sphinx search server, or a AIMbot server, etc. If not, what is the likelyhood of you wanting to? *eh* I'd go with the managed server these days so I can focus on the code. You can always move later if you decide you need more security/functionality. From 1j0lkq002 at sneakemail.com Mon Oct 1 15:56:23 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Mon, 01 Oct 2007 12:56:23 -0700 Subject: [nycphp-talk] neeed help In-Reply-To: <4700CF7D.30002@gmx.net> References: <783212.41158.qm@web59309.mail.re1.yahoo.com> <4700CF7D.30002@gmx.net> Message-ID: <13436-29302@sneakemail.com> David Krings ramons-at-gmx.net |nyphp dev/internal group use| wrote: > birgunj birgunj wrote: > >> Dear All, >> i am uploading ebooks on my website. i want to restrict user from >> downloading or printing the book.user should only read the document >> but cant not save or download or printing. >> how do we do this ? can anybody help me? its very urgent.if any >> software which can do it, then plz give me the name of that software >> also. >> >> thanks to all in advance. >> >> humayoo >> > There were many discussions about this in the past months and they all > resulted to this being a futile attempt. In order to display the > content in a browser the users have to download the file. This is how > the WWW works. Printing is as easy by pressing Print Screen. There are > some attempts to stop caching, obfuscating the real source URL of the > file, and some tricks disabling the most obvious functions for > printing and saving, which may or may not work depending on browser used. > > As I pointed out back then, you try to solve a management problem with > technology and that never works. Your ebooks need to be priced right > and be of such a high quality that the users do want to pay you for > them. If that doesn't fit your business model, seek out avenues other > than online distribution. The only good idea that I have is > self-desctructing CDs, which yet have to be invented. > > Good luck, you will need it for what you want to do. > > David Not to be contrary :-) but there is *always* a way. In this case there are social engineering approaches to the application of technology which work, but they don't involve PHP any more than building an HTML form or writing a PDF file might involve PHP. No, I won't explain them, and anyway people who look for scripts and "software" to protect their eBook websites don't usually commit adequate resources to execute effectively. People log into web pages they would never want to print or distribute every single day of the year. It's not about prevention, but persuasion. Think about that, and you'll see some possibilities. -=john andrews -- ------------------------------------------------------------- You never really know how good you can until someone competes against you right in your own space. It's thrilling, invigorating, and empowering. Unless you lose. Then it sucks. --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From ramons at gmx.net Mon Oct 1 18:54:57 2007 From: ramons at gmx.net (David Krings) Date: Mon, 01 Oct 2007 18:54:57 -0400 Subject: [nycphp-talk] neeed help In-Reply-To: <13436-29302@sneakemail.com> References: <783212.41158.qm@web59309.mail.re1.yahoo.com> <4700CF7D.30002@gmx.net> <13436-29302@sneakemail.com> Message-ID: <47017AC1.1090706@gmx.net> inforequest wrote: > > Not to be contrary :-) but there is *always* a way. > OK, then craft a web page that has something in it that disables using Print Screen. Show me that and I'll be a believer. Until then I stand to what I wrote earlier. OK, and not posting it on a page is cheating. ;) David From 1j0lkq002 at sneakemail.com Tue Oct 2 04:06:09 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 02 Oct 2007 01:06:09 -0700 Subject: [OT] Re: [nycphp-talk] neeed help In-Reply-To: <47017AC1.1090706@gmx.net> References: <783212.41158.qm@web59309.mail.re1.yahoo.com> <4700CF7D.30002@gmx.net> <13436-29302@sneakemail.com> <47017AC1.1090706@gmx.net> Message-ID: <32428-72288@sneakemail.com> David Krings ramons-at-gmx.net |nyphp dev/internal group use| wrote: > inforequest wrote: > >> >> Not to be contrary :-) but there is *always* a way. >> > > OK, then craft a web page that has something in it that disables using > Print Screen. Show me that and I'll be a believer. Until then I stand > to what I wrote earlier. OK, and not posting it on a page is cheating. ;) > > David David you have to think outside the box. It's not about technology... it's about causing the user to not *want* to print that screen, or save and share/email/etc. That's all I'll say ;-) -=john From ramons at gmx.net Tue Oct 2 06:58:29 2007 From: ramons at gmx.net (David Krings) Date: Tue, 02 Oct 2007 06:58:29 -0400 Subject: [OT] Re: [nycphp-talk] neeed help In-Reply-To: <32428-72288@sneakemail.com> References: <783212.41158.qm@web59309.mail.re1.yahoo.com> <4700CF7D.30002@gmx.net> <13436-29302@sneakemail.com> <47017AC1.1090706@gmx.net> <32428-72288@sneakemail.com> Message-ID: <47022455.8000403@gmx.net> inforequest wrote: > David Krings ramons-at-gmx.net |nyphp dev/internal group use| wrote: > >> inforequest wrote: >> >>> >>> Not to be contrary :-) but there is *always* a way. >>> >> >> OK, then craft a web page that has something in it that disables using >> Print Screen. Show me that and I'll be a believer. Until then I stand >> to what I wrote earlier. OK, and not posting it on a page is cheating. ;) >> >> David > > David you have to think outside the box. It's not about technology... > it's about causing the user to not *want* to print that screen, or save > and share/email/etc. That's all I'll say ;-) > > -=john Yes, and that is all I wrote in my initial reply. David From ioplex at gmail.com Tue Oct 2 12:04:13 2007 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 2 Oct 2007 12:04:13 -0400 Subject: [nycphp-talk] Apache Directives to Disable All Scripts in Sub-Directory? Message-ID: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> Hey, I would like to have a directory under ~/public_html that completely disables all mime time interpretations. Specifically, if I put a php or cgi file in there I want people to see the PHP. I tried the following just to see if I could disable .php but it had no effect. RemoveType .php Order allow,deny Allow from all Options Indexes Any ideas? Mike From matteo.rinaudo at gmail.com Tue Oct 2 14:10:11 2007 From: matteo.rinaudo at gmail.com (Matteo Rinaudo) Date: Tue, 2 Oct 2007 14:10:11 -0400 Subject: [nycphp-talk] Apache Directives to Disable All Scripts in Sub-Directory? In-Reply-To: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> References: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> Message-ID: > I tried the following just to see if I could disable .php but it had no effect. > > > RemoveType .php > Order allow,deny > Allow from all > Options Indexes > Hi, I am not sure if this helps, but, from the httpd manual: RemoveType directives are processed after any AddType directives, so it is possible they may undo the effects of the latter if both occur within the same directory configuration. You may want to check your global server configuration, give it a try. Matteo From cliff at pinestream.com Tue Oct 2 14:35:12 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 02 Oct 2007 14:35:12 -0400 Subject: [nycphp-talk] Apache Directives to Disable All Scripts in Sub-Directory? In-Reply-To: Message-ID: >> I tried the following just to see if I could disable .php but it had no >> effect. >> >> >> RemoveType .php >> Order allow,deny >> Allow from all >> Options Indexes >> > > Hi, > I am not sure if this helps, but, from the httpd manual: > > RemoveType directives are processed after any AddType directives, so > it is possible they may undo the effects of the latter if both occur > within the same directory configuration. > > You may want to check your global server configuration, give it a try. Make sure you have Override FileInfo in a highly layer directive as well. From ioplex at gmail.com Tue Oct 2 14:36:03 2007 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 2 Oct 2007 14:36:03 -0400 Subject: [nycphp-talk] Apache Directives to Disable All Scripts in Sub-Directory? In-Reply-To: References: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> Message-ID: <78c6bd860710021136h152cae60w766e7e22bd23abc0@mail.gmail.com> On 10/2/07, Matteo Rinaudo wrote: > > I tried the following just to see if I could disable .php but it had no effect. > > > > > > RemoveType .php > > Order allow,deny > > Allow from all > > Options Indexes > > > > Hi, > I am not sure if this helps, but, from the httpd manual: > > RemoveType directives are processed after any AddType directives, so > it is possible they may undo the effects of the latter if both occur > within the same directory configuration. As it turns out, this is actually really hard to do. It does not seem possible to redefine a subdirectory of public_html. Many directives in .htaccess are just ignored or generate errors when you know they're supposed to work. I managed to create a separate directory not under public_html without a .htaccess that worked (mostly - index.php was still preventing directory indexing). If would be nice if there was an Apache directive that meant "clear everything and treat all content as static text/plain, unconditionally, everwhere". Mike From rmarscher at beaffinitive.com Tue Oct 2 17:15:42 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 2 Oct 2007 17:15:42 -0400 Subject: [OT] Re: [nycphp-talk] neeed help In-Reply-To: <32428-72288@sneakemail.com> References: <783212.41158.qm@web59309.mail.re1.yahoo.com> <4700CF7D.30002@gmx.net> <13436-29302@sneakemail.com> <47017AC1.1090706@gmx.net> <32428-72288@sneakemail.com> Message-ID: <68DED278-8AA6-4B3F-9AB6-5BBC3A70C49A@beaffinitive.com> On Oct 2, 2007, at 4:06 AM, inforequest wrote: > David Krings ramons-at-gmx.net |nyphp dev/internal group use| wrote: >> inforequest wrote: >>> Not to be contrary :-) but there is *always* a way. >> OK, then craft a web page that has something in it that disables >> using Print Screen. Show me that and I'll be a believer. Until >> then I stand to what I wrote earlier. OK, and not posting it on a >> page is cheating. ;) >> David > David you have to think outside the box. It's not about > technology... it's about causing the user to not *want* to print > that screen, or save and share/email/etc. That's all I'll say ;-) OK... now I have to know... make it include personal information about the user (social security/credit card info/nude pictures)? I guess photoshop could get rid of that though. Hmm.... On a more serious note, a friend recently told me what some labels are doing with their album pre-releases to the press. Each album is stamped with some inaudible frequency over the whole thing. Then if the album got leaked, the label could take the leaked version, check out which frequency is on it, and then look up who leaked it and call in the lawyers. Of course... how long until people figure out how to get rid of those frequencies? Let's just make everything free. :) From urb at e-government.com Tue Oct 2 21:00:04 2007 From: urb at e-government.com (Urb LeJeune) Date: Tue, 02 Oct 2007 21:00:04 -0400 Subject: [nycphp-talk] Premature submit In-Reply-To: <78c6bd860710021136h152cae60w766e7e22bd23abc0@mail.gmail.co m> References: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> <78c6bd860710021136h152cae60w766e7e22bd23abc0@mail.gmail.com> Message-ID: <7.0.1.0.2.20071002205640.029e8640@e-government.com> Had a client who twice lost existing content while making a change using a CMS. Turns out the problem was they he was using a DSL line and he made a change and hit the "Submit Changes" button before the page had fully downloaded. Needless to say the undownloaded textarea fields were empty and were written to the DB. Is there a way to disallow a form submit before the entire form has downloaded? Thanks Urb Dr. Urban A. LeJeune, President E-Government.com 800-204-9545 From arzala at gmail.com Wed Oct 3 00:10:29 2007 From: arzala at gmail.com (Anirudh Zala) Date: Wed, 3 Oct 2007 09:40:29 +0530 Subject: [nycphp-talk] Premature submit In-Reply-To: <7.0.1.0.2.20071002205640.029e8640@e-government.com> References: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> <78c6bd860710021136h152cae60w766e7e22bd23abc0@mail.gmail.com> <7.0.1.0.2.20071002205640.029e8640@e-government.com> Message-ID: <200710030940.29375.arzala@gmail.com> On Wednesday 03 Oct 2007 06:30:04 Urb LeJeune wrote: > Had a client who twice lost existing content while making a change > using a CMS. Turns out the problem was they he was using a DSL line > and he made a change and hit the "Submit Changes" button before the > page had fully downloaded. Needless to say the undownloaded textarea > fields were empty and were written to the DB. > > Is there a way to disallow a form submit before the entire form > has downloaded? Simplest solution is to keep submit button disabled by default, and then enabling it by javascript when page is loaded. Technically it can be done like this. # While writing submit tag, keep it disabled by default. # In the form where this button exists, put javascript code at the end of page to make it enabled. By this way until page will get reloaded, Submit button would not be available in press/click mode. Thanks Anirudh Zala > > Thanks > > Urb > > Dr. Urban A. LeJeune, President > E-Government.com > 800-204-9545 > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From lists at enobrev.com Wed Oct 3 00:24:47 2007 From: lists at enobrev.com (Mark Armendariz) Date: Wed, 03 Oct 2007 00:24:47 -0400 Subject: [nycphp-talk] Premature submit In-Reply-To: <200710030940.29375.arzala@gmail.com> References: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> <78c6bd860710021136h152cae60w766e7e22bd23abc0@mail.gmail.com> <7.0.1.0.2.20071002205640.029e8640@e-government.com> <200710030940.29375.arzala@gmail.com> Message-ID: <4703198F.5060305@enobrev.com> Anirudh Zala wrote: > On Wednesday 03 Oct 2007 06:30:04 Urb LeJeune wrote: > >> Had a client who twice lost existing content while making a change >> using a CMS. Turns out the problem was they he was using a DSL line >> and he made a change and hit the "Submit Changes" button before the >> page had fully downloaded. Needless to say the undownloaded textarea >> fields were empty and were written to the DB. >> >> Is there a way to disallow a form submit before the entire form >> has downloaded? >> > > Simplest solution is to keep submit button disabled by default, and then > enabling it by javascript when page is loaded. > > Technically it can be done like this. > > # While writing submit tag, keep it disabled by default. > # In the form where this button exists, put javascript code at the end of page > to make it enabled. > > By this way until page will get reloaded, Submit button would not be available > in press/click mode. > > Thanks > > Anirudh Zala Agreed. Also, in case the user hits enter to submit, you should force the form's onsubmit to do nothing while form is loading. You can also check that the form was fully loaded on the server side (in case javascript was off or otherwise futzed with), by checking for the existence of the last field in the form. As long as it's not a checkbox / radio button, even if it's blank it'll still send the data. if (array_key_exists('last_field', $_POST) === false) { // show form with warning or change sql to exclude field } Mark Armendariz -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Wed Oct 3 08:42:24 2007 From: tedd at sperling.com (tedd) Date: Wed, 3 Oct 2007 08:42:24 -0400 Subject: [nycphp-talk] Premature submit In-Reply-To: <7.0.1.0.2.20071002205640.029e8640@e-government.com> References: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> <78c6bd860710021136h152cae60w766e7e22bd23abc0@mail.gmail.com> <7.0.1.0.2.20071002205640.029e8640@e-government.com> Message-ID: At 9:00 PM -0400 10/2/07, Urb LeJeune wrote: > Had a client who twice lost existing content while making a change >using a CMS. Turns out the problem was they he was using a DSL line >and he made a change and hit the "Submit Changes" button before the >page had fully downloaded. Needless to say the undownloaded textarea >fields were empty and were written to the DB. > > Is there a way to disallow a form submit before the entire form >has downloaded? > > Thanks > >Urb Urb: I don't understand the download problem, but the rest can be done via javascript. Please review this: http://webbytedd.com/c/form-submit/ If you use js to check client-side before submitting server-side, then by definition it would require the entire form (required fields) to be downloaded and filled out before sending. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From aw at sap8.com Wed Oct 3 09:57:06 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 3 Oct 2007 09:57:06 -0400 Subject: [nycphp-talk] Scripting to get a backup of your current MySQL database. Message-ID: <004201c805c5$48d146b0$da73d410$@com> I was confused on the relevance of this topic but since PHP and MySQL go together like PB&J I thought it would be relevant. It has gotten to the point that the application that I built for candidate tracking is growing astronomically so now I was given the task of backing up our data. So far our Apache/Drupal installation is backed up and SCP'ed to a secure server. My one big problem is backing up our MySQL database. Does the script "mysqlhotcopy" have the same drawback as just copy the files manually (frm, MYD, MYI) in the sense that the server can't be updating anything. To be honest I can't guarantee that no one in the office will not be using the system at certain times so it might present a problem. Would it be easier to just to script something that follows this logic: Pre: rename index.php, copy in temp file with downtime message 1.) Stop daemon. 2.) Copy all the table files *.frm, *.MYD, *.MYI files, tar/gzip them 3.) SCP archive offsite 4.) Delete temp folder 5.) Restart daemon. Post: delete temp file, rename file back to index.php Is it unrealistic for my office to expect 100% uptime, even at 3:30 am in the morning (those whacky recruiters). Anthony Wlodarski aw at sap8.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Wed Oct 3 10:03:40 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 03 Oct 2007 10:03:40 -0400 Subject: [nycphp-talk] Scripting to get a backup of your current MySQL database. In-Reply-To: <004201c805c5$48d146b0$da73d410$@com> Message-ID: On 10/3/07 9:57 AM, "Anthony Wlodarski" wrote: > I was confused on the relevance of this topic but since PHP and MySQL go > together like PB&J I thought it would be relevant. > > It has gotten to the point that the application that I built for candidate > tracking is growing astronomically so now I was given the task of backing up > our data. So far our Apache/Drupal installation is backed up and SCP?ed to a > secure server. My one big problem is backing up our MySQL database. Does the > script ?mysqlhotcopy? have the same drawback as just copy the files manually > (frm, MYD, MYI) in the sense that the server can?t be updating anything. To > be honest I can?t guarantee that no one in the office will not be using the > system at certain times so it might present a problem. Would it be easier to > just to script something that follows this logic: > > Pre: rename index.php, copy in temp file with downtime message > > 1.) Stop daemon. > > 2.) Copy all the table files *.frm, *.MYD, *.MYI files, tar/gzip them > > 3.) SCP archive offsite > > 4.) Delete temp folder > > 5.) Restart daemon. > > > Post: delete temp file, rename file back to index.php > > Is it unrealistic for my office to expect 100% uptime, even at 3:30 am in the > morning (those whacky recruiters). > > Anthony Wlodarski > aw at sap8.com > > First off, what engines do you use? Mysqlhotcopy does not work for the Innodb > engine. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw at sap8.com Wed Oct 3 10:18:59 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 3 Oct 2007 10:18:59 -0400 Subject: [nycphp-talk] Scripting to get a backup of your current MySQL database. In-Reply-To: References: <004201c805c5$48d146b0$da73d410$@com> Message-ID: <005601c805c8$57176c10$05464430$@com> Cliff, I believe we use MyISAM and after verifying it with phpMyAdmin all the types for our tables are MyISAM. Regards, Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Cliff Hirsch Sent: Wednesday, October 03, 2007 10:04 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Scripting to get a backup of your current MySQL database. On 10/3/07 9:57 AM, "Anthony Wlodarski" wrote: I was confused on the relevance of this topic but since PHP and MySQL go together like PB&J I thought it would be relevant. It has gotten to the point that the application that I built for candidate tracking is growing astronomically so now I was given the task of backing up our data. So far our Apache/Drupal installation is backed up and SCP'ed to a secure server. My one big problem is backing up our MySQL database. Does the script "mysqlhotcopy" have the same drawback as just copy the files manually (frm, MYD, MYI) in the sense that the server can't be updating anything. To be honest I can't guarantee that no one in the office will not be using the system at certain times so it might present a problem. Would it be easier to just to script something that follows this logic: Pre: rename index.php, copy in temp file with downtime message 1.) Stop daemon. 2.) Copy all the table files *.frm, *.MYD, *.MYI files, tar/gzip them 3.) SCP archive offsite 4.) Delete temp folder 5.) Restart daemon. Post: delete temp file, rename file back to index.php Is it unrealistic for my office to expect 100% uptime, even at 3:30 am in the morning (those whacky recruiters). Anthony Wlodarski aw at sap8.com First off, what engines do you use? Mysqlhotcopy does not work for the Innodb engine. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Wed Oct 3 10:24:41 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 03 Oct 2007 10:24:41 -0400 Subject: [nycphp-talk] Scripting to get a backup of your current MySQL database. In-Reply-To: <005601c805c8$57176c10$05464430$@com> Message-ID: I?m no expert, but it that?s the case, I believe you can just use mysqlhotcopy, without stopping the database. Even if it does a lock, it should be very fast, since its a file copy, not a dump. On 10/3/07 10:18 AM, "Anthony Wlodarski" wrote: > Cliff, > > I believe we use MyISAM and after verifying it with phpMyAdmin all the types > for our tables are MyISAM. > > Regards, > > > Anthony Wlodarski > Senior Technical Recruiter > Shulman Fleming & Partners > 646-285-0500 x230 > aw at sap8.com > > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of Cliff Hirsch > Sent: Wednesday, October 03, 2007 10:04 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Scripting to get a backup of your current MySQL > database. > > On 10/3/07 9:57 AM, "Anthony Wlodarski" wrote: > I was confused on the relevance of this topic but since PHP and MySQL go > together like PB&J I thought it would be relevant. > > It has gotten to the point that the application that I built for candidate > tracking is growing astronomically so now I was given the task of backing up > our data. So far our Apache/Drupal installation is backed up and SCP?ed to a > secure server. My one big problem is backing up our MySQL database. Does the > script ?mysqlhotcopy? have the same drawback as just copy the files manually > (frm, MYD, MYI) in the sense that the server can?t be updating anything. To > be honest I can?t guarantee that no one in the office will not be using the > system at certain times so it might present a problem. Would it be easier to > just to script something that follows this logic: > > Pre: rename index.php, copy in temp file with downtime message > > 1.) Stop daemon. > > 2.) Copy all the table files *.frm, *.MYD, *.MYI files, tar/gzip them > > 3.) SCP archive offsite > > 4.) Delete temp folder > > 5.) Restart daemon. > > > Post: delete temp file, rename file back to index.php > > Is it unrealistic for my office to expect 100% uptime, even at 3:30 am in the > morning (those whacky recruiters). > > Anthony Wlodarski > aw at sap8.com > > First off, what engines do you use? Mysqlhotcopy does not work for the Innodb > engine. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw at sap8.com Wed Oct 3 10:34:48 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 3 Oct 2007 10:34:48 -0400 Subject: [nycphp-talk] Scripting to get a backup of your current MySQL database. In-Reply-To: References: <005601c805c8$57176c10$05464430$@com> Message-ID: <006f01c805ca$8d0be9c0$a723bd40$@com> I will set cron to run the scrip tonight and I will let you know how it goes. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Cliff Hirsch Sent: Wednesday, October 03, 2007 10:25 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Scripting to get a backup of your current MySQL database. I'm no expert, but it that's the case, I believe you can just use mysqlhotcopy, without stopping the database. Even if it does a lock, it should be very fast, since its a file copy, not a dump. On 10/3/07 10:18 AM, "Anthony Wlodarski" wrote: Cliff, I believe we use MyISAM and after verifying it with phpMyAdmin all the types for our tables are MyISAM. Regards, Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Cliff Hirsch Sent: Wednesday, October 03, 2007 10:04 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Scripting to get a backup of your current MySQL database. On 10/3/07 9:57 AM, "Anthony Wlodarski" wrote: I was confused on the relevance of this topic but since PHP and MySQL go together like PB&J I thought it would be relevant. It has gotten to the point that the application that I built for candidate tracking is growing astronomically so now I was given the task of backing up our data. So far our Apache/Drupal installation is backed up and SCP'ed to a secure server. My one big problem is backing up our MySQL database. Does the script "mysqlhotcopy" have the same drawback as just copy the files manually (frm, MYD, MYI) in the sense that the server can't be updating anything. To be honest I can't guarantee that no one in the office will not be using the system at certain times so it might present a problem. Would it be easier to just to script something that follows this logic: Pre: rename index.php, copy in temp file with downtime message 1.) Stop daemon. 2.) Copy all the table files *.frm, *.MYD, *.MYI files, tar/gzip them 3.) SCP archive offsite 4.) Delete temp folder 5.) Restart daemon. Post: delete temp file, rename file back to index.php Is it unrealistic for my office to expect 100% uptime, even at 3:30 am in the morning (those whacky recruiters). Anthony Wlodarski aw at sap8.com First off, what engines do you use? Mysqlhotcopy does not work for the Innodb engine. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sfranciuos at gmail.com Wed Oct 3 11:21:10 2007 From: sfranciuos at gmail.com (Franciuos K S X) Date: Wed, 3 Oct 2007 18:21:10 +0300 Subject: [nycphp-talk] Re: talk Digest, Vol 12, Issue 4 In-Reply-To: <4703a068.1626360a.542e.ffff9edaSMTPIN_ADDED@mx.google.com> References: <4703a068.1626360a.542e.ffff9edaSMTPIN_ADDED@mx.google.com> Message-ID: <5d44d6b80710030821t24e483f2jcf7805ff25853375@mail.gmail.com> Hi All, Hey am very green about programming but i wanted to start on PHP?is that possible ? if so then i call upon anyone to help me get started otherwise am badly off yet i need the knowledge please if anyone knows or has any ideas, links, tutorials etc help me. Tks, Franciuos. On 10/3/07, talk-request at lists.nyphp.org wrote: > > 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. Apache Directives to Disable All Scripts in Sub-Directory? > (Michael B Allen) > 2. Re: Apache Directives to Disable All Scripts in > Sub-Directory? (Matteo Rinaudo) > 3. Re: Apache Directives to Disable All Scripts in > Sub-Directory? (Cliff Hirsch) > 4. Re: Apache Directives to Disable All Scripts in > Sub-Directory? (Michael B Allen) > 5. Re: [OT] Re: [nycphp-talk] neeed help (Rob Marscher) > 6. Premature submit (Urb LeJeune) > 7. Re: Premature submit (Anirudh Zala) > 8. Re: Premature submit (Mark Armendariz) > 9. Re: Premature submit (tedd) > 10. Scripting to get a backup of your current MySQL database. > (Anthony Wlodarski) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 2 Oct 2007 12:04:13 -0400 > From: "Michael B Allen" > Subject: [nycphp-talk] Apache Directives to Disable All Scripts in > Sub-Directory? > To: nyphp > Message-ID: > <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hey, > > I would like to have a directory under ~/public_html that completely > disables all mime time interpretations. Specifically, if I put a php > or cgi file in there I want people to see the PHP. > > I tried the following just to see if I could disable .php but it had no > effect. > > > RemoveType .php > Order allow,deny > Allow from all > Options Indexes > > > Any ideas? > > Mike > > > ------------------------------ > > Message: 2 > Date: Tue, 2 Oct 2007 14:10:11 -0400 > From: "Matteo Rinaudo" > Subject: Re: [nycphp-talk] Apache Directives to Disable All Scripts in > Sub-Directory? > To: "NYPHP Talk" > Message-ID: > > Content-Type: text/plain; charset=UTF-8 > > > I tried the following just to see if I could disable .php but it had no > effect. > > > > > > RemoveType .php > > Order allow,deny > > Allow from all > > Options Indexes > > > > Hi, > I am not sure if this helps, but, from the httpd manual: > > RemoveType directives are processed after any AddType directives, so > it is possible they may undo the effects of the latter if both occur > within the same directory configuration. > > You may want to check your global server configuration, give it a try. > > Matteo > > > ------------------------------ > > Message: 3 > Date: Tue, 02 Oct 2007 14:35:12 -0400 > From: Cliff Hirsch > Subject: Re: [nycphp-talk] Apache Directives to Disable All Scripts in > Sub-Directory? > To: NYPHP Talk > Message-ID: > Content-Type: text/plain; charset="US-ASCII" > > >> I tried the following just to see if I could disable .php but it had no > >> effect. > >> > >> > >> RemoveType .php > >> Order allow,deny > >> Allow from all > >> Options Indexes > >> > > > > Hi, > > I am not sure if this helps, but, from the httpd manual: > > > > RemoveType directives are processed after any AddType directives, so > > it is possible they may undo the effects of the latter if both occur > > within the same directory configuration. > > > > You may want to check your global server configuration, give it a try. > > Make sure you have Override FileInfo in a highly layer directive as well. > > > > > ------------------------------ > > Message: 4 > Date: Tue, 2 Oct 2007 14:36:03 -0400 > From: "Michael B Allen" > Subject: Re: [nycphp-talk] Apache Directives to Disable All Scripts in > Sub-Directory? > To: "NYPHP Talk" > Message-ID: > <78c6bd860710021136h152cae60w766e7e22bd23abc0 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On 10/2/07, Matteo Rinaudo wrote: > > > I tried the following just to see if I could disable .php but it had > no effect. > > > > > > > > > RemoveType .php > > > Order allow,deny > > > Allow from all > > > Options Indexes > > > > > > > Hi, > > I am not sure if this helps, but, from the httpd manual: > > > > RemoveType directives are processed after any AddType directives, so > > it is possible they may undo the effects of the latter if both occur > > within the same directory configuration. > > As it turns out, this is actually really hard to do. > > It does not seem possible to redefine a subdirectory of public_html. > Many directives in .htaccess are just ignored or generate errors when > you know they're supposed to work. I managed to create a separate > directory not under public_html without a .htaccess that worked > (mostly - index.php was still preventing directory indexing). > > If would be nice if there was an Apache directive that meant "clear > everything and treat all content as static text/plain, > unconditionally, everwhere". > > Mike > > > ------------------------------ > > Message: 5 > Date: Tue, 2 Oct 2007 17:15:42 -0400 > From: Rob Marscher > Subject: Re: [OT] Re: [nycphp-talk] neeed help > To: NYPHP Talk > Message-ID: <68DED278-8AA6-4B3F-9AB6-5BBC3A70C49A at beaffinitive.com> > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > On Oct 2, 2007, at 4:06 AM, inforequest wrote: > > David Krings ramons-at-gmx.net |nyphp dev/internal group use| wrote: > >> inforequest wrote: > >>> Not to be contrary :-) but there is *always* a way. > >> OK, then craft a web page that has something in it that disables > >> using Print Screen. Show me that and I'll be a believer. Until > >> then I stand to what I wrote earlier. OK, and not posting it on a > >> page is cheating. ;) > >> David > > David you have to think outside the box. It's not about > > technology... it's about causing the user to not *want* to print > > that screen, or save and share/email/etc. That's all I'll say ;-) > OK... now I have to know... make it include personal information > about the user (social security/credit card info/nude pictures)? I > guess photoshop could get rid of that though. Hmm.... > > On a more serious note, a friend recently told me what some labels > are doing with their album pre-releases to the press. Each album is > stamped with some inaudible frequency over the whole thing. Then if > the album got leaked, the label could take the leaked version, check > out which frequency is on it, and then look up who leaked it and call > in the lawyers. Of course... how long until people figure out how to > get rid of those frequencies? > > Let's just make everything free. :) > > > ------------------------------ > > Message: 6 > Date: Tue, 02 Oct 2007 21:00:04 -0400 > From: Urb LeJeune > Subject: [nycphp-talk] Premature submit > To: NYPHP Talk > Message-ID: <7.0.1.0.2.20071002205640.029e8640 at e-government.com> > Content-Type: text/plain; charset="us-ascii"; format=flowed > > Had a client who twice lost existing content while making a change > using a CMS. Turns out the problem was they he was using a DSL line > and he made a change and hit the "Submit Changes" button before the > page had fully downloaded. Needless to say the undownloaded textarea > fields were empty and were written to the DB. > > Is there a way to disallow a form submit before the entire form > has downloaded? > > Thanks > > Urb > > Dr. Urban A. LeJeune, President > E-Government.com > 800-204-9545 > > > > > ------------------------------ > > Message: 7 > Date: Wed, 3 Oct 2007 09:40:29 +0530 > From: Anirudh Zala > Subject: Re: [nycphp-talk] Premature submit > To: NYPHP Talk > Message-ID: <200710030940.29375.arzala at gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > On Wednesday 03 Oct 2007 06:30:04 Urb LeJeune wrote: > > Had a client who twice lost existing content while making a change > > using a CMS. Turns out the problem was they he was using a DSL line > > and he made a change and hit the "Submit Changes" button before the > > page had fully downloaded. Needless to say the undownloaded textarea > > fields were empty and were written to the DB. > > > > Is there a way to disallow a form submit before the entire form > > has downloaded? > > Simplest solution is to keep submit button disabled by default, and then > enabling it by javascript when page is loaded. > > Technically it can be done like this. > > # While writing submit tag, keep it disabled by default. > # In the form where this button exists, put javascript code at the end of > page > to make it enabled. > > By this way until page will get reloaded, Submit button would not be > available > in press/click mode. > > Thanks > > Anirudh Zala > > > > > Thanks > > > > Urb > > > > Dr. Urban A. LeJeune, President > > E-Government.com > > 800-204-9545 > > > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/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: 8 > Date: Wed, 03 Oct 2007 00:24:47 -0400 > From: Mark Armendariz > Subject: Re: [nycphp-talk] Premature submit > To: NYPHP Talk > Message-ID: <4703198F.5060305 at enobrev.com> > Content-Type: text/plain; charset="utf-8" > > Anirudh Zala wrote: > > On Wednesday 03 Oct 2007 06:30:04 Urb LeJeune wrote: > > > >> Had a client who twice lost existing content while making a change > >> using a CMS. Turns out the problem was they he was using a DSL line > >> and he made a change and hit the "Submit Changes" button before the > >> page had fully downloaded. Needless to say the undownloaded textarea > >> fields were empty and were written to the DB. > >> > >> Is there a way to disallow a form submit before the entire form > >> has downloaded? > >> > > > > Simplest solution is to keep submit button disabled by default, and then > > enabling it by javascript when page is loaded. > > > > Technically it can be done like this. > > > > # While writing submit tag, keep it disabled by default. > > # In the form where this button exists, put javascript code at the end > of page > > to make it enabled. > > > > By this way until page will get reloaded, Submit button would not be > available > > in press/click mode. > > > > Thanks > > > > Anirudh Zala > Agreed. Also, in case the user hits enter to submit, you should force > the form's onsubmit to do nothing while form is loading. > > You can also check that the form was fully loaded on the server side (in > case javascript was off or otherwise futzed with), by checking for the > existence of the last field in the form. As long as it's not a checkbox > / radio button, even if it's blank it'll still send the data. > > if (array_key_exists('last_field', $_POST) === false) { > // show form with warning or change sql to exclude field > } > > Mark Armendariz > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://lists.nyphp.org/pipermail/talk/attachments/20071003/5a3f580b/attachment-0001.html > > ------------------------------ > > Message: 9 > Date: Wed, 3 Oct 2007 08:42:24 -0400 > From: tedd > Subject: Re: [nycphp-talk] Premature submit > To: NYPHP Talk > Message-ID: > Content-Type: text/plain; charset="us-ascii" ; format="flowed" > > At 9:00 PM -0400 10/2/07, Urb LeJeune wrote: > > Had a client who twice lost existing content while making a change > >using a CMS. Turns out the problem was they he was using a DSL line > >and he made a change and hit the "Submit Changes" button before the > >page had fully downloaded. Needless to say the undownloaded textarea > >fields were empty and were written to the DB. > > > > Is there a way to disallow a form submit before the entire form > >has downloaded? > > > > Thanks > > > >Urb > > Urb: > > I don't understand the download problem, but the rest can be done via > javascript. Please review this: > > http://webbytedd.com/c/form-submit/ > > If you use js to check client-side before submitting server-side, > then by definition it would require the entire form (required fields) > to be downloaded and filled out before sending. > > Cheers, > > tedd > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.com > > > ------------------------------ > > Message: 10 > Date: Wed, 3 Oct 2007 09:57:06 -0400 > From: "Anthony Wlodarski" > Subject: [nycphp-talk] Scripting to get a backup of your current MySQL > database. > To: "'NYPHP Talk'" > Message-ID: <004201c805c5$48d146b0$da73d410$@com> > Content-Type: text/plain; charset="us-ascii" > > I was confused on the relevance of this topic but since PHP and MySQL go > together like PB&J I thought it would be relevant. > > > > It has gotten to the point that the application that I built for candidate > tracking is growing astronomically so now I was given the task of backing > up > our data. So far our Apache/Drupal installation is backed up and SCP'ed > to > a secure server. My one big problem is backing up our MySQL > database. Does > the script "mysqlhotcopy" have the same drawback as just copy the files > manually (frm, MYD, MYI) in the sense that the server can't be updating > anything. To be honest I can't guarantee that no one in the office will > not > be using the system at certain times so it might present a problem. Would > it be easier to just to script something that follows this logic: > > > > Pre: rename index.php, copy in temp file with downtime message > > > > 1.) Stop daemon. > > 2.) Copy all the table files *.frm, *.MYD, *.MYI files, tar/gzip them > > 3.) SCP archive offsite > > 4.) Delete temp folder > > 5.) Restart daemon. > > > > Post: delete temp file, rename file back to index.php > > > > Is it unrealistic for my office to expect 100% uptime, even at 3:30 am in > the morning (those whacky recruiters). > > > > Anthony Wlodarski > > aw at sap8.com > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://lists.nyphp.org/pipermail/talk/attachments/20071003/ec52219e/attachment.html > > ------------------------------ > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > End of talk Digest, Vol 12, Issue 4 > *********************************** > -- sfx -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw at sap8.com Wed Oct 3 11:32:04 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 3 Oct 2007 11:32:04 -0400 Subject: [nycphp-talk] Re: talk Digest, Vol 12, Issue 4 In-Reply-To: <5d44d6b80710030821t24e483f2jcf7805ff25853375@mail.gmail.com> References: <4703a068.1626360a.542e.ffff9edaSMTPIN_ADDED@mx.google.com> <5d44d6b80710030821t24e483f2jcf7805ff25853375@mail.gmail.com> Message-ID: <009601c805d2$8d20b0a0$a76211e0$@com> Franciuos, I started at www.php.net, more specifically this link: http://www.php.net/manual/en/tutorial.php. I cannot recommend any books since I have not purchased any but can point you to some links to tutorials online: http://www.tizag.com/phpT/. Also reading the topics and discussions on this mailing list are a good way to learn as well. Regards, Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rolan at omnistep.com Wed Oct 3 11:43:41 2007 From: rolan at omnistep.com (Rolan Yang) Date: Wed, 03 Oct 2007 11:43:41 -0400 Subject: [nycphp-talk] Scripting to get a backup of your current MySQL database. In-Reply-To: <004201c805c5$48d146b0$da73d410$@com> References: <004201c805c5$48d146b0$da73d410$@com> Message-ID: <4703B8AD.1090904@omnistep.com> If you want to do a database backup with no downtime, replicate to a second mysql machine. You can stop the slave and perform a dump. Then after the dump is complete, it will sync back up upon restart. If you're really tight on hardware resources, you might even be able to start a second instance of mysql (listening on a different port/socket) and do it all on the same machine. ~Rolan Anthony Wlodarski wrote: > > I was confused on the relevance of this topic but since PHP and MySQL > go together like PB&J I thought it would be relevant. > > It has gotten to the point that the application that I built for > candidate tracking is growing astronomically so now I was given the > task of backing up our data. So far our Apache/Drupal installation is > backed up and SCP?ed to a secure server. My one big problem is backing > up our MySQL database. Does the script ?mysqlhotcopy? have the same > drawback as just copy the files manually (frm, MYD, MYI) in the sense > that the server can?t be updating anything. To be honest I can?t > guarantee that no one in the office will not be using the system at > certain times so it might present a problem. Would it be easier to > just to script something that follows this logic: > > Pre: rename index.php, copy in temp file with downtime message > > 1.) Stop daemon. > > 2.) Copy all the table files *.frm, *.MYD, *.MYI files, tar/gzip them > > 3.) SCP archive offsite > > 4.) Delete temp folder > > 5.) Restart daemon. > > Post: delete temp file, rename file back to index.php > > Is it unrealistic for my office to expect 100% uptime, even at 3:30 am > in the morning (those whacky recruiters). > > /Anthony Wlodarski/ > > aw at sap8.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 tomsartain at gmail.com Wed Oct 3 12:07:56 2007 From: tomsartain at gmail.com (Tom Sartain) Date: Wed, 3 Oct 2007 12:07:56 -0400 Subject: [nycphp-talk] Premature submit In-Reply-To: <7.0.1.0.2.20071002205640.029e8640@e-government.com> References: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> <78c6bd860710021136h152cae60w766e7e22bd23abc0@mail.gmail.com> <7.0.1.0.2.20071002205640.029e8640@e-government.com> Message-ID: <20190d950710030907k111090a0lc0dbd71f15ccb6b9@mail.gmail.com> You could also just check that the form fields are not empty when processing the form.. or put the submit button *after* all of the fields. Javascript is too breakable to rely on for process intensive things... also, what happens if someone uses the site with javascript turned off? The form will be completely unusable. On 10/2/07, Urb LeJeune wrote: > > Had a client who twice lost existing content while making a change > using a CMS. Turns out the problem was they he was using a DSL line > and he made a change and hit the "Submit Changes" button before the > page had fully downloaded. Needless to say the undownloaded textarea > fields were empty and were written to the DB. > > Is there a way to disallow a form submit before the entire form > has downloaded? > > Thanks > > Urb > > Dr. Urban A. LeJeune, President > E-Government.com > 800-204-9545 > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 aw at sap8.com Wed Oct 3 12:16:52 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 3 Oct 2007 12:16:52 -0400 Subject: [nycphp-talk] Scripting to get a backup of your current MySQL database. In-Reply-To: <4703B8AD.1090904@omnistep.com> References: <004201c805c5$48d146b0$da73d410$@com> <4703B8AD.1090904@omnistep.com> Message-ID: <00b501c805d8$cf0c8c40$6d25a4c0$@com> I think for sake of ease of doing this project we will just have a ten minute drop on the server at midnight every night to backup the database. Granted that is a great scheme to get it done and I will investigate how to do so just for knowledge sake. Thanks for the insight. Anthony Wlodarski Senior Technical Recruiter 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 Rolan Yang Sent: Wednesday, October 03, 2007 11:44 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Scripting to get a backup of your current MySQL database. If you want to do a database backup with no downtime, replicate to a second mysql machine. You can stop the slave and perform a dump. Then after the dump is complete, it will sync back up upon restart. If you're really tight on hardware resources, you might even be able to start a second instance of mysql (listening on a different port/socket) and do it all on the same machine. ~Rolan Anthony Wlodarski wrote: > > I was confused on the relevance of this topic but since PHP and MySQL > go together like PB&J I thought it would be relevant. > > It has gotten to the point that the application that I built for > candidate tracking is growing astronomically so now I was given the > task of backing up our data. So far our Apache/Drupal installation is > backed up and SCP'ed to a secure server. My one big problem is backing > up our MySQL database. Does the script "mysqlhotcopy" have the same > drawback as just copy the files manually (frm, MYD, MYI) in the sense > that the server can't be updating anything. To be honest I can't > guarantee that no one in the office will not be using the system at > certain times so it might present a problem. Would it be easier to > just to script something that follows this logic: > > Pre: rename index.php, copy in temp file with downtime message > > 1.) Stop daemon. > > 2.) Copy all the table files *.frm, *.MYD, *.MYI files, tar/gzip them > > 3.) SCP archive offsite > > 4.) Delete temp folder > > 5.) Restart daemon. > > Post: delete temp file, rename file back to index.php > > Is it unrealistic for my office to expect 100% uptime, even at 3:30 am > in the morning (those whacky recruiters). > > /Anthony Wlodarski/ > > aw at sap8.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 From rmarscher at beaffinitive.com Wed Oct 3 14:42:42 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 3 Oct 2007 14:42:42 -0400 Subject: [nycphp-talk] Scripting to get a backup of your current MySQL database. In-Reply-To: <00b501c805d8$cf0c8c40$6d25a4c0$@com> References: <004201c805c5$48d146b0$da73d410$@com> <4703B8AD.1090904@omnistep.com> <00b501c805d8$cf0c8c40$6d25a4c0$@com> Message-ID: <0E1D91C7-0792-45F3-8251-668BF71CB8D1@beaffinitive.com> On Oct 3, 2007, at 12:16 PM, Anthony Wlodarski wrote: > I think for sake of ease of doing this project we will just have a ten > minute drop on the server at midnight every night to backup the > database. I doubt it will take 10 minutes. From http://dev.mysql.com/doc/ refman/5.0/en/backup.html: "You can also create a binary backup simply by copying all table files (*.frm, *.MYD, and *.MYI files), as long as the server isn't updating anything. The mysqlhotcopy script uses this method. (But note that these methods do not work if your database contains InnoDB tables. InnoDB does not store table contents in database directories, and mysqlhotcopy works only for MyISAM tables.)" From aw at sap8.com Wed Oct 3 16:13:04 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 3 Oct 2007 16:13:04 -0400 Subject: [nycphp-talk] Scripting to get a backup of your current MySQL database. In-Reply-To: <0E1D91C7-0792-45F3-8251-668BF71CB8D1@beaffinitive.com> References: <004201c805c5$48d146b0$da73d410$@com> <4703B8AD.1090904@omnistep.com> <00b501c805d8$cf0c8c40$6d25a4c0$@com> <0E1D91C7-0792-45F3-8251-668BF71CB8D1@beaffinitive.com> Message-ID: <013401c805f9$cee63c90$6cb2b5b0$@com> I assume a ten minute window as I have not done it before. I am going to have Cron call that script but just to make sure at the start of the script I am going to make sure people don't have access to the CMS so the database doesn't try to update itself. I found that link useful, actually found it before I posted on the user group. Anthony Wlodarski Senior Technical Recruiter 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 Rob Marscher Sent: Wednesday, October 03, 2007 2:43 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Scripting to get a backup of your current MySQL database. On Oct 3, 2007, at 12:16 PM, Anthony Wlodarski wrote: > I think for sake of ease of doing this project we will just have a ten > minute drop on the server at midnight every night to backup the > database. I doubt it will take 10 minutes. From http://dev.mysql.com/doc/ refman/5.0/en/backup.html: "You can also create a binary backup simply by copying all table files (*.frm, *.MYD, and *.MYI files), as long as the server isn't updating anything. The mysqlhotcopy script uses this method. (But note that these methods do not work if your database contains InnoDB tables. InnoDB does not store table contents in database directories, and mysqlhotcopy works only for MyISAM tables.)" _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/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 Wed Oct 3 16:42:07 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 3 Oct 2007 16:42:07 -0400 Subject: [nycphp-talk] Scripting to get a backup of yourcurrent MySQL database. References: <004201c805c5$48d146b0$da73d410$@com> <4703B8AD.1090904@omnistep.com> <00b501c805d8$cf0c8c40$6d25a4c0$@com><0E1D91C7-0792-45F3-8251-668BF71CB8D1@beaffinitive.com> <013401c805f9$cee63c90$6cb2b5b0$@com> Message-ID: <007901c805fd$dd8e89b0$1701a8c0@c500> Hello, I just came into this conversation mid way, but I wanted to include a script I use via cron to do mysql backups. Not sure if someone already provided this. [sk at tinman ~]$ crontab -l 0 */23 * * * /path/to/sql_backup.sh [sk at tinman ~]$ cat sql_backup.sh DATE=`date '+%m%d%Y'` DUMPFILE="/path/to/all_databases-$DATE.sql.gz" /usr/bin/mysqldump --all-databases --user=root --password=changeme | gzip > $\ DUMPFILE - Ben ----- Original Message ----- From: "Anthony Wlodarski" To: "'NYPHP Talk'" Sent: Wednesday, October 03, 2007 4:13 PM Subject: RE: [nycphp-talk] Scripting to get a backup of yourcurrent MySQL database. >I assume a ten minute window as I have not done it before. I am going to > have Cron call that script but just to make sure at the start of the > script > I am going to make sure people don't have access to the CMS so the > database > doesn't try to update itself. I found that link useful, actually found it > before I posted on the user group. > > Anthony Wlodarski > Senior Technical Recruiter > 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 Rob Marscher > Sent: Wednesday, October 03, 2007 2:43 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Scripting to get a backup of your current MySQL > database. > > On Oct 3, 2007, at 12:16 PM, Anthony Wlodarski wrote: >> I think for sake of ease of doing this project we will just have a ten >> minute drop on the server at midnight every night to backup the >> database. > I doubt it will take 10 minutes. From http://dev.mysql.com/doc/ > refman/5.0/en/backup.html: > > "You can also create a binary backup simply by copying all table > files (*.frm, *.MYD, and *.MYI files), as long as the server isn't > updating anything. The mysqlhotcopy script uses this method. (But > note that these methods do not work if your database contains InnoDB > tables. InnoDB does not store table contents in database directories, > and mysqlhotcopy works only for MyISAM tables.)" > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ajai at bitblit.net Wed Oct 3 23:42:11 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 3 Oct 2007 23:42:11 -0400 (EDT) Subject: [nycphp-talk] Scripting to get a backup of yourcurrent MySQL database. In-Reply-To: <007901c805fd$dd8e89b0$1701a8c0@c500> Message-ID: On Wed, 3 Oct 2007, Ben Sgro \(ProjectSkyLine\) wrote: > I just came into this conversation mid way, but I wanted to include a script > I use > via cron to do mysql backups. Not sure if someone already provided this. > > [sk at tinman ~]$ crontab -l > 0 */23 * * * /path/to/sql_backup.sh > > [sk at tinman ~]$ cat sql_backup.sh > DATE=`date '+%m%d%Y'` > DUMPFILE="/path/to/all_databases-$DATE.sql.gz" > /usr/bin/mysqldump --all-databases --user=root --password=changeme | gzip > > $\ > DUMPFILE Or avoid re-invention and use automysqlbackup. http://sourceforge.net/projects/automysqlbackup/ -- Aj. From randalrust at gmail.com Thu Oct 4 06:41:21 2007 From: randalrust at gmail.com (Randal Rust) Date: Thu, 4 Oct 2007 06:41:21 -0400 Subject: [nycphp-talk] PHPSESSID Issue Message-ID: I have a site where the ID keeps getting appended to the URL. So I went in and added the following lines to my config.php file, which is included on every page. ini_set('session.user_only_cookies', TRUE); ini_set('session.use_trans_sid', FALSE); The ID still shows when I first visit the page. If I refresh, it goes away. This is more than a little annoying. What else do I need I need to do? -- Randal Rust R.Squared Communications www.r2communications.com From danielc at analysisandsolutions.com Thu Oct 4 11:01:48 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 4 Oct 2007 11:01:48 -0400 Subject: [nycphp-talk] Apache Directives to Disable All Scripts in Sub-Directory? In-Reply-To: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> References: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> Message-ID: <20071004150148.GA15745@panix.com> On Tue, Oct 02, 2007 at 12:04:13PM -0400, Michael B Allen wrote: > > > RemoveType .php Guess you could redefine .php as text/plain or something. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From matteo.rinaudo at gmail.com Thu Oct 4 11:22:19 2007 From: matteo.rinaudo at gmail.com (Matteo Rinaudo) Date: Thu, 4 Oct 2007 11:22:19 -0400 Subject: [nycphp-talk] Apache Directives to Disable All Scripts in Sub-Directory? In-Reply-To: <20071004150148.GA15745@panix.com> References: <78c6bd860710020904m16ec8a8bt35c18d77ff9a8169@mail.gmail.com> <20071004150148.GA15745@panix.com> Message-ID: Yes, or just force this behavior, because when a type is removed, it defaults to the default type. Matteo On 10/4/07, Daniel Convissor wrote: > On Tue, Oct 02, 2007 at 12:04:13PM -0400, Michael B Allen wrote: > > > > > > RemoveType .php > > Guess you could redefine .php as text/plain or something. > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From lists at zaunere.com Thu Oct 4 11:37:57 2007 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 4 Oct 2007 11:37:57 -0400 Subject: [nycphp-talk] PHP in Action, Online Book Message-ID: <035201c8069c$89ef8620$671ba8c0@MobileZ> All, Thanks to Manning Publishing, we're pleased to be able to provide the online edition of the new PHP in Action book. http://tinyurl.com/283hzh The link will be valid for 5 days. We'll also have copies for review and give-away at our next meeting, and we encourage folks to post reviews of the book. Regards, --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From lists at zaunere.com Thu Oct 4 11:38:56 2007 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 4 Oct 2007 11:38:56 -0400 Subject: [nycphp-talk] PHP in Action, Online Book In-Reply-To: <035201c8069c$89ef8620$671ba8c0@MobileZ> References: <035201c8069c$89ef8620$671ba8c0@MobileZ> Message-ID: <035601c8069c$acece410$671ba8c0@MobileZ> Hans Zaunere wrote on Thursday, October 04, 2007 11:38 AM: > All, > > Thanks to Manning Publishing, we're pleased to be able to provide the > online edition of the new PHP in Action book. > > http://tinyurl.com/283hzh > > The link will be valid for 5 days. > > We'll also have copies for review and give-away at our next meeting, > and we encourage folks to post reviews of the book. Apologies, but I did forget to include this link: http://www.manning-sandbox.com/forum.jspa?forumID=277 --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From cliff at pinestream.com Thu Oct 4 15:30:36 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 04 Oct 2007 15:30:36 -0400 Subject: [nycphp-talk] Multi-server DB config caching strategy Message-ID: I?m understand caching and packages like cachelite, etc. What perplexes me is how to update a cache in a multi-server, one database environment. Say I cache config data from the database on each server. If I update config info in the database, how would I propagate this out to each server. Essentially, how would I invalidate each cache? Normally, a cache routine checks for an expire time against a file. But what is the equivalent with a database? Create a last updated field? Perhaps there?s a last updated flag in the db? Ideas? Cliff Hirsch -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitch.pirtle at gmail.com Thu Oct 4 15:41:50 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 4 Oct 2007 15:41:50 -0400 Subject: [nycphp-talk] Multi-server DB config caching strategy In-Reply-To: References: Message-ID: <330532b60710041241w2362d4ebse4c773be20707703@mail.gmail.com> On 10/4/07, Cliff Hirsch wrote: > > Ideas? Why not just have a memcached instance run on every webserver and be done with it? http://www.danga.com/memcached/ Dead simple, maybe I could present memcache at NYPHP? -- Mitch From cliff at pinestream.com Thu Oct 4 16:18:17 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 04 Oct 2007 16:18:17 -0400 Subject: [nycphp-talk] Multi-server DB config caching strategy In-Reply-To: <330532b60710041241w2362d4ebse4c773be20707703@mail.gmail.com> Message-ID: > Why not just have a memcached instance run on every webserver and be > done with it? > > http://www.danga.com/memcached/ > > Dead simple, maybe I could present memcache at NYPHP? > > -- Mitch Dang, that is dead simple. I knew there had to be an easy answer. Seems like it would even work well as a caching solution for one machine, providing for painless scale-out. Thanks, Cliff From cliff at pinestream.com Thu Oct 4 21:53:48 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 04 Oct 2007 21:53:48 -0400 Subject: [nycphp-talk] Caching, memcached and sessions Message-ID: So Mitch proposed memcached as a solution to caching a DB in a distributed environment. For that matter, why not use memcached or even an in-memory database engine for sessions? Remind me why I need to store my sessions in a disk-based file or database? Sessions are meant to be temporary, not permanent..... Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Fri Oct 5 18:43:01 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 05 Oct 2007 18:43:01 -0400 Subject: [nycphp-talk] apc.shm_size Message-ID: ?apc.shm_size integer The size of each shared memory segment in MB. By default, some systems (including most BSD variants) have very low limits on the size of a shared memory segment.? How do we determine the size of our system?s shared memory segment? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Sun Oct 7 15:56:06 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Sun, 7 Oct 2007 15:56:06 -0400 Subject: [nycphp-talk] Caching, memcached and sessions In-Reply-To: References: Message-ID: <0D0D490D-C6CE-4AB4-9D60-C27EAE527F33@beaffinitive.com> On Oct 4, 2007, at 9:53 PM, Cliff Hirsch wrote: > So Mitch proposed memcached as a solution to caching a DB in a > distributed environment. For that matter, why not use memcached or > even an in-memory database engine for sessions? The memcache extension automatically a memcache save handler for php's built-in sessions - set the ini session.save_handler param to "memcache". I haven't tried it yet though. Anyone used it? > Remind me why I need to store my sessions in a disk-based file or > database? Sessions are meant to be temporary, not permanent..... If you want to support a "remember me" session, you'll need to backup your active sessions from time to time in case of a server failure or reboot. You'll also need to make sure you have enough memory to store all of the currently active sessions. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Mon Oct 8 08:59:09 2007 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 8 Oct 2007 08:59:09 -0400 Subject: [nycphp-talk] From DreamweaverNY.com - PHP Frameworks for Beginners Message-ID: <047d01c809ab$043be1b0$640aa8c0@MobileZ> All, Our friends at the Dreamweaver NY group are having a beginner/introductory meeting on "Build a PHP/MySQL based Database-Driven Website Using an Open Source Framework" that would be relevant to the newer users on this list. Please see their site, http://www.dreamweaverny.com and details below. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com > Wednesday October 10, 6pm to 8pm > At Robert Half Technologies > 245 Park Avenue, 25th Fl. > > Email us for confirmation one time only to > keep your name in the building security list. > > Please do not expect receipt confirmation > > ak at dreamweaverNY.com before Tuesday 10/9 midnight. > > > What is a framework website? > > Build a PHP/MySQL based Database-Driven Website Using an Open Source > Framework with WordPress, Joomla, ZenCart or Drupal in less than an > hour by Consultant Stephen Britton > > As you probably know, there are several open source website > frameworks based on PHP/MySQL. The most popular are WordPress, > Joomla, ZenCart and Drupal. The benefit from using these sites is > they allow web developers and web designers to instantly build a > database driven website. > > As recently as five years ago you would have to hire a programming > crew for days to build a database driven website with a Content > Management System (CMS). Today it is possible to build the same CMS > website in less than an hour. > > Consultant Stephen Britton will show how to build a CMS website using > the popular WordPress program, which is based on the PHP programming > language and MySQL database. He will also briefly demonstrate two > other popular open source CMS programs - Joomla and Drupal. If you > need to build a database driven website fast... these programs are > the > > > > For further details click on: http://DreamweaverNY.com/ From brian at realm3.com Mon Oct 8 10:37:10 2007 From: brian at realm3.com (Brian D.) Date: Mon, 8 Oct 2007 10:37:10 -0400 Subject: [nycphp-talk] apc.shm_size In-Reply-To: References: Message-ID: Try: cat /proc/sys/kernel/shmmax ... or something similar. It worked on Ubuntu Linux, anyway, so it might work for you. - Brian D. On 10/5/07, Cliff Hirsch wrote: > > "apc.shm_size integer > The size of each shared memory segment in MB. By default, some systems > (including most BSD variants) have very low limits on the size of a shared > memory segment." > > How do we determine the size of our system's shared memory segment? > > 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 brian at realm3.com Mon Oct 8 10:44:25 2007 From: brian at realm3.com (Brian D.) Date: Mon, 8 Oct 2007 10:44:25 -0400 Subject: [nycphp-talk] PHPSESSID Issue In-Reply-To: References: Message-ID: I think what you want to do is actually set "use_trans_id" to TRUE. >From the docs: session.use_trans_sid whether transparent sid support is enabled or not. Defaults to 0 (disabled). You want the sid to be transparent, so I would set that to true and see if that helps. - Brian On 10/4/07, Randal Rust wrote: > I have a site where the ID keeps getting appended to the URL. So I > went in and added the following lines to my config.php file, which is > included on every page. > > ini_set('session.user_only_cookies', TRUE); > ini_set('session.use_trans_sid', FALSE); > > The ID still shows when I first visit the page. If I refresh, it goes away. > > This is more than a little annoying. What else do I need I need to do? > > -- > 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 mitch.pirtle at gmail.com Mon Oct 8 14:48:11 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 8 Oct 2007 14:48:11 -0400 Subject: [nycphp-talk] Caching, memcached and sessions In-Reply-To: <0D0D490D-C6CE-4AB4-9D60-C27EAE527F33@beaffinitive.com> References: <0D0D490D-C6CE-4AB4-9D60-C27EAE527F33@beaffinitive.com> Message-ID: <330532b60710081148k64f2c347y47e4f1879471a846@mail.gmail.com> On 10/7/07, Rob Marscher wrote: > > If you want to support a "remember me" session, you'll need to backup your > active sessions from time to time in case of a server failure or reboot. Exactly, that is one occasion where you'd want to store the session data in case of reboot/disaster/Microsoft. Didn't know that memcache could be used as the default session save handler though, that's interesting. For Joomla I implemented a memcache driver for JSession, so it's handled at the application level. -- Mitch From paulcheung at tiscali.co.uk Tue Oct 9 08:37:48 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Tue, 9 Oct 2007 13:37:48 +0100 Subject: [nycphp-talk] Emailing from a PHP script References: <206328.34768.qm@web37906.mail.mud.yahoo.com> <001201c7f6e4$cdf04340$0200a8c0@X9183> Message-ID: <004d01c80a71$34337970$0300a8c0@X9183> It must be my birthday today. As I have managed to solve my two knottiest problems today. Here is the solution to my email problem I hope this helps others who are wrestling with the same problem ----- Original Message ----- From: PaulCheung To: NYPHP Talk Sent: Friday, September 14, 2007 4:34 PM Subject: Re: [nycphp-talk] Emailing from a PHP script Thanks for the solution. I've tried it and it did not work for me changed php.ini to reflect change rebooted my system. Don't really understand why it is necessary to download QK SMTP Has all my problems been something to do with XAMPP under windows?? Paul ----- Original Message ----- From: Jason Sia To: NYPHP Talk Sent: Friday, September 14, 2007 4:00 PM Subject: Re: [nycphp-talk] Emailing from a PHP script ok that will not really work you should use SMTP=localhost then download QK SMTP Server to make this work. ----- Original Message ---- From: PaulCheung To: NYPHP Talk Sent: Friday, September 14, 2007 10:37:11 PM Subject: Re: [nycphp-talk] Emailing from a PHP script Yes, that is correct. Has this anything to do with my problem? ----- Original Message ----- From: Jason Sia To: NYPHP Talk Sent: Friday, September 14, 2007 3:24 PM Subject: Re: [nycphp-talk] Emailing from a PHP script you are just using XAMPP for windows right? ----- Original Message ---- From: Ken Robinson To: NYPHP Talk Sent: Friday, September 14, 2007 9:32:07 PM Subject: Re: [nycphp-talk] Emailing from a PHP script At 09:09 AM 9/14/2007, PaulCheung wrote: >Can anybody see what I am doing wrong?? > >I have set php.ini (as per the manual) to my email settings >====================================== >[mail function] >; For Win32 only. >SMTP = smtp.tiscali.co.uk >smtp_port = 25 > >; For Win32 only. >sendmail_from = paulcheung at tiscali.co.uk >======================================================== >I run the script and the following message appears Did you restart your web server (Apache?) after making the changes to the PHP.INI file? This has to be done for the changes to take affect. 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 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 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 ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/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 paulcheung at tiscali.co.uk Tue Oct 9 09:04:48 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Tue, 9 Oct 2007 14:04:48 +0100 Subject: [nycphp-talk] MySQL Monitor V PHP & MySQL References: <008001c7fc88$3e086d80$0200a8c0@X9183><20070921194129.hrl1k96k0s8kcs4g@webmail.nyphp.com> <001401c8042f$a7162700$0300a8c0@X9183> Message-ID: <005b01c80a74$f8c5b610$0300a8c0@X9183> Just in case others have been suffering from the same problem I have cut and pasted my test table (authorised_users) into this posting, in order that others who want to follow it through can.I have also left the MySQL mysql_error() debugging tool in just in anybody wants to try it for themselves. The problem lay in the database and table call and the only way I found that out was through the mysql_error() routine. All the strange message all stemmed from the wrong type of database and table calls. Paul use test_db; Database changed mysql> desc authorised_users; +---------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+-------------+------+-----+---------+-------+ | user_name | varchar(35) | YES | | NULL | | | company | varchar(50) | YES | | NULL | | | user_id | varchar(16) | YES | | NULL | | | user_passcode | varchar(16) | YES | | NULL | | | account | varchar(8) | YES | | NULL | | | access_code | varchar(8) | YES | | NULL | | | testrecord | varchar(3) | YES | | NULL | | +---------------+-------------+------+-----+---------+-------+ 7 rows in set (0.20 sec) mysql> select * from authorised_users where user_id = 'qwerty' and user_passcode = '123456' and account = 29764404; +-----------+---------+---------+---------------+----------+-------------+------------+ | user_name | company | user_id | user_passcode | account | access_code | testrecord | +-----------+---------+---------+---------------+----------+-------------+------------+ | | | qwerty | 123456 | 29764404 | 79334716 | 0 | +-----------+---------+---------+---------------+----------+-------------+------------+ 1 row in set (0.59 sec) mysql> select access_code from authorised_users where user_id = 'qwerty' and user_passcode= '123456' and account = 29764404; +-------------+ | access_code | +-------------+ | 79334716 | +-------------+ 1 row in set (0.00 sec) */ // ++++++++++++++++++++++++PHP CODING ++++++++++++++++++++++++++ // INITIATE VARIABLES // ================== $userid = "qwerty"; $passcode = "123456"; $account = 29764404; $result = "empty"; $access = 00000000; $query = "rubbish"; echo ('Before $userid = ' . $userid . "
"); echo ('Before $account = ' . $account . "
"); echo ('Before $passcode = ' . $passcode . "

"); echo ('Before $result = ' . $result . "
"); echo ('Before $access = ' . $access . "
"); echo ('Before $query = ' . $query . "

"); echo ('========================================================' . "
"); // CONNECT & READ DB mysql_connect("localhost",'paul','enter'); mysql_select_db(test_db) or die( "Unable to select database"); // ============================================================== $query = "SELECT access_code FROM authorised_users WHERE user_id = '$userid' AND user_passcode = '$passcode' AND account = '$account'"; // ============================================================= $result = mysql_query($query); if (!$result) { echo ('Check $result' . "
"); echo ('Using mysql_error() - To show the actual query sent to MySQL, and the error. ' . "

"); $message = 'Invalid query: ===> ' . mysql_error() . "
"; $message .= 'Whole query: ===> ' . $query; die($message); } $data = mysql_fetch_array($result); $access = $data['access_code']; echo '$data = ' . $access . "
"; echo ('$query = MYSQL_QUERY( select ACCESS_CODE from AUTHORISED_USERS)ETC. ETC.' . "
"); echo ('========================================================' . "
"); echo ("
"); echo ('AFTER $USERID = ' . $userid . "

"); echo ('AFTER $PASSCODE = ' . $passcode . "

"); echo ('AFTER $ACCOUNT = ' . $account . "

"); echo ('AFTER $ACCESS = ' . $access . "
"); echo ('========================================================' . "
"); ?> OUTPUT FROM TEST Before $userid = qwerty Before $account = 29764404 Before $passcode = 123456 Before $result = empty Before $access = 0 Before $query = rubbish ======================================================== $data = 79334716 $query = MYSQL_QUERY( select ACCESS_CODE from AUTHORISED_USERS)ETC. ETC. ======================================================== AFTER $USERID = qwerty AFTER $PASSCODE = 123456 AFTER $ACCOUNT = 29764404 AFTER $ACCESS = 79334716 ======================================================== ----- Original Message ----- From: "PaulCheung" To: "NYPHP Talk" Sent: Monday, October 01, 2007 2:33 PM Subject: Re: [nycphp-talk] MySQL Monitor V PHP & MySQL > Hi Michael, > > I have taken onboard all the comments and research things further and was > eventual able to force an error message > Warning: mysql_query() [function.mysql-query]: Access denied for user > 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\tp_test.php on > line 38 > Armed with this info I changed the PHP.INI and used > grant all privileges on *.* to ODBC at localhost identified by enter with > grant option; > both with and without the password and still I cannot move ahead. > > The error message is a "mysql error 1045". There appears to be one PHP > rule for Linux and another for Windows. > Apart from the obvious of moving from Windows to Linux does anybody have > any ideas or suggestion that will help me overcome > this problem. From what I have read on the MySQL website there does not > appear to be any help there > as what I am trying to accomplish works in MySQL command mode. It only > falls over, for me anyway, when trying the same thing using PHP & MySQL. > > > > > > > > ---- Original Message ----- > From: "Michael Southwell" > To: > Sent: Saturday, September 22, 2007 12:41 AM > Subject: Re: [nycphp-talk] MySQL Monitor V PHP & MySQL > > >> Quoting PaulCheung : >> >>> I have researched, checked and tried everything I can think of and >>> still cannot get it to work. >> >>> SELECT access_code FROM authorised_users WHEN >> >> I am not familiar with WHEN but that could be my own ignorance >> >>> $rs = @mysql_select_db( "test_db", $conn ) >>> or die( "Could not select database" ); >>> >>> $rs = @mysql_select_db( "test_db", $conn ) or die( "Could not select >>> database" ); >> >> This line is doubled but that is not your problem. >> >>> >>> $sql = "SELECT access_code >>> FROM authorised_users >>> user_id = '$userid' AND >> >> This is the reason that you are getting different results: you left out >> the WHEN that you had above (unless this is not an accurate >> representation of your code); whether WHEN is a legitimate keyword is a >> different issue. >> >> -- >> 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 > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 jeffmailings99 at verizon.net Tue Oct 9 12:28:08 2007 From: jeffmailings99 at verizon.net (Jeff Siegel) Date: Tue, 09 Oct 2007 12:28:08 -0400 Subject: [nycphp-talk] readcfg a PERL command? Message-ID: Is readcfg a PERL command? If yes, can it be called from PHP? I'm sifting through someone else's code and I'm trying to make sense out of it. Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Tue Oct 9 12:53:24 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 09 Oct 2007 12:53:24 -0400 Subject: [nycphp-talk] Getting IP address from $_SERVER Message-ID: I am trying to get the server address of my development server, but $_SERVER[?remote_addr?] and $_SERVER[?server_addr?] keep giving me the localhost addr (127.0.0.1). Kinda makes it hard to create a URL for redirects. The IP address should be 192.168.168.###, based on the current DHCP setting. How do I get the IP address of the machine? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashaw at polymerdb.org Tue Oct 9 13:01:02 2007 From: ashaw at polymerdb.org (Allen Shaw) Date: Tue, 09 Oct 2007 12:01:02 -0500 Subject: [nycphp-talk] readcfg a PERL command? In-Reply-To: References: Message-ID: <470BB3CE.4030200@polymerdb.org> Jeff Siegel wrote: > Is readcfg a PERL command? If yes, can it be called from PHP? > I'm sifting through someone else's code and I'm trying to make sense out > of it. > You probably did this already: http://www.google.com/search?q=readcfg Doesn't show much in the way of PERL-specific stuff, but it does turn up a Windows binary called readcfg.exe; could be relevant, but maybe not. Wanna show us the lines you're wrestling with? - Allen -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From phplists at jellyandcustard.com Tue Oct 9 13:08:33 2007 From: phplists at jellyandcustard.com (Khalid Hanif) Date: Tue, 9 Oct 2007 18:08:33 +0100 Subject: [nycphp-talk] Getting IP address from $_SERVER In-Reply-To: References: Message-ID: <9E365843-809F-46E3-ADC6-D472912E10E2@jellyandcustard.com> Hi Cliff, $_SERVER['SERVER_ADDR'] gives me the correct IP on a development server. Your mileage may vary for a local machine running apache locally... Regards, Khalid On 9 Oct 2007, at 17:53, Cliff Hirsch wrote: > I am trying to get the server address of my development server, but > $_SERVER[?remote_addr?] and $_SERVER[?server_addr?] keep giving me > the localhost addr (127.0.0.1). Kinda makes it hard to create a URL > for redirects. > > The IP address should be 192.168.168.###, based on the current DHCP > setting. > > How do I get the IP address of the machine? > > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffmailings99 at verizon.net Tue Oct 9 13:13:21 2007 From: jeffmailings99 at verizon.net (Jeff Siegel) Date: Tue, 09 Oct 2007 13:13:21 -0400 Subject: [nycphp-talk] readcfg a PERL command? In-Reply-To: <470BB3CE.4030200@polymerdb.org> Message-ID: Allen, Thanks for your reply. Probably because I saw the word "PERL" in a few places...I jumped to conclusions. Did some additional digging and found a homegrown function with fifteen parameters (all well-named, I might add...see below...I'm sure this was intuitive to somebody...but not me). The function parses a text file and does a search/replace on variables that are in the text. function readcfg($cfile,$rt1="",$rw1="",$rt2="",$rw2="",$rt3="",$rw3="",$rt4="",$rw4= "",$rt5="",$rw5="",$rt6="",$rw6="",$rt7="",$rw7="") Jeff -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Allen Shaw Sent: Tuesday, October 09, 2007 1:01 PM To: NYPHP Talk Subject: Re: [nycphp-talk] readcfg a PERL command? Jeff Siegel wrote: > Is readcfg a PERL command? If yes, can it be called from PHP? > I'm sifting through someone else's code and I'm trying to make sense out > of it. > You probably did this already: http://www.google.com/search?q=readcfg Doesn't show much in the way of PERL-specific stuff, but it does turn up a Windows binary called readcfg.exe; could be relevant, but maybe not. Wanna show us the lines you're wrestling with? - 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 cliff at pinestream.com Tue Oct 9 13:27:24 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 09 Oct 2007 13:27:24 -0400 Subject: [nycphp-talk] Getting IP address from $_SERVER In-Reply-To: <9E365843-809F-46E3-ADC6-D472912E10E2@jellyandcustard.com> Message-ID: Thanks. We got it ? turned out to be a different screw-up. Server_addr was the server and remote_addr was the client machine. On 10/9/07 1:08 PM, "Khalid Hanif" wrote: > Hi Cliff, > > $_SERVER['SERVER_ADDR'] gives me the correct IP on a development server. Your > mileage may vary for a local machine running apache locally... > > Regards, > Khalid > > On 9 Oct 2007, at 17:53, Cliff Hirsch wrote: > >> I am trying to get the server address of my development server, but >> $_SERVER[?remote_addr?] and $_SERVER[?server_addr?] keep giving me the >> localhost addr (127.0.0.1). Kinda makes it hard to create a URL for >> redirects. >> >> The IP address should be 192.168.168.###, based on the current DHCP setting. >> >> How do I get the IP address of the machine? >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashaw at polymerdb.org Tue Oct 9 13:45:28 2007 From: ashaw at polymerdb.org (Allen Shaw) Date: Tue, 09 Oct 2007 12:45:28 -0500 Subject: [nycphp-talk] readcfg a PERL command? In-Reply-To: References: Message-ID: <470BBE38.8040405@polymerdb.org> Jeff Siegel wrote: > I'm sure this was > intuitive to somebody...but not me. > ... > function > readcfg($cfile,$rt1="",$rw1="",$rt2="",$rw2="",$rt3="",$rw3="",$rt4="",$rw4= > "",$rt5="",$rw5="",$rt6="",$rw6="",$rt7="",$rw7="") > Wow, looks like you've got a fun time ahead. - A. -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From aw at sap8.com Tue Oct 9 14:14:10 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Tue, 9 Oct 2007 14:14:10 -0400 Subject: [nycphp-talk] Emailing from a PHP script In-Reply-To: <004d01c80a71$34337970$0300a8c0@X9183> References: <206328.34768.qm@web37906.mail.mud.yahoo.com> <001201c7f6e4$cdf04340$0200a8c0@X9183> <004d01c80a71$34337970$0300a8c0@X9183> Message-ID: <00ac01c80aa0$306d8c70$9148a550$@com> Here is my version of sending items via email, I was creating a site where you can bounce things to a Verizon or Cingular phone from my server such as wallpapers. Has some imaging resizing code in there as well but the code mostly illustrates how to send multimedia files using the right header information. 240 pixels if($width > 240) { $percent = 240/$width; $new_width = $width * $percent; $new_height = $height * $percent; } else if($height > 320) { $percent = 320/$height; $new_width = $width * $percent; $new_height = $height * $percent; } // create our image resource from the temp file $image = imagecreatefromjpeg($tempfile); // create a resized image $imagetemp = imagecreatetruecolor($new_width, $new_height);; // resize the image imagecopyresampled($imagetemp, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); // save the resized file into the temp file and send the message upon success if(imagejpeg($imagetemp, $tempfile)) { // end of line characters $eol="\r\n"; $mime_boundary=md5(time()); //Common Headers $headers .= 'From: MyName<'.$fromaddress.'>'.$eol; $headers .= 'Reply-To: MyName<'.$fromaddress.'>'.$eol; $headers .= 'Return-Path: MyName<'.$fromaddress.'>'.$eol; // these two to set reply address $headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters # Boundry for marking the split & Multitype Headers $headers .= 'MIME-Version: 1.0'.$eol; $headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol; $msg = ""; //original php.net code ends here //Anthony W. edits if(is_file($tempfile)) { //File for Attachment //Find the last occurence of "/" in the absolute path and then chop $file_name = substr($tempfile, (strrpos($tempfile, "/")+1)); $handle=fopen($tempfile, 'rb'); $f_contents=fread($handle, filesize($tempfile)); $f_contents=chunk_split(base64_encode($f_contents)); //Encode The Data For Transition using base64_encode(); fclose($handle); # Attachment $msg .= "--".$mime_boundary.$eol; $msg .= "Content-Type: image/jpeg; name=\"".$file_name."\"".$eol; $msg .= "Content-Transfer-Encoding: base64".$eol; $msg .= "Content-Disposition: attachment; filename=\"".$file_name."\"".$eol.$eol; // !! This line needs TWO end of lines !! IMPORTANT !! $msg .= $f_contents.$eol.$eol; } else { echo "Error, file does not exist"; } // Setup for text OR html $msg .= "Content-Type: multipart/alternative".$eol; // text only messages are sent $msg .= "--".$mime_boundary.$eol; $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol; $msg .= "Content-Transfer-Encoding: 8bit".$eol; $msg .= strip_tags(str_replace("
", "\n", $body)).$eol.$eol; // end of mime $msg .= "--".$mime_boundary."--".$eol.$eol; // finish with two eol's for better security. see Injection. // send the email ini_set(sendmail_from,$fromaddress); // the INI lines are to force the From Address to be used ! mail($emailaddress, $emailsubject, $msg, $headers); ini_restore(sendmail_from); echo "Message sent to ".$emailaddress; }// end of if(imagecopy... // delete the temporary file unlink($tempfile); } // store all teh variable posted from the previous html form // catch the phone number if($_POST['mobilenum'] == '') { echo 'Phone number must be entered please return to the previous page.'; } else { $mobilenum = $_POST['mobilenum']; $domobile = true; } // simple check for email validation if($_POST['email'] == '') { echo 'Email must be entered please return to the previous page.'; } else { $email = $_POST['email']; $doemail = true; } // simple check for email validation if(isset($_POST['file'])) { $file = $_POST['file']; $dofile = true; } else { echo 'File handle has been lost please return to the previous page.
'; } // simple check for email validation if(isset($_POST['carrier'])) { $carrier = $_POST['carrier']; $docarrier = true; } else { echo 'Carrier has not been selected please return to the previous page.
'; } // Message Subject $emailsubject="picture"; // Message Body $body=""; if($carrier == 'verizon') { $mobilenum .= "@vzwpix.com"; } else if($carrier == 'cingular') { $mobilenum .= "@cingularme.com"; } // call function to resize and send image send_mail($mobilenum, $email, $emailsubject, $body, $file); ?> Hope this helps in addition to Paul's infol. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of PaulCheung Sent: Tuesday, October 09, 2007 8:38 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Emailing from a PHP script It must be my birthday today. As I have managed to solve my two knottiest problems today. Here is the solution to my email problem "; $subject = "Enter your subject here"; $message = "YES IT WORKED @ LONG LAST I can put anything I like here"; $from = "FROM: admin at isp.com "; mail("$to", "$subject", "$message", "$from"); echo "The email has been sent"; ?> I hope this helps others who are wrestling with the same problem ----- Original Message ----- From: PaulCheung To: NYPHP Talk Sent: Friday, September 14, 2007 4:34 PM Subject: Re: [nycphp-talk] Emailing from a PHP script Thanks for the solution. I've tried it and it did not work for me changed php.ini to reflect change rebooted my system. Don't really understand why it is necessary to download QK SMTP Has all my problems been something to do with XAMPP under windows?? Paul ----- Original Message ----- From: Jason Sia To: NYPHP Talk Sent: Friday, September 14, 2007 4:00 PM Subject: Re: [nycphp-talk] Emailing from a PHP script ok that will not really work you should use SMTP=localhost then download QK SMTP Server to make this work. ----- Original Message ---- From: PaulCheung To: NYPHP Talk Sent: Friday, September 14, 2007 10:37:11 PM Subject: Re: [nycphp-talk] Emailing from a PHP script Yes, that is correct. Has this anything to do with my problem? ----- Original Message ----- From: Jason Sia To: NYPHP Talk Sent: Friday, September 14, 2007 3:24 PM Subject: Re: [nycphp-talk] Emailing from a PHP script you are just using XAMPP for windows right? ----- Original Message ---- From: Ken Robinson To: NYPHP Talk Sent: Friday, September 14, 2007 9:32:07 PM Subject: Re: [nycphp-talk] Emailing from a PHP script At 09:09 AM 9/14/2007, PaulCheung wrote: >Can anybody see what I am doing wrong?? > >I have set php.ini (as per the manual) to my email settings >====================================== >[mail function] >; For Win32 only. >SMTP = smtp.tiscali.co.uk >smtp_port = 25 > >; For Win32 only. >sendmail_from = paulcheung at tiscali.co.uk >======================================================== >I run the script and the following message appears Did you restart your web server (Apache?) after making the changes to the PHP.INI file? This has to be done for the changes to take affect. 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 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 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 _____ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Tue Oct 9 17:01:46 2007 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 9 Oct 2007 17:01:46 -0400 Subject: [nycphp-talk] IBM QEDWiki Mashup Message-ID: <044001c80ab7$9aa97970$671ba8c0@MobileZ> Hi all, Here's an update on a presentation we had from IBM last year: http://tinyurl.com/2l3xu9 Looks like it might be time for an updated talk! --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From birgunjp0071 at yahoo.com Wed Oct 10 01:50:55 2007 From: birgunjp0071 at yahoo.com (birgunj birgunj) Date: Tue, 9 Oct 2007 22:50:55 -0700 (PDT) Subject: [nycphp-talk] need help about search engine In-Reply-To: <46DFDDE9.4020908@gmx.net> Message-ID: <751567.79682.qm@web59308.mail.re1.yahoo.com> Dear All, i want to make advance search engine in PHP.i have 7 fields and all fields are optional.if user select only 4 filed,then search engine will display the result according to 4 selected field.? how to do it ? if anybody have any idea or document or book or article please share with me? its very urgent. thanks to all in advance humayoo --------------------------------- Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw at sap8.com Wed Oct 10 08:49:39 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 10 Oct 2007 08:49:39 -0400 Subject: [nycphp-talk] need help about search engine In-Reply-To: <751567.79682.qm@web59308.mail.re1.yahoo.com> References: <46DFDDE9.4020908@gmx.net> <751567.79682.qm@web59308.mail.re1.yahoo.com> Message-ID: <001301c80b3c$058e3c10$10aab430$@com> I believe you can begin your quest for that type of knowledge here: http://www.roscripts.com/PHP_search_engine-119.html. This is assuming that you have worked with PHP before. Anthony Wlodarski aw at sap8.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Wed Oct 10 09:33:22 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 10 Oct 2007 09:33:22 -0400 Subject: [nycphp-talk] [OT] FFMPEG & LAME Message-ID: <007701c80b42$21333410$6401a8c0@gamebox> Good morning, Super off topic, but since this list is one of my best resources for help, I figured I'll try here. I've spent a lot of time on google and can't seem to figure out the problem. I have a PHP app that is converting .avi's to .flvs. I'm using ffmpeg and lame. I've built ffmpeg w/libmp3lame support enabled, to encode to .mp3 for the .flv However, I don't know much about this stuff, and I can't seem to figure out the correct parameters. The online documentation for ffmpeg is lacking. [sk at tinman storyx]$ /usr/local/bin/ffmpeg -i uploaded_videos/978516602470bb1a2a1373.AVI -acodec libmp3lame -vcodec flv -b 1200kb -mbd 2 -flags +4mv+4rell -aic 2 -cmp 2 -subcmp 2 -s 450x300 -title Title converted_videos/978516602470bb1a2a1373.flv FFmpeg version SVN-r10700, Copyright (c) 2000-2007 Fabrice Bellard, et al. configuration: --enable-libmp3lame libavutil version: 49.5.0 libavcodec version: 51.45.0 libavformat version: 51.14.0 built on Oct 9 2007 15:26:19, gcc: 4.1.1 20070105 (Red Hat 4.1.1-52) Input #0, avi, from 'uploaded_videos/978516602470bb1a2a1373.AVI': Duration: 00:00:09.1, start: 0.000000, bitrate: 3407 kb/s Stream #0.0: Video: mjpeg, yuvj422p, 320x240, 20.00 fps(r) Stream #0.1: Audio: pcm_u8, 11024 Hz, mono, 88 kb/s File 'converted_videos/978516602470bb1a2a1373.flv' already exists. Overwrite ? [y/N] y PIX_FMT_YUV420P will be used as an intermediate format for rescaling Output #0, flv, to 'converted_videos/978516602470bb1a2a1373.flv': Stream #0.0: Video: flv (hq), yuv420p, 450x300, q=2-31, 1200 kb/s, 20.00 fps(c) Stream #0.1: Audio: libmp3lame, 11024 Hz, mono, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 [flv @ 0x84b51f0]removing common factors from framerate Error while opening codec for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height Any one w/experiance that can help is appreciated! - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Wed Oct 10 10:05:18 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Wed, 10 Oct 2007 10:05:18 -0400 Subject: [nycphp-talk] [OT] FFMPEG & LAME In-Reply-To: <007701c80b42$21333410$6401a8c0@gamebox> References: <007701c80b42$21333410$6401a8c0@gamebox> Message-ID: <470CDC1E.6000906@beezifies.com> Ben Sgro (ProjectSkyLine) wrote: > Good morning, > > Super off topic, but since this list is one of my best resources for help, > I figured I'll try here. > > I've spent a lot of time on google and can't seem to figure out the problem. > > I have a PHP app that is converting .avi's to .flvs. I'm using ffmpeg > and lame. > > I've built ffmpeg w/libmp3lame support enabled, to encode to .mp3 for > the .flv > > However, I don't know much about this stuff, and I can't seem to figure > out the correct > parameters. The online documentation for ffmpeg is lacking. It's not so much lacking, as there are so many different parameters that are format specific, and many that you would only use for a particular combination, that it is a waste of time to try to document it all when they can be working on making the next version. Generally, I find it easiest when working with ffmpeg to find someone else that wants to do what I want and start with a known working formula. For example, converting to flash is a web thing. People running personal DVR's do a lot of Flash conversion. So if you search for Mythweb and FLV you will get a lot of hits on people who want to convert their MythTV recorded videos to FLV. Here is a simple howto, give it a try: http://www.mythtv.org/wiki/index.php/Stream_mythtv_recordings_from_mythweb_using_flash_video Also, please note that FLVTOOL is very important in making flash videos. Basically, without getting technical(cause I have no clue what it is), the flv file you get from ffmpeg is gonna be one loooong file where you have to start at the beginning and go to the end to view a file. No fast forwarding, no rewinding. FLVTOOL adds some "bookmarks" to allow you to jump forward and back in the flash player. FFMPEG is not always as forgiving of poorly packaged audio/video as a video player(VLC, Windows Media, Realplayer, etc). Which leads to loads of headaches when someone has a file that plays fine, but after conversion is missing the last 5-15 seconds of audio or video or both! In such a situation, one thing to do is to upload the video to Google video or Youtube. They use similar programs and run into the same problems - so if you can demonstrate that Youtube can't convert the video, you will find people a lot more understanding of why their free/low cost app won't do it. There are a couple of services to convert videos to flash(or convert from any format to any format) where you submit your video and they email you a link or some such. There was one I used that was credit based, so they had a relatively intelligent API for doing the conversion - this moves the conversion off of your responsibility and onto someone else, but it costs something like 10 cents per video. For medium traffic sites or proof of concepts, I'd start with them and only deal with ffmpeg when it becomes economically justifiable(ie you are willing to put the hours in to troubleshooting again and again when problems crop up). For extremely low volume, use Super to do the translation offline on a PC and just upload Flash videos. From jeffmailings99 at verizon.net Wed Oct 10 10:24:11 2007 From: jeffmailings99 at verizon.net (Jeff Siegel) Date: Wed, 10 Oct 2007 10:24:11 -0400 Subject: [nycphp-talk] readcfg a PERL command? In-Reply-To: <470BBE38.8040405@polymerdb.org> Message-ID: Tons of fun...I can't wait to make BIG changes to the code. ;) Jeff -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Allen Shaw Sent: Tuesday, October 09, 2007 1:45 PM To: NYPHP Talk Subject: Re: [nycphp-talk] readcfg a PERL command? Jeff Siegel wrote: > I'm sure this was > intuitive to somebody...but not me. > ... > function > readcfg($cfile,$rt1="",$rw1="",$rt2="",$rw2="",$rt3="",$rw3="",$rt4="",$rw4= > "",$rt5="",$rw5="",$rt6="",$rw6="",$rt7="",$rw7="") > Wow, looks like you've got a fun time ahead. - A. -- 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 ben at projectskyline.com Wed Oct 10 10:56:54 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 10 Oct 2007 10:56:54 -0400 Subject: [nycphp-talk] [OT] FFMPEG & LAME References: <007701c80b42$21333410$6401a8c0@gamebox> <470CDC1E.6000906@beezifies.com> Message-ID: <00b601c80b4d$ccad83d0$6401a8c0@gamebox> Hello, Good points. I've gotten ffmpeg to work on the .avi's, but I've yet to try it on .mpeg's. I'll take a look into the credit based conversion. I haven't noticed problems w/the sample video, but I've only done a few. I won't start seeing problems until other people are using it. = ] > Also, please note that FLVTOOL is very important in making flash videos. > Basically, without getting technical(cause I have no clue what it is), > the flv file you get from ffmpeg is gonna be one loooong file where you > have to start at the beginning and go to the end to view a file. No fast > forwarding, no rewinding. I don't seem to be having that problem w/the converted videos. We have a flash player we've developed ourselves. They use similar programs and run into the same > problems - so if you can demonstrate that Youtube can't convert the video, > you will find people a lot more understanding of why their free/low cost > app won't do it. Great point. > with ffmpeg when it becomes economically justifiable(ie you are willing to > put the hours in to troubleshooting again and again when problems crop > up). Wish I knew what a problem it was before I fell into the trap of deliverying a working application. Thanks! - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: To: "NYPHP Talk" Sent: Wednesday, October 10, 2007 10:05 AM Subject: Re: [nycphp-talk] [OT] FFMPEG & LAME > Ben Sgro (ProjectSkyLine) wrote: >> Good morning, >> Super off topic, but since this list is one of my best resources for >> help, >> I figured I'll try here. >> I've spent a lot of time on google and can't seem to figure out the >> problem. >> I have a PHP app that is converting .avi's to .flvs. I'm using ffmpeg >> and lame. >> I've built ffmpeg w/libmp3lame support enabled, to encode to .mp3 for >> the .flv >> However, I don't know much about this stuff, and I can't seem to figure >> out the correct >> parameters. The online documentation for ffmpeg is lacking. > > > It's not so much lacking, as there are so many different parameters that > are format specific, and many that you would only use for a particular > combination, that it is a waste of time to try to document it all when > they can be working on making the next version. > > Generally, I find it easiest when working with ffmpeg to find someone else > that wants to do what I want and start with a known working formula. > > For example, converting to flash is a web thing. > People running personal DVR's do a lot of Flash conversion. > So if you search for Mythweb and FLV you will get a lot of hits on people > who want to convert their MythTV recorded videos to FLV. > > Here is a simple howto, give it a try: > http://www.mythtv.org/wiki/index.php/Stream_mythtv_recordings_from_mythweb_using_flash_video > > Also, please note that FLVTOOL is very important in making flash videos. > Basically, without getting technical(cause I have no clue what it is), > the flv file you get from ffmpeg is gonna be one loooong file where you > have to start at the beginning and go to the end to view a file. No fast > forwarding, no rewinding. > > FLVTOOL adds some "bookmarks" to allow you to jump forward and back in the > flash player. > > FFMPEG is not always as forgiving of poorly packaged audio/video as a > video player(VLC, Windows Media, Realplayer, etc). Which leads to loads > of headaches when someone has a file that plays fine, but after conversion > is missing the last 5-15 seconds of audio or video or both! In such a > situation, one thing to do is to upload the video to Google video or > Youtube. They use similar programs and run into the same problems - so if > you can demonstrate that Youtube can't convert the video, you will find > people a lot more understanding of why their free/low cost app won't do > it. > > There are a couple of services to convert videos to flash(or convert from > any format to any format) where you submit your video and they email you a > link or some such. There was one I used that was credit based, so they > had a relatively intelligent API for doing the conversion - this moves the > conversion off of your responsibility and onto someone else, but it costs > something like 10 cents per video. For medium traffic sites or proof of > concepts, I'd start with them and only deal with ffmpeg when it becomes > economically justifiable(ie you are willing to put the hours in to > troubleshooting again and again when problems crop up). > > For extremely low volume, use Super to do the translation offline on a PC > and just upload Flash videos. > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Wed Oct 10 11:14:15 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Wed, 10 Oct 2007 11:14:15 -0400 Subject: [nycphp-talk] [OT] FFMPEG & LAME In-Reply-To: <00b601c80b4d$ccad83d0$6401a8c0@gamebox> References: <007701c80b42$21333410$6401a8c0@gamebox> <470CDC1E.6000906@beezifies.com> <00b601c80b4d$ccad83d0$6401a8c0@gamebox> Message-ID: <470CEC47.6080309@beezifies.com> Ben Sgro (ProjectSkyLine) wrote: >> with ffmpeg when it becomes economically justifiable(ie you are >> willing to put the hours in to troubleshooting again and again when >> problems crop up). > > Wish I knew what a problem it was before I fell into the trap of > deliverying > a working application. I knew what a problem it was and so set the rate quite high - so they had someone else do it and when they ran into problems than had to deal with hourly charges for troubleshooting. The sad thing was they were uploading maybe a dozen videos over the course of a week - ie it would take next to nothing to convert the videos manually and ensure they work perfectly. But they got stuck in the mindset that they paid hundreds of dollars for automatic conversion, so they wanted automatic conversion if it costs thousands more in troubleshooting problems. :-( From chsnyder at gmail.com Wed Oct 10 12:39:06 2007 From: chsnyder at gmail.com (csnyder) Date: Wed, 10 Oct 2007 12:39:06 -0400 Subject: [nycphp-talk] [OT] FFMPEG & LAME In-Reply-To: <007701c80b42$21333410$6401a8c0@gamebox> References: <007701c80b42$21333410$6401a8c0@gamebox> Message-ID: On 10/10/07, Ben Sgro (ProjectSkyLine) wrote: > Stream #0.1: Audio: pcm_u8, 11024 Hz, mono, 88 kb/s > Error while opening codec for output stream #0.1 - maybe incorrect > parameters such as bit_rate, rate, width or height The audio rate needs to be resampled to 44100Hz in order to work with the mp3 encoder. Use the command line switch -ar 44100 ffmpeg development frequently exceeds the ability of documentation to keep up--remember that it is an interface to a ton of different libraries and codecs, many of which are in constant flux themselves. The developers tend to reorganize command line switches between versions, too. C'est la vie, it's such a useful tool that you complain a bit and move on. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Wed Oct 10 12:47:44 2007 From: chsnyder at gmail.com (csnyder) Date: Wed, 10 Oct 2007 12:47:44 -0400 Subject: [nycphp-talk] [OT] FFMPEG & LAME In-Reply-To: <470CDC1E.6000906@beezifies.com> References: <007701c80b42$21333410$6401a8c0@gamebox> <470CDC1E.6000906@beezifies.com> Message-ID: On 10/10/07, bz-gmort at beezifies.com wrote: > Also, please note that FLVTOOL is very important in making flash videos. > Basically, without getting technical(cause I have no clue what it is), > the flv file you get from ffmpeg is gonna be one loooong file where you > have to start at the beginning and go to the end to view a file. No > fast forwarding, no rewinding. > > FLVTOOL adds some "bookmarks" to allow you to jump forward and back in > the flash player. This seems to have been fixed in recent versions of ffmpeg. Hmm, it seems I'm using the latest snapshot, so it might not be in any releases. The only problem I still experience with flv encoding under ffmpeg is an audio pop at the end of some videos. Otherwise it works great, and is impressively (even scarily) fast. -- Chris Snyder http://chxo.com/ From ben at projectskyline.com Wed Oct 10 13:14:54 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 10 Oct 2007 13:14:54 -0400 Subject: [nycphp-talk] [OT] FFMPEG & LAME References: <007701c80b42$21333410$6401a8c0@gamebox> Message-ID: <011e01c80b61$13f86bc0$6401a8c0@gamebox> Hello Chris, I got the sampling to work with -ar 22050, which I'm guessing I could change to 44100 without any trouble. Yah, ffmpeg is a great tool. Really powerful and yes, REALLY fast. I'm having trouble w/mpegs, but I've gotten the thumbnail's working as well. - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "csnyder" To: "NYPHP Talk" Sent: Wednesday, October 10, 2007 12:39 PM Subject: Re: [nycphp-talk] [OT] FFMPEG & LAME > On 10/10/07, Ben Sgro (ProjectSkyLine) wrote: > > >> Stream #0.1: Audio: pcm_u8, 11024 Hz, mono, 88 kb/s > >> Error while opening codec for output stream #0.1 - maybe incorrect >> parameters such as bit_rate, rate, width or height > > > The audio rate needs to be resampled to 44100Hz in order to work with > the mp3 encoder. Use the command line switch -ar 44100 > > ffmpeg development frequently exceeds the ability of documentation to > keep up--remember that it is an interface to a ton of different > libraries and codecs, many of which are in constant flux themselves. > > The developers tend to reorganize command line switches between > versions, too. C'est la vie, it's such a useful tool that you complain > a bit and move on. > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From cliff at pinestream.com Wed Oct 10 15:02:14 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 10 Oct 2007 15:02:14 -0400 Subject: [nycphp-talk] Is it hard to compile and install php from source? Message-ID: My service provider doesn?t have an rhel4 rpm for php5.2.x. They gave me three options: 1. Switch to Fedora 7 or Ubuntu 7.0.4 2. Have them do it (they quoted 1-3 hours) 3. Their last suggestion, which they discourage ? do it myself What do you suggest? The geek in me wants to take on the challenge. But the businessman in me knows there?s only so many hours in the day. Switching OS seem easy, but I have another server elsewhere that uses rhel4 and would like to maintain some consistency. Thoughts? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Wed Oct 10 15:11:05 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 10 Oct 2007 15:11:05 -0400 Subject: [nycphp-talk] Is it hard to compile and install php from source? References: Message-ID: <018101c80b71$4f2194f0$6401a8c0@gamebox> Is it hard to compile and install php from source?Hello Cliff, >From what I've heard and experiance, FC7 isn't really a great platform for deploying applications on. CentOS (rhel) is a better choice. Why not use CentOS, as it has the php versions you need. - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: Cliff Hirsch To: NYPHP Talk Sent: Wednesday, October 10, 2007 3:02 PM Subject: [nycphp-talk] Is it hard to compile and install php from source? My service provider doesn't have an rhel4 rpm for php5.2.x. They gave me three options: 1.. Switch to Fedora 7 or Ubuntu 7.0.4 2.. Have them do it (they quoted 1-3 hours) 3.. Their last suggestion, which they discourage - do it myself What do you suggest? The geek in me wants to take on the challenge. But the businessman in me knows there's only so many hours in the day. Switching OS seem easy, but I have another server elsewhere that uses rhel4 and would like to maintain some consistency. Thoughts? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Oct 10 15:09:11 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 10 Oct 2007 15:09:11 -0400 (EDT) Subject: [nycphp-talk] Is it hard to compile and install php from source? In-Reply-To: Message-ID: On Wed, 10 Oct 2007, Cliff Hirsch wrote: > What do you suggest? The geek in me wants to take on the challenge. But the > businessman in me knows there?s only so many hours in the day. Switching OS > seem easy, but I have another server elsewhere that uses rhel4 and would > like to maintain some consistency. Thoughts? PHP is not hard to build from source (though on Solaris its a bitch because the Solaris build system is old and retarded). It really depends on what extensions you want enabled. The libraries those extensions depend on need to be installed first before you configure and build PHP. So basically you will have to do the dependency checking first. I used to do this on older-no-longer-supported RH boxes. -- Aj. From cliff at pinestream.com Wed Oct 10 15:14:52 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 10 Oct 2007 15:14:52 -0400 Subject: [nycphp-talk] Is it hard to compile and install php from source? In-Reply-To: <018101c80b71$4f2194f0$6401a8c0@gamebox> Message-ID: Will have to check out CentOS. Its all the extensions that worry me. Figuring out what I need, getting them, installing them... On 10/10/07 3:11 PM, "Ben Sgro (ProjectSkyLine)" wrote: > Hello Cliff, > > From what I've heard and experiance, FC7 isn't really a great platform for > deploying applications on. > CentOS (rhel) is a better choice. > > Why not use CentOS, as it has the php versions you need. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rolan at omnistep.com Wed Oct 10 15:21:54 2007 From: rolan at omnistep.com (Rolan Yang) Date: Wed, 10 Oct 2007 15:21:54 -0400 Subject: [nycphp-talk] Good one today on xkcd Message-ID: <470D2652.8010804@omnistep.com> http://xkcd.com/327/ ~Rolan From phplists at jellyandcustard.com Wed Oct 10 15:23:42 2007 From: phplists at jellyandcustard.com (Khalid Hanif) Date: Wed, 10 Oct 2007 20:23:42 +0100 Subject: [nycphp-talk] Is it hard to compile and install php from source? In-Reply-To: <018101c80b71$4f2194f0$6401a8c0@gamebox> References: <018101c80b71$4f2194f0$6401a8c0@gamebox> Message-ID: <18ACFD74-E074-47AC-B8B5-3E10C06E2F57@jellyandcustard.com> On 10 Oct 2007, at 20:11, Ben Sgro ((ProjectSkyLine)) wrote: > From what I've heard and experiance, FC7 isn't really a great > platform for deploying applications on. What was your (bad?) experiences? I've used it without issues... Cliff, you should be able to use a fedora core source RPM on a RHEL system. I've done this on a RHEL3 system before, but not for PHP. It might be easier to get it done from source. If you don't fancy doing it, I'm sure there are people on this list and others who could assist. Khalid -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Wed Oct 10 15:41:53 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 10 Oct 2007 15:41:53 -0400 Subject: [nycphp-talk] Is it hard to compile and install php from source? References: <018101c80b71$4f2194f0$6401a8c0@gamebox> <18ACFD74-E074-47AC-B8B5-3E10C06E2F57@jellyandcustard.com> Message-ID: <01b901c80b75$9cfcee00$6401a8c0@gamebox> Hello, 1) Fedora is beta, CentOS is production releases. 2) Fedora has the life span of a house fly. 3) Rapid release cycle and no long-term support. 4) Not tied to redhat Its just better! = ] - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: Khalid Hanif To: NYPHP Talk Sent: Wednesday, October 10, 2007 3:23 PM Subject: Re: [nycphp-talk] Is it hard to compile and install php from source? On 10 Oct 2007, at 20:11, Ben Sgro ((ProjectSkyLine)) wrote: From what I've heard and experiance, FC7 isn't really a great platform for deploying applications on. What was your (bad?) experiences? I've used it without issues... Cliff, you should be able to use a fedora core source RPM on a RHEL system. I've done this on a RHEL3 system before, but not for PHP. It might be easier to get it done from source. If you don't fancy doing it, I'm sure there are people on this list and others who could assist. Khalid ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/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 msaraujo at php.net Wed Oct 10 15:44:17 2007 From: msaraujo at php.net (Marcelo Araujo) Date: Wed, 10 Oct 2007 16:44:17 -0300 Subject: [nycphp-talk] Is it hard to compile and install php from source? In-Reply-To: <01b901c80b75$9cfcee00$6401a8c0@gamebox> References: <018101c80b71$4f2194f0$6401a8c0@gamebox> <18ACFD74-E074-47AC-B8B5-3E10C06E2F57@jellyandcustard.com> <01b901c80b75$9cfcee00$6401a8c0@gamebox> Message-ID: <5947f2ab0710101244w24394b84jc08ce628b3c5a70e@mail.gmail.com> Well, IMO there is no such problem compile php in a fedora box. You may just choose the right directives carefully :) Regards, Marcelo Araujo On 10/10/07, Ben Sgro (ProjectSkyLine) wrote: > > Hello, > > 1) Fedora is beta, CentOS is production releases. > > 2) Fedora has the life span of a house fly. > 3) Rapid release cycle and no long-term support. > 4) Not tied to redhat > > Its just better! = ] > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use of the > individual to whom it is addressed. > > ----- Original Message ----- > *From:* Khalid Hanif > *To:* NYPHP Talk > *Sent:* Wednesday, October 10, 2007 3:23 PM > *Subject:* Re: [nycphp-talk] Is it hard to compile and install php from > source? > > On 10 Oct 2007, at 20:11, Ben Sgro ((ProjectSkyLine)) wrote: > > From what I've heard and experiance, FC7 isn't really a great platform for > deploying applications on. > > > What was your (bad?) experiences? I've used it without issues... > > Cliff, you should be able to use a fedora core source RPM on a RHEL > system. I've done this on a RHEL3 system before, but not for PHP. > > It might be easier to get it done from source. If you don't fancy doing > it, I'm sure there are people on this list and others who could assist. > > Khalid > > ------------------------------ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Wed Oct 10 16:07:37 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 10 Oct 2007 16:07:37 -0400 Subject: [nycphp-talk] Is it hard to compile and install php from source? In-Reply-To: <18ACFD74-E074-47AC-B8B5-3E10C06E2F57@jellyandcustard.com> Message-ID: On 10/10/07 3:23 PM, "Khalid Hanif" wrote: > On 10 Oct 2007, at 20:11, Ben Sgro ((ProjectSkyLine)) wrote: > >> From what I've heard and experiance, FC7 isn't really a great platform for >> deploying applications on. > > What was your (bad?) experiences? I've used it without issues... > > Cliff, you should be able to use a fedora core source RPM on a RHEL system. > I've done this on a RHEL3 system before, but not for PHP. > > It might be easier to get it done from source. If you don't fancy doing it, > I'm sure there are people on this list and others who could assist. > > Khalid > Good idea. I?ll have to try the Fedora rpm idea. If not, I might as well try installing myself. Good exercise for the future.... -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Oct 10 16:26:24 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 10 Oct 2007 16:26:24 -0400 (EDT) Subject: [nycphp-talk] Is it hard to compile and install php from source? In-Reply-To: <018101c80b71$4f2194f0$6401a8c0@gamebox> Message-ID: On Wed, 10 Oct 2007, Ben Sgro \(ProjectSkyLine\) wrote: > Is it hard to compile and install php from source?Hello Cliff, > > >From what I've heard and experiance, FC7 isn't really a great platform for deploying applications on. > CentOS (rhel) is a better choice. > > Why not use CentOS, as it has the php versions you need. CentOS is probably fine for PHP. Not so good for Ruby/Rails - I had to rebuild Ruby from source to be able to use Capistrano2 (in case you're wondering about the relevancy, Im using Capistrano to deploy PHP apps ;-) -- Aj. From ioplex at gmail.com Wed Oct 10 17:37:13 2007 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 10 Oct 2007 17:37:13 -0400 Subject: [nycphp-talk] Is it hard to compile and install php from source? In-Reply-To: References: Message-ID: <78c6bd860710101437x7a196ad8s50404487ae323e85@mail.gmail.com> On 10/10/07, Cliff Hirsch wrote: > Switch to Fedora 7 or Ubuntu 7.0.4 > Have them do it (they quoted 1-3 hours) > Their last suggestion, which they discourage ? do it myself > > What do you suggest? The geek in me wants to take on the challenge. But the > businessman in me knows there's only so many hours in the day. Switching OS > seem easy, but I have another server elsewhere that uses rhel4 and would > like to maintain some consistency. Thoughts? Hi Cliff, Once you install something from source, you bypass the automated update capability of your distro. That package and all of it's dependencies suddenly become much less predictable. For these reasons I almost never build anything from source. And when I do, I use rpmbuild to build from .src.rpm (on RPM based systems anyway). I recommend that you get a distro specifically suited to your needs. I agree with the other poster that CentOS is a good choice. Specifically you want CentOS 5 Server w/o X (although the .0 release looks like it has some SELinux issues - you might want to install w/ SELinux disabled and then enabled it later when you have everything dialed in). I do not recommend Fedora or Ubuntu or any other desktop oriented systems (even if it's a "server" version). RH's core business is Linux *servers* so stick with CentOS (for those who may not be aware, CentOS is basically RHEL with all the logos and stuff stripped out). That also makes it easy to upgrade to RHEL if you're business takes off an you want better support. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ioplex at gmail.com Wed Oct 10 17:44:55 2007 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 10 Oct 2007 17:44:55 -0400 Subject: [nycphp-talk] Is it hard to compile and install php from source? In-Reply-To: References: <018101c80b71$4f2194f0$6401a8c0@gamebox> Message-ID: <78c6bd860710101444p929ac8dx5a77fee75c5e7e61@mail.gmail.com> On 10/10/07, Cliff Hirsch wrote: > > Will have to check out CentOS. Its all the extensions that worry me. > Figuring out what I need, getting them, installing them... No worries. Just do: # yum list | grep php # yum install php-ldap # yum install php-imap # ... Yum will figure out all the deps and get and install the right packages. It's not the fastest thing in the world but it does the job and works out of the box. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From tgales at tgaconnect.com Wed Oct 10 22:28:35 2007 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 10 Oct 2007 22:28:35 -0400 Subject: [nycphp-talk] Is it hard to compile and install php from source? In-Reply-To: <78c6bd860710101437x7a196ad8s50404487ae323e85@mail.gmail.com> References: <78c6bd860710101437x7a196ad8s50404487ae323e85@mail.gmail.com> Message-ID: <470D8A53.9070505@tgaconnect.com> Michael B Allen wrote: > On 10/10/07, Cliff Hirsch wrote: > >> Switch to Fedora 7 or Ubuntu 7.0.4 >> Have them do it (they quoted 1-3 hours) >> Their last suggestion, which they discourage ? do it myself >> >> What do you suggest? The geek in me wants to take on the challenge. But the >> businessman in me knows there's only so many hours in the day. Switching OS >> seem easy, but I have another server elsewhere that uses rhel4 and would >> like to maintain some consistency. Thoughts? >> > > Hi Cliff, > > Once you install something from source, you bypass the automated > update capability of your distro. That package and all of it's > dependencies suddenly become much less predictable. For these reasons > I almost never build anything from source. And when I do, I use > rpmbuild to build from .src.rpm (on RPM based systems anyway). > > [snip] If you want to 'roll your own' with rpmbuild, have a lok at this: http://www.jasonlitka.com/2006/11/30/upgrading-php-520-rhel-centos/ T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From jonbaer at jonbaer.com Thu Oct 11 17:27:50 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 11 Oct 2007 17:27:50 -0400 Subject: [nycphp-talk] Zend Neon - (Zend Framework Project) Message-ID: <043522D9-17C5-43C8-BD7B-8EBE61E64FAE@jonbaer.com> Im taking Zend Neon for a spin + am not sure if all the templates being created for a framework project are actually working correctly. It looks like the index.php file is out of place and creating new Zend controllers + Zend views dont seem to place them properly unless you explicitly specify the path (as oppose to the project folder itself). All in all it's not bad but it seems some of the templates are incomplete(?), has anyone tried it out yet + have feedback and / or having same issues? - Jon From ben at projectskyline.com Thu Oct 11 20:27:52 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Thu, 11 Oct 2007 20:27:52 -0400 Subject: [nycphp-talk] Creating Avatar Images Message-ID: <001c01c80c66$baac7140$6401a8c0@gamebox> Hello All, I'm sure this has been done a bunch of times and answered even more. I looked around google and I just want to the most basic implementation I can find. Something in PEAR would be nice, but I'd like the "user friendly" wrapping of calls to already be done. I want to allow users to upload images (.png, .jpg, .jpeg, gif, etc) to use as an avatar for an online application. What's the best 3rd party lib for doing this. It will need to resize to approriate sizes (maybe even convert to a common format) and I need it to be secure, no "file.gif.php" or #> cat "" > img.php hacks. Thanks for the ideas!!!!! - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Thu Oct 11 21:42:10 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 11 Oct 2007 21:42:10 -0400 Subject: [nycphp-talk] Creating Avatar Images In-Reply-To: <001c01c80c66$baac7140$6401a8c0@gamebox> References: <001c01c80c66$baac7140$6401a8c0@gamebox> Message-ID: <77477ABA-1EAD-48FC-A344-F9CCC5865651@jonbaer.com> Have you looked @ the gravatar setup before? http://site.gravatar.com/site/implement - Jon On Oct 11, 2007, at 8:27 PM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello All, > > I'm sure this has been done a bunch of times and answered even more. > > I looked around google and I just want to the most basic > implementation > I can find. Something in PEAR would be nice, but I'd like the "user > friendly" > wrapping of calls to already be done. > > I want to allow users to upload images (.png, .jpg, .jpeg, gif, > etc) to use > as an avatar for an online application. > > What's the best 3rd party lib for doing this. It will need to > resize to approriate > sizes (maybe even convert to a common format) and I need it to be > secure, > no "file.gif.php" or #> cat "" > img.php hacks. > > Thanks for the ideas!!!!! > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use > of the individual to whom it is > addressed._______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Thu Oct 11 22:18:33 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Thu, 11 Oct 2007 22:18:33 -0400 Subject: [nycphp-talk] Creating Avatar Images References: <001c01c80c66$baac7140$6401a8c0@gamebox> <77477ABA-1EAD-48FC-A344-F9CCC5865651@jonbaer.com> Message-ID: <004601c80c76$30995ad0$6401a8c0@gamebox> Hello Jon, A gravatar, or globally recognized avatar, is quite simply an 80?80 pixel avatar image that follows you from weblog to weblog appearing beside your name when you comment on gravatar enabled sites. Avatars help identify your posts on web forums, so why not on weblogs? Not exactly what Im looking for. In fact, this has external dependencies on the gravatar.com site. Thanks anyways. - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: Jon Baer To: NYPHP Talk Sent: Thursday, October 11, 2007 9:42 PM Subject: Re: [nycphp-talk] Creating Avatar Images Have you looked @ the gravatar setup before? http://site.gravatar.com/site/implement - Jon On Oct 11, 2007, at 8:27 PM, Ben Sgro ((ProjectSkyLine)) wrote: Hello All, I'm sure this has been done a bunch of times and answered even more. I looked around google and I just want to the most basic implementation I can find. Something in PEAR would be nice, but I'd like the "user friendly" wrapping of calls to already be done. I want to allow users to upload images (.png, .jpg, .jpeg, gif, etc) to use as an avatar for an online application. What's the best 3rd party lib for doing this. It will need to resize to approriate sizes (maybe even convert to a common format) and I need it to be secure, no "file.gif.php" or #> cat "" > img.php hacks. Thanks for the ideas!!!!! - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed._______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/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 phplists at jellyandcustard.com Fri Oct 12 04:19:09 2007 From: phplists at jellyandcustard.com (Khalid Hanif) Date: Fri, 12 Oct 2007 09:19:09 +0100 Subject: [nycphp-talk] Creating Avatar Images In-Reply-To: <001c01c80c66$baac7140$6401a8c0@gamebox> References: <001c01c80c66$baac7140$6401a8c0@gamebox> Message-ID: On 12 Oct 2007, at 01:27, Ben Sgro ((ProjectSkyLine)) wrote: > I want to allow users to upload images (.png, .jpg, .jpeg, gif, > etc) to use > as an avatar for an online application. > > What's the best 3rd party lib for doing this. It will need to > resize to approriate > sizes (maybe even convert to a common format) http://pear.php.net/package/Image_Transform or http://pecl.php.net/package/imagick or use the GD Library - it's really not that hard... > and I need it to be secure, > no "file.gif.php" or #> cat "" > img.php hacks. Check for the file's mimetype via: http://pecl.php.net/package/Fileinfo (some docs on this: http:// www.jellyandcustard.com/2006/01/19/php-mime-types-and-fileinfo/ ) Or via the command line: /usr/bin/file -i filename.ext (your location of the file program may vary) Khalid -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Fri Oct 12 09:40:10 2007 From: tedd at sperling.com (tedd) Date: Fri, 12 Oct 2007 09:40:10 -0400 Subject: [nycphp-talk] Creating Avatar Images In-Reply-To: <001c01c80c66$baac7140$6401a8c0@gamebox> References: <001c01c80c66$baac7140$6401a8c0@gamebox> Message-ID: At 8:27 PM -0400 10/11/07, Ben Sgro \(ProjectSkyLine\) wrote: >Hello All, > >I'm sure this has been done a bunch of times and answered even more. > >I looked around google and I just want to the most basic implementation >I can find. Something in PEAR would be nice, but I'd like the "user friendly" >wrapping of calls to already be done. > >I want to allow users to upload images (.png, .jpg, .jpeg, gif, etc) to use >as an avatar for an online application. > >What's the best 3rd party lib for doing this. It will need to resize >to approriate >sizes (maybe even convert to a common format) and I need it to be secure, >no "file.gif.php" or #> cat "" > img.php hacks. > >Thanks for the ideas!!!!! > >- Ben Ben: What's the difference between an avatar and any other 80 x 80 pixels graphic? If there is no difference, then why not do it yourself? It's a fairly simple thing to upload a graphic and scale it to 80 x 80 pixels. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From jonbaer at jonbaer.com Fri Oct 12 12:24:37 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 12 Oct 2007 12:24:37 -0400 Subject: [nycphp-talk] Creating Avatar Images In-Reply-To: <004601c80c76$30995ad0$6401a8c0@gamebox> References: <001c01c80c66$baac7140$6401a8c0@gamebox> <77477ABA-1EAD-48FC-A344-F9CCC5865651@jonbaer.com> <004601c80c76$30995ad0$6401a8c0@gamebox> Message-ID: Well I was not suggesting to fully use the gravatar site itself (although you can scale to whatever size you wish for your avatar using &size=n), I think they recognize anything > 80px to not be an "avatar" ... your question dealt w/ the security of such images + the technique w/ the MD5 hash of email address link to an image path was more the idea. There actually is an excellent library if you want to roll your own ... http://phpthumb.sourceforge.net. It includes this hashing mechanism already. - Jon On Oct 11, 2007, at 10:18 PM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello Jon, > > A gravatar, or globally recognized avatar, is quite simply an 80?80 > pixel avatar image that follows you from weblog to weblog appearing > beside your name when you comment on gravatar enabled sites. > Avatars help identify your posts on web forums, so why not on weblogs? > > Not exactly what Im looking for. In fact, this has external > dependencies on the gravatar.com site. > > Thanks anyways. From brian at realm3.com Fri Oct 12 13:00:01 2007 From: brian at realm3.com (Brian D.) Date: Fri, 12 Oct 2007 13:00:01 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? Message-ID: I can't find where I read it originally, but somewhere I've been told or read that "using $_REQUEST is bad form." I understand that in cases where you want to force a $_POST request, but if you might receive $_GET or $_POST then isn't is better than doing if/elses? The only related thing I could find on Google was this guy ( http://mypetprogrammer.com/blog/?p=15 ) but he seems to erroneously believe that using $_POST somehow saves you from a SQL injection attack. I'm also thinking that some servers don't use the $_REQUEST array. Can you define why it's bad form? When is it considered acceptable to use? Thanks! - B. From aw at sap8.com Fri Oct 12 14:32:33 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Fri, 12 Oct 2007 14:32:33 -0400 Subject: [nycphp-talk] Releasing of memory used in results. Message-ID: <007201c80cfe$41782b00$c4688100$@com> What is the difference between let us say: unset($result); and mysql_free_result($result);? I noticed that unset's documentation doesn't include any information about memory being returned. Anthony Wlodarski aw at sap8.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Fri Oct 12 15:15:55 2007 From: ramons at gmx.net (David Krings) Date: Fri, 12 Oct 2007 15:15:55 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: References: Message-ID: <470FC7EB.4060404@gmx.net> Brian D. wrote: > I can't find where I read it originally, but somewhere I've been told > or read that "using $_REQUEST is bad form." I understand that in cases > where you want to force a $_POST request, but if you might receive > $_GET or $_POST then isn't is better than doing if/elses? I recall that this was discussed several weeks ago on this mailing list, so you may want to look through the archives. I never came across the situation where I didn't know if the incoming data comes fro a GET or a POST. In any case, I do want to know as I'd trust a GET even less than a POST to deliver some sane and safe data (not that I wouldn't check / prepare it anyway). IIRC the matter is not using or not using REQUEST, but what one does with the stuff that is returned. > The only related thing I could find on Google was this guy ( > http://mypetprogrammer.com/blog/?p=15 ) but he seems to erroneously > believe that using $_POST somehow saves you from a SQL injection > attack. You're saying it doesn't? But it still saves one from parse errors and 404s.... > I'm also thinking that some servers don't use the $_REQUEST array. That is possible. Server provided arrays are something that really baffles me, especially the wild variations between the various $_SERVER implementations. > Can you define why it's bad form? When is it considered acceptable to use? As mentioned above, I don't think it is "bad", but more dangerous in the sense that you may not get anything when the server does not craft this array. It is more that you need to know what to do with the data. I do wonder if there ever is a situation where it is unknown if date comes from POST or GET. Since you know what the variables are called and are supposed to contain, isn't it reasonable to assume that one also knows how the data gets submitted? David From brenttech at gmail.com Fri Oct 12 15:33:07 2007 From: brenttech at gmail.com (Brent Baisley) Date: Fri, 12 Oct 2007 15:33:07 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: References: Message-ID: <5d515c620710121233n51b59d7ax5d2557035c6a01c9@mail.gmail.com> It's bad form because you should know whether data is being passed to you from a form or via the url. You can post a form to a url that contains parameters, in which case some data will be in the $_GET array and some in the $_POST array. What happens if you have a parameter in the url with the same name as a form field? One of them will be missing in the $_REQUEST array. If you don't know which way a piece of data will be coming in, then you probably have a poorly designed site. The other thing to remember is that a url (meaning what's in the $_GET), gets recorded in the web server log. An unencrypted, plain text file. Nothing private she get recorded there. The rule to follow is that $_GET should be used to retrieve data from the server, $_POST should be used to pass data to the server. On 10/12/07, Brian D. wrote: > I can't find where I read it originally, but somewhere I've been told > or read that "using $_REQUEST is bad form." I understand that in cases > where you want to force a $_POST request, but if you might receive > $_GET or $_POST then isn't is better than doing if/elses? > > The only related thing I could find on Google was this guy ( > http://mypetprogrammer.com/blog/?p=15 ) but he seems to erroneously > believe that using $_POST somehow saves you from a SQL injection > attack. > > I'm also thinking that some servers don't use the $_REQUEST array. > > Can you define why it's bad form? When is it considered acceptable to use? > > Thanks! > - B. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Oct 12 15:43:43 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Fri, 12 Oct 2007 15:43:43 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: <470FC7EB.4060404@gmx.net> References: <470FC7EB.4060404@gmx.net> Message-ID: <470FCE6F.7020705@beezifies.com> David Krings wrote: > Brian D. wrote: >> Can you define why it's bad form? When is it considered acceptable to >> use? > > As mentioned above, I don't think it is "bad", but more dangerous in the > sense that you may not get anything when the server does not craft this > array. It is more that you need to know what to do with the data. I do > wonder if there ever is a situation where it is unknown if date comes > from POST or GET. Since you know what the variables are called and are > supposed to contain, isn't it reasonable to assume that one also knows > how the data gets submitted? If you setup an function to be called by multiple scripts(For example, pulling a list of matching auction lots based on search criteria) and you want to allow anyone to view your data or embed it on their site. You might PREFER to demand a POST, but since your goal is to advertise the data demanding it would be a stupid thing to do - let the other people pull the data for display any way they want. If your dealing with a large, complex application and your only changing one small part of it and have to complete it in a few hours. You may have a GET coming from one section of the site, but you can't guarantee some other page isn't doing a POST. All that said, though, it is remember that REQUEST is not just GET/POST, it's also COOKIE. So if your logic counts on certain variables being empty if their not passed to the script, Than your better off using conditional logic to retrieve JUST the GET and the POST. Mainly, the issue comes into play when you don't get to design/dictate the entire site OR you count on external web developers to call your app for some reason. From brian at realm3.com Fri Oct 12 15:59:55 2007 From: brian at realm3.com (Brian D.) Date: Fri, 12 Oct 2007 15:59:55 -0400 Subject: [nycphp-talk] Releasing of memory used in results. In-Reply-To: <007201c80cfe$41782b00$c4688100$@com> References: <007201c80cfe$41782b00$c4688100$@com> Message-ID: The difference, I think, lies in the fact that unset($result) unsets the "value" for a variable, whereas mysql_free_result actually free's the result identifier associated with $result (try echoing $result out before freeing it to see what I mean). Basically, mysql_free_result() is database aware, and unset() is not. - B. On 10/12/07, Anthony Wlodarski wrote: > > > > > What is the difference between let us say: unset($result); and > mysql_free_result($result);? > > > > I noticed that unset's documentation doesn't include any information about > memory being returned. > > > > Anthony Wlodarski > > aw at sap8.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 brenttech at gmail.com Fri Oct 12 16:36:59 2007 From: brenttech at gmail.com (Brent Baisley) Date: Fri, 12 Oct 2007 16:36:59 -0400 Subject: [nycphp-talk] Releasing of memory used in results. In-Reply-To: References: <007201c80cfe$41782b00$c4688100$@com> Message-ID: <5d515c620710121336s36bdc2d9q7cf788c9f090907b@mail.gmail.com> unset will free the memory from php's memory, mysql_free_result will free the memory from the database's memory. mysql_free_result really has little effect on php memory usage. On 10/12/07, Brian D. wrote: > The difference, I think, lies in the fact that unset($result) unsets > the "value" for a variable, whereas mysql_free_result actually free's > the result identifier associated with $result (try echoing $result out > before freeing it to see what I mean). > > Basically, mysql_free_result() is database aware, and unset() is not. > > - B. > > On 10/12/07, Anthony Wlodarski wrote: > > > > > > > > > > What is the difference between let us say: unset($result); and > > mysql_free_result($result);? > > > > > > > > I noticed that unset's documentation doesn't include any information about > > memory being returned. > > > > > > > > Anthony Wlodarski > > > > aw at sap8.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 > From chsnyder at gmail.com Fri Oct 12 17:07:52 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 12 Oct 2007 17:07:52 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: References: Message-ID: On 10/12/07, Brian D. wrote: > I can't find where I read it originally, but somewhere I've been told > or read that "using $_REQUEST is bad form." I understand that in cases > where you want to force a $_POST request, but if you might receive > $_GET or $_POST then isn't is better than doing if/elses? As others have mentioned, it is harder to debug and/or more open to confusion because it combines inputs, and that can sometimes lead to surprising results. It's not that you shouldn't use it, but you should be aware of the potential consequences (POSTed values overwriting GET, COOKIE values overwriting GET and POST) when you do. The semantics of the get and post HTTP methods is different. Get requests are always supposed to be "safe," not making changes to server-side resources. There is no expectation that post requests _must_ be unsafe, but it's kind of implied. Based on that, I think it is good form to pick either get or post for your interface, depending on whether a resource is being updated or not. -- Chris Snyder http://chxo.com/ From ben at projectskyline.com Fri Oct 12 19:17:35 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Fri, 12 Oct 2007 19:17:35 -0400 Subject: [nycphp-talk] Creating Avatar Images References: <001c01c80c66$baac7140$6401a8c0@gamebox><77477ABA-1EAD-48FC-A344-F9CCC5865651@jonbaer.com><004601c80c76$30995ad0$6401a8c0@gamebox> Message-ID: <008b01c80d26$139d66a0$6401a8c0@gamebox> Hello Again, No, I don't want to roll my own at all. I want the quickest way possible to do this. The code I have *should* work, but doesn't.... $imageObject =& Image_Transform::factory(''); $imageObject->load($fileName); if ( PEAR::isError($imageObject) ) { error_log("imageObject->load( ) error"); } $imageObject->fit(90, 110); if ( PEAR::isError($imageObject) ) { error_log("imageObject->fit( ) error"); } $newFileName = substr($fileName, 0, strrpos($fileName,".")); $newFileName .= '.png'; $imageObject->save(USER_IMAGES_PATH . $newFileName); if ( PEAR::isError($imageObject) ) { error_log("imageObject->save( ) error"); } print_r($imageObject); I can't figure it out. No PEAR errors are getting thrown, but the image is never being saved. Any ideas? The file is getting uploaded to the server, I can see that. Thanks! - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Jon Baer" To: "NYPHP Talk" Sent: Friday, October 12, 2007 12:24 PM Subject: Re: [nycphp-talk] Creating Avatar Images Well I was not suggesting to fully use the gravatar site itself (although you can scale to whatever size you wish for your avatar using &size=n), I think they recognize anything > 80px to not be an "avatar" ... your question dealt w/ the security of such images + the technique w/ the MD5 hash of email address link to an image path was more the idea. There actually is an excellent library if you want to roll your own ... http://phpthumb.sourceforge.net. It includes this hashing mechanism already. - Jon On Oct 11, 2007, at 10:18 PM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello Jon, > > A gravatar, or globally recognized avatar, is quite simply an 80?80 pixel > avatar image that follows you from weblog to weblog appearing beside your > name when you comment on gravatar enabled sites. Avatars help identify > your posts on web forums, so why not on weblogs? > > Not exactly what Im looking for. In fact, this has external dependencies > on the gravatar.com site. > > Thanks anyways. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ben at projectskyline.com Fri Oct 12 19:20:31 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Fri, 12 Oct 2007 19:20:31 -0400 Subject: [nycphp-talk] Creating Avatar Images References: <001c01c80c66$baac7140$6401a8c0@gamebox><77477ABA-1EAD-48FC-A344-F9CCC5865651@jonbaer.com><004601c80c76$30995ad0$6401a8c0@gamebox> <008b01c80d26$139d66a0$6401a8c0@gamebox> Message-ID: <009301c80d26$7cedb290$6401a8c0@gamebox> Quick thing, Just a bit more info for those that want to help debug: The contents of the imageObject print_r( ) call: Image_Transform_Driver_GD Object ( [imageHandle] => [old_image] => [image] => 8752441244710006fed1bf.jpg [type] => [img_x] => [img_y] => [new_x] => [new_y] => [lib_path] => [resized] => [_options] => Array ( [quality] => 75 [scaleMethod] => smooth [canvasColor] => Array ( [0] => 255 [1] => 255 [2] => 255 ) [pencilColor] => Array ( [0] => 0 [1] => 0 [2] => 0 ) [textColor] => Array ( [0] => 0 [1] => 0 [2] => 0 ) ) [keep_settings_on_save] => [_supported_image_types] => Array ( [png] => rw [gif] => rw [jpeg] => rw [wbmp] => rw ) [_error] => [_programs] => Array ( ) [default_text_params] => Array ( [text] => Default text [x] => 10 [y] => 20 [color] => red [font] => Arial.ttf [size] => 12 [angle] => 0 [resize_first] => ) ) The dir's are chmod 777 just because. if ( $stateObject->Get('do_avatar') == TRUE ) { $uploadObject = new FileUpload(0666); $fileName = $uploadObject->MoveFile(USER_IMAGES_PATH, 'uploadImage'); error_log($fileName); if ( $fileName == PROC_FAILURE ) { /* There has been an unrecoverable error. */ error_log(USER_IMAGES_PATH . ' directory does not exist'); return PROC_FAILURE; } $imageObject =& Image_Transform::factory(''); $imageObject->load($fileName); if ( PEAR::isError($imageObject) ) { error_log("imageObject->load( ) error"); } $imageObject->fit(90, 110); if ( PEAR::isError($imageObject) ) { error_log("imageObject->fit( ) error"); } $newFileName = substr($fileName, 0, strrpos($fileName,".")); $newFileName .= '.png'; $imageObject->save(USER_IMAGES_PATH . $newFileName); if ( PEAR::isError($imageObject) ) { error_log("imageObject->save( ) error"); } print_r($imageObject); } ^ The entire code snippet. - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Ben Sgro (ProjectSkyLine)" To: "NYPHP Talk" Sent: Friday, October 12, 2007 7:17 PM Subject: Re: [nycphp-talk] Creating Avatar Images > Hello Again, > > No, I don't want to roll my own at all. I want the quickest way possible > to do this. > > The code I have *should* work, but doesn't.... > > $imageObject =& Image_Transform::factory(''); > $imageObject->load($fileName); > if ( PEAR::isError($imageObject) ) > { > error_log("imageObject->load( ) error"); > } > $imageObject->fit(90, 110); > if ( PEAR::isError($imageObject) ) > { > error_log("imageObject->fit( ) error"); > } > $newFileName = substr($fileName, 0, strrpos($fileName,".")); > $newFileName .= '.png'; > $imageObject->save(USER_IMAGES_PATH . $newFileName); > if ( PEAR::isError($imageObject) ) > { > error_log("imageObject->save( ) error"); > } > print_r($imageObject); > > I can't figure it out. No PEAR errors are getting thrown, > but the image is never being saved. > > Any ideas? The file is getting uploaded to the server, I can see that. > > Thanks! > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use of the > individual to whom it is addressed. > ----- Original Message ----- > From: "Jon Baer" > To: "NYPHP Talk" > Sent: Friday, October 12, 2007 12:24 PM > Subject: Re: [nycphp-talk] Creating Avatar Images > > > Well I was not suggesting to fully use the gravatar site itself > (although you can scale to whatever size you wish for your avatar > using &size=n), I think they recognize anything > 80px to not be an > "avatar" ... your question dealt w/ the security of such images + the > technique w/ the MD5 hash of email address link to an image path was > more the idea. > > There actually is an excellent library if you want to roll your > own ... http://phpthumb.sourceforge.net. It includes this hashing > mechanism already. > > - Jon > > On Oct 11, 2007, at 10:18 PM, Ben Sgro ((ProjectSkyLine)) wrote: > >> Hello Jon, >> >> A gravatar, or globally recognized avatar, is quite simply an 80?80 >> pixel avatar image that follows you from weblog to weblog appearing >> beside your name when you comment on gravatar enabled sites. Avatars >> help identify your posts on web forums, so why not on weblogs? >> >> Not exactly what Im looking for. In fact, this has external dependencies >> on the gravatar.com site. >> >> Thanks anyways. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 ken at secdat.com Sat Oct 13 10:31:45 2007 From: ken at secdat.com (Kenneth Downs) Date: Sat, 13 Oct 2007 10:31:45 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: References: Message-ID: <4710D6D1.4070100@secdat.com> Brian D. wrote: > I can't find where I read it originally, but somewhere I've been told > or read that "using $_REQUEST is bad form." I understand that in cases > where you want to force a $_POST request, but if you might receive > $_GET or $_POST then isn't is better than doing if/elses? > Others have already pointed out that for reliability sake, $_POST and $_GET give you direct access to user supplied data before some other process has interfered with it. Originally GET and POST were intended for different purposes. The one to "get" data from the server and the other to "post" data to the server. In real life this means that a GET querystring is limited, depending on the browser, to about 2000-8000 bytes. A POST query on the other hand is expected to upload files, possibly post large text fields and so forth and so the size of a POST is allowed to be much more than a GET. But if you take large uploads out of the picture, the simple fact is that a GET and POST are functionally identical once the PHP script is executing. Each arrives as an associative array. If you treat them differently then you are doing so out of respect for conventions that have no direct impact on your program. In cases like this I go back and forth. I will do whatever produces the most reliable code, even if it defies convention, but if there is nothing to be gained by defying convention I will try to go along so as to avoid all the free advice you get from the code police. > The only related thing I could find on Google was this guy ( > http://mypetprogrammer.com/blog/?p=15 ) but he seems to erroneously > believe that using $_POST somehow saves you from a SQL injection > attack. > > I'm also thinking that some servers don't use the $_REQUEST array. > > Can you define why it's bad form? When is it considered acceptable to use? > > Thanks! > - B. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Sat Oct 13 12:48:22 2007 From: ramons at gmx.net (David Krings) Date: Sat, 13 Oct 2007 12:48:22 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: <4710D6D1.4070100@secdat.com> References: <4710D6D1.4070100@secdat.com> Message-ID: <4710F6D6.6000603@gmx.net> Kenneth Downs wrote: > Brian D. wrote: >> I can't find where I read it originally, but somewhere I've been told >> or read that "using $_REQUEST is bad form." I understand that in cases >> where you want to force a $_POST request, but if you might receive >> $_GET or $_POST then isn't is better than doing if/elses? >> > > Others have already pointed out that for reliability sake, $_POST and > $_GET give you direct access to user supplied data before some other > process has interfered with it. > > Originally GET and POST were intended for different purposes. The one > to "get" data from the server and the other to "post" data to the > server. In real life this means that a GET querystring is limited, > depending on the browser, to about 2000-8000 bytes. A POST query on the > other hand is expected to upload files, possibly post large text fields > and so forth and so the size of a POST is allowed to be much more than a > GET. > > But if you take large uploads out of the picture, the simple fact is > that a GET and POST are functionally identical once the PHP script is > executing. Each arrives as an associative array. If you treat them > differently then you are doing so out of respect for conventions that > have no direct impact on your program. In cases like this I go back > and forth. I will do whatever produces the most reliable code, even if > it defies convention, but if there is nothing to be gained by defying > convention I will try to go along so as to avoid all the free advice you > get from the code police. One difference not pointed out is that GET is usually transmitted in plain sight via URL, whereas POST is not. That hasn't anything to do with what happens on the server side. I generally dislike GET just for that reason, but sometimes it comes in handy. David From jeffmailings99 at verizon.net Sat Oct 13 12:59:55 2007 From: jeffmailings99 at verizon.net (Jeff Siegel) Date: Sat, 13 Oct 2007 12:59:55 -0400 Subject: [nycphp-talk] From Rails back to PHP Message-ID: Thought this might be of interest. "I spent two years trying to make Rails do something it wasn?t meant to do, then realized my old abandoned language (PHP, in my case) would do just fine if approached with my new Rails-gained wisdom." See: http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1 .html Jeff From ben at projectskyline.com Sat Oct 13 13:26:18 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Sat, 13 Oct 2007 13:26:18 -0400 Subject: [nycphp-talk] From Rails back to PHP References: Message-ID: <004d01c80dbe$2b151b50$6401a8c0@gamebox> Jeff, Good read, thanks for sharing. - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Jeff Siegel" To: "NYPHP Talk" Sent: Saturday, October 13, 2007 12:59 PM Subject: [nycphp-talk] From Rails back to PHP > Thought this might be of interest. > > "I spent two years trying to make Rails do something it wasn't meant to > do, > then realized my old abandoned language (PHP, in my case) would do just > fine > if approached with my new Rails-gained wisdom." > > See: > http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1 > .html > > 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 From brian at realm3.com Sun Oct 14 16:26:31 2007 From: brian at realm3.com (Brian D.) Date: Sun, 14 Oct 2007 16:26:31 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: References: <4710D6D1.4070100@secdat.com> <4710F6D6.6000603@gmx.net> Message-ID: The most direct answer to my original question was from Brent: "It's bad form because you should know whether data is being passed to you from a form or via the url." While this is partially correct, I believe that you could run into situations that you want to accept both (e.g., a record ID via a hidden field or via a GET). I'm aware of the differences between POST and GET, I just wasn't sure why using the $_REQUEST array was considered bad form. Another good point that was made: "Mainly, the issue comes into play when you don't get to design/dictate the entire site OR you count on external web developers to call your app for some reason." As far as I can tell there's nothing fundamentally wrong with using $_REQUEST, but if you can control how the data is passed, more power to you. One last question, David, you said in reference to $_POST saving one from SQL injections: "You're saying it doesn't? But it still saves one from parse errors and 404s...." Using $_POST over $_REQUEST makes no difference in what you receive - you'll still have to escape data that you put into a SQL query either way. How does using $_POST save one from parse errors and 404s? Thanks for all of the feedback. From brian at realm3.com Sun Oct 14 16:40:23 2007 From: brian at realm3.com (Brian D.) Date: Sun, 14 Oct 2007 16:40:23 -0400 Subject: [nycphp-talk] Creating Avatar Images In-Reply-To: References: <001c01c80c66$baac7140$6401a8c0@gamebox> <77477ABA-1EAD-48FC-A344-F9CCC5865651@jonbaer.com> <004601c80c76$30995ad0$6401a8c0@gamebox> <008b01c80d26$139d66a0$6401a8c0@gamebox> <009301c80d26$7cedb290$6401a8c0@gamebox> Message-ID: A few things to try: - It might seem obvious, but first I'd confirm that the error_log is acting as expected. - After you first initialize the factory() object, check to see if that creates an error. - When calling "save" you're only passing the filename. I don't know if you're perhaps using an older version of this, but according to the documentation a 'type' parameter is also required. See docs here: http://pear.php.net/package/Image_Transform/docs/latest/Image_Transform/Image_Transform.html#methodsave Just a couple of other things that I noticed: - The blank string in the factory() call isn't necessary (it defaults to that anyway). - If it does turn out to the be second parameter in save() causing your problem, you might want to check your php.ini file to make sure the E_WARNINGs are being displayed or handled somehow. On 10/12/07, Ben Sgro (ProjectSkyLine) wrote: > Quick thing, > > Just a bit more info for those that want to help debug: > > The contents of the imageObject print_r( ) call: > > Image_Transform_Driver_GD Object ( [imageHandle] => [old_image] => [image] > => 8752441244710006fed1bf.jpg [type] => [img_x] => [img_y] => [new_x] => > [new_y] => [lib_path] => [resized] => [_options] => Array ( [quality] => 75 > [scaleMethod] => smooth [canvasColor] => Array ( [0] => 255 [1] => 255 [2] > => 255 ) [pencilColor] => Array ( [0] => 0 [1] => 0 [2] => 0 ) [textColor] > => Array ( [0] => 0 [1] => 0 [2] => 0 ) ) [keep_settings_on_save] => > [_supported_image_types] => Array ( [png] => rw [gif] => rw [jpeg] => rw > [wbmp] => rw ) [_error] => [_programs] => Array ( ) [default_text_params] => > Array ( [text] => Default text [x] => 10 [y] => 20 [color] => red [font] => > Arial.ttf [size] => 12 [angle] => 0 [resize_first] => ) ) > > The dir's are chmod 777 just because. > > > if ( $stateObject->Get('do_avatar') == TRUE ) > { > $uploadObject = new FileUpload(0666); > $fileName = $uploadObject->MoveFile(USER_IMAGES_PATH, > 'uploadImage'); > error_log($fileName); > if ( $fileName == PROC_FAILURE ) > { /* There has been an unrecoverable error. */ > error_log(USER_IMAGES_PATH . ' directory does not exist'); > return PROC_FAILURE; > } > > $imageObject =& Image_Transform::factory(''); > $imageObject->load($fileName); > if ( PEAR::isError($imageObject) ) > { > error_log("imageObject->load( ) error"); > } > $imageObject->fit(90, 110); > if ( PEAR::isError($imageObject) ) > { > error_log("imageObject->fit( ) error"); > } > $newFileName = substr($fileName, 0, strrpos($fileName,".")); > $newFileName .= '.png'; > $imageObject->save(USER_IMAGES_PATH . $newFileName); > if ( PEAR::isError($imageObject) ) > { > error_log("imageObject->save( ) error"); > } > print_r($imageObject); > } > > ^ The entire code snippet. > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use of the > individual to whom it is addressed. > ----- Original Message ----- > From: "Ben Sgro (ProjectSkyLine)" > To: "NYPHP Talk" > Sent: Friday, October 12, 2007 7:17 PM > Subject: Re: [nycphp-talk] Creating Avatar Images > > > > Hello Again, > > > > No, I don't want to roll my own at all. I want the quickest way possible > > to do this. > > > > The code I have *should* work, but doesn't.... > > > > $imageObject =& Image_Transform::factory(''); > > $imageObject->load($fileName); > > if ( PEAR::isError($imageObject) ) > > { > > error_log("imageObject->load( ) error"); > > } > > $imageObject->fit(90, 110); > > if ( PEAR::isError($imageObject) ) > > { > > error_log("imageObject->fit( ) error"); > > } > > $newFileName = substr($fileName, 0, strrpos($fileName,".")); > > $newFileName .= '.png'; > > $imageObject->save(USER_IMAGES_PATH . $newFileName); > > if ( PEAR::isError($imageObject) ) > > { > > error_log("imageObject->save( ) error"); > > } > > print_r($imageObject); > > > > I can't figure it out. No PEAR errors are getting thrown, > > but the image is never being saved. > > > > Any ideas? The file is getting uploaded to the server, I can see that. > > > > Thanks! > > > > - Ben > > > > Ben Sgro, President > > ProjectSkyLine - Defining New Horizons > > +1 718.487.9368 (N.Y. Office) > > > > Our company: www.projectskyline.com > > Our products: www.project-contact.com > > > > This e-mail is confidential information intended only for the use of the > > individual to whom it is addressed. > > ----- Original Message ----- > > From: "Jon Baer" > > To: "NYPHP Talk" > > Sent: Friday, October 12, 2007 12:24 PM > > Subject: Re: [nycphp-talk] Creating Avatar Images > > > > > > Well I was not suggesting to fully use the gravatar site itself > > (although you can scale to whatever size you wish for your avatar > > using &size=n), I think they recognize anything > 80px to not be an > > "avatar" ... your question dealt w/ the security of such images + the > > technique w/ the MD5 hash of email address link to an image path was > > more the idea. > > > > There actually is an excellent library if you want to roll your > > own ... http://phpthumb.sourceforge.net. It includes this hashing > > mechanism already. > > > > - Jon > > > > On Oct 11, 2007, at 10:18 PM, Ben Sgro ((ProjectSkyLine)) wrote: > > > >> Hello Jon, > >> > >> A gravatar, or globally recognized avatar, is quite simply an 80?80 > >> pixel avatar image that follows you from weblog to weblog appearing > >> beside your name when you comment on gravatar enabled sites. Avatars > >> help identify your posts on web forums, so why not on weblogs? > >> > >> Not exactly what Im looking for. In fact, this has external dependencies > >> on the gravatar.com site. > >> > >> Thanks anyways. > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From ramons at gmx.net Sun Oct 14 16:59:21 2007 From: ramons at gmx.net (David Krings) Date: Sun, 14 Oct 2007 16:59:21 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: References: <4710D6D1.4070100@secdat.com> <4710F6D6.6000603@gmx.net> Message-ID: <47128329.6020107@gmx.net> Brian D. wrote: > One last question, David, you said in reference to $_POST saving one >>from SQL injections: > "You're saying it doesn't? But it still saves one from parse errors > and 404s...." > > Using $_POST over $_REQUEST makes no difference in what you receive - > you'll still have to escape data that you put into a SQL query either > way. How does using $_POST save one from parse errors and 404s? > Sometimes sarcasm does... ;) David From paul at devonianfarm.com Sun Oct 14 19:01:24 2007 From: paul at devonianfarm.com (Paul Houle) Date: Sun, 14 Oct 2007 19:01:24 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: <4710D6D1.4070100@secdat.com> References: <4710D6D1.4070100@secdat.com> Message-ID: <47129FC4.8030404@devonianfarm.com> The most effective PHP code doesn't use $_GET, $_POST, $_REQUEST or any of those superglobals except inside a few subroutines. $_GET, $_POST and $_REQUEST are not reliable across PHP hosting environments because some have "magic_quotes_gpc"on and other have it off. There's also the problem that some PHP environments have strict variable checking on and others don't. If you want "value not set" to evaluate false without errors and warnings, you need to write something like: if(isset($_GET["myvar"])) { $myvar=$_GET["myvar"]; } else { $myvar=""; } This gets tedious if you need to write it hundreds of times in your app, so write something like function get($name,$default_value="") { if(!isset($_GET[$name])) { return $default_value }; if (get_magic_quotes_gpc()) { return stripslashes($_GET[$name]); } else { return $_GET[$name]; } } Now you can forget about magic_quotes_gpc and other runtime configuration and go ahead writing reliable apps. In real life you might pick a name that's a little less prone to namespace conflict. From ben at projectskyline.com Sun Oct 14 20:11:15 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Sun, 14 Oct 2007 20:11:15 -0400 Subject: [nycphp-talk] Creating Avatar Images References: <001c01c80c66$baac7140$6401a8c0@gamebox><77477ABA-1EAD-48FC-A344-F9CCC5865651@jonbaer.com><004601c80c76$30995ad0$6401a8c0@gamebox><008b01c80d26$139d66a0$6401a8c0@gamebox><009301c80d26$7cedb290$6401a8c0@gamebox> Message-ID: <001701c80ebf$e887b790$6401a8c0@gamebox> Hello Brian, Thanks, I fixed it though (by using another library.) heh. - Ben $imageObject = new ImageTransform( ); $imageObject->sourceFile = USER_IMAGES_PATH . $fileName; $newFileName = substr($fileName, 0, strrpos($fileName,".")); $newFileName .= '.png'; $imageObject->targetFile = USER_IMAGES_PATH . $newFileName; $imageObject->resizeToHeight = 90; $imageObject->resizeToWidth = 110; if ( !$imageObject->resize( ) ) { error_log($imageObject->error); } Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Brian D." To: "NYPHP Talk" Sent: Sunday, October 14, 2007 4:40 PM Subject: [nycphp-talk] Creating Avatar Images A few things to try: - It might seem obvious, but first I'd confirm that the error_log is acting as expected. - After you first initialize the factory() object, check to see if that creates an error. - When calling "save" you're only passing the filename. I don't know if you're perhaps using an older version of this, but according to the documentation a 'type' parameter is also required. See docs here: http://pear.php.net/package/Image_Transform/docs/latest/Image_Transform/Image_Transform.html#methodsave Just a couple of other things that I noticed: - The blank string in the factory() call isn't necessary (it defaults to that anyway). - If it does turn out to the be second parameter in save() causing your problem, you might want to check your php.ini file to make sure the E_WARNINGs are being displayed or handled somehow. On 10/12/07, Ben Sgro (ProjectSkyLine) wrote: > Quick thing, > > Just a bit more info for those that want to help debug: > > The contents of the imageObject print_r( ) call: > > Image_Transform_Driver_GD Object ( [imageHandle] => [old_image] => [image] > => 8752441244710006fed1bf.jpg [type] => [img_x] => [img_y] => [new_x] => > [new_y] => [lib_path] => [resized] => [_options] => Array ( [quality] => > 75 > [scaleMethod] => smooth [canvasColor] => Array ( [0] => 255 [1] => 255 [2] > => 255 ) [pencilColor] => Array ( [0] => 0 [1] => 0 [2] => 0 ) [textColor] > => Array ( [0] => 0 [1] => 0 [2] => 0 ) ) [keep_settings_on_save] => > [_supported_image_types] => Array ( [png] => rw [gif] => rw [jpeg] => rw > [wbmp] => rw ) [_error] => [_programs] => Array ( ) [default_text_params] > => > Array ( [text] => Default text [x] => 10 [y] => 20 [color] => red [font] > => > Arial.ttf [size] => 12 [angle] => 0 [resize_first] => ) ) > > The dir's are chmod 777 just because. > > > if ( $stateObject->Get('do_avatar') == TRUE ) > { > $uploadObject = new FileUpload(0666); > $fileName = $uploadObject->MoveFile(USER_IMAGES_PATH, > 'uploadImage'); > error_log($fileName); > if ( $fileName == PROC_FAILURE ) > { /* There has been an unrecoverable error. */ > error_log(USER_IMAGES_PATH . ' directory does not exist'); > return PROC_FAILURE; > } > > $imageObject =& Image_Transform::factory(''); > $imageObject->load($fileName); > if ( PEAR::isError($imageObject) ) > { > error_log("imageObject->load( ) error"); > } > $imageObject->fit(90, 110); > if ( PEAR::isError($imageObject) ) > { > error_log("imageObject->fit( ) error"); > } > $newFileName = substr($fileName, 0, strrpos($fileName,".")); > $newFileName .= '.png'; > $imageObject->save(USER_IMAGES_PATH . $newFileName); > if ( PEAR::isError($imageObject) ) > { > error_log("imageObject->save( ) error"); > } > print_r($imageObject); > } > > ^ The entire code snippet. > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use of the > individual to whom it is addressed. > ----- Original Message ----- > From: "Ben Sgro (ProjectSkyLine)" > To: "NYPHP Talk" > Sent: Friday, October 12, 2007 7:17 PM > Subject: Re: [nycphp-talk] Creating Avatar Images > > > > Hello Again, > > > > No, I don't want to roll my own at all. I want the quickest way possible > > to do this. > > > > The code I have *should* work, but doesn't.... > > > > $imageObject =& Image_Transform::factory(''); > > $imageObject->load($fileName); > > if ( PEAR::isError($imageObject) ) > > { > > error_log("imageObject->load( ) error"); > > } > > $imageObject->fit(90, 110); > > if ( PEAR::isError($imageObject) ) > > { > > error_log("imageObject->fit( ) error"); > > } > > $newFileName = substr($fileName, 0, strrpos($fileName,".")); > > $newFileName .= '.png'; > > $imageObject->save(USER_IMAGES_PATH . $newFileName); > > if ( PEAR::isError($imageObject) ) > > { > > error_log("imageObject->save( ) error"); > > } > > print_r($imageObject); > > > > I can't figure it out. No PEAR errors are getting thrown, > > but the image is never being saved. > > > > Any ideas? The file is getting uploaded to the server, I can see that. > > > > Thanks! > > > > - Ben > > > > Ben Sgro, President > > ProjectSkyLine - Defining New Horizons > > +1 718.487.9368 (N.Y. Office) > > > > Our company: www.projectskyline.com > > Our products: www.project-contact.com > > > > This e-mail is confidential information intended only for the use of the > > individual to whom it is addressed. > > ----- Original Message ----- > > From: "Jon Baer" > > To: "NYPHP Talk" > > Sent: Friday, October 12, 2007 12:24 PM > > Subject: Re: [nycphp-talk] Creating Avatar Images > > > > > > Well I was not suggesting to fully use the gravatar site itself > > (although you can scale to whatever size you wish for your avatar > > using &size=n), I think they recognize anything > 80px to not be an > > "avatar" ... your question dealt w/ the security of such images + the > > technique w/ the MD5 hash of email address link to an image path was > > more the idea. > > > > There actually is an excellent library if you want to roll your > > own ... http://phpthumb.sourceforge.net. It includes this hashing > > mechanism already. > > > > - Jon > > > > On Oct 11, 2007, at 10:18 PM, Ben Sgro ((ProjectSkyLine)) wrote: > > > >> Hello Jon, > >> > >> A gravatar, or globally recognized avatar, is quite simply an 80?80 > >> pixel avatar image that follows you from weblog to weblog appearing > >> beside your name when you comment on gravatar enabled sites. Avatars > >> help identify your posts on web forums, so why not on weblogs? > >> > >> Not exactly what Im looking for. In fact, this has external > >> dependencies > >> on the gravatar.com site. > >> > >> Thanks anyways. > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From dcech at phpwerx.net Mon Oct 15 10:53:35 2007 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 15 Oct 2007 10:53:35 -0400 Subject: [nycphp-talk] From Rails back to PHP In-Reply-To: References: Message-ID: <47137EEF.40706@phpwerx.net> Jeff Siegel wrote: > Thought this might be of interest. > > "I spent two years trying to make Rails do something it wasn?t meant to do, > then realized my old abandoned language (PHP, in my case) would do just fine > if approached with my new Rails-gained wisdom." Great article Jeff, thanks for the post. Dan > See: > http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1 > .html > > Jeff From mitch.pirtle at gmail.com Mon Oct 15 12:23:01 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 15 Oct 2007 12:23:01 -0400 Subject: [nycphp-talk] From Rails back to PHP In-Reply-To: References: Message-ID: <330532b60710150923p5a5c7c68q1ba515d74490f977@mail.gmail.com> On 10/13/07, Jeff Siegel wrote: > Thought this might be of interest. > > "I spent two years trying to make Rails do something it wasn't meant to do, > then realized my old abandoned language (PHP, in my case) would do just fine > if approached with my new Rails-gained wisdom." > > See: > http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1 > .html The comments perhaps are more informative than the article was, as he barely explained anything in any meaningful detail. Other than "I tried to do a PHP site in Rails the PHP way, and it sucked." there's *very* little information in this article. Perhaps the most amusing was the vi-vs-emacs style debate that raged for about a week. Personally I see each with their own strengths, and prefer to make software with the right tool for the job (the old hammer/drill saying applies here). However, I can agree with one sentiment that the author has - working in Rails has made me a better PHP developer, with better application design and semantics. And PHP has the flexibility for me to go beyond that world, whether that is good or bad is up for debate though *laugh* -- Mitch From mailinglists at caseysoftware.com Mon Oct 15 14:18:07 2007 From: mailinglists at caseysoftware.com (Keith Casey) Date: Mon, 15 Oct 2007 14:18:07 -0400 Subject: [nycphp-talk] From Rails back to PHP In-Reply-To: <330532b60710150923p5a5c7c68q1ba515d74490f977@mail.gmail.com> References: <330532b60710150923p5a5c7c68q1ba515d74490f977@mail.gmail.com> Message-ID: On 10/15/07, Mitch Pirtle wrote: > However, I can agree with one sentiment that the author has - working > in Rails has made me a better PHP developer, with better application > design and semantics. And PHP has the flexibility for me to go beyond > that world, whether that is good or bad is up for debate though > *laugh* But that's not exclusive to Rails... I think being versed in multiple languages causes this inherently. I came to PHP from a long history with Java and Struts, so I tend to approach things in an OO-manner with a heavy focus on Unit Testing and MVC. Stealing... er.. sharing good ideas and lessons learned only helps. kc -- D. Keith Casey Jr. CEO, CaseySoftware, LLC http://CaseySoftware.com From ali at vpproperty.com Mon Oct 15 18:36:08 2007 From: ali at vpproperty.com (ali mohammad) Date: Mon, 15 Oct 2007 18:36:08 -0400 Subject: [nycphp-talk] How to submit POST vars via html image tags In-Reply-To: References: <330532b60710150923p5a5c7c68q1ba515d74490f977@mail.gmail.com> Message-ID: <3E6F267FA8AEC34B88F8E679637000630C86C5@S48286.vpproperty.com> Hello, Hopefully, this is not off-topic. I have a couple of html image tags such as on a single web page, and each such tag points to an image creating php file that sends out image headers and image data after receiving certain data parameters through POST. I am unable to figure out how to send POST data to a URL path that is embedded inside an img tag (...and not even sure if that is indeed the right way to do it). I need to use POST since there is a limitation on the length of the GET vars. I tried using curl (never used it before and just learnt about it) to replace the entire img tag...something like this: $imgurl = curl_init(); curl_setopt($imgurl, CURLOPT_URL, '/path/to/file.php'); curl_setopt($imgurl, CURLOPT_POST, 1); curl_setopt($imgurl, CURLOPT_POST,'datastuff='.$datastuff); curl_exec($imgurl); curl_close($imgurl); Nothing much happens if I do that. I know I can avoid this approach by simply using session variables but I am curious if there is an alternative approach to this. Any help is much appreciated. Thanks in advance, Best Regards, Nefertitian. From jonbaer at jonbaer.com Mon Oct 15 18:50:44 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 15 Oct 2007 18:50:44 -0400 Subject: [nycphp-talk] How to submit POST vars via html image tags In-Reply-To: <3E6F267FA8AEC34B88F8E679637000630C86C5@S48286.vpproperty.com> References: <330532b60710150923p5a5c7c68q1ba515d74490f977@mail.gmail.com> <3E6F267FA8AEC34B88F8E679637000630C86C5@S48286.vpproperty.com> Message-ID: <9173DAA6-B3D1-4C64-A34F-811B01F291C9@jonbaer.com> No post data is being sent, It should be ... curl_setopt($imgurl, CURLOPT_POSTFIELDS, 'datastuff='.$datastuff); - Jon On Oct 15, 2007, at 6:36 PM, ali mohammad wrote: > Hello, > > Hopefully, this is not off-topic. I have a couple of html image tags > such as on a single web page, and each > such tag points to an image creating php file that sends out image > headers and image data after receiving certain data parameters through > POST. I am unable to figure out how to send POST data to a URL path > that > is embedded inside an img tag (...and not even sure if that is indeed > the right way to do it). > > I need to use POST since there is a limitation on the length of the > GET > vars. I tried using curl (never used it before and just learnt > about it) > to replace the entire img tag...something like this: > > $imgurl = curl_init(); > curl_setopt($imgurl, CURLOPT_URL, '/path/to/file.php'); > curl_setopt($imgurl, CURLOPT_POST, 1); > curl_setopt($imgurl, CURLOPT_POST,'datastuff='.$datastuff); > curl_exec($imgurl); > curl_close($imgurl); > > Nothing much happens if I do that. I know I can avoid this approach by > simply using session variables but I am curious if there is an > alternative approach to this. Any help is much appreciated. > > Thanks in advance, > > Best Regards, > Nefertitian. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 nelly at cgim.com Mon Oct 15 22:02:51 2007 From: nelly at cgim.com (Nelly Yusupova) Date: Mon, 15 Oct 2007 22:02:51 -0400 Subject: [nycphp-talk] 40 Tips for optimizing your php Code Message-ID: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> Hello Everyone, I just read 40 Tips for optimizing your php code post and wanted to share it with you all: http://reinholdweber.com/?p=3 Sincerely, Nelly Yusupova Webgrrls International nelly at cgim.com http://www.webgrrls.com From mancinic at gmail.com Tue Oct 16 08:02:43 2007 From: mancinic at gmail.com (Christopher M Mancini) Date: Tue, 16 Oct 2007 08:02:43 -0400 Subject: [nycphp-talk] 40 Tips for optimizing your php Code In-Reply-To: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> References: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> Message-ID: <84caf2b90710160502l4afce46fg972741fc2d5efb50@mail.gmail.com> Hi, I am not familiar with this site or its author? Is this list credible? Because some of the things on there I have never heard before. Chris On 10/15/07, Nelly Yusupova wrote: > > Hello Everyone, > > I just read 40 Tips for optimizing your php code post and wanted to share > it > with you all: > > http://reinholdweber.com/?p=3 > > Sincerely, > Nelly Yusupova > Webgrrls International > nelly at cgim.com > http://www.webgrrls.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 > -- <------------------------- Sincerely, Christopher M Mancini mancinic at gmail.com http://www.linkedin.com/in/buffaloit http://blog.itrealm.net --------------------------> -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Tue Oct 16 08:06:10 2007 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 16 Oct 2007 08:06:10 -0400 Subject: [nycphp-talk] 40 Tips for optimizing your php Code In-Reply-To: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> References: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> Message-ID: <4714A932.5040700@phpwerx.net> Nelly Yusupova wrote: > I just read 40 Tips for optimizing your php code post and wanted to share it > with you all: > > http://reinholdweber.com/?p=3 Definitely an interesting article, but a little short-sighted. For the vast majority of PHP applications, the biggest speed improvements are made by reducing the size of the pages generated (to minimize the time in transit) and optimizing the database (efficient layout, proper indexes and optimized queries). Every little bit helps, but the impact of most of those tweaks is marginal compared to the gains to be found in those 2 areas for most systems. Dan From lists at enobrev.com Tue Oct 16 08:17:10 2007 From: lists at enobrev.com (Mark Armendariz) Date: Tue, 16 Oct 2007 08:17:10 -0400 Subject: [nycphp-talk] 40 Tips for optimizing your php Code In-Reply-To: <84caf2b90710160502l4afce46fg972741fc2d5efb50@mail.gmail.com> References: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> <84caf2b90710160502l4afce46fg972741fc2d5efb50@mail.gmail.com> Message-ID: <4714ABC6.9070609@enobrev.com> Christopher M Mancini wrote: > Hi, > I am not familiar with this site or its author? Is this list > credible? Because some of the things on there I have never heard before. Looks to be a summary of a bunch of other php optimization articles. I've seen most of these tips in one form or another in the past. Though a lot of these will give you minimally incremental speed increases, optimization tends to be application specific. Nothing beats profiling an entire application and speeding up the slowest areas. Besides caching, following all of these points, you might shave a few ms off of every request, but if you rewrite a slow database layer or slow template engine or properly index your database and optimize your queries (as Dan mentioned), you may very well notice speed increases in multiples of 10 and 100. Mark From ps at sun-code.com Tue Oct 16 08:42:26 2007 From: ps at sun-code.com (Peter Sawczynec) Date: Tue, 16 Oct 2007 08:42:26 -0400 Subject: [nycphp-talk] $_REQUEST: Bad Form? In-Reply-To: References: Message-ID: <003301c80ff2$01fba370$05f2ea50$@com> $_REQUEST provides an opportunity of some degree for a hack and/or an attack against a script or application. Worst case secenario is the you as new programmer on a complex legacy application that incorporates $_REQUEST has actually taken over a script product that has willful backdoor hacks integrated into the programming, such as that deep in some large class object or buried in a benign PHP include file there could plausably be functionality that is expecting and operating on variables that can at anytime be forced into the script logic stream by simply adding them to the URL GET or POST data. The above noted is clearly a very bad worst case, but has a higher probability of occurring that you might first consider becasue statistically more black hat attacks and breakins occur from inside people inside the company rather that external attackers. Now if you employ sanitizing techniques on all your variables that not only cleans up the expected varibales but additionally proactively destroys or denies all other unexpected variables than you might be Okay. For example, in my last sanitizing scheme, I maintained a white list array of expected variable names and all REQUEST data was first compared against the white list before it was operated on. All other variable names not on the white list were not only ignored but explicitly destroyed. Additionally, in a script when I was expecting POST data, I explicitly destroyed the GET data. The additional rub of dealing with GET, POST and COOKIE data with the same variable names is also a potential downside that might not affect you but might trip up a future programmer who works on your code later. I think the case against using $_REQUEST is fairly solid and if an existing script is allowing other users and applications from anywhere in the world to essentially submit any kind of variables by any method they please, then we might have a 'situation' of some sort on our hands that likely needs careful review and re-review. 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 Brian D. Sent: Friday, October 12, 2007 1:00 PM To: NYPHP Talk Subject: [nycphp-talk] $_REQUEST: Bad Form? I can't find where I read it originally, but somewhere I've been told or read that "using $_REQUEST is bad form." I understand that in cases where you want to force a $_POST request, but if you might receive $_GET or $_POST then isn't is better than doing if/elses? The only related thing I could find on Google was this guy ( http://mypetprogrammer.com/blog/?p=15 ) but he seems to erroneously believe that using $_POST somehow saves you from a SQL injection attack. I'm also thinking that some servers don't use the $_REQUEST array. Can you define why it's bad form? When is it considered acceptable to use? Thanks! - B. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ken at secdat.com Tue Oct 16 09:03:00 2007 From: ken at secdat.com (Kenneth Downs) Date: Tue, 16 Oct 2007 09:03:00 -0400 Subject: [nycphp-talk] 40 Tips for optimizing your php Code In-Reply-To: <4714A932.5040700@phpwerx.net> References: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> <4714A932.5040700@phpwerx.net> Message-ID: <4714B684.3000607@secdat.com> Dan Cech wrote: > Nelly Yusupova wrote: > >> I just read 40 Tips for optimizing your php code post and wanted to share it >> with you all: >> >> http://reinholdweber.com/?p=3 >> > > Definitely an interesting article, but a little short-sighted. > I would say incomplete, or perhaps cart-before-horse. As many have pointed out, the big two are database optimization and size of return payload. Everything else is single-digit percentages after that. Once you've got the db stuff down though, it seems it can't hurt to develop habits to use code known to be slightly faster, like the single-quote vs. double-quote thing. -- 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 Tue Oct 16 09:07:14 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Tue, 16 Oct 2007 09:07:14 -0400 Subject: [nycphp-talk] 40 Tips for optimizing your php Code In-Reply-To: <4714B684.3000607@secdat.com> References: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> <4714A932.5040700@phpwerx.net> <4714B684.3000607@secdat.com> Message-ID: <002d01c80ff5$78f00860$6ad01920$@com> Can you point me in the right direction for articles pertaining to database optimization techniques? Anthony Wlodarski aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Kenneth Downs Sent: Tuesday, October 16, 2007 9:03 AM To: NYPHP Talk Subject: Re: [nycphp-talk] 40 Tips for optimizing your php Code Dan Cech wrote: Nelly Yusupova wrote: I just read 40 Tips for optimizing your php code post and wanted to share it with you all: http://reinholdweber.com/?p=3 Definitely an interesting article, but a little short-sighted. I would say incomplete, or perhaps cart-before-horse. As many have pointed out, the big two are database optimization and size of return payload. Everything else is single-digit percentages after that. Once you've got the db stuff down though, it seems it can't hurt to develop habits to use code known to be slightly faster, like the single-quote vs. double-quote thing. -- 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 dcech at phpwerx.net Tue Oct 16 09:34:13 2007 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 16 Oct 2007 09:34:13 -0400 Subject: [nycphp-talk] 40 Tips for optimizing your php Code In-Reply-To: <4714B684.3000607@secdat.com> References: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> <4714A932.5040700@phpwerx.net> <4714B684.3000607@secdat.com> Message-ID: <4714BDD5.6020407@phpwerx.net> Kenneth Downs wrote: > Dan Cech wrote: >> Nelly Yusupova wrote: >> >>> I just read 40 Tips for optimizing your php code post and wanted to >>> share it >>> with you all: >>> >>> http://reinholdweber.com/?p=3 >> >> Definitely an interesting article, but a little short-sighted. > > I would say incomplete, or perhaps cart-before-horse. > > As many have pointed out, the big two are database optimization and size > of return payload. Everything else is single-digit percentages after that. > > Once you've got the db stuff down though, it seems it can't hurt to > develop habits to use code known to be slightly faster, like the > single-quote vs. double-quote thing. Absolutely there are tips in there which are valuable, but by the same token there are many which are of marginal value. For example, the 'tip' regarding checking the length of a string (33). While the method advocated may save a couple of cycles, it adds another level of obscurity to the code which will make it that much less readable and maintainable in the future, especially if you are not the one doing the maintaining. The tips I would consider worthwhile are: 5. Unset your variables to free memory, especially large arrays. This is a good practice and can help out greatly if you are operating on large data sets. 15. Turn on apache's mod_deflate 42. mod_gzip which is available as an Apache module compresses your data on the fly and can reduce the data to transfer up to 80% These are really the same tip, compressing output can increase speed if your pages are large or your clients are on slow connections. 16. Close your database connections when you're done with them If you are using non-persistent connections this is a good idea and will help you to avoid having old connections hanging around on the db server. If you're running on a dedicated machine persistent connections are even better (don't use persistent connections on a machine hosting multiple different applications). 17. $row['id'] is 7 times faster than $row[id] This is elementary, and if you are developing with error_reporting E_ALL (as you should) you would know that php will try to resolve id as a constant if it is not quoted. 28. Surrounding your string by ' instead of " will make things interpret a little faster since php looks for variables inside "..." but not inside '...'. Of course you can only do this when you don't need to have variables in the string. I subscribe to the single quotes school of thought, mostly because I find it much easier to locate variables when reading the code. Also, if the string you are building is destined for html, sql or a url the variables should be escaped anyway. Using single-quotes and escaping inline makes it trivial to spot where this isn't being done. $name = $_GET['name']; // 10 lines of code echo 'Your Name: '. htmlentities($name); vs $name = htmlentities($_GET['name']); // 10 lines of code echo "Your Name: $name"; If you get into the habit of using the first format (I define a function h() as a shortcut for htmlentities()) you will be able to spot instantly any place you forget to properly escape $name. With the second format I guarantee you won't. 31. Your PHP scripts are recompiled every time unless the scripts are cached. Install a PHP caching product to typically increase performance by 25-100% by removing compile times. 32. Cache as much as possible. Use memcached - memcached is a high-performance memory object caching system intended to speed up dynamic web applications by alleviating database load. OP code caches are useful so that your script does not have to be compiled on every request Good advice, and can definitely provide huge speed increases. 41. Profile your code. A profiler shows you, which parts of your code consumes how many time. The Xdebug debugger already contains a profiler. Profiling shows you the bottlenecks in overview This is the kicker, and will tell you where YOU can make gains with YOUR code. If you want more speed, start by profiling your code and you will be able to tell exactly where to focus your efforts for maximum results. Dan From dcech at phpwerx.net Tue Oct 16 09:38:31 2007 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 16 Oct 2007 09:38:31 -0400 Subject: [nycphp-talk] 40 Tips for optimizing your php Code In-Reply-To: <002d01c80ff5$78f00860$6ad01920$@com> References: <200710160203.l9G232j7014825@ms-smtp-04.rdc-nyc.rr.com> <4714A932.5040700@phpwerx.net> <4714B684.3000607@secdat.com> <002d01c80ff5$78f00860$6ad01920$@com> Message-ID: <4714BED7.8000002@phpwerx.net> Anthony Wlodarski wrote: > Can you point me in the right direction for articles pertaining to database optimization techniques? If you are using MySQL I highly recommend getting familiar with the concepts here: http://dev.mysql.com/doc/refman/5.0/en/optimization.html For a more gentle introduction, try google: http://www.google.com/search?q=optimizing+mysql Dan From jeffmailings99 at verizon.net Tue Oct 16 11:20:22 2007 From: jeffmailings99 at verizon.net (Jeff Siegel) Date: Tue, 16 Oct 2007 11:20:22 -0400 Subject: [nycphp-talk] From Rails back to PHP In-Reply-To: Message-ID: There's definitely something to be said for cross-language conceptual polinization. Jeff -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Keith Casey Sent: Monday, October 15, 2007 2:18 PM To: NYPHP Talk Subject: Re: [nycphp-talk] From Rails back to PHP On 10/15/07, Mitch Pirtle wrote: > However, I can agree with one sentiment that the author has - working > in Rails has made me a better PHP developer, with better application > design and semantics. And PHP has the flexibility for me to go beyond > that world, whether that is good or bad is up for debate though > *laugh* But that's not exclusive to Rails... I think being versed in multiple languages causes this inherently. I came to PHP from a long history with Java and Struts, so I tend to approach things in an OO-manner with a heavy focus on Unit Testing and MVC. Stealing... er.. sharing good ideas and lessons learned only helps. kc - From cliff at pinestream.com Tue Oct 16 13:26:39 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 16 Oct 2007 13:26:39 -0400 Subject: [nycphp-talk] Php file owner, group and permissions Message-ID: For the php, html, css, image, & javascript files in a web application, who should be the owner and group? (assume a dedicated server). Should the owner be a user, Apache, a username that is specific to the application? Should the group be apache? What is the best permission level? 644, 640? Thanks, Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From sequethin at gmail.com Tue Oct 16 13:36:45 2007 From: sequethin at gmail.com (Michael Hernandez) Date: Tue, 16 Oct 2007 13:36:45 -0400 Subject: [nycphp-talk] Php file owner, group and permissions In-Reply-To: References: Message-ID: <8B769B0C-8C94-4F60-8458-6908C0C42D88@gmail.com> On Oct 16, 2007, at 1:26 PM, Cliff Hirsch wrote: > For the php, html, css, image, & javascript files in a web > application, who should be the owner and group? (assume a dedicated > server). > > Should the owner be a user, Apache, a username that is specific to > the application? Should the group be apache? > > What is the best permission level? 644, 640? > > Thanks, > Cliff I'd say it really depends (you must have seen that one coming haha). If your web application needs to write to files then those files need to be writable to someone, and it's better imho to be writable by a specific user than "the world". In that case having the files owned by the user that php will run as is usually safe. Alternatively you can use group writable permissions. If you don't have to write to the file system the owner of the files is not so important so long as the files that you want the world to read are world readable. My .02 --Mike H -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Tue Oct 16 14:53:23 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 16 Oct 2007 14:53:23 -0400 Subject: [nycphp-talk] Php file owner, group and permissions In-Reply-To: <8B769B0C-8C94-4F60-8458-6908C0C42D88@gmail.com> Message-ID: >I'd say it really depends You?re making me think here! > > (you must have seen that one coming haha). If your web application needs to > write to files then those files need to be writable to someone, and it's > better imho to be writable by a specific user than "the world". In that case > having the files owned by the user that php will run as is usually safe. > Alternatively you can use group writable permissions. If you don't have to > write to the file system the owner of the files is not so important so long as > the files that you want the world to read are world readable.? > > My .02 > > --Mike H > I guess I have to see how apache/php is running ? I?m guess as ?nobody? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sequethin at gmail.com Tue Oct 16 15:11:57 2007 From: sequethin at gmail.com (Michael Hernandez) Date: Tue, 16 Oct 2007 15:11:57 -0400 Subject: [nycphp-talk] Php file owner, group and permissions In-Reply-To: References: Message-ID: <92F479A6-4FC7-495F-BF73-2BE1CCDC02CB@gmail.com> On Oct 16, 2007, at 2:53 PM, Cliff Hirsch wrote: > >I'd say it really depends > You?re making me think here! >> >> (you must have seen that one coming haha). If your web >> application needs to write to files then those files need to be >> writable to someone, and it's better imho to be writable by a >> specific user than "the world". In that case having the files >> owned by the user that php will run as is usually safe. >> Alternatively you can use group writable permissions. If you don't >> have to write to the file system the owner of the files is not so >> important so long as the files that you want the world to read are >> world readable. >> >> My .02 >> >> --Mike H >> I guess I have to see how apache/php is running ? I?m guess as >> ?nobody? > _______________________________________________ well if apache is running as nobody, php is running as nobody (most likely) and that's a case where I'd say you might want to reconfigure things so that apache/php run as a different user. Most of the time when I've seen nobody, there are lots of daemons running as nobody and it might not be a good idea to have so much running as nobody (in case someone manages to hijack something else that's running as nobody). Creating a user like www might work, but as you know it all depends. Also, keep in mind that if you chown stuff to a user that is not a login user and you have shell users that need to edit those files you will run into a problem (but that's where group perms really do come in handy). My shared host chowns files that they want me to be able to edit to my shell user, with the group being a special group they have created for process segregation. For files they don't want me to edit (some special log files mostly), they chown those files to the segregated "apache user". On the servers at my office anyone who needs to edit files is also trusted with sudo rights (very few of us) so we can edit any file on the system regardless of who owns the file. If you are the only user you might not need to worry about that as much but (last time I promise...) it depends ;) Again it's really only a problem if your PHP has to write to files on the system and not strictly to some mysql db, for example. As long as the php interpreter and apache (and of course, the world, that is - web browsers) can see the files you should be alright. Hope it helps! --Mike H -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitch.pirtle at gmail.com Tue Oct 16 15:23:52 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 16 Oct 2007 15:23:52 -0400 Subject: [nycphp-talk] Php file owner, group and permissions In-Reply-To: <92F479A6-4FC7-495F-BF73-2BE1CCDC02CB@gmail.com> References: <92F479A6-4FC7-495F-BF73-2BE1CCDC02CB@gmail.com> Message-ID: <330532b60710161223k5aa392a8v62598bef074a710a@mail.gmail.com> Very apropos reading are these two: 1) 2) Setting up apache in a chrooted environment puts you in the driver's seat regarding security options, and makes it possible for much more granular control over the security aspects of your webserver. -- Mitch From ken at secdat.com Tue Oct 16 15:28:42 2007 From: ken at secdat.com (Kenneth Downs) Date: Tue, 16 Oct 2007 15:28:42 -0400 Subject: [nycphp-talk] [ANNOUNCE] Various Andromeda Announcements Message-ID: <471510EA.7010008@secdat.com> Hello everybody, I have a handful of announcements about Andromeda, the database application framework for PHP. First, I have created an alpha version of a very exciting new user interface design and concept. Heavily ajax-based, it aims to beat the desktop for usability. The main thrust is heavy use of the keyboard, and having events happen in realtime. So if a user is on the "First Name" box and hits "F", it pulls the first 15 rows where the name starts with "F", no need to click "Search" or anything like that. We put in things that desktop users expect, like arrow keys! Hit SHIFT-UPARROW and it sorts on the column you are on, stuff like that. The new UI is in alpha, I believe there is enough there to see what it is about. We are looking for volunteers to help get it going in IE (Right now only firefox) and to round out the design ideas and finish it up. The live demo is at: http://dhost2.secdat.com/develop. If you just login, then go to the "new x4 version" link and hit the number 0, it should be self-explanatory from there. Next, I've modified the main Andromeda page to get the long-overdue news articles features. So bookmark the Andromeda page http://www.andromeda-project.org and check back at least once/week, there will be a lot of announcements coming out. Third, I've added HELP WANTED postings over at the sourceforge site: http://sourceforge.net/people/?group_id=188856. If you want to help but don't know what to do, that will get you started. Fourth, we have our first unofficial code contributor down here on Long Island who has been working with Andromeda and giving me tweaks. More on that once he gets back from vacation and "goes public" as it were. More later! -- 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 cliff at pinestream.com Tue Oct 16 18:27:27 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 16 Oct 2007 18:27:27 -0400 Subject: [nycphp-talk] Php file owner, group and permissions In-Reply-To: <92F479A6-4FC7-495F-BF73-2BE1CCDC02CB@gmail.com> Message-ID: well if apache is running as nobody, php is running as nobody (most likely) and that's a case where I'd say you might want to reconfigure things so that apache/php run as a different user. Most of the time when I've seen nobody, there are lots of daemons running as nobody and it might not be a good idea to have so much running as nobody (in case someone manages to hijack something else that's running as nobody). Creating a user like www might work, but as you know it all depends. Also, keep in mind that if you chown stuff to a user that is not a login user and you have shell users that need to edit those files you will run into a problem (but that's where group perms really do come in handy). > > My shared host chowns files that they want me to be able to edit to my shell > user, with the group being a special group they have created for process > segregation. For files they don't want me to edit (some special log files > mostly), they chown those files to the segregated "apache user". On the > servers at my office anyone who needs to edit files is also trusted with sudo > rights (very few of us) so we can edit any file on the system regardless of > who owns the file. If you are the only user you might not need to worry about > that as much but (last time I promise...) it depends ;) > > Again it's really only a problem if your PHP has to write to files on the > system and not strictly to some mysql db, for example. As long as the php > interpreter and apache (and of course, the world, that is - web browsers) can > see the files you should be alright. > > Hope it helps! > > --Mike H > Mike: Many thanks. This was really helpful. My strategy is already formulating. A brew or two and it will be solidified.... -------------- next part -------------- An HTML attachment was scrubbed... URL: From tommyo at gmail.com Tue Oct 16 22:51:57 2007 From: tommyo at gmail.com (Thomas O'Neill) Date: Tue, 16 Oct 2007 21:51:57 -0500 Subject: [nycphp-talk] From Rails back to PHP In-Reply-To: References: Message-ID: I agree with kc, I think its pretty interesting how all these people that are into rails act like MVC and ORM where invented there. I too have worked with Struts, Hibernate and other J2EE tools but I realize that MVC was not invented there either. MVC and other design patterns are just that, Design Patterns, they can be implemented in a number of development environments. Tom ONeill > But that's not exclusive to Rails... I think being versed in multiple > languages causes this inherently. I came to PHP from a long history > with Java and Struts, so I tend to approach things in an OO-manner > with a heavy focus on Unit Testing and MVC. > > Stealing... er.. sharing good ideas and lessons learned only helps. > > kc > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Wed Oct 17 09:31:38 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Wed, 17 Oct 2007 09:31:38 -0400 Subject: [nycphp-talk] Paypal Developer Day Message-ID: <47160EBA.4010900@beezifies.com> I just received an email announcement that Paypal will be holding 2 developer day presentations(9AM to 5PM) in New York. One in Brooklyn on November 8th, and one in Manhattan on November 9th. It's a free all day presentation, plus you can take their "certification" exam for free at the event(whatever that means). I don't have a direct link to the event(or rather, my direct link emailed to me is tied to my Paypal account) so if your interested you will need to sign up for their developer network and than look for the announcement on their site. From donnamarievincent at yahoo.com Wed Oct 17 14:31:13 2007 From: donnamarievincent at yahoo.com (Donna Marie Vincent) Date: Wed, 17 Oct 2007 11:31:13 -0700 (PDT) Subject: [nycphp-talk] Re: [joomla] Paypal Developer Day Message-ID: <456729.96802.qm@web35609.mail.mud.yahoo.com> The URL is www.paypal.com/developerday ----- Original Message ---- From: "bz-gmort at beezifies.com" To: Joomla ; NYPHP Talk Sent: Wednesday, October 17, 2007 9:31:38 AM Subject: [joomla] Paypal Developer Day I just received an email announcement that Paypal will be holding 2 developer day presentations(9AM to 5PM) in New York. One in Brooklyn on November 8th, and one in Manhattan on November 9th. It's a free all day presentation, plus you can take their "certification" exam for free at the event(whatever that means). I don't have a direct link to the event(or rather, my direct link emailed to me is tied to my Paypal account) so if your interested you will need to sign up for their developer network and than look for the announcement on their site. _______________________________________________ New York PHP SIG: Joomla! Mailing List http://lists.nyphp.org/mailman/listinfo/joomla 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 Oct 17 15:21:54 2007 From: ken at secdat.com (Kenneth Downs) Date: Wed, 17 Oct 2007 15:21:54 -0400 Subject: [nycphp-talk] I think this is an encoding issue? Message-ID: <471660D2.3030603@secdat.com> I'm wondering if somebody knows whats up here. I'm writing does in OO.org. Then I export them to xhtml. Those files I parse with PHP and output HTML. On my laptop this works out just fine. But on the production server you will see problem squiggly stuff instead of double-quotes, as on this page: http://www.andromeda-project.org/pages/cms/Making+Hyperlinks Can somebody give me a clue where to start Googling on this? -- 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 bz-gmort at beezifies.com Wed Oct 17 15:26:19 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Wed, 17 Oct 2007 15:26:19 -0400 Subject: [nycphp-talk] I think this is an encoding issue? In-Reply-To: <471660D2.3030603@secdat.com> References: <471660D2.3030603@secdat.com> Message-ID: <471661DB.9020502@beezifies.com> Kenneth Downs wrote: > I'm wondering if somebody knows whats up here. > > I'm writing does in OO.org. As far as I know, you need bucks to write does. From ken at secdat.com Wed Oct 17 15:29:23 2007 From: ken at secdat.com (Kenneth Downs) Date: Wed, 17 Oct 2007 15:29:23 -0400 Subject: [nycphp-talk] I think this is an encoding issue? In-Reply-To: <471661DB.9020502@beezifies.com> References: <471660D2.3030603@secdat.com> <471661DB.9020502@beezifies.com> Message-ID: <47166293.1000109@secdat.com> bz-gmort at beezifies.com wrote: > Kenneth Downs wrote: >> I'm wondering if somebody knows whats up here. >> >> I'm writing does in OO.org. > > As far as I know, you need bucks to write does. Not to worry, I'll be bagging one in about a month... > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 ajai at bitblit.net Wed Oct 17 15:41:23 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 17 Oct 2007 15:41:23 -0400 (EDT) Subject: [nycphp-talk] I think this is an encoding issue? In-Reply-To: <471660D2.3030603@secdat.com> Message-ID: On Wed, 17 Oct 2007, Kenneth Downs wrote: > I'm writing does in OO.org. Then I export them to xhtml. Those files I > parse with PHP and output HTML. > > On my laptop this works out just fine. But on the production server you > will see problem squiggly stuff instead of double-quotes, as on this page: > > http://www.andromeda-project.org/pages/cms/Making+Hyperlinks > > Can somebody give me a clue where to start Googling on this? Yeah, looks like you're using a character set that isn't one used commonly on web browsers. You maybe have it installed on your computer so it works there. In Firefox on my machine, I see the following header sent with the HTTP request: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 So Im guessing that you need to use this encoding. -- Aj. From jellicle at gmail.com Wed Oct 17 16:21:58 2007 From: jellicle at gmail.com (Michael Sims) Date: Wed, 17 Oct 2007 16:21:58 -0400 Subject: [nycphp-talk] I think this is an encoding issue? In-Reply-To: <471660D2.3030603@secdat.com> References: <471660D2.3030603@secdat.com> Message-ID: <200710171621.58627.jellicle@gmail.com> On October 17, 2007, Kenneth Downs wrote: > I'm wondering if somebody knows whats up here. > > I'm writing does in OO.org. Then I export them to xhtml. Those files I > parse with PHP and output HTML. > > On my laptop this works out just fine. But on the production server you > will see problem squiggly stuff instead of double-quotes, as on this > page: > > http://www.andromeda-project.org/pages/cms/Making+Hyperlinks > > Can somebody give me a clue where to start Googling on this? When that page is sent, the web server is telling my browser that it's in ISO-8859-1. It isn't. It's UTF-8. For Firefox, choose View, Character Encoding, UTF-8, and suddenly the page will be rendered correctly, because you told your browser to ignore what the webserver told it and render the page in UTF-8. If I look at the headers that the webserver sent with the page, I see: ------------------------------- Date: Wed, 17 Oct 2007 20:07:32 GMT Server: Apache X-Powered-By: PHP/5.2.2-pl1-gentoo Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: private Pragma: no-cache Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 200 OK -------------------------------- See that second to last line? That's wrong (as in, it doesn't match the page you're serving). So either you need to write your app in ISO-8859-1, or you need to tell your webserver to serve the proper header. You can do it in Apache or in PHP. Here's a page of useful info: http://www.w3.org/International/O-HTTP-charset Probably the server on your laptop is configured slightly differently than the production server. What *I* would do to solve this problem is get rid of the fancy curly quotes altogether. They are nothing but trouble. While curly quotes in books (dialogue) are nice for readability, where you're using them they're definitely wrong. That is, if you write: this is not correct HTML. HTML calls for the double-tick mark, not whatever the curly quote character is, so if you cut-and-paste that into an HTML document, it won't parse. You can turn off the curly quotes in OpenOffice's options, so that it won't auto-convert the double-tick mark for you anymore. Michael Sims From hafezadnan at gmail.com Thu Oct 18 07:57:44 2007 From: hafezadnan at gmail.com (hafez ahmad) Date: Thu, 18 Oct 2007 14:57:44 +0300 Subject: [nycphp-talk] Kannel with PHP Message-ID: Hi All, I need to use Kannel(http://www.kannel.org/) with PHP , I search for useful tutorials but I did not find anything useful, did any body use it? can you please help me with some links ? -- thanks Hafez -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Thu Oct 18 08:59:42 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Thu, 18 Oct 2007 08:59:42 -0400 Subject: [nycphp-talk] Kannel with PHP In-Reply-To: References: Message-ID: <471758BE.8050102@beezifies.com> Keep in mind, the primary purpose of Kannel is to allow a linux box to send SMS messages either through a cell phone, or through another SMS provider. As such, your not going to find a lot directly on Kannel and PHP, it's not relevant. The codeword to search for is: SMPP, MM1 and MM7 . I will note that a brief google search doesn't show much good info. Mainly, I believe, because the protocols themselves are so simple and trivial, that once you implement it most people don't even see it being worth their time to document. There does seem to be a PEAR library for SMPP, http://pear.php.net/package/Net_SMPP_Client That one seems to be targetted for communicating with your own PHP built SMPP server using the SMPP Server pear module. However, assuming the protocol calls follow the standards, you should be able to use it with Kannels as well. There is also one for "SMS" http://pear.php.net/package/Net_SMS Browsing that package, it looks like a generic set of interfaces to either clickatell, vodafone, a generic smtp to SMS gateway, and a generic http gateway. I'd attack the solution in stages. Stage 1: Download and setup your PHP script to use the ClickATell PHP libary. Spend a few bucks on buying credits from them, and get your PHP programming working first. Stage 2a: Get your kannel server configured and working correctly. IIRC it comes with a simply web interface for sending SMS messages. Since this is a simple post/get to a URL, you can adapt your PHP program to post the message data through the web interface. OR Stage 2b: Give the Pear SMPP module a try with ClickATell, since they do support the SMPP protocol. If you can get it working with a generic set of function calls, than in stage 3 try Kannel with SMPP. Stage 3: Look into MM7, MM1, or SMPP and work out the protocols and then adapt your ClickATell script for Kannel(make new functions to replace the ClickATell ones that implement the SMS protocol you choose) One thing I'd recommend is hunting around for C SDK's for SMS messages and compiling their samples to give you a command line interface for testing against the various protocols. IE if you can get a stock SMPP based command line program sending messages, than you know you aren't dealing with problems in your protocols. Another alternative is to give NowSMS a try, as their forums are a bit more well trafficed for integration solutions, and then switch to Kannel once you have NowSMS funcitoning(NowSMS is a *shudder* windows program that provides the same functionality as Kannel+Mbuni ie SMS and MMS messages. IIRC the lowest license for it was 500-1000, with a 60 day demo. Worth giving it a try to jumpstart development, and then determining once you have everything working if it is more cost effective to buy the license or fiddle with Kannel, and then Mbuni if your looking for MMS messages) As a last alternative, my memory also prods me that Kannel comes with a a sample program for processing email messages and converting them to SMS messages. So for purely sending messages, you can give that a try. Hmmmm, so...after all of that, I guess my first question should have been: What is it you want to do with PHP regarding cell phone messaging? Send text messages? Send text and multimedia messages(ClickATell can't send multimedia without hoops)? Receive text messages(ClickATell falls flat there). Receive text and multimedia messages? And do you want to do this with an attached cell phone, or through a text message service?(Kannel supports both). (I've looked into and played with SMS on a number of occassions, but the either the projects never materialized so I didn't take it to the implementation level, or I found a commercial interface such as ClickATell, which worked out to be more cost effective). Lastly, now that I've given you all the various bits and pieces, here is my advice: For pure text messages, assuming you were considering Kannel, forget EVERYTHING I said above. Your wasting time on a single solution. If you can run a Kannel server, than you can run an AIM message bot. So you can send text messages by AIM. And AIM will send text messages to most cell phone carriers - for free and without sticking advertising on them. So if you implement a PHP to AIM gateway instead, you will have 2 way functionality, the ability to send messages to instant message clients AND cell phones, and if your smart and use a multi-system connector like your own jabber server, you can send messages to most other major instant message applications. From dell at sala.ca Thu Oct 18 15:05:56 2007 From: dell at sala.ca (Dell Sala) Date: Thu, 18 Oct 2007 15:05:56 -0400 Subject: [nycphp-talk] Paging Strategies Message-ID: Every time I implement paging for search results I end up using different approaches, but I'm never happy with any of them. Am I missing a simpler, more "correct" solution here? Here's what I've tried: 1) TWO-QUERY APPROACH on every page view: - step 1: execute search query with a "SELECT count(*) " to get the total record count - step 2: run the search again with the appropriate LIMIT clause to retrieve the records I need for the current page 2) ONE QUERY, SEEK TO RESULTS on every page view: - step 1: execute search query - step 2: use *_data_seek() to move to the right slice of results for the current page 3) ONE QUERY, CACHE EVERYTHING on the first page view: - execute search query, fetch all results, and cache them on every other page view: - retrieve the right slice of results from the cache -- Dell From cliff at pinestream.com Thu Oct 18 15:15:09 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 18 Oct 2007 15:15:09 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: Message-ID: > 1) TWO-QUERY APPROACH > on every page view: FAILSAFE. An extra count query, but no worries. > 3) ONE QUERY, CACHE EVERYTHING What if the count changes between pages view? What if there are millions of records -- awfully big fetch. What if you change the application down the road, which creates the potential for changes in row count between views? Lot's of state info to think about.... My two cents... Cliff From ben at projectskyline.com Thu Oct 18 17:07:01 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Thu, 18 Oct 2007 17:07:01 -0400 Subject: [nycphp-talk] Paging Strategies References: Message-ID: <008301c811ca$d41dae00$6701a8c0@c500> Hello, I've been struggling w/this issue lately. I looked into the PEAR library, and started writing a wrapper for it. Does anyone have some good open source code or know of a 3rd party lib that does pagination? - Ben ----- Original Message ----- From: "Cliff Hirsch" To: "NYPHP Talk" Sent: Thursday, October 18, 2007 3:15 PM Subject: Re: [nycphp-talk] Paging Strategies >> 1) TWO-QUERY APPROACH >> on every page view: > FAILSAFE. An extra count query, but no worries. > >> 3) ONE QUERY, CACHE EVERYTHING > What if the count changes between pages view? What if there are millions > of > records -- awfully big fetch. What if you change the application down the > road, which creates the potential for changes in row count between views? > Lot's of state info to think about.... > > My two cents... > 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 brenttech at gmail.com Thu Oct 18 17:08:16 2007 From: brenttech at gmail.com (Brent Baisley) Date: Thu, 18 Oct 2007 17:08:16 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: References: Message-ID: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> You don't need to do an extra count query. If you are using MySQL, just add SQL_CALC_FOUND_ROWS to your select query. SELECT SQL_CALC_FOUND_ROWS * FROM ... You can then run SELECT FOUND_ROWS() to get the total rows without any limits. It's still 2 queries, but the second one is essentially free. On 10/18/07, Cliff Hirsch wrote: > > 1) TWO-QUERY APPROACH > > on every page view: > FAILSAFE. An extra count query, but no worries. > > > 3) ONE QUERY, CACHE EVERYTHING > What if the count changes between pages view? What if there are millions of > records -- awfully big fetch. What if you change the application down the > road, which creates the potential for changes in row count between views? > Lot's of state info to think about.... > > My two cents... > 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 brenttech at gmail.com Thu Oct 18 17:20:07 2007 From: brenttech at gmail.com (Brent Baisley) Date: Thu, 18 Oct 2007 17:20:07 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> References: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> Message-ID: <5d515c620710181420l5f96e809x45ff0bbfb1180a03@mail.gmail.com> You hardly need a library for figuring out pagination. A very simple formula tells you how many "pages" you have. $itemsPerPage = 10; $totalRecords = 52; //Result of SELECT FOUND_ROWS() $pages = ceil($totalRecords/$itemsPerPage); Based on those numbers, you know you have 6 pages of data. You can then create a loop to generate the links with the proper parameter(s), however you want to format them. For example: link.php?page=3&itemsperpage=10 Would make the following query: SELECT * FROM table LIMIT ($_GET['page']-1)*10,10 I may be off by 1 on that. Hope that helps. On 10/18/07, Brent Baisley wrote: > You don't need to do an extra count query. If you are using MySQL, > just add SQL_CALC_FOUND_ROWS to your select query. > SELECT SQL_CALC_FOUND_ROWS * FROM ... > > You can then run SELECT FOUND_ROWS() to get the total rows without any > limits. It's still 2 queries, but the second one is essentially free. > > > On 10/18/07, Cliff Hirsch wrote: > > > 1) TWO-QUERY APPROACH > > > on every page view: > > FAILSAFE. An extra count query, but no worries. > > > > > 3) ONE QUERY, CACHE EVERYTHING > > What if the count changes between pages view? What if there are millions of > > records -- awfully big fetch. What if you change the application down the > > road, which creates the potential for changes in row count between views? > > Lot's of state info to think about.... > > > > My two cents... > > 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 ben at projectskyline.com Thu Oct 18 17:27:58 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Thu, 18 Oct 2007 17:27:58 -0400 Subject: [nycphp-talk] Paging Strategies References: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> <5d515c620710181420l5f96e809x45ff0bbfb1180a03@mail.gmail.com> Message-ID: <009f01c811cd$c0f6d970$6701a8c0@c500> Hello Brent, Sure, I guess that's a fine way to do it. I'll just toss it into a class for reuseability. - Ben ----- Original Message ----- From: "Brent Baisley" To: "NYPHP Talk" Sent: Thursday, October 18, 2007 5:20 PM Subject: Re: [nycphp-talk] Paging Strategies > You hardly need a library for figuring out pagination. A very simple > formula tells you how many "pages" you have. > $itemsPerPage = 10; > $totalRecords = 52; //Result of SELECT FOUND_ROWS() > $pages = ceil($totalRecords/$itemsPerPage); > > Based on those numbers, you know you have 6 pages of data. You can > then create a loop to generate the links with the proper parameter(s), > however you want to format them. > For example: > link.php?page=3&itemsperpage=10 > > Would make the following query: > SELECT * FROM table LIMIT ($_GET['page']-1)*10,10 > > I may be off by 1 on that. Hope that helps. > > On 10/18/07, Brent Baisley wrote: >> You don't need to do an extra count query. If you are using MySQL, >> just add SQL_CALC_FOUND_ROWS to your select query. >> SELECT SQL_CALC_FOUND_ROWS * FROM ... >> >> You can then run SELECT FOUND_ROWS() to get the total rows without any >> limits. It's still 2 queries, but the second one is essentially free. >> >> >> On 10/18/07, Cliff Hirsch wrote: >> > > 1) TWO-QUERY APPROACH >> > > on every page view: >> > FAILSAFE. An extra count query, but no worries. >> > >> > > 3) ONE QUERY, CACHE EVERYTHING >> > What if the count changes between pages view? What if there are >> > millions of >> > records -- awfully big fetch. What if you change the application down >> > the >> > road, which creates the potential for changes in row count between >> > views? >> > Lot's of state info to think about.... >> > >> > My two cents... >> > 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 >> > >> > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Thu Oct 18 19:18:46 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 18 Oct 2007 19:18:46 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> Message-ID: This is brilliant. But read the notes: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html On 10/18/07 5:08 PM, "Brent Baisley" wrote: > You don't need to do an extra count query. If you are using MySQL, > just add SQL_CALC_FOUND_ROWS to your select query. > SELECT SQL_CALC_FOUND_ROWS * FROM ... > > You can then run SELECT FOUND_ROWS() to get the total rows without any > limits. It's still 2 queries, but the second one is essentially free. > > > On 10/18/07, Cliff Hirsch wrote: >>> 1) TWO-QUERY APPROACH >>> on every page view: >> FAILSAFE. An extra count query, but no worries. >> >>> 3) ONE QUERY, CACHE EVERYTHING >> What if the count changes between pages view? What if there are millions of >> records -- awfully big fetch. What if you change the application down the >> road, which creates the potential for changes in row count between views? >> Lot's of state info to think about.... >> >> My two cents... >> Cliff From dell at sala.ca Thu Oct 18 22:50:26 2007 From: dell at sala.ca (Dell Sala) Date: Thu, 18 Oct 2007 22:50:26 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> References: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> Message-ID: <029AECDC-1759-48C5-8C31-2EA72FB87618@sala.ca> On Oct 18, 2007, at 5:08 PM, Brent Baisley wrote: > You don't need to do an extra count query. If you are using MySQL, > just add SQL_CALC_FOUND_ROWS to your select query. > SELECT SQL_CALC_FOUND_ROWS * FROM ... > > You can then run SELECT FOUND_ROWS() to get the total rows without any > limits. It's still 2 queries, but the second one is essentially free. Great tip Brent! Thanks. -- Dell From dell at sala.ca Fri Oct 19 00:07:22 2007 From: dell at sala.ca (Dell Sala) Date: Fri, 19 Oct 2007 00:07:22 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: <009f01c811cd$c0f6d970$6701a8c0@c500> References: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> <5d515c620710181420l5f96e809x45ff0bbfb1180a03@mail.gmail.com> <009f01c811cd$c0f6d970$6701a8c0@c500> Message-ID: >> From: "Brent Baisley" >> >> You hardly need a library for figuring out pagination. A very simple >> formula tells you how many "pages" you have. >> $itemsPerPage = 10; >> $totalRecords = 52; //Result of SELECT FOUND_ROWS() >> $pages = ceil($totalRecords/$itemsPerPage); >> >> Based on those numbers, you know you have 6 pages of data. You can >> then create a loop to generate the links with the proper parameter >> (s), >> however you want to format them. > > On Oct 18, 2007, at 5:27 PM, Ben Sgro ((ProjectSkyLine)) wrote: > Sure, I guess that's a fine way to do it. > I'll just toss it into a class for reuseability. Here's my version of such a class: http://dev.dellsala.com/source/Pager.phps An example of how it might be used: $pager = new Pager(); $pager->setItemsPerPage(10); $pager->setCurrentPage(2); // from $_POST or $_GET // generate your query LIMIT $sqlLimit = "LIMIT {$pager->getItemOffset()}, {$pager->getItemsPerPage ()}"; $pager->setItemCount(125); // from SELECT FOUND_ROWS(). thanks brent! // output the paging interface ?>

Page getCurrentPage(); ?> of getPageCount(); ?>

Previous Next -- Dell From phplists at jellyandcustard.com Fri Oct 19 04:46:36 2007 From: phplists at jellyandcustard.com (Khalid Hanif) Date: Fri, 19 Oct 2007 09:46:36 +0100 Subject: [nycphp-talk] Paging Strategies In-Reply-To: <5d515c620710181420l5f96e809x45ff0bbfb1180a03@mail.gmail.com> References: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> <5d515c620710181420l5f96e809x45ff0bbfb1180a03@mail.gmail.com> Message-ID: <22D9D68C-3330-4F60-B842-390BF88DABBD@jellyandcustard.com> On 18 Oct 2007, at 22:20, Brent Baisley wrote: > You hardly need a library for figuring out pagination. Totally agree. But when time = money, and time is short, I've found Pear::Pager to be a good starting place. The actual HTML output is horrible, but it works, and you can have a sliding or jumping number set, and set a delta for the links as well: http://pear.php.net/manual/en/package.html.pager.intro.php Yours, Khalid -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at realm3.com Fri Oct 19 07:17:19 2007 From: brian at realm3.com (Brian D.) Date: Fri, 19 Oct 2007 07:17:19 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: <029AECDC-1759-48C5-8C31-2EA72FB87618@sala.ca> References: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> <029AECDC-1759-48C5-8C31-2EA72FB87618@sala.ca> Message-ID: > Great tip Brent! Thanks. I second that - I had no idea this useful function existed. - B. On 10/18/07, Dell Sala wrote: > On Oct 18, 2007, at 5:08 PM, Brent Baisley wrote: > > > You don't need to do an extra count query. If you are using MySQL, > > just add SQL_CALC_FOUND_ROWS to your select query. > > SELECT SQL_CALC_FOUND_ROWS * FROM ... > > > > You can then run SELECT FOUND_ROWS() to get the total rows without any > > limits. It's still 2 queries, but the second one is essentially free. > > > -- Dell > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 jeffmailings99 at verizon.net Fri Oct 19 10:34:01 2007 From: jeffmailings99 at verizon.net (Jeff Siegel) Date: Fri, 19 Oct 2007 10:34:01 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: Message-ID: Two sources of code: 1. EZSql (if you are using that library) has a library for paging. 2. PHP Cookbook has some code you can use. There's lots of other good stuff in there too. Jeff -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Dell Sala Sent: Thursday, October 18, 2007 3:06 PM To: NYPHP Talk Subject: [nycphp-talk] Paging Strategies Every time I implement paging for search results I end up using different approaches, but I'm never happy with any of them. Am I missing a simpler, more "correct" solution here? Here's what I've tried: 1) TWO-QUERY APPROACH on every page view: - step 1: execute search query with a "SELECT count(*) " to get the total record count - step 2: run the search again with the appropriate LIMIT clause to retrieve the records I need for the current page 2) ONE QUERY, SEEK TO RESULTS on every page view: - step 1: execute search query - step 2: use *_data_seek() to move to the right slice of results for the current page 3) ONE QUERY, CACHE EVERYTHING on the first page view: - execute search query, fetch all results, and cache them on every other page view: - retrieve the right slice of results from the cache -- Dell _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/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 Fri Oct 19 13:39:06 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 19 Oct 2007 13:39:06 -0400 Subject: [nycphp-talk] Character set issues revisited Message-ID: There was recently a thread about some character set problem. I just found a similar issue. I just transferred a site from a Windows XP dev. platform to rhel. Everything looks fine except for a few special characters. Windows -> rhel it?s -> it?s ? -> ? (should be the long dash, an em I think) ?blahblah? -> ?blahblah? ? -> ? In phpMyAdmin I see: can?t In my app, I see: can?t So phpMyAdmin is displaying things correctly on either platform. Page Headers: My page: (on both windows & rhel) phpMyadmin: The charset headers are the same on both machine. I might have mistakenly imported some of the database files with the wrong collation setting, but I change it to be the same on both platforms. And these errors appear on pages/code that was brought in via subversion, not the database. Where should I start looking? What is the best charset to use anyway? Iso-8859-1 or utf-8? Thanks, Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Fri Oct 19 14:29:55 2007 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 19 Oct 2007 14:29:55 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: References: Message-ID: <78c6bd860710191129v5d73eb47rc900038e9063c202@mail.gmail.com> On 10/19/07, Cliff Hirsch wrote: > > There was recently a thread about some character set problem. I just found > a similar issue. I just transferred a site from a Windows XP dev. platform > to rhel. Everything looks fine except for a few special characters. > > Windows -> rhel > it's -> it?s > ? -> ? (should be the long dash, an em I think) > 'blahblah' -> ?blahblah? > " -> ? Hey Cliff, That's actually not a character encoding issue. The '?' or an empty box is commonly displayed whenever a glyph associated with a character value is not available. Meaning the client doesn't have the necessary font. Also meaning, whatever editor was used to input those single quotes didn't input the more common ASCII single quote character value of 0x27. If you hexdump that content you'll see it's something else (it will probably be a multibyte UTF-8 secquence which when decoded will give you a Unicode value that you can lookup in Adobe's glyph tables). This is the sort of thing that happends when you create some content with a word processor and then copy and paste it into the web page. The way to fix this problem is to just seek and destory all of those characters and replace them with their more common equivalent values (e.g. the single quote 0x27 ASCII value). Or you could install whatever wacked out font that has that character on every client that will ever visit the page but that's probably not the more desirable solution. > In phpMyAdmin I see: can't > In my app, I see: can?t > So phpMyAdmin is displaying things correctly on either platform. That's odd. Maybe phpMyAdmin is doing some transliteration. > Where should I start looking? What is the best charset to use anyway? > Iso-8859-1 or utf-8? Look at the page with hexdump to see verify what the encoding is and what the unicode value of one of the errant characters really is. Then you can start to figure out where things went wrong. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jonbaer at jonbaer.com Fri Oct 19 14:42:07 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 19 Oct 2007 14:42:07 -0400 Subject: [nycphp-talk] Framework SIG lists? Message-ID: <50F571DC-4FE3-4926-8A0A-91B9C8B84496@jonbaer.com> Hi, Just curious, is there any interest out there to maybe(?) create local framework-specific lists (SIGs) around CakePHP, Zend, Symfony, etc. Or would it be better to just post to Talk w/ something in the subject [Zend] to signify the topic better or would that annoy everyone? Any thoughts? - Jon From ajai at bitblit.net Fri Oct 19 14:46:43 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 19 Oct 2007 14:46:43 -0400 (EDT) Subject: [nycphp-talk] Framework SIG lists? In-Reply-To: <50F571DC-4FE3-4926-8A0A-91B9C8B84496@jonbaer.com> Message-ID: On Fri, 19 Oct 2007, Jon Baer wrote: > Just curious, is there any interest out there to maybe(?) create > local framework-specific lists (SIGs) around CakePHP, Zend, Symfony, > etc. Or would it be better to just post to Talk w/ something in the > subject [Zend] to signify the topic better or would that annoy everyone? Most of these frameworks have their own lists which are more useful for asking questions on than here. That said, its always useful to discuss those here with developers NOT using your framework of choice, if only to have another prespective to bounce ideas off. Oh, and Im all for adding things to the Subject: headers to easier filter stuff. -- Aj. From mitch.pirtle at gmail.com Fri Oct 19 15:14:32 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Fri, 19 Oct 2007 15:14:32 -0400 Subject: [nycphp-talk] Framework SIG lists? In-Reply-To: <50F571DC-4FE3-4926-8A0A-91B9C8B84496@jonbaer.com> References: <50F571DC-4FE3-4926-8A0A-91B9C8B84496@jonbaer.com> Message-ID: <330532b60710191214x6c5a2f05k6ed12b65265af846@mail.gmail.com> On 10/19/07, Jon Baer wrote: > Hi, > > Just curious, is there any interest out there to maybe(?) create > local framework-specific lists (SIGs) around CakePHP, Zend, Symfony, > etc. Or would it be better to just post to Talk w/ something in the > subject [Zend] to signify the topic better or would that annoy everyone? I like the subject idea and will do it anyway in the hopes others find it helpful. Another idea - why not have one NYPHP meet centered around frameworks, and have a framework-fest of sorts? I'd love to see a handful of people talk about their experiences, compare notes with others and see what some of the advantages/disadvantages are between them. -- Mitch From ajai at bitblit.net Fri Oct 19 15:39:15 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 19 Oct 2007 15:39:15 -0400 (EDT) Subject: [nycphp-talk] Framework SIG lists? In-Reply-To: <330532b60710191214x6c5a2f05k6ed12b65265af846@mail.gmail.com> Message-ID: On Fri, 19 Oct 2007, Mitch Pirtle wrote: > Another idea - why not have one NYPHP meet centered around frameworks, > and have a framework-fest of sorts? I'd love to see a handful of > people talk about their experiences, compare notes with others and see > what some of the advantages/disadvantages are between them. Good idea - I'd be happy to talk about symfony. -- Aj. From cliff at pinestream.com Fri Oct 19 15:44:05 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 19 Oct 2007 15:44:05 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: <78c6bd860710191129v5d73eb47rc900038e9063c202@mail.gmail.com> Message-ID: On 10/19/07 2:29 PM, "Michael B Allen" wrote: > On 10/19/07, Cliff Hirsch wrote: >> >> There was recently a thread about some character set problem. I just found >> a similar issue. I just transferred a site from a Windows XP dev. platform >> to rhel. Everything looks fine except for a few special characters. >> >> Windows -> rhel >> it's -> it?s >> ? -> ? (should be the long dash, an em I think) >> 'blahblah' -> ?blahblah? >> " -> ? > > Hey Cliff, > > That's actually not a character encoding issue. The '?' or an empty > box is commonly displayed whenever a glyph associated with a character > value is not available. Meaning the client doesn't have the necessary > font. Also meaning, whatever editor was used to input those single > quotes didn't input the more common ASCII single quote character value > of 0x27. If you hexdump that content you'll see it's something else > (it will probably be a multibyte UTF-8 secquence which when decoded > will give you a Unicode value that you can lookup in Adobe's glyph > tables). > > This is the sort of thing that happends when you create some content > with a word processor and then copy and paste it into the web page. > > The way to fix this problem is to just seek and destory all of those > characters and replace them with their more common equivalent values > (e.g. the single quote 0x27 ASCII value). > > Or you could install whatever wacked out font that has that character > on every client that will ever visit the page but that's probably not > the more desirable solution. > >> In phpMyAdmin I see: can't >> In my app, I see: can?t >> So phpMyAdmin is displaying things correctly on either platform. > > That's odd. Maybe phpMyAdmin is doing some transliteration. > >> Where should I start looking? What is the best charset to use anyway? >> Iso-8859-1 or utf-8? > > Look at the page with hexdump to see verify what the encoding is and > what the unicode value of one of the errant characters really is. Then > you can start to figure out where things went wrong. > > Mike Mike: Thanks. This is helpful. Here's another interesting puzzle. Why does the page info in FireFox say encoding: UTF-8 while the Content-Type is charset=iso-8859-1. Ah, I think I see it. The encoding is how the page was saved. And as usual, Microsoft butchers everything. But this is php -- the page is dynamically generated. So is the encoding picked up from my php script, index.php, or the template file index.tpl? From ken at secdat.com Fri Oct 19 15:46:47 2007 From: ken at secdat.com (Kenneth Downs) Date: Fri, 19 Oct 2007 15:46:47 -0400 Subject: [nycphp-talk] Framework SIG lists? In-Reply-To: <330532b60710191214x6c5a2f05k6ed12b65265af846@mail.gmail.com> References: <50F571DC-4FE3-4926-8A0A-91B9C8B84496@jonbaer.com> <330532b60710191214x6c5a2f05k6ed12b65265af846@mail.gmail.com> Message-ID: <471909A7.6050201@secdat.com> Mitch Pirtle wrote: > On 10/19/07, Jon Baer wrote: > >> Hi, >> >> Just curious, is there any interest out there to maybe(?) create >> local framework-specific lists (SIGs) around CakePHP, Zend, Symfony, >> etc. Or would it be better to just post to Talk w/ something in the >> subject [Zend] to signify the topic better or would that annoy everyone? >> > > I like the subject idea and will do it anyway in the hopes others find > it helpful. > > Another idea - why not have one NYPHP meet centered around frameworks, > and have a framework-fest of sorts? I'd love to see a handful of > people talk about their experiences, compare notes with others and see > what some of the advantages/disadvantages are between them. > Boston PHP was going to do this and ultimately decided against it. Maybe Mark Withington will chime in here and tell us something about why. I think it came down to logistics. You really need a few hours for this, with refreshments, because people are going to be settling in and coding. Restaurants and bars are out of the question, the venue has to allow us to stay into the late hours if people get really involved. > -- 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 > -- 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 ioplex at gmail.com Fri Oct 19 17:54:58 2007 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 19 Oct 2007 17:54:58 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: References: <78c6bd860710191129v5d73eb47rc900038e9063c202@mail.gmail.com> Message-ID: <78c6bd860710191454mf75d855ra96fbf66fb4c9f54@mail.gmail.com> On 10/19/07, Cliff Hirsch wrote: > Thanks. This is helpful. Here's another interesting puzzle. Why does the > page info in FireFox say encoding: UTF-8 while the Content-Type is > charset=iso-8859-1. Note that even if you set the content-type header to ISO-8859-1 it's still very possible generate page content in some other encoding. For example, databases are pretty much put out what you put in so if you have an "admin.php" putting data in in UTF-8 and all your other pages are doing ISO-8859-1 w/ data from the DB the data from the DB will be in UTF-8 and non-ASCII characters will not be encoded properly. > Ah, I think I see it. The encoding is how the page was saved. And as usual, > Microsoft butchers everything. Actually if you right click on the page in FF and select "page info" I think it should tell you the real encoding emitted by the server (the content-type header). Note that the META content-type tag in a page is basically ignored unless the page is read from disk. Also, note that if you're serving static content, the web server has a default Content-Type encoding which is usually UTF-8. So if you have some pages that are encoded in ISO-8859-1 and the web server is UTF-8 the web server will send Content-Type UTF-8 but the page will actually still be encoded in ISO-8859-1 and the page will not be rendered properly. > But this is php -- the page is dynamically generated. So is the encoding > picked up from my php script, index.php, or the template file index.tpl? The browser will interpret the page based on the Content-Type encoding. Period. But it's up to *you* to make sure the page is really encoded in that encoding. It sounds like the script files are actually the wrong encoding or contain funky characters. The easiest way to determin if that is the case is to run hexdump or a hex editor and look at one of the script files with a non-ASCII character in it. If that character is encoded with one byte, then the encoding is ISO-8850-x. If the character is encoded with two or more bytes, it's probably UTF-8. Note that if you have a lot of pages in the wrong encoding you might want to look into the iconv utility found on *nix machines. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From jcampbell1 at gmail.com Fri Oct 19 21:07:08 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Fri, 19 Oct 2007 21:07:08 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: <78c6bd860710191454mf75d855ra96fbf66fb4c9f54@mail.gmail.com> References: <78c6bd860710191129v5d73eb47rc900038e9063c202@mail.gmail.com> <78c6bd860710191454mf75d855ra96fbf66fb4c9f54@mail.gmail.com> Message-ID: <8f0676b40710191807t75ae8faree8ea4c90a918670@mail.gmail.com> I think people are trying to diagnose a problem with incomplete information. There are a bunch of places where things can go wrong with character encoding, and without the details it is impossible to know what is going on. What is the collation of the column in the database? (available in phpmyadmin) What is the value of the "Content-Type" header? (use firebug to determine) Which mysql drivers are you using? mysql,mysqli, pdo Are you calling mysql('set names ...') anywhere? Do you have a tag? And by '?' do you mean '?' or '?' ... there is a big difference. My guess is that you are using utf8 as the database collation, and you need to remove your meta tag, call mysql_query("set names utf-8") as soon as you create a connection to the database, and add a header("Content-Type: text/html; charset=utf-8"); to all scripts. But again, that is a guess since I only have about 20% of the relevant info. Hope that helps. Regards, John Campbell From mikesz at qualityadvantages.com Fri Oct 19 22:47:34 2007 From: mikesz at qualityadvantages.com (mikesz at qualityadvantages.com) Date: Sat, 20 Oct 2007 10:47:34 +0800 Subject: [nycphp-talk] Any ideas appreciated... short cuts are not always a good thing for script maintenance... need some advise... Message-ID: <1822385224.20071020104734@qualityadvantages.com> Greetings and Hello, I am converting a script to use SMTP if php mail() is not available for the users of this script. I have all the active calls working so that if my smtp flag is set it automatically switches to smtp and sends the message with the appropriate headers etc. but part of the script is run by a cron job and I see a php mail call but don't quite understand the syntax. Anyone care to take a guess at translating what it does? It is part of a while loop and I think its combining two conditions into one statement but would like confirmation. here is the code fragment: if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site[email_notify]", "-f$site[email_notify]") ) ++$err; I thinks this is the equivalent of: if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site[email_notify]", "-f$site[email_notify]") ) { ++$err; //update the error queue } else { mail( $row['Email'], $row[Subj], $row[Body], "From: $site[email_notify]", "-f$site[email_notify]"); } Has anyone seen or used this technique before? This is the first time I have seen it used, though this script has a lot of short cuts that make the code difficult to debug sometimes, like this one. Thanks in advance for your comments, -- Best regards, mikesz mailto:mikesz at qualityadvantages.com From leeeyerman at aol.com Fri Oct 19 23:02:20 2007 From: leeeyerman at aol.com (leeeyerman at aol.com) Date: Fri, 19 Oct 2007 23:02:20 -0400 Subject: [nycphp-talk] Any ideas appreciated... short cuts are not always a good thing for script maintenance... need some advise... In-Reply-To: <1822385224.20071020104734@qualityadvantages.com> References: <1822385224.20071020104734@qualityadvantages.com> Message-ID: <8C9E0DCC39A95C2-23C-2E74@webmail-mf04.sysops.aol.com> I believe you are correct except for the else.? The if statement can be written that way, but it will not do the else statement you put in your example, you would include that... http://us.php.net/manual/en/language.control-structures.php#control-structures.if This is a good link to learn how to write the shorter version of the if statement.? However, I like writing it out... old school. I thinks this is the equivalent of: if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site[email_notify]", "-f$site[email_notify]") ) { ++$err; //update the error queue } else { mail( $row['Email'], $row[Subj], $row[Body], "From: $site[email_notify]", "-f$site[email_notify]"); } -----Original Message----- From: mikesz at qualityadvantages.com To: talk at lists.nyphp.org Sent: Fri, 19 Oct 2007 8:47 pm Subject: [nycphp-talk] Any ideas appreciated... short cuts are not always a good thing for script maintenance... need some advise... Greetings and Hello, I am converting a script to use SMTP if php mail() is not available for the users of this script. I have all the active calls working so that if my smtp flag is set it automatically switches to smtp and sends the message with the appropriate headers etc. but part of the script is run by a cron job and I see a php mail call but don't quite understand the syntax. Anyone care to take a guess at translating what it does? It is part of a while loop and I think its combining two conditions into one statement but would like confirmation. here is the code fragment: if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site[email_notify]", "-f$site[email_notify]") ) ++$err; I thinks this is the equivalent of: if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site[email_notify]", "-f$site[email_notify]") ) { ++$err; //update the error queue } else { mail( $row['Email'], $row[Subj], $row[Body], "From: $site[email_notify]", "-f$site[email_notify]"); } Has anyone seen or used this technique before? This is the first time I have seen it used, though this script has a lot of short cuts that make the code difficult to debug sometimes, like this one. Thanks in advance for your comments, -- Best regards, mikesz mailto:mikesz at qualityadvantages.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 ________________________________________________________________________ Email and AIM finally together. You've gotta check out free AOL Mail! - http://mail.aol.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim_lists at o2group.com Sat Oct 20 03:13:47 2007 From: tim_lists at o2group.com (Tim Lieberman) Date: Sat, 20 Oct 2007 09:13:47 +0200 Subject: [nycphp-talk] Any ideas appreciated... short cuts are not always a good thing for script maintenance... need some advise... In-Reply-To: <1822385224.20071020104734@qualityadvantages.com> References: <1822385224.20071020104734@qualityadvantages.com> Message-ID: <8C284286-0420-4E23-AFBF-53176A7531DE@o2group.com> The "equivalent" you wrote should generally result in sending either zero or two emails ... which is probably not what you want. The code you're trying to grok is simply "send mail and if there's an error, increment the error counter". A slightly more obvious way for writing it would be: $result = mail(...); if (! $result){ ++$err; } The way you re-wrote it, it says "send mail and if there's an error increment the error counter. If there isn't an error, send the mail a second time". HTH -Tim On Oct 20, 2007, at 4:47 AM, mikesz at qualityadvantages.com wrote: > Greetings and Hello, > > I am converting a script to use SMTP if php mail() is not available > for the users of this script. I have all the active calls working so > that if my smtp flag is set it automatically switches to smtp and > sends the message with the appropriate headers etc. but part of the > script is run by a > cron job and I see a php mail call but don't quite understand the > syntax. > Anyone care to take a guess at translating what it does? > > It is part of a while loop and I think its combining two conditions > into one statement but would like confirmation. > > here is the code fragment: > > if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site > [email_notify]", "-f$site[email_notify]") ) > ++$err; > > > I thinks this is the equivalent of: > > if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site > [email_notify]", "-f$site[email_notify]") ) > { > ++$err; //update the error queue > } > else > { > mail( $row['Email'], $row[Subj], $row[Body], "From: $site > [email_notify]", "-f$site[email_notify]"); > } > > > Has anyone seen or used this technique before? This is the first time > I have seen it used, though this script has a lot of short cuts that > make the code difficult to debug sometimes, like this one. > > Thanks in advance for your comments, > -- > Best regards, > mikesz mailto:mikesz at qualityadvantages.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 mikesz at qualityadvantages.com Sat Oct 20 03:36:04 2007 From: mikesz at qualityadvantages.com (mikesz at qualityadvantages.com) Date: Sat, 20 Oct 2007 15:36:04 +0800 Subject: [nycphp-talk] Any ideas appreciated... short cuts are not always a good thing for script maintenance... need some advise... In-Reply-To: <8C284286-0420-4E23-AFBF-53176A7531DE@o2group.com> References: <1822385224.20071020104734@qualityadvantages.com> <8C284286-0420-4E23-AFBF-53176A7531DE@o2group.com> Message-ID: <1866423701.20071020153604@qualityadvantages.com> Hello Tim, Saturday, October 20, 2007, 3:13:47 PM, you wrote: > The "equivalent" you wrote should generally result in sending either > zero or two emails ... which is probably not what you want. > The code you're trying to grok is simply "send mail and if there's an > error, increment the error counter". A slightly more obvious way for > writing it would be: > $result = mail(...); > if (! $result){ > ++$err; > } > The way you re-wrote it, it says "send mail and if there's an error > increment the error counter. If there isn't an error, send the mail > a second time". > HTH > -Tim > On Oct 20, 2007, at 4:47 AM, mikesz at qualityadvantages.com wrote: >> Greetings and Hello, >> >> I am converting a script to use SMTP if php mail() is not available >> for the users of this script. I have all the active calls working so >> that if my smtp flag is set it automatically switches to smtp and >> sends the message with the appropriate headers etc. but part of the >> script is run by a >> cron job and I see a php mail call but don't quite understand the >> syntax. >> Anyone care to take a guess at translating what it does? >> >> It is part of a while loop and I think its combining two conditions >> into one statement but would like confirmation. >> >> here is the code fragment: >> >> if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site >> [email_notify]", "-f$site[email_notify]") ) >> ++$err; >> >> >> I thinks this is the equivalent of: >> >> if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site >> [email_notify]", "-f$site[email_notify]") ) >> { >> ++$err; //update the error queue >> } >> else >> { >> mail( $row['Email'], $row[Subj], $row[Body], "From: $site >> [email_notify]", "-f$site[email_notify]"); >> } >> >> >> Has anyone seen or used this technique before? This is the first time >> I have seen it used, though this script has a lot of short cuts that >> make the code difficult to debug sometimes, like this one. >> >> Thanks in advance for your comments, >> -- >> Best regards, >> mikesz mailto:mikesz at qualityadvantages.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 > __________ NOD32 2604 (20071019) Information __________ > This message was checked by NOD32 antivirus system. > http://www.eset.com Thanks very much Tim, your example is exactly what I needed. -- Best regards, mikesz mailto:mikesz at qualityadvantages.com From brenttech at gmail.com Sat Oct 20 10:00:37 2007 From: brenttech at gmail.com (Brent Baisley) Date: Sat, 20 Oct 2007 10:00:37 -0400 Subject: [nycphp-talk] Any ideas appreciated... short cuts are not always a good thing for script maintenance... need some advise... In-Reply-To: <1822385224.20071020104734@qualityadvantages.com> References: <1822385224.20071020104734@qualityadvantages.com> Message-ID: <8C79FEA2-6765-4187-B048-194C658FD4AB@gmail.com> You are reinventing the wheel by writing your own smtp code. I use swiftmailer (http://www.swiftmailer.org/) when I need a script that is going to send out emails on a regular basis. Another option is phpmailer (http://phpmailer.sourceforge.net/), but that's not really being updated anymore. Both are free and handle SMTP extremely well. On Oct 19, 2007, at 10:47 PM, mikesz at qualityadvantages.com wrote: > Greetings and Hello, > > I am converting a script to use SMTP if php mail() is not available > for the users of this script. I have all the active calls working so > that if my smtp flag is set it automatically switches to smtp and > sends the message with the appropriate headers etc. but part of the > script is run by a > cron job and I see a php mail call but don't quite understand the > syntax. > Anyone care to take a guess at translating what it does? > > It is part of a while loop and I think its combining two conditions > into one statement but would like confirmation. > > here is the code fragment: > > if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site > [email_notify]", "-f$site[email_notify]") ) > ++$err; > > > I thinks this is the equivalent of: > > if ( !mail( $row['Email'], $row[Subj], $row[Body], "From: $site > [email_notify]", "-f$site[email_notify]") ) > { > ++$err; //update the error queue > } > else > { > mail( $row['Email'], $row[Subj], $row[Body], "From: $site > [email_notify]", "-f$site[email_notify]"); > } > > > Has anyone seen or used this technique before? This is the first time > I have seen it used, though this script has a lot of short cuts that > make the code difficult to debug sometimes, like this one. > > Thanks in advance for your comments, > -- > Best regards, > mikesz mailto:mikesz at qualityadvantages.com > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From cliff at pinestream.com Sat Oct 20 14:46:49 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Sat, 20 Oct 2007 14:46:49 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: <8f0676b40710191807t75ae8faree8ea4c90a918670@mail.gmail.com> Message-ID: John, Michael: Thanks for all the info. > And by '?' do you mean '?' or '?' ... there is a big difference. What is the difference? I have seen both? If anyone else is struggling with this, John and Michael have great points. There are some great articles on Wikepedia and Sitepoint regarding this issue. Essentially, you need to look at the entire "publishing" chain -- from text editors, to database to php to Apache to the browser.... In my case, this narrowed down to a few problem areas. 1. I conveniently "grabbed" some special characters from a windows editor. When, where? Who knows. But it's obvious. Lord knows I couldn't figure out how to get that special squiggle thing any other way. 2. ISO-8859 and Windows-1252 char set are very, very similar. Naturally, it's all those lovely special characters that are the difference. From Wikepedia: "It is very common to mislabel text data with the charset label ISO-8859-1, even though the data is really Windows-1252 encoded." 3. My pages were encoded as utf-8 -- the Apache default. Sure, I set the meta tag to 8859. Not enough -- use: header('Content-type: text/html; charset=ISO-8859-1'); 4. I still have some of those special characters, and I know they are not in the 8859 char set, yet things are look'n fine. Puzzling, eh. Why? From Wikepedia: "Many web browsers and e-mail clients will interpret ISO-8859-1 control codes as Windows-1252 characters in order to accommodate such mislabeling but it is not a standard behaviour and care should be taken to avoid generating these characters in ISO-8859-1 labeled content." 5. And this is big!!! I use the Firefox html validator plug-in to validate my pages. It uses Tidy. My pages came up as perfect -- till this problem hit when I switched platforms. Yet, when I ran them through the W3c validator, it barfed all over them. Use http://validator.w3.org to validate your pages. Cliff From ioplex at gmail.com Sat Oct 20 15:14:19 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sat, 20 Oct 2007 15:14:19 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: References: <8f0676b40710191807t75ae8faree8ea4c90a918670@mail.gmail.com> Message-ID: <78c6bd860710201214k221f7854qfd9247a179901739@mail.gmail.com> You got it baby. Now you can talk about character encoding at cocktail parties. On 10/20/07, Cliff Hirsch wrote: > John, Michael: > > Thanks for all the info. > > > And by '?' do you mean '?' or '?' ... there is a big difference. > What is the difference? I have seen both? > > If anyone else is struggling with this, John and Michael have great points. > There are some great articles on Wikepedia and Sitepoint regarding this > issue. Essentially, you need to look at the entire "publishing" chain -- > from text editors, to database to php to Apache to the browser.... > > In my case, this narrowed down to a few problem areas. > > 1. I conveniently "grabbed" some special characters from a windows editor. > When, where? Who knows. But it's obvious. Lord knows I couldn't figure out > how to get that special squiggle thing any other way. > > 2. ISO-8859 and Windows-1252 char set are very, very similar. Naturally, > it's all those lovely special characters that are the difference. From > Wikepedia: "It is very common to mislabel text data with the charset label > ISO-8859-1, even though the data is really Windows-1252 encoded." > > 3. My pages were encoded as utf-8 -- the Apache default. Sure, I set the > meta tag to 8859. Not enough -- use: > header('Content-type: text/html; charset=ISO-8859-1'); > > 4. I still have some of those special characters, and I know they are not in > the 8859 char set, yet things are look'n fine. Puzzling, eh. Why? From > Wikepedia: > > "Many web browsers and e-mail clients will interpret ISO-8859-1 control > codes as Windows-1252 characters in order to accommodate such mislabeling > but it is not a standard behaviour and care should be taken to avoid > generating these characters in ISO-8859-1 labeled content." > > 5. And this is big!!! > I use the Firefox html validator plug-in to validate my pages. It uses Tidy. > My pages came up as perfect -- till this problem hit when I switched > platforms. Yet, when I ran them through the W3c validator, it barfed all > over them. > > Use http://validator.w3.org to validate your pages. > > 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 > -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From lists at zaunere.com Sun Oct 21 15:27:52 2007 From: lists at zaunere.com (Hans Zaunere) Date: Sun, 21 Oct 2007 15:27:52 -0400 Subject: [nycphp-talk] Framework SIG lists? In-Reply-To: <330532b60710191214x6c5a2f05k6ed12b65265af846@mail.gmail.com> References: <50F571DC-4FE3-4926-8A0A-91B9C8B84496@jonbaer.com> <330532b60710191214x6c5a2f05k6ed12b65265af846@mail.gmail.com> Message-ID: <06e001c81418$79405910$640aa8c0@MobileZ> Mitch Pirtle wrote on Friday, October 19, 2007 3:15 PM: > On 10/19/07, Jon Baer wrote: > > Hi, > > > > Just curious, is there any interest out there to maybe(?) create > > local framework-specific lists (SIGs) around CakePHP, Zend, Symfony, > > etc. Or would it be better to just post to Talk w/ something in the > > subject [Zend] to signify the topic better or would that annoy > > everyone? > > I like the subject idea and will do it anyway in the hopes others find > it helpful. > > Another idea - why not have one NYPHP meet centered around frameworks, > and have a framework-fest of sorts? I'd love to see a handful of > people talk about their experiences, compare notes with others and see > what some of the advantages/disadvantages are between them. If there's interest in this, we could probably provide space. Noteably, we could have the back room at Suspenders where we can code, eat and drink until they close. H From 1j0lkq002 at sneakemail.com Sun Oct 21 16:35:10 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Sun, 21 Oct 2007 13:35:10 -0700 Subject: [nycphp-talk] Framework SIG lists? In-Reply-To: <330532b60710191214x6c5a2f05k6ed12b65265af846@mail.gmail.com> References: <50F571DC-4FE3-4926-8A0A-91B9C8B84496@jonbaer.com> <330532b60710191214x6c5a2f05k6ed12b65265af846@mail.gmail.com> Message-ID: <17744-09914@sneakemail.com> Mitch Pirtle mitch.pirtle-at-gmail.com |nyphp dev/internal group use| wrote: >On 10/19/07, Jon Baer wrote: > > >>Hi, >> >>Just curious, is there any interest out there to maybe(?) create >>local framework-specific lists (SIGs) around CakePHP, Zend, Symfony, >>etc. Or would it be better to just post to Talk w/ something in the >>subject [Zend] to signify the topic better or would that annoy everyone? >> >> > >I like the subject idea and will do it anyway in the hopes others find >it helpful. > >Another idea - why not have one NYPHP meet centered around frameworks, >and have a framework-fest of sorts? I'd love to see a handful of >people talk about their experiences, compare notes with others and see >what some of the advantages/disadvantages are between them. > >-- Mitch > > > +1 It's most relevant to PHP IMHO. -=john -- ------------------------------------------------------------- Your web server traffic log file is the most important source of web business information available. Do you know where your logs are right now? Do you know who else has access to your log files? When they were last archived? Where those archives are? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From jcampbell1 at gmail.com Sun Oct 21 19:21:44 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Sun, 21 Oct 2007 19:21:44 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: References: <8f0676b40710191807t75ae8faree8ea4c90a918670@mail.gmail.com> Message-ID: <8f0676b40710211621y47512a08ta24a9c36267727e8@mail.gmail.com> > > And by '?' do you mean '?' or '?' ... there is a big difference. > What is the difference? I have seen both? '?' is typically caused by storing the data in Mysql as UTF-8, and then a magical undocumented feature in the php mysql drivers auto converts it to 8859-1. Thus if you have a character that is not in 8859-1 (e.g. a korean character) mysql will convert it to a '?'. A '?' is generated by the browser when the browser is trying to render as UTF-8 and it comes across an invalid byte sequence. The first thing to understand about character encoding is the overlap between UTF-8 and 8859-1. Below is a sample a - lower case a (Same in 8859-1 & UTF-8) ? - a acute (Available in 8859-1 & UTF8 but different values..) ? - Chinese character (Not in 8859-1, in UTF-8) These days, you should really do everything in UTF-8. There was a lot of talk about PHP not being UTF-8 safe, but it is largely nonsense and primarily because developers don't think about other languages. I personally never see the need for functions like substr, and I don't use regular expressions like [a-zA-Z0-9]. One other piece of advice, is don't ever use that stupid meta tag to specify the content encoding. It makes no sense to specify the encoding of the content in the content itself. The content encoding should be specified in the header and only in the header. Regards, John Campbell From jmcgraw1 at gmail.com Mon Oct 22 09:45:44 2007 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Mon, 22 Oct 2007 09:45:44 -0400 Subject: [nycphp-talk] Compiling PHP Message-ID: Hello All: We currently have PHP 5.2.4 installed on our web server. It was compiled and installed with PHP MySQL library version 4.1.22 and our MySQL Server version is 5.0.45. Until yesterday this hadn't caused us any problems, but I believe it is now the source of the following error: Unable to bind arguments to query: Using unsupported buffer type: 0 (parameter: 1) My question is, How should I go about recompiling our PHP install with a newer MySQL library? Do I need to make any changes to Apache once this is done? If anyone could point me to a step by step guide I'd be much obliged. Thanks, - jake From ajai at bitblit.net Mon Oct 22 10:30:50 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 22 Oct 2007 10:30:50 -0400 (EDT) Subject: [nycphp-talk] Compiling PHP In-Reply-To: Message-ID: On Mon, 22 Oct 2007, Jake McGraw wrote: > My question is, How should I go about recompiling our PHP install with > a newer MySQL library? Do I need to make any changes to Apache once > this is done? If anyone could point me to a step by step guide I'd be > much obliged. Do you have the original files used to build your PHP and Apache? If you do, it should be a simple matter of just rebuilding PHP and then rebuilding Apache afterwards. If you dont have the sources used to build it, then you will need to figure out the configuration of your exiting PHP install (phpinfo() is your friend) and use that to figure out the flags to give to thwe configure script to build it. Same for Apache. -- Aj. From ben at projectskyline.com Mon Oct 22 12:01:53 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 22 Oct 2007 12:01:53 -0400 Subject: [nycphp-talk] [OT] Book search: The best DIV/CSS book? Message-ID: <010201c814c4$ddb8f210$6401a8c0@gamebox> Hello All, I still used table based layouts. I try to remove all my style attributes and place them in .css files. However, I still haven't made the jump from table to div based layouts. I've looked at a few books, but haven't found one that really drove the point home. I have no formal HTML experiance, I just write it to get stuff done. So, can anyone recommend a great book for div/css? Good websites are fine too, but the lack of depth in most online articles/whitepapers about the topic leaves me wanting more. Thanks, - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rharding at mitechie.com Mon Oct 22 12:04:32 2007 From: rharding at mitechie.com (Richard Harding) Date: Mon, 22 Oct 2007 12:04:32 -0400 Subject: [nycphp-talk] [OT] Book search: The best DIV/CSS book? In-Reply-To: <010201c814c4$ddb8f210$6401a8c0@gamebox> References: <010201c814c4$ddb8f210$6401a8c0@gamebox> Message-ID: <1193069072.7644.4.camel@traken.lan> On Mon, 2007-10-22 at 12:01 -0400, Ben Sgro (ProjectSkyLine) wrote: > Hello All, > > I still used table based layouts. I try to remove all my style > attributes and place them in .css files. > However, I still haven't made the jump from table to div based > layouts. > > I've looked at a few books, but haven't found one that really drove > the point home. > I have no formal HTML experiance, I just write it to get stuff done. > So, can anyone > recommend a great book for div/css? > > Good websites are fine too, but the lack of depth in most online > articles/whitepapers > about the topic leaves me wanting more. > > Thanks, > > - Ben I have only checked out a couple of CSS books, but they were both really helpful. Bulletproof Web Design, and CSS Mastery. I'd recommend both of them. Bulletproof does some simple things, but the ideas are good to have. CSS Mastery covers more complicated layouts and such. HTH Rick From jonbaer at jonbaer.com Mon Oct 22 12:06:54 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 22 Oct 2007 12:06:54 -0400 Subject: [nycphp-talk] [OT] Book search: The best DIV/CSS book? In-Reply-To: <010201c814c4$ddb8f210$6401a8c0@gamebox> References: <010201c814c4$ddb8f210$6401a8c0@gamebox> Message-ID: <7268FA6E-51B8-4E1D-A08C-E5282643E65B@jonbaer.com> I find pretty much all of the Friend of Ed series pretty insightful + extremely helpful on the topic ... http://www.friendsofed.com Particularly the title "CSS Mastery" ... http://cssmastery.com HTH, (I can bring this to tomorrows XML DB meetup if interested). - Jon On Oct 22, 2007, at 12:01 PM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello All, > > I still used table based layouts. I try to remove all my style > attributes and place them in .css files. > However, I still haven't made the jump from table to div based > layouts. > > I've looked at a few books, but haven't found one that really drove > the point home. > I have no formal HTML experiance, I just write it to get stuff > done. So, can anyone > recommend a great book for div/css? > > Good websites are fine too, but the lack of depth in most online > articles/whitepapers > about the topic leaves me wanting more. > > Thanks, > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use > of the individual to whom it is > addressed._______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 mitch.pirtle at gmail.com Mon Oct 22 12:13:28 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 22 Oct 2007 12:13:28 -0400 Subject: [nycphp-talk] [OT] Book search: The best DIV/CSS book? In-Reply-To: <1193069072.7644.4.camel@traken.lan> References: <010201c814c4$ddb8f210$6401a8c0@gamebox> <1193069072.7644.4.camel@traken.lan> Message-ID: <330532b60710220913v76033b73jc48005e07bf4bedf@mail.gmail.com> I'd also like to point you to A List Apart, another New Yorker (Jeffrey Zeldman) who has made quite a name for himself on this subject. His latest book "designing with web standards" (second edition) is a great read and recommended to everyone here. http://alistapart.com/ -- Mitch From aw at sap8.com Mon Oct 22 12:16:41 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Mon, 22 Oct 2007 12:16:41 -0400 Subject: [nycphp-talk] [OT] Book search: The best DIV/CSS book? In-Reply-To: <010201c814c4$ddb8f210$6401a8c0@gamebox> References: <010201c814c4$ddb8f210$6401a8c0@gamebox> Message-ID: <007b01c814c6$ee92fe30$cbb8fa90$@com> Ben, This is list of articles that I have read in learning how to implement div elements into what would have been a table layout. http://www.glish.com/css/. Hope it helps. Anthony W.i aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Ben Sgro (ProjectSkyLine) Sent: Monday, October 22, 2007 12:02 PM To: NYPHP Talk Subject: [nycphp-talk] [OT] Book search: The best DIV/CSS book? Hello All, I still used table based layouts. I try to remove all my style attributes and place them in .css files. However, I still haven't made the jump from table to div based layouts. I've looked at a few books, but haven't found one that really drove the point home. I have no formal HTML experiance, I just write it to get stuff done. So, can anyone recommend a great book for div/css? Good websites are fine too, but the lack of depth in most online articles/whitepapers about the topic leaves me wanting more. Thanks, - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Mon Oct 22 12:22:37 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 22 Oct 2007 12:22:37 -0400 Subject: [nycphp-talk] Compiling PHP In-Reply-To: References: Message-ID: <705E3518-BA18-4A54-B109-7BF354E7FEE7@jonbaer.com> First thing Id do is grab php-5.2.4 and mysql 5.0.45 sources and untar to /usr/local/src so you have them in case they are not there or outdated. Run "php -i | grep configure" and copy that to a handy file somewhere, it shows how your current php bin was built. Look for the mysql directives ... ./configure --help | grep mysql --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory --with-mysql-sock[=DIR] MySQL: Location of the MySQL unix socket pointer. --with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname to mysql_config [mysql_config] --enable-embedded-mysqli MYSQLi: Enable embedded support --with-pdo-mysql[=DIR] PDO: MySQL support. DIR is the MySQL base directory Your configure should already point to apxs for your apache setup so you don't need to do anything w/ apache except restart when the recompile is done. When I did this before I learned my lesson of symlinking up versions of mysql (and php) so I could easily rollback. BTW, was mysql compiled in or is it shared? From what I recall if it is shared you can also jump into /ext/mysql and run phpize, configure, make and swap out the extension in php.ini. This would of course be a possibly less secure method. - Jon On Oct 22, 2007, at 9:45 AM, Jake McGraw wrote: > Hello All: > > We currently have PHP 5.2.4 installed on our web server. It was > compiled and installed with PHP MySQL library version 4.1.22 and our > MySQL Server version is 5.0.45. Until yesterday this hadn't caused us > any problems, but I believe it is now the source of the following > error: > > Unable to bind arguments to query: Using unsupported buffer type: 0 > (parameter: 1) > > My question is, How should I go about recompiling our PHP install with > a newer MySQL library? Do I need to make any changes to Apache once > this is done? If anyone could point me to a step by step guide I'd be > much obliged. > > Thanks, > - 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 From ajai at bitblit.net Mon Oct 22 12:30:45 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 22 Oct 2007 12:30:45 -0400 (EDT) Subject: [nycphp-talk] [OT] Book search: The best DIV/CSS book? In-Reply-To: <7268FA6E-51B8-4E1D-A08C-E5282643E65B@jonbaer.com> Message-ID: On Mon, 22 Oct 2007, Jon Baer wrote: > I find pretty much all of the Friend of Ed series pretty insightful + > extremely helpful on the topic ... > > http://www.friendsofed.com > > Particularly the title "CSS Mastery" ... > > http://cssmastery.com > > HTH, (I can bring this to tomorrows XML DB meetup if interested). I believe the Friends of Ed title are also available as ebooks from Apress. -- Aj. From 1j0lkq002 at sneakemail.com Mon Oct 22 14:25:47 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Mon, 22 Oct 2007 11:25:47 -0700 Subject: [nycphp-talk] [OT] Book search: The best DIV/CSS book? In-Reply-To: <010201c814c4$ddb8f210$6401a8c0@gamebox> References: <010201c814c4$ddb8f210$6401a8c0@gamebox> Message-ID: <23447-22126@sneakemail.com> Ben Sgro (ProjectSkyLine) ben-at-projectskyline.com |nyphp dev/internal group use| wrote: > Hello All, > > I still used table based layouts. I try to remove all my style > attributes and place them in .css files. > However, I still haven't made the jump from table to div based layouts. > > I've looked at a few books, but haven't found one that really drove > the point home. > I have no formal HTML experiance, I just write it to get stuff done. > So, can anyone > recommend a great book for div/css? > > Good websites are fine too, but the lack of depth in most online > articles/whitepapers > about the topic leaves me wanting more. > > Thanks, > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) Ben, If you're productive and just looking to move over to div layouts, I suggest you query the "CSS Box model" and study that concept first. It's the math behind page layout using divs, and IMHO you need it first in order to be productive no matter how you approach CSS for layout. There are two "box models" described on the web: the CSS box model for HTML elements, and the concept of page layout as a series of nested "boxes". Layout the page box model properly, and everything else seems to flow logically and comfortably. Not completely clear on the box model, and everything can seem like a P.I.T.A. This is a very good article on the box model behind CSS, but scan all the pages http://www.brainjar.com/css/positioning/ Visual people like this simple demo for the HTML element box model concept. http://redmelon.net/tstme/box_model/ and I like to go here for page layouts according to box model (page level) http://glish.com/css/ but they are not the latest. For the latest, as always you go to the CSS lists. Hope that helps. -=john -- ------------------------------------------------------------- Your web server traffic log file is the most important source of web business information available. Do you know where your logs are right now? Do you know who else has access to your log files? When they were last archived? Where those archives are? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From ajai at bitblit.net Mon Oct 22 15:15:43 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 22 Oct 2007 15:15:43 -0400 (EDT) Subject: [nycphp-talk] Compiling PHP In-Reply-To: <705E3518-BA18-4A54-B109-7BF354E7FEE7@jonbaer.com> Message-ID: On Mon, 22 Oct 2007, Jon Baer wrote: > Your configure should already point to apxs for your apache setup so > you don't need to do anything w/ apache except restart when the > recompile is done. Rebuilding PHP by itself doesn't rebuild mod_php right? -- Aj. From ken at secdat.com Mon Oct 22 15:31:55 2007 From: ken at secdat.com (Kenneth Downs) Date: Mon, 22 Oct 2007 15:31:55 -0400 Subject: [nycphp-talk] I think this is an encoding issue? In-Reply-To: <200710171621.58627.jellicle@gmail.com> References: <471660D2.3030603@secdat.com> <200710171621.58627.jellicle@gmail.com> Message-ID: <471CFAAB.2080309@secdat.com> Michael Sims wrote: > On October 17, 2007, Kenneth Downs wrote: > >> I'm wondering if somebody knows whats up here. >> >> I'm writing does in OO.org. Then I export them to xhtml. Those files I >> parse with PHP and output HTML. >> >> On my laptop this works out just fine. But on the production server you >> will see problem squiggly stuff instead of double-quotes, as on this >> page: >> >> http://www.andromeda-project.org/pages/cms/Making+Hyperlinks >> >> Can somebody give me a clue where to start Googling on this? >> > > When that page is sent, the web server is telling my browser that it's in > ISO-8859-1. It isn't. It's UTF-8. For Firefox, choose View, Character > Encoding, UTF-8, and suddenly the page will be rendered correctly, because > you told your browser to ignore what the webserver told it and render the > page in UTF-8. > > If I look at the headers that the webserver sent with the page, I see: > ------------------------------- > Date: Wed, 17 Oct 2007 20:07:32 GMT > Server: Apache > X-Powered-By: PHP/5.2.2-pl1-gentoo > Expires: Thu, 19 Nov 1981 08:52:00 GMT > Cache-Control: private > Pragma: no-cache > Keep-Alive: timeout=15, max=100 > Connection: Keep-Alive > Transfer-Encoding: chunked > Content-Type: text/html; charset=ISO-8859-1 > > 200 OK > -------------------------------- > See that second to last line? That's wrong (as in, it doesn't match the > page you're serving). > > So either you need to write your app in ISO-8859-1, or you need to tell your > webserver to serve the proper header. You can do it in Apache or in PHP. > Here's a page of useful info: > > http://www.w3.org/International/O-HTTP-charset > > Probably the server on your laptop is configured slightly differently than > the production server. > > What *I* would do to solve this problem is get rid of the fancy curly quotes > altogether. They are nothing but trouble. While curly quotes in books > (dialogue) are nice for readability, where you're using them they're > definitely wrong. That is, if you write: > > > Mike, thanks for a very thorough reply. I did as you suggested, turned off that option in OO.org, did a search-and-replace on existing docs, and for the moment this allows me to ignore the mismatched encodings. > this is not correct HTML. HTML calls for the double-tick mark, not whatever > the curly quote character is, so if you cut-and-paste that into an HTML > document, it won't parse. You can turn off the curly quotes in > OpenOffice's options, so that it won't auto-convert the double-tick mark > for you anymore. > > Michael Sims > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 cliff at pinestream.com Mon Oct 22 17:10:15 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 22 Oct 2007 17:10:15 -0400 Subject: [nycphp-talk] Application performance optimization Message-ID: I am testing my production site, and something seems to be very wrong. I just loaded my homepage and it took 53.46 seconds. Clearly unacceptable for a production web site. And there should be zero load on the site, since no-one knows about it. One 775 byte image took 23 seconds. A 51byte image took 6 seconds. The main script took 28 seconds. Pulling in a 60K javascript file took 10 seconds. When accessing the page a second time, where the images and Javascript are pulled from the browser cache, the load time is typically a more respectable 250msec ? about what I would expect. I know the script is fast ? for the homepage there is barely any load at all. The site seems to be choking on the static content. There are a lot of static images to download... Sure, I expect the static content to take a bit of time to pull in, but 56 seconds?! Are there setting in Apache (or elsewhere) that would stall the download of multiple image files? Number of simultaneous connections, etc. Any idea for how to debug this? I can debug php, for a slow static image? I?m clueless... Thanks, Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at realm3.com Mon Oct 22 17:15:37 2007 From: brian at realm3.com (Brian D.) Date: Mon, 22 Oct 2007 17:15:37 -0400 Subject: [nycphp-talk] Application performance optimization In-Reply-To: References: Message-ID: Cliff - are you on a shared host or a dedicated server? > On 10/22/07, Cliff Hirsch wrote: > > > > I am testing my production site, and something seems to be very wrong. I > > just loaded my homepage and it took 53.46 seconds. Clearly unacceptable for > > a production web site. And there should be zero load on the site, since > > no-one knows about it. One 775 byte image took 23 seconds. A 51byte image > > took 6 seconds. The main script took 28 seconds. Pulling in a 60K javascript > > file took 10 seconds. > > > > When accessing the page a second time, where the images and Javascript are > > pulled from the browser cache, the load time is typically a more respectable > > 250msec ? about what I would expect. > > > > I know the script is fast ? for the homepage there is barely any load at > > all. The site seems to be choking on the static content. There are a lot of > > static images to download... Sure, I expect the static content to take a bit > > of time to pull in, but 56 seconds?! > > > > Are there setting in Apache (or elsewhere) that would stall the download of > > multiple image files? Number of simultaneous connections, etc. Any idea for > > how to debug this? I can debug php, for a slow static image? I'm clueless... > > > > Thanks, > > 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 cliff at pinestream.com Mon Oct 22 17:16:32 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 22 Oct 2007 17:16:32 -0400 Subject: [nycphp-talk] Application performance optimization In-Reply-To: Message-ID: On 10/22/07 5:10 PM, "Cliff Hirsch" wrote: > I am testing my production site, and something seems to be very wrong. I just > loaded my homepage and it took 53.46 seconds. Clearly unacceptable for a > production web site. And there should be zero load on the site, since no-one > knows about it. One 775 byte image took 23 seconds. A 51byte image took 6 > seconds. The main script took 28 seconds. Pulling in a 60K javascript file > took 10 seconds. > > When accessing the page a second time, where the images and Javascript are > pulled from the browser cache, the load time is typically a more respectable > 250msec ? about what I would expect. > > I know the script is fast ? for the homepage there is barely any load at all. > The site seems to be choking on the static content. There are a lot of static > images to download... Sure, I expect the static content to take a bit of time > to pull in, but 56 seconds?! > > Are there setting in Apache (or elsewhere) that would stall the download of > multiple image files? Number of simultaneous connections, etc. Any idea for > how to debug this? I can debug php, for a slow static image? I?m clueless... > As usual, answering my own question in real-time. Item #1: KeepAlive is Off ? looks like this could be one potential problem so far -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim_lists at o2group.com Mon Oct 22 17:21:25 2007 From: tim_lists at o2group.com (Tim Lieberman) Date: Mon, 22 Oct 2007 23:21:25 +0200 Subject: [nycphp-talk] Application performance optimization In-Reply-To: References: Message-ID: Sounds like your server is sick. If downloading a single sub-1k image is taking seconds upon seconds, something is seriously wrong. Do you have full control of the server, or is there someone at a hosting company that can look at this? I wouldn't start worrying about apache settings (which are pretty reasonable out of the box) until you're sure that there's not some runaway process on the box chewing up all sorts of resources, or (probably more likely) some local network issue near the server. -Tim On Oct 22, 2007, at 11:10 PM, Cliff Hirsch wrote: > I am testing my production site, and something seems to be very > wrong. I just loaded my homepage and it took 53.46 seconds. Clearly > unacceptable for a production web site. And there should be zero > load on the site, since no-one knows about it. One 775 byte image > took 23 seconds. A 51byte image took 6 seconds. The main script > took 28 seconds. Pulling in a 60K javascript file took 10 seconds. > > When accessing the page a second time, where the images and > Javascript are pulled from the browser cache, the load time is > typically a more respectable 250msec ? about what I would expect. > > I know the script is fast ? for the homepage there is barely any > load at all. The site seems to be choking on the static content. > There are a lot of static images to download... Sure, I expect the > static content to take a bit of time to pull in, but 56 seconds?! > > Are there setting in Apache (or elsewhere) that would stall the > download of multiple image files? Number of simultaneous > connections, etc. Any idea for how to debug this? I can debug php, > for a slow static image? I?m clueless... > > Thanks, > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pjlists at pobox.com Mon Oct 22 17:22:14 2007 From: pjlists at pobox.com (=?BIG5?B?UC4gSnUgKKa2un7moik=?=) Date: Mon, 22 Oct 2007 17:22:14 -0400 Subject: [nycphp-talk] Application performance optimization In-Reply-To: <7fb2405d0710221419p3867f891s2fd777d476aafece@mail.gmail.com> References: <7fb2405d0710221419p3867f891s2fd777d476aafece@mail.gmail.com> Message-ID: <7fb2405d0710221422r32bc8b08jaa56613ca6b0d310@mail.gmail.com> Hi Cliff, Are you doing remote access of DB, images, or scripts? Recently DNS resolution with a freshly created site caused me 7-10 second access times to a remote database. PJ > On 10/22/07, Cliff Hirsch wrote: > > > > I am testing my production site, and something seems to be very wrong. I > > just loaded my homepage and it took 53.46 seconds. Clearly unacceptable for > > a production web site. And there should be zero load on the site, since > > no-one knows about it. One 775 byte image took 23 seconds. A 51byte image > > took 6 seconds. The main script took 28 seconds. Pulling in a 60K javascript > > file took 10 seconds. > > > > When accessing the page a second time, where the images and Javascript are > > pulled from the browser cache, the load time is typically a more respectable > > 250msec ? about what I would expect. > > > > I know the script is fast ? for the homepage there is barely any load at > > all. The site seems to be choking on the static content. There are a lot of > > static images to download... Sure, I expect the static content to take a bit > > of time to pull in, but 56 seconds?! > > > > Are there setting in Apache (or elsewhere) that would stall the download of > > multiple image files? Number of simultaneous connections, etc. Any idea for > > how to debug this? I can debug php, for a slow static image? I'm clueless... > > > > Thanks, > > 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 > > > > > -- > Patricia Ju > phj at pobox.com > +1-646-717-3871 > > success = fn(perseverance) > -- Patricia Ju phj at pobox.com +1-646-717-3871 success = fn(perseverance) From cliff at pinestream.com Mon Oct 22 17:26:32 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 22 Oct 2007 17:26:32 -0400 Subject: [nycphp-talk] Application performance optimization In-Reply-To: Message-ID: Big-fat, honking dedicated, but was ready to switch to $3.95 shared. KeepAlive was off -- turning it on appears to have solved the problem. On 10/22/07 5:15 PM, "Brian D." wrote: > Cliff - are you on a shared host or a dedicated server? > >> On 10/22/07, Cliff Hirsch wrote: >>> >>> Are there setting in Apache (or elsewhere) that would stall the download of >>> multiple image files? Number of simultaneous connections, etc. Any idea for >>> how to debug this? I can debug php, for a slow static image? I'm clueless... From krook at us.ibm.com Mon Oct 22 17:35:23 2007 From: krook at us.ibm.com (Daniel Krook) Date: Mon, 22 Oct 2007 17:35:23 -0400 Subject: [nycphp-talk] Application performance optimization In-Reply-To: Message-ID: Hi Cliff, > I am testing my production site, and something seems to be > very wrong. I just loaded my homepage and it took 53.46 > seconds. Clearly unacceptable for a production web site. > And there should be zero load on the site, since no-one > knows about it. One 775 byte image took 23 seconds. A > 51byte image took 6 seconds. The main script took 28 > seconds. Pulling in a 60K javascript file took 10 seconds. > > When accessing the page a second time, where the images > and Javascript are pulled from the browser cache, the load > time is typically a more respectable 250msec ? about what > I would expect. > > I know the script is fast ? for the homepage there is > barely any load at all. The site seems to be choking on > the static content. There are a lot of static images to > download... Sure, I expect the static content to take a > bit of time to pull in, but 56 seconds?! > > Are there setting in Apache (or elsewhere) that would > stall the download of multiple image files? Number of > simultaneous connections, etc. Any idea for how to debug > this? I can debug php, for a slow static image? I?m clueless... > > Thanks, > Cliff Have a look at the site with the YSlow plugin for Firefox. It tests your site agains list of best practices from the performance guys at Yahoo: http://developer.yahoo.com/yslow/ You may also experience better performance if you offload your static files to a different hostname, e.g., www.example.org and img.example.org. This gets around maximum simultaneous connections to one server in the visitor's browser. Daniel Krook Content Tools Developer - SCSA, SCJP, SCWCD, ZCE, ICDAssoc. Global Solutions, ibm.com From cliff at pinestream.com Mon Oct 22 17:47:48 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 22 Oct 2007 17:47:48 -0400 Subject: [nycphp-talk] Application performance optimization In-Reply-To: <7fb2405d0710221422r32bc8b08jaa56613ca6b0d310@mail.gmail.com> Message-ID: No remote access -- everything is coming from the server. On 10/22/07 5:22 PM, "P. Ju (???)" wrote: > Hi Cliff, > > Are you doing remote access of DB, images, or scripts? Recently DNS resolution > with a freshly created site caused me 7-10 second access times to a > remote database. > > PJ From cliff at pinestream.com Mon Oct 22 17:49:40 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 22 Oct 2007 17:49:40 -0400 Subject: [nycphp-talk] Application performance optimization In-Reply-To: Message-ID: I have people working on it ? hopefully they?ll figure it out. On 10/22/07 5:21 PM, "Tim Lieberman" wrote: > Sounds like your server is sick.? If downloading a single sub-1k image is > taking seconds upon seconds, something is seriously wrong.? Do you have full > control of the server, or is there someone at a hosting company that can look > at this?? I wouldn't start worrying about apache settings (which are pretty > reasonable out of the box) until you're sure that there's not some runaway > process on the box chewing up all sorts of resources, or (probably more > likely) some local network issue near the server. > > -Tim > > On Oct 22, 2007, at 11:10 PM, Cliff Hirsch wrote: > >> I am testing my production site, and something seems to be very wrong. I >> just loaded my homepage and it took 53.46 seconds. Clearly unacceptable for a >> production web site. And there should be zero load on the site, since no-one >> knows about it. One 775 byte image took 23 seconds. A 51byte image took 6 >> seconds. The main script took 28 seconds. Pulling in a 60K javascript file >> took 10 seconds. >> >> When accessing the page a second time, where the images and Javascript are >> pulled from the browser cache, the load time is typically a more respectable >> 250msec ? about what I would expect. >> >> I know the script is fast ? for the homepage there is barely any load at >> all. The site seems to be choking on the static content. There are a lot of >> static images to download... Sure, I expect the static content to take a bit >> of time to pull in, but 56 seconds?! >> >> Are there setting in Apache (or elsewhere) that would stall the download of >> multiple image files? Number of simultaneous connections, etc. Any idea for >> how to debug this? I can debug php, for a slow static image? I?m clueless... >> >> Thanks, Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Mon Oct 22 18:08:06 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 22 Oct 2007 18:08:06 -0400 Subject: [nycphp-talk] Application performance optimization In-Reply-To: Message-ID: >> I am testing my production site, and something seems to be >> very wrong. I just loaded my homepage and it took 53.46 > Have a look at the site with the YSlow plugin for Firefox. It tests your > site agains list of best practices from the performance guys at Yahoo: > http://developer.yahoo.com/yslow/ > > You may also experience better performance if you offload your static > files to a different hostname, e.g., www.example.org and img.example.org. > This gets around maximum simultaneous connections to one server in the > visitor's browser. Thanks. This tool looks great! From cliff at pinestream.com Mon Oct 22 22:40:23 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 22 Oct 2007 22:40:23 -0400 Subject: [nycphp-talk] Sharing great css sprites link Message-ID: A great link to Yahoo?s performance plug-in in one of today?s threads eventually led me to this. Looks like a great solution to an image-intensive page. http://www.alistapart.com/articles/sprites http://spritegen.website-performance.org/ Enjoy, Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulcheung at tiscali.co.uk Tue Oct 23 04:13:18 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Tue, 23 Oct 2007 09:13:18 +0100 Subject: [nycphp-talk] automatic redirection of PHP script References: Message-ID: <001301c8154c$921a6400$0300a8c0@X9183> Hi I was wondering if anybody knows? I am sure that others must have encountered this in the past. What I am trying to accomplish is a conditional exit from the current script, go to and execute another script without any manual intervention. Using the following pseudo code, I am fully aware it is not elegant but it serves to explain what I want to accomplish. If $Cost < 100 goto and execute script-a.php else if $Cost > 1000 goto and execute script-b.php else carry on; Normally I would be happy to supply real PHP coding but unfortunately I do not know how to execute what I want to. Paul From nasir81 at gmail.com Tue Oct 23 05:52:57 2007 From: nasir81 at gmail.com (Nasir Zubair) Date: Tue, 23 Oct 2007 05:52:57 -0400 Subject: [nycphp-talk] automatic redirection of PHP script In-Reply-To: <001301c8154c$921a6400$0300a8c0@X9183> References: <001301c8154c$921a6400$0300a8c0@X9183> Message-ID: <40fcda730710230252p139bdddy43591e25dfb9f55c@mail.gmail.com> The simplest way I can think of is: if($Cost < 100) { include('script-a.php'); exit(); } else if($Cost > 1000) { include('script-b.php'); exit(); } // if the above two "exit's" didn't get invoked, rest of the script will be processed. . . . . On 10/23/07, PaulCheung wrote: > > Hi > > I was wondering if anybody knows? I am sure that others must have > encountered this in the past. What I am trying to accomplish is a > conditional exit from the current script, go to and execute another > script > without any manual intervention. Using the following pseudo code, I am > fully > aware it is not elegant but it serves to explain what I want to > accomplish. > > If $Cost < 100 goto and execute script-a.php > else > if $Cost > 1000 goto and execute script-b.php > else > carry on; > > Normally I would be happy to supply real PHP coding but unfortunately I do > not know how to execute what I want to. > > 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 > -- Nasir Zubair http://www.nasir.us/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Tue Oct 23 06:43:57 2007 From: ramons at gmx.net (David Krings) Date: Tue, 23 Oct 2007 06:43:57 -0400 Subject: [nycphp-talk] automatic redirection of PHP script In-Reply-To: <001301c8154c$921a6400$0300a8c0@X9183> References: <001301c8154c$921a6400$0300a8c0@X9183> Message-ID: <471DD06D.1030604@gmx.net> PaulCheung wrote: > Hi > > I was wondering if anybody knows? I am sure that others must have > encountered this in the past. What I am trying to accomplish is a > conditional exit from the current script, go to and execute another > script without any manual intervention. Using the following pseudo code, > I am fully aware it is not elegant but it serves to explain what I want > to accomplish. > > If $Cost < 100 goto and execute script-a.php > else > if $Cost > 1000 goto and execute script-b.php > else > carry on; > > Normally I would be happy to supply real PHP coding but unfortunately I > do not know how to execute what I want to. > > Paul You can use the HTML header redirect header("location:http://www.myserver.gov/script-a.php"); and send the browser to a different script. That will work only if you haven't sent output to the browser yet. David From jonbaer at jonbaer.com Tue Oct 23 07:34:58 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 23 Oct 2007 07:34:58 -0400 Subject: [nycphp-talk] automatic redirection of PHP script In-Reply-To: <001301c8154c$921a6400$0300a8c0@X9183> References: <001301c8154c$921a6400$0300a8c0@X9183> Message-ID: <0E19EE35-01B0-46CB-81FB-BCB015C49DF0@jonbaer.com> Another option ... switch(TRUE) { case($cost < 100): include("a.php"); break; case($cost > 1000): include("b.php"); break; default: break; } - Jon On Oct 23, 2007, at 4:13 AM, PaulCheung wrote: > Hi > > I was wondering if anybody knows? I am sure that others must have > encountered this in the past. What I am trying to accomplish is a > conditional exit from the current script, go to and execute > another script without any manual intervention. Using the following > pseudo code, I am fully aware it is not elegant but it serves to > explain what I want to accomplish. > > If $Cost < 100 goto and execute script-a.php > else > if $Cost > 1000 goto and execute script-b.php > else > carry on; > > Normally I would be happy to supply real PHP coding but > unfortunately I do not know how to execute what I want to. > > 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 tedd at sperling.com Tue Oct 23 09:12:06 2007 From: tedd at sperling.com (tedd) Date: Tue, 23 Oct 2007 09:12:06 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: <8f0676b40710211621y47512a08ta24a9c36267727e8@mail.gmail.com> References: <8f0676b40710191807t75ae8faree8ea4c90a918670@mail.gmail.com> <8f0676b40710211621y47512a08ta24a9c36267727e8@mail.gmail.com> Message-ID: At 7:21 PM -0400 10/21/07, John Campbell wrote: >The first thing to understand about character encoding is the overlap >between UTF-8 and 8859-1. Below is a sample >a - lower case a (Same in 8859-1 & UTF-8) >? - a acute (Available in 8859-1 & UTF8 but different values..) >?? - Chinese character (Not in 8859-1, in UTF-8) A small clarification -- it's not really overlap, but rather UTF-8 is a super-set containing 8859-1 like both contain ASCII. Other than that minor clarification, you've been spot-on with your advice. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ioplex at gmail.com Tue Oct 23 11:12:21 2007 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 23 Oct 2007 11:12:21 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: References: <8f0676b40710191807t75ae8faree8ea4c90a918670@mail.gmail.com> <8f0676b40710211621y47512a08ta24a9c36267727e8@mail.gmail.com> Message-ID: <78c6bd860710230812u73b8a270j70b161c9d34708da@mail.gmail.com> On 10/23/07, tedd wrote: > At 7:21 PM -0400 10/21/07, John Campbell wrote: > >The first thing to understand about character encoding is the overlap > >between UTF-8 and 8859-1. Below is a sample > >a - lower case a (Same in 8859-1 & UTF-8) > >? - a acute (Available in 8859-1 & UTF8 but different values..) > >?? - Chinese character (Not in 8859-1, in UTF-8) > > A small clarification -- it's not really overlap, > but rather UTF-8 is a super-set containing 8859-1 > like both contain ASCII. Well if you want to be pedantic about it, "overlap" is more accurate. UTF-8 is a multibyte encoding of the Unicode charset. ISO-8859-1 is a single byte encoding of the ISO-8859-1 charset. So yes, Unicode is a superset of ISO-8859-1 but the UTF-8 encoding of values above 0x7f are not the same. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From mitch.pirtle at gmail.com Tue Oct 23 11:52:43 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 23 Oct 2007 11:52:43 -0400 Subject: [nycphp-talk] Compiling PHP In-Reply-To: References: <705E3518-BA18-4A54-B109-7BF354E7FEE7@jonbaer.com> Message-ID: <330532b60710230852l299306bu288b6812d61401c8@mail.gmail.com> On 10/22/07, Ajai Khattri wrote: > On Mon, 22 Oct 2007, Jon Baer wrote: > > > Your configure should already point to apxs for your apache setup so > > you don't need to do anything w/ apache except restart when the > > recompile is done. > > Rebuilding PHP by itself doesn't rebuild mod_php right? Yes it does, if you passed the right arguments to configure. Remember that there are two different ways to build mod_php based on whether you're using Apache 1.x or Apache 2.x... -- Mitch From ali at vpproperty.com Tue Oct 23 12:26:41 2007 From: ali at vpproperty.com (ali mohammad) Date: Tue, 23 Oct 2007 12:26:41 -0400 Subject: [nycphp-talk] automatic redirection of PHP script In-Reply-To: <0E19EE35-01B0-46CB-81FB-BCB015C49DF0@jonbaer.com> References: <001301c8154c$921a6400$0300a8c0@X9183> <0E19EE35-01B0-46CB-81FB-BCB015C49DF0@jonbaer.com> Message-ID: <3E6F267FA8AEC34B88F8E679637000630C86CC@S48286.vpproperty.com> Based on your pseudo code, I am probably assuming you want to terminate the rest of the current script when it conditionally branches to one of your branch scripts. If so, make sure it does. Your pseudo code should more closely resemble the below statements if what I presumed is correct. ======================================================================= //script begin //script code common to all conditions... If ($cost < 100) { //execute branch script-a.php (could be with a header statement) //exit current script } else if ($cost > 1000) { //execute branch script-b.php (could be with a header statement) //exit current script } else { //carry on with the rest of the script. } ... //script code only applicable to the third 'default' case if any //script end ======================================================================== You can also consider an alternative approach based on Jon's solution that obviates the need for specific exit statements with header() redirections (and the additional work that may be involved with pushing potential GET/POST data you want to send to that redirected script if you are not or decide not to pass the data via session variables). //script begin //common script code applicable to all three cases... Switch (true) { Case ($cost < 100): include 'script-a.php'; break; Case ($cost > 1000) include 'script-b.php'; Break; Default: //Put in all specific statements that need to be executed //when $cost fails to meet above two conditions } //common script code applicable to all three cases //end of script Regards, Ali Mohammed. On Oct 23, 2007, at 4:13 AM, PaulCheung wrote: > Hi > > I was wondering if anybody knows? I am sure that others must have > encountered this in the past. What I am trying to accomplish is a > conditional exit from the current script, go to and execute > another script without any manual intervention. Using the following > pseudo code, I am fully aware it is not elegant but it serves to > explain what I want to accomplish. > > If $Cost < 100 goto and execute script-a.php > else > if $Cost > 1000 goto and execute script-b.php > else > carry on; > > Normally I would be happy to supply real PHP coding but > unfortunately I do not know how to execute what I want to. > > Paul > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ben at projectskyline.com Wed Oct 24 09:11:47 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 24 Oct 2007 09:11:47 -0400 Subject: [nycphp-talk] [OT] Book search: The best DIV/CSS book? References: <010201c814c4$ddb8f210$6401a8c0@gamebox> <23447-22126@sneakemail.com> Message-ID: <003c01c8163f$6f8f1d60$6401a8c0@gamebox> > Ben, > > If you're productive and just looking to move over to div layouts, I > suggest you query the "CSS Box model" and study that concept first. It's > the math behind page layout using divs, and IMHO you need it first in > order to be productive no matter how you approach CSS for layout. There > are two "box models" described on the web: the CSS box model for HTML > elements, and the concept of page layout as a series of nested "boxes". > I believe that's the missing link. I went and got the CSS Mastery book. > Layout the page box model properly, and everything else seems to flow > logically and comfortably. Not completely clear on the box model, and > everything can seem like a P.I.T.A. Exactly. > > This is a very good article on the box model behind CSS, but scan all the > pages http://www.brainjar.com/css/positioning/ > Visual people like this simple demo for the HTML element box model > concept. http://redmelon.net/tstme/box_model/ > and I like to go here for page layouts according to box model (page level) > http://glish.com/css/ > but they are not the latest. For the latest, as always you go to the CSS > lists. > > Hope that helps. It does, thanks! And thanks to everyone else you posted. - Ben > > -=john > > -- > ------------------------------------------------------------- > Your web server traffic log file is the most important source of web > business information available. Do you know where your logs are right now? > Do you know who else has access to your log files? When they were last > archived? Where those archives are? --John Andrews Competitive Webmaster > and SEO Blogging at http://www.johnon.com > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 SHalter at ThorntonTomasetti.com Wed Oct 24 09:36:39 2007 From: SHalter at ThorntonTomasetti.com (Halter, Shari) Date: Wed, 24 Oct 2007 09:36:39 -0400 Subject: [nycphp-talk] Native XML Databases References: <010201c814c4$ddb8f210$6401a8c0@gamebox><23447-22126@sneakemail.com> <20071024131018.C4FC8BC8039@gatekeeper.thettgroup.com> Message-ID: <20071024133914.AA9A1BC8245@gatekeeper.thettgroup.com> Great Native XML Database talk last night! Can you tell me where the slides are posted so I can digest some of that material? Shari L. Halter Web Programmer, Corporate Services Thornton Tomasetti 51 Madison Avenue New York, NY 10010 T 917.661.7800 F 917.661.7801 D 917.661.7970 SHalter at ThorntonTomasetti.com From brian at realm3.com Wed Oct 24 09:59:32 2007 From: brian at realm3.com (Brian D.) Date: Wed, 24 Oct 2007 09:59:32 -0400 Subject: [nycphp-talk] Native XML Databases In-Reply-To: <20071024133914.AA9A1BC8245@gatekeeper.thettgroup.com> References: <010201c814c4$ddb8f210$6401a8c0@gamebox> <23447-22126@sneakemail.com> <20071024131018.C4FC8BC8039@gatekeeper.thettgroup.com> <20071024133914.AA9A1BC8245@gatekeeper.thettgroup.com> Message-ID: Yes, I want to second that and congratulate Elliotte on a very well put-together demonstration. I believe the slides can be found here: http://www.cafeconleche.org/slides/nyphp/xquery/01.html I work in the medical industry, and I've seen a lot of not-so-rectangular data stuffed into rectangular holes (see the NYPHP thread on "Flexible Forms" back in May, for example) and XML seems as if it would provide a nice alternative. The only thing that makes me hesitate is the relative infancy of the open source DB's available. I would have to be convinced that they are stable, long-term solutions, and so far I'm not seeing that. Some of the hybrid solutions out there, however, look quite viable. Again, thanks for the talk, Elliotte. On 10/24/07, Halter, Shari wrote: > > Great Native XML Database talk last night! Can you tell me where the > slides are posted so I can digest some of that material? > > > Shari L. Halter > Web Programmer, Corporate Services > Thornton Tomasetti > 51 Madison Avenue > New York, NY 10010 > T 917.661.7800 F 917.661.7801 > D 917.661.7970 > SHalter at ThorntonTomasetti.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Wed Oct 24 09:08:13 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 24 Oct 2007 09:08:13 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> References: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> Message-ID: <714705A4-24DB-4BBB-8E64-95BE31471919@beaffinitive.com> On Oct 18, 2007, at 5:08 PM, Brent Baisley wrote: > You don't need to do an extra count query. If you are using MySQL, > just add SQL_CALC_FOUND_ROWS to your select query. > SELECT SQL_CALC_FOUND_ROWS * FROM ... > You can then run SELECT FOUND_ROWS() to get the total rows without any > limits. It's still 2 queries, but the second one is essentially free. If it's a relatively simple query that makes use of indexes, then it's going to be faster to do a separate count(0) query instead of SQL_CALC_FOUND_ROWS. I confirmed with some gurus at the recent mysql camp that SQL_CAL_FOUND_ROWS is faster than count(0) if it's a complex search query (i.e. where clauses/joins on non-indexed columns). -Rob From brenttech at gmail.com Wed Oct 24 14:03:02 2007 From: brenttech at gmail.com (Brent Baisley) Date: Wed, 24 Oct 2007 14:03:02 -0400 Subject: [nycphp-talk] Paging Strategies In-Reply-To: <714705A4-24DB-4BBB-8E64-95BE31471919@beaffinitive.com> References: <5d515c620710181408j780828c3v7bf17f0e820ae88f@mail.gmail.com> <714705A4-24DB-4BBB-8E64-95BE31471919@beaffinitive.com> Message-ID: <5d515c620710241103y2e4373d9hb8ac37d3d63d3293@mail.gmail.com> My guess is that two queries would be faster if only the indexes needed to be accessed. Meaning it would not need to read from the main data file to determine the result set, just the index file. This would be especially true of InnoDB based tables. On 10/24/07, Rob Marscher wrote: > On Oct 18, 2007, at 5:08 PM, Brent Baisley wrote: > > You don't need to do an extra count query. If you are using MySQL, > > just add SQL_CALC_FOUND_ROWS to your select query. > > SELECT SQL_CALC_FOUND_ROWS * FROM ... > > You can then run SELECT FOUND_ROWS() to get the total rows without any > > limits. It's still 2 queries, but the second one is essentially free. > > If it's a relatively simple query that makes use of indexes, then > it's going to be faster to do a separate count(0) query instead of > SQL_CALC_FOUND_ROWS. I confirmed with some gurus at the recent mysql > camp that SQL_CAL_FOUND_ROWS is faster than count(0) if it's a > complex search query (i.e. where clauses/joins on non-indexed columns). > > -Rob > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From czech at npgroup.net Wed Oct 24 17:36:22 2007 From: czech at npgroup.net (Pete Czech - New Possibilities Group, LLC) Date: Wed, 24 Oct 2007 17:36:22 -0400 Subject: [nycphp-talk] VMWare Message-ID: <471FBAD6.5000701@npgroup.net> This is a little bit off topic, but I'm wondering how the group feels about running servers off of VMWare. I have a social networking site currently with about 1M+ uniques/mo. Runs on php5/MySQL. I've been toying with moving to servers hosted on VMWare and load balanced. Anyone have any experiences, pros, cons of installing such an architecture? Thanks, Pete Czech -- Pete Czech Lead Guru New Possibilities Group, LLC http://npgroup.net 973.931.8283 AIM: PJCzech From volcimaster at gmail.com Wed Oct 24 17:43:17 2007 From: volcimaster at gmail.com (Warren Myers) Date: Wed, 24 Oct 2007 17:43:17 -0400 Subject: [nycphp-talk] VMWare In-Reply-To: <471FBAD6.5000701@npgroup.net> References: <471FBAD6.5000701@npgroup.net> Message-ID: What kind of hardware will you be running on? I presume you're talking about ESX INfrastructure, and not VMware Server, yes? What hosted OS do you want to use? WMM On 10/24/07, Pete Czech - New Possibilities Group, LLC wrote: > > This is a little bit off topic, but I'm wondering how the group feels > about running servers off of VMWare. I have a social networking site > currently with about 1M+ uniques/mo. Runs on php5/MySQL. I've been > toying with moving to servers hosted on VMWare and load balanced. > Anyone have any experiences, pros, cons of installing such an > architecture? > > Thanks, > > Pete Czech > > -- > > Pete Czech > Lead Guru > New Possibilities Group, LLC > http://npgroup.net > > 973.931.8283 > AIM: PJCzech > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- http://warrenmyers.com "God may not play dice with the universe, but something strange is going on with the prime numbers." --Paul Erd?s "It's not possible. We are the type of people who have everything in our favor going against us." --Ben Jarhvi, Short Circuit 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Wed Oct 24 18:57:36 2007 From: chsnyder at gmail.com (csnyder) Date: Wed, 24 Oct 2007 18:57:36 -0400 Subject: [nycphp-talk] VMWare In-Reply-To: <471FBAD6.5000701@npgroup.net> References: <471FBAD6.5000701@npgroup.net> Message-ID: On 10/24/07, Pete Czech - New Possibilities Group, LLC wrote: > This is a little bit off topic, but I'm wondering how the group feels > about running servers off of VMWare. I have a social networking site > currently with about 1M+ uniques/mo. Runs on php5/MySQL. I've been > toying with moving to servers hosted on VMWare and load balanced. > Anyone have any experiences, pros, cons of installing such an architecture? > > Thanks, > > Pete Czech There have been recent issues running Linux on VMWare--you have to configure 2.6 kernels not to hit the clock so hard, a fairly easy fix in recent versions. I still saw above average clock skew on mine (30-40 seconds over 24 hours), but ymmv. I've never tried to put one under production load. I like virtualization a lot for simple things like proxys and mirrors, which I'm happy to let somebody else host. There are a lot of folks doing VPS. My advice is to find a host that allows you to build your own images, and stay away from the "web control panel" unless you have time to audit it. Check out Amazon's EC2, also. -- Chris Snyder http://chxo.com/ From sequethin at gmail.com Wed Oct 24 19:41:39 2007 From: sequethin at gmail.com (Michael Hernandez) Date: Wed, 24 Oct 2007 19:41:39 -0400 Subject: [nycphp-talk] VMWare In-Reply-To: References: <471FBAD6.5000701@npgroup.net> Message-ID: On Oct 24, 2007, at 6:57 PM, csnyder wrote: > On 10/24/07, Pete Czech - New Possibilities Group, LLC > wrote: >> This is a little bit off topic, but I'm wondering how the group feels >> about running servers off of VMWare. I have a social networking site >> currently with about 1M+ uniques/mo. Runs on php5/MySQL. I've been >> toying with moving to servers hosted on VMWare and load balanced. >> Anyone have any experiences, pros, cons of installing such an >> architecture? >> >> Thanks, >> >> Pete Czech > > There have been recent issues running Linux on VMWare--you have to > configure 2.6 kernels not to hit the clock so hard, a fairly easy fix > in recent versions. I still saw above average clock skew on mine > (30-40 seconds over 24 hours), but ymmv. I've never tried to put one > under production load. > > I like virtualization a lot for simple things like proxys and mirrors, > which I'm happy to let somebody else host. There are a lot of folks > doing VPS. My advice is to find a host that allows you to build your > own images, and stay away from the "web control panel" unless you have > time to audit it. Check out Amazon's EC2, also. > > -- At my office we run some FreeBSD virtual machines in VMWare and serve some PHP web applications including Plesk and some custom apps. As long as you have decent hardware for it it's not really a problem, but be careful with your clock - there are some tweaks you need to perform to keep the virtual server clock in sync with the real clock. NTP helps but if you don't adjust some RTC settings the clock will be horribly skewed (this is with 6.1, not sure about more recent versions). In terms of PHP performance I haven't noticed any significant issues. --Mike H From ajai at bitblit.net Thu Oct 25 09:22:45 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 25 Oct 2007 09:22:45 -0400 (EDT) Subject: [nycphp-talk] VMWare In-Reply-To: Message-ID: On Wed, 24 Oct 2007, csnyder wrote: > I like virtualization a lot for simple things like proxys and mirrors, > which I'm happy to let somebody else host. There are a lot of folks > doing VPS. My advice is to find a host that allows you to build your > own images Im using linode.com to host a vitual mail/webmail server (they use UML for virtualization). Their control panel allows you to build a disk image from among 10 Linux distributions and then boot it as a VPS. You can then ssh into it and build your server software as normal. You also have console access by ssh'ing into the host server for your VPS where you're connected to the virtual console via a screen session. Disk space, memory and IP address upgrades are managed through software that upgrades your VPS (which you can then reboot through the control panel). I thought this is a nice way to run your own server without the hardware worries. Just passing on my positive experience. -- Aj. From tedd at sperling.com Thu Oct 25 10:03:38 2007 From: tedd at sperling.com (tedd) Date: Thu, 25 Oct 2007 10:03:38 -0400 Subject: [nycphp-talk] automatic redirection of PHP script In-Reply-To: <001301c8154c$921a6400$0300a8c0@X9183> References: <001301c8154c$921a6400$0300a8c0@X9183> Message-ID: At 9:13 AM +0100 10/23/07, PaulCheung wrote: >Hi > >I was wondering if anybody knows? I am sure that others must have >encountered this in the past. What I am trying to accomplish is a >conditional exit from the current script, go to and execute another >script without any manual intervention. Using the following pseudo >code, I am fully aware it is not elegant but it serves to explain >what I want to accomplish. > >If $Cost < 100 goto and execute script-a.php > else > if $Cost > 1000 goto and execute script-b.php > else > carry on; > >Normally I would be happy to supply real PHP coding but >unfortunately I do not know how to execute what I want to. > >Paul Paul: Please review -- example and code: http://www.webbytedd.com/bb/php-run-php/ Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Thu Oct 25 10:49:21 2007 From: tedd at sperling.com (tedd) Date: Thu, 25 Oct 2007 10:49:21 -0400 Subject: [nycphp-talk] Character set issues revisited In-Reply-To: <78c6bd860710230812u73b8a270j70b161c9d34708da@mail.gmail.com> References: <8f0676b40710191807t75ae8faree8ea4c90a918670@mail.gmail.com> <8f0676b40710211621y47512a08ta24a9c36267727e8@mail.gmail.com> <78c6bd860710230812u73b8a270j70b161c9d34708da@mail.gmail.com> Message-ID: At 11:12 AM -0400 10/23/07, Michael B Allen wrote: >On 10/23/07, tedd wrote: >> At 7:21 PM -0400 10/21/07, John Campbell wrote: >> >The first thing to understand about character encoding is the overlap >> >between UTF-8 and 8859-1. Below is a sample >> >a - lower case a (Same in 8859-1 & UTF-8) >> >? - a acute (Available in 8859-1 & UTF8 but different values..) >> >?? - Chinese character (Not in 8859-1, in UTF-8) >> >> A small clarification -- it's not really overlap, >> but rather UTF-8 is a super-set containing 8859-1 >> like both contain ASCII. > >Well if you want to be pedantic about it, "overlap" is more accurate. >UTF-8 is a multibyte encoding of the Unicode charset. ISO-8859-1 is a >single byte encoding of the ISO-8859-1 charset. So yes, Unicode is a >superset of ISO-8859-1 but the UTF-8 encoding of values above 0x7f are >not the same. > >Mike You are free to call it what you want. True, the code-points for the ISO-8859-1 charset above 0x7F (the M$ spin) are not the same as UTF-* et al, but the glyphs are still included in UFT-8 regardless of encoding differences -- is that not true? If this is true, then the term "overlap" would be less correct than "super-set" because the two sets do not overlap with respect to all code-points -- but the larger one still contain all the glyphs that the smaller one does (for the exception of Apple's spin on that set, which included adding their logo). That's the reason I'm free to call one a super-set of the the other. I believe it's easier to explain char-sets and code-points in terms of current Unicode standards than it is to point out historical differences that are diminishing in importance as more people convert. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From dorgan at optonline.net Thu Oct 25 10:53:58 2007 From: dorgan at optonline.net (Donald Organ) Date: Thu, 25 Oct 2007 10:53:58 -0400 Subject: [nycphp-talk] Change Email address Message-ID: <1193324038.5946.1.camel@dorgan-mobile> Can my emailo address for this list please be changed to dorgan at donaldorgan.com, as the web interface is not allowing me to do so. -------------- next part -------------- An HTML attachment was scrubbed... URL: From czech at npgroup.net Thu Oct 25 11:21:14 2007 From: czech at npgroup.net (Pete Czech - New Possibilities Group, LLC) Date: Thu, 25 Oct 2007 11:21:14 -0400 Subject: [nycphp-talk] VMWare In-Reply-To: References: Message-ID: <4720B46A.6020304@npgroup.net> Thanks for the feedback guys. I'm torn between this and just setting up a rack of my own machines with software load balancers. The debate will continue.. Ajai Khattri wrote: > On Wed, 24 Oct 2007, csnyder wrote: > > >> I like virtualization a lot for simple things like proxys and mirrors, >> which I'm happy to let somebody else host. There are a lot of folks >> doing VPS. My advice is to find a host that allows you to build your >> own images >> > > Im using linode.com to host a vitual mail/webmail server (they use UML for > virtualization). Their control panel allows you to build a disk image from > among 10 Linux distributions and then boot it as a VPS. You can then ssh > into it and build your server software as normal. > > You also have console access by ssh'ing into the host server for your VPS > where you're connected to the virtual console via a screen session. > > Disk space, memory and IP address upgrades are managed through software > that upgrades your VPS (which you can then reboot through the control > panel). > > I thought this is a nice way to run your own server without the hardware > worries. Just passing on my positive experience. > > > -- Pete Czech Lead Guru New Possibilities Group, LLC http://npgroup.net 973.931.8283 AIM: PJCzech From ajai at bitblit.net Thu Oct 25 11:31:11 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 25 Oct 2007 11:31:11 -0400 (EDT) Subject: [nycphp-talk] VMWare In-Reply-To: <4720B46A.6020304@npgroup.net> Message-ID: On Thu, 25 Oct 2007, Pete Czech - New Possibilities Group, LLC wrote: > Thanks for the feedback guys. I'm torn between this and just setting up > a rack of my own machines with software load balancers. The debate will > continue.. That's what I *used* to do until I got tired stressing over hardware failures. -- Aj. From ali at vpproperty.com Thu Oct 25 12:32:44 2007 From: ali at vpproperty.com (ali mohammad) Date: Thu, 25 Oct 2007 12:32:44 -0400 Subject: [nycphp-talk] Change Email address In-Reply-To: <1193324038.5946.1.camel@dorgan-mobile> References: <1193324038.5946.1.camel@dorgan-mobile> Message-ID: <3E6F267FA8AEC34B88F8E679637000630C86CD@S48286.vpproperty.com> Then again, you could always unsubscribe and re-subscribe :-) ________________________________ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Donald Organ Sent: Thursday, October 25, 2007 9:54 AM To: NYPHP Talk Subject: [nycphp-talk] Change Email address Can my emailo address for this list please be changed to dorgan at donaldorgan.com, as the web interface is not allowing me to do so. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Thu Oct 25 12:33:38 2007 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 25 Oct 2007 12:33:38 -0400 Subject: [nycphp-talk] Change Email address In-Reply-To: <3E6F267FA8AEC34B88F8E679637000630C86CD@S48286.vpproperty.com> References: <1193324038.5946.1.camel@dorgan-mobile> <3E6F267FA8AEC34B88F8E679637000630C86CD@S48286.vpproperty.com> Message-ID: <025f01c81724$cb9525b0$640aa8c0@MobileZ> ali mohammad wrote on Thursday, October 25, 2007 12:33 PM: > Then again, you could always unsubscribe and re-subscribe :-) Which is exactly what you need to do. H From ajai at bitblit.net Thu Oct 25 16:28:58 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 25 Oct 2007 16:28:58 -0400 (EDT) Subject: [nycphp-talk] Compiling PHP In-Reply-To: <330532b60710230852l299306bu288b6812d61401c8@mail.gmail.com> Message-ID: On Tue, 23 Oct 2007, Mitch Pirtle wrote: > Yes it does, if you passed the right arguments to configure. Remember > that there are two different ways to build mod_php based on whether > you're using Apache 1.x or Apache 2.x... Ah, recently Ive been working with Apache 1.x a lot... -- Aj. From selyah1 at yahoo.com Thu Oct 25 17:56:54 2007 From: selyah1 at yahoo.com (selyah) Date: Thu, 25 Oct 2007 14:56:54 -0700 (PDT) Subject: [nycphp-talk] opening files Message-ID: <334585.83619.qm@web30806.mail.mud.yahoo.com> Hello Folks: I am still relatively new with php and am enjoying it very much. I am creating a html script to show images on a page. instead of creating a source image for all of the images, i would like to incorporate a php script that would "go" to the file location where all of the images are and display them. I wrote a script but it does not work. Any help or ideas ? thanks new guy -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Thu Oct 25 18:37:01 2007 From: ramons at gmx.net (David Krings) Date: Thu, 25 Oct 2007 18:37:01 -0400 Subject: [nycphp-talk] opening files In-Reply-To: <334585.83619.qm@web30806.mail.mud.yahoo.com> References: <334585.83619.qm@web30806.mail.mud.yahoo.com> Message-ID: <47211A8D.205@gmx.net> selyah wrote: > Hello Folks: > I am still relatively new with php and am enjoying it very much. I am > creating a html script to show images on a page. instead of creating a > source image for all of the images, i would like to incorporate a php > script that would "go" to the file location where all of the images are > and display them. I wrote a script but it does not work. Any help or > ideas ? thanks > new guy You'd need to provide some code samples for us to give you some advice. Also, what do you consider the difference between "creating a source image" and "go to the location where all of the images are and display them"? I'd establish a place where all images are (as appears to be given in your case), then write a script that creates pages with tags that point to the image in the specific location. I created and still work on a very similar system with a database backend that allows for quite complex searches and a bunch of other stuff. Basically, you need to tell us what you did so that we can tell you what you did wrong. David From susan_shemin at yahoo.com Thu Oct 25 20:26:11 2007 From: susan_shemin at yahoo.com (Susan Shemin) Date: Thu, 25 Oct 2007 17:26:11 -0700 (PDT) Subject: [nycphp-talk] opening files Message-ID: <481148.31720.qm@web50209.mail.re2.yahoo.com> Just adding on David's answer -- put the name/path of the image in a variable in your database. I've done it because the name of the image matches the name of the record entry so it's easy to locate the correct image to display through a query. Let's say the business is Susan so my logo for the business is named susan.jpg which I can easily locate in a query. susan ----- Original Message ---- From: David Krings To: NYPHP Talk Sent: Thursday, October 25, 2007 3:37:01 PM Subject: Re: [nycphp-talk] opening files selyah wrote: > Hello Folks: > I am still relatively new with php and am enjoying it very much. I am > creating a html script to show images on a page. instead of creating a > source image for all of the images, i would like to incorporate a php > script that would "go" to the file location where all of the images are > and display them. I wrote a script but it does not work. Any help or > ideas ? thanks > new guy You'd need to provide some code samples for us to give you some advice. Also, what do you consider the difference between "creating a source image" and "go to the location where all of the images are and display them"? I'd establish a place where all images are (as appears to be given in your case), then write a script that creates pages with tags that point to the image in the specific location. I created and still work on a very similar system with a database backend that allows for quite complex searches and a bunch of other stuff. Basically, you need to tell us what you did so that we can tell you what you did wrong. 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 ali at vpproperty.com Fri Oct 26 02:04:46 2007 From: ali at vpproperty.com (ali mohammad) Date: Fri, 26 Oct 2007 02:04:46 -0400 Subject: [nycphp-talk] opening files In-Reply-To: <481148.31720.qm@web50209.mail.re2.yahoo.com> References: <481148.31720.qm@web50209.mail.re2.yahoo.com> Message-ID: <3E6F267FA8AEC34B88F8E679637000630C86CE@S48286.vpproperty.com> Putting image paths in a database would only work if you know beforehand the path and name of all the images you want displayed (not to mention the unreasonable overhead of updating that database for additional images added or existing image files renamed later on). What you would want, if David's assumption is correct, is to automatically read the names of all image files contained in a given path location at the time of script execution , and then loop through each of the names and display the appropriate html img tag for each of these images. IMHO, you could adopt for a simpler approach by using the concept of directory browsing in php. The pseudo code of one possible way (among several others) would be something like this (hopefully assuming you are not stuck in a chrooted web jail). function displayallimages($imagepathlocation) { $listoffiles = system("ls " . $imagepathlocation); //filter $listoffiles to contain an array list of only valid image files based on allowable image file extensions foreach($listoffiles as $imgfile) echo ''; //make sure the image path here is relative to the document root of the web server } Or at least I think that is one way to do it. ________________________________ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Susan Shemin Sent: Thursday, October 25, 2007 7:26 PM To: NYPHP Talk Subject: Re: [nycphp-talk] opening files Just adding on David's answer -- put the name/path of the image in a variable in your database. I've done it because the name of the image matches the name of the record entry so it's easy to locate the correct image to display through a query. Let's say the business is Susan so my logo for the business is named susan.jpg which I can easily locate in a query. susan ----- Original Message ---- From: David Krings To: NYPHP Talk Sent: Thursday, October 25, 2007 3:37:01 PM Subject: Re: [nycphp-talk] opening files selyah wrote: > Hello Folks: > I am still relatively new with php and am enjoying it very much. I am > creating a html script to show images on a page. instead of creating a > source image for all of the images, i would like to incorporate a php > script that would "go" to the file location where all of the images are > and display them. I wrote a script but it does not work. Any help or > ideas ? thanks > new guy You'd need to provide some code samples for us to give you some advice. Also, what do you consider the difference between "creating a source image" and "go to the location where all of the images are and display them"? I'd establish a place where all images are (as appears to be given in your case), then write a script that creates pages with tags that point to the image in the specific location. I created and still work on a very similar system with a database backend that allows for quite complex searches and a bunch of other stuff. Basically, you need to tell us what you did so that we can tell you what you did wrong. 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 ramons at gmx.net Fri Oct 26 06:47:14 2007 From: ramons at gmx.net (David Krings) Date: Fri, 26 Oct 2007 06:47:14 -0400 Subject: [nycphp-talk] opening files In-Reply-To: <3E6F267FA8AEC34B88F8E679637000630C86CE@S48286.vpproperty.com> References: <481148.31720.qm@web50209.mail.re2.yahoo.com> <3E6F267FA8AEC34B88F8E679637000630C86CE@S48286.vpproperty.com> Message-ID: <4721C5B2.3030205@gmx.net> ali mohammad wrote: > Putting image paths in a database would only work if you know beforehand > the path and name of all the images you want displayed (not to mention > the unreasonable overhead of updating that database for additional > images added or existing image files renamed later on). What you would > want, if David?s assumption is correct, is to automatically read the > names of all image files contained in a given path location at the time > of script execution , and then loop through each of the names and > display the appropriate html img tag for each of these images. > > > > IMHO, you could adopt for a simpler approach by using the concept of > directory browsing in php. > The pseudo code of one possible way (among several others) would be > something like this (hopefully assuming you are not stuck in a chrooted > web jail). The one does not exclude the other. What I used to do in my picture viewer is go through the dirs, get the paths, and write those to the db (although "new guy" did not specify if he/she even uses a database, being new to PHP I doubt it a bit). You can then look at each file and check if you can extract exif information, at least the image size so that the page build is a bit faster. I later dropped parsing dir listings as I do not see why I want to dump just a bunch of files into some spot, I rather have then roughly sorted by year and month. I now upload a ZIP archive, read the file names into an array, unpack the archive to a temporary location, then go through the pile of files, determine if it is indeed an image (oh, still have to write that part), get some of the exif info, and dump it into the db with a marker set so that I can later find these images and properly title them, set the rotation, add tags, and fix the creation date if it wasn't available through exif. David From aw at sap8.com Fri Oct 26 09:31:28 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Fri, 26 Oct 2007 09:31:28 -0400 Subject: [nycphp-talk] opening files In-Reply-To: <4721C5B2.3030205@gmx.net> References: <481148.31720.qm@web50209.mail.re2.yahoo.com> <3E6F267FA8AEC34B88F8E679637000630C86CE@S48286.vpproperty.com> <4721C5B2.3030205@gmx.net> Message-ID: <004301c817d4$8369be30$8a3d3a90$@com> I believe the simple way would to be to store a path in a database. Here is an example of an upload procedure to add files to the directory (must be world writeable though and does not provide for mime types, just extension checks since mime_content_type() and PEAR extensions might not be an option on shared hosting). $height) { $ratio = 250/$width; $newWidth = 250; $newHeight = $height * $ratio; } else { $ratio = 250/$height; $newWidth = $width * $ratio; $newHeight = 250; } // create an image resource from the temp uploaded file if($extension == 'jpeg') { $image = imagecreatefromjpeg($srcImage); } elseif($extension == 'gif') { $image = imagecreatefromgif($srcImage); } elseif($extension == 'png') { $image = imagecreatefrompng($srcImage); } else { //output an error for extensions checks and die() } // create an image resource with the new dimensions $resizedImage = imagecreatetruecolor($newWidth, $newHeight); // copy the image with resampling imagecopyresampled($resizedImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); // save the resized image resource to a file // create an image resource from the temp uploaded file if($extension == 'jpeg') { imagejpeg($resizedImage, $uploadFile.".".$extension, 100); } elseif($extension == 'gif') { imagegif($resizedImage, $uploadFile.".".$extension); } else { imagepng($resizedImage, $uploadFile.".".$extension); } // update the database with the new image link // query data from the database for use in building the page $dbh = mysql_connect("localhostorIPofhost", "putyourusernamehere", "putyourpasswordhere"); // select the database mysql_select_db("anthonyw_mystory"); $query = sprintf("UPDATE `anthonyw_mystory`.`users` SET `profilePhoto` = '%s' WHERE `users`.`id` ='%s' LIMIT 1",$uploadFile.".".$extension,$userId); // make change in database $results = mysql_query($query); // close the database connection mysql_close($dbh); // return them back to the lobby; include './lobby.php'; } // the only way we can get to this script is when someone submits // a form submission to this script // copy their userID session_start(); $userId = $_SESSION['id']; // since mime_content_type or fileinfo are not available we must rely on the browser // and see if it has uploaded the mime type of the file $mimeString = $_FILES['userfile']['type']; // now test the mime string for varying different types if(strpos($mimeString,"jpeg") || strpos($mimeString,"jpg")) { $mimeType = 'jpeg'; } elseif(strpos($mimeString,"gif")) { $mimeType = 'gif'; } elseif(strpos($mimeString,"png")) { $mimeType = 'png'; } else { $mimeType = 'invalid'; } buildImage($userId, $_FILES['userfile']['tmp_name'], $mimeType); ?> And this is how I pull the file out for an image wrapped in an 'img' tag: "" But this assumes that $row is a successful mysql_query. There are additional functions if you know that the extension they can display images or image resources: imagejpeg(), imagegif(), imagepng(). I did not include the actual HTML form as I am assuming you can google that or look it up on PHP.net Anthony Wlodarski aw at sap8.com From ben at projectskyline.com Fri Oct 26 09:48:42 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Fri, 26 Oct 2007 09:48:42 -0400 Subject: [nycphp-talk] opening files References: <481148.31720.qm@web50209.mail.re2.yahoo.com> <3E6F267FA8AEC34B88F8E679637000630C86CE@S48286.vpproperty.com><4721C5B2.3030205@gmx.net> <004301c817d4$8369be30$8a3d3a90$@com> Message-ID: <000501c817d6$ec929a10$6401a8c0@gamebox> Hello, Here's some code I'm using to store user's avatars. I have the paths' mapped to defines. It removes the original image and converts to png (which is hardwired) and then saves JUST the filename to the database (since I know the path, DEFINE). I use the PEAR FileUpload( ) Class to take care of moving the files. and the ImageTransform( ) (which is some kinda derivation of the PEAR Image_Transform() class) to resize the image. Thatttsss it! if ( $stateObject->Get('do_avatar') == TRUE ) { $uploadObject = new FileUpload(0666); $fileName = $uploadObject->MoveFile(USER_IMAGES_PATH, 'uploadImage'); if ( $fileName == PROC_FAILURE ) { /* There has been an unrecoverable error. */ error_log(USER_IMAGES_PATH . ' directory does not exist'); } $imageObject = new ImageTransform( ); $imageObject->sourceFile = USER_IMAGES_PATH . $fileName; $newFileName = substr($fileName, 0, strrpos($fileName,".")); $newFileName .= '.png'; $imageObject->targetFile = USER_IMAGES_PATH . $newFileName; $imageObject->resizeToHeight = 90; $imageObject->resizeToWidth = 110; if ( !$imageObject->resize( ) ) { error_log($imageObject->error); } /* Remove the uploaded image. */ unlink(USER_IMAGES_PATH . $fileName); /* Update the users thumbnail in the database. */ $dbObject->DatabaseQuery('UPDATE ' . DATABASE_TABLE_USERS . ' SET thumbnail = ' . $dbObject->Safe($newFileName) . ' WHERE username = ' . $dbObject->Safe($sessionObject->Get(SESSION_USER)) . ' AND email = ' . $dbObject->Safe($sessionObject->Get(SESSION_EMAIL)) . ' AND id = ' . $dbObject->Safe($sessionObject->Get(SESSION_DBID)), RETURN_NONE, LOG_LEVEL_DEBUG); $avatarImage = $newFileName; } .....keeps going..... - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Anthony Wlodarski" To: "'NYPHP Talk'" Sent: Friday, October 26, 2007 9:31 AM Subject: RE: [nycphp-talk] opening files >I believe the simple way would to be to store a path in a database. Here >is > an example of an upload procedure to add files to the directory (must be > world writeable though and does not provide for mime types, just extension > checks since mime_content_type() and PEAR extensions might not be an > option > on shared hosting). > > /* > * Created on Oct 14, 2007 > * > * This application uploads a photo to be used for the profile. The image > * will be no larger than 250 x 250 pixels. If the image is not of type > gif/jpeg/png > * the user will be asked to upload a new photo that meets the > requirements, > additionally > * the max file size for a picture upload is two megabytes. > */ > // pre: cookie is set for user id, source image is uploaded and mime type > is > checked > // post: db is updated with link to profile photo > function buildImage($userId, $srcImage, $extension) > { > $uploadDir = './images/profilePhotos/'; > // try to make sure no one has a collision of profile files > $uploadFile = $uploadDir . md5($_SESSION['id']); > > // get our image dimensions so we can calculate a resize/aspect > ratio > list($width,$height) = getimagesize($srcImage); > > // check what axis we are going to calculate our resize ratio from > if($width > $height) > { > $ratio = 250/$width; > $newWidth = 250; > $newHeight = $height * $ratio; > } > else > { > $ratio = 250/$height; > $newWidth = $width * $ratio; > $newHeight = 250; > } > > // create an image resource from the temp uploaded file > if($extension == 'jpeg') > { > $image = imagecreatefromjpeg($srcImage); > } > elseif($extension == 'gif') > { > $image = imagecreatefromgif($srcImage); > } > elseif($extension == 'png') > { > $image = imagecreatefrompng($srcImage); > } > else > { > //output an error for extensions checks and die() > } > > > // create an image resource with the new dimensions > $resizedImage = imagecreatetruecolor($newWidth, $newHeight); > // copy the image with resampling > imagecopyresampled($resizedImage, $image, 0, 0, 0, 0, $newWidth, > $newHeight, $width, $height); > // save the resized image resource to a file > > // create an image resource from the temp uploaded file > if($extension == 'jpeg') > { > imagejpeg($resizedImage, $uploadFile.".".$extension, 100); > } > elseif($extension == 'gif') > { > imagegif($resizedImage, $uploadFile.".".$extension); > } > else > { > imagepng($resizedImage, $uploadFile.".".$extension); > } > > // update the database with the new image link > // query data from the database for use in building the page > $dbh = mysql_connect("localhostorIPofhost", "putyourusernamehere", > "putyourpasswordhere"); > // select the database > mysql_select_db("anthonyw_mystory"); > $query = sprintf("UPDATE `anthonyw_mystory`.`users` SET > `profilePhoto` = '%s' WHERE `users`.`id` ='%s' LIMIT > 1",$uploadFile.".".$extension,$userId); > // make change in database > $results = mysql_query($query); > // close the database connection > mysql_close($dbh); > // return them back to the lobby; > include './lobby.php'; > } > > // the only way we can get to this script is when someone submits > // a form submission to this script > > // copy their userID > session_start(); > $userId = $_SESSION['id']; > > // since mime_content_type or fileinfo are not available we must > rely on the browser > // and see if it has uploaded the mime type of the file > $mimeString = $_FILES['userfile']['type']; > > // now test the mime string for varying different types > if(strpos($mimeString,"jpeg") || strpos($mimeString,"jpg")) > { > $mimeType = 'jpeg'; > } > elseif(strpos($mimeString,"gif")) > { > $mimeType = 'gif'; > } > elseif(strpos($mimeString,"png")) > { > $mimeType = 'png'; > } > else > { > $mimeType = 'invalid'; > } > > buildImage($userId, $_FILES['userfile']['tmp_name'], $mimeType); > ?> > > And this is how I pull the file out for an image wrapped in an 'img' tag: > > "" > > But this assumes that $row is a successful mysql_query. There are > additional functions if you know that the extension they can display > images > or image resources: imagejpeg(), imagegif(), imagepng(). I did not > include > the actual HTML form as I am assuming you can google that or look it up on > PHP.net > > Anthony Wlodarski > aw at sap8.com > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From paulcheung at tiscali.co.uk Sat Oct 27 12:57:13 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Sat, 27 Oct 2007 17:57:13 +0100 Subject: [nycphp-talk] automatic redirection of PHP script References: <001301c8154c$921a6400$0300a8c0@X9183> <40fcda730710230252p139bdddy43591e25dfb9f55c@mail.gmail.com> Message-ID: <003101c818ba$6c645ec0$0200a8c0@X9183> Thanks everybody for all your suggestions. Sorry it has taken so long for me to reply, but I ran into another one of those mysterious error codes which for some odd reason spontaneously appeared where everything was previously working. Now that that is out of the way I can once again concentrate the automatic redirection of PHP scripts. Once again thanks for your help. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From nelly at cgim.com Sat Oct 27 17:02:53 2007 From: nelly at cgim.com (Nelly Yusupova) Date: Sat, 27 Oct 2007 17:02:53 -0400 Subject: [nycphp-talk] Looking for Solaris 2.6 System Admin to help with installation Message-ID: <200710272102.l9RL2sIp014147@ms-smtp-03.rdc-nyc.rr.com> Hello Everyone, We have an old server Solaris 2.6 that was configured with MySQL, PHP3, mod_perl and apache. The server is running our listserv lists (CGI) and I wanted to add a new app on it that required PHP4...after attempting to recompile apache with PHP4, the system is not working. I am looking for a Solaris 2.6 system administrator to help with the installation of apache with PHP4, mod_perl, mod_ssl. If you are interested, please contact me directly at nelly at cgim.com. Thank you in advance. Nelly Yusupova. From tedd at sperling.com Sun Oct 28 10:08:17 2007 From: tedd at sperling.com (tedd) Date: Sun, 28 Oct 2007 10:08:17 -0400 Subject: [nycphp-talk] opening files In-Reply-To: <004301c817d4$8369be30$8a3d3a90$@com> References: <481148.31720.qm@web50209.mail.re2.yahoo.com> <3E6F267FA8AEC34B88F8E679637000630C86CE@S48286.vpproperty.com> <4721C5B2.3030205@gmx.net> <004301c817d4$8369be30$8a3d3a90$@com> Message-ID: At 9:31 AM -0400 10/26/07, Anthony Wlodarski wrote: >I believe the simple way would to be to store a path in a database. I don't agree with that for a couple of reasons. One) redundant data; Two) what path? The path you're using today or the one you change to later? I think it is far better practice to just store the names in the dB and then to provide the path as needed. That way you can move your dB and files anywhere you want without having to rewrite the paths in your dB -- and you don't have that redundant path to the file name appearing throughout your data. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ben at projectskyline.com Sun Oct 28 11:25:23 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Sun, 28 Oct 2007 11:25:23 -0400 Subject: [nycphp-talk] Database creation (YAML VS hard coded PHP) Message-ID: <001301c81976$c424f1d0$6401a8c0@gamebox> Hello all, #1 Thanks for the ideas on CSS (my last question). I still haven't been able to invest the type of time I would like to play around with the code, but I will. I got the CSS Mastery book and I've got an APress book on HTML/CSS design patterns. Both look promising. I started off doing db deployment code in a seperate file, say createdb.php that I would run from the URL. include ('PROS.php'); include ('../LIBRARY/DBAS.php'); DBAS_InitDBHandle(PROS_SQLInfo( ), 'PROS.php', $db); DBAS_MySQLUseDB(constPROSDBStr, $db); $tableSet = DBAS_FetchTables(constPROSDBStr, $db); if ( @ !$tableSet[constContentStr]) { error_log("createdb.php: creating 'content' table"); $sqlStr = "CREATE TABLE content " . "(id int(11) NOT NULL auto_increment," . " display_on int(11) default 0," . " title varchar(64) default ''," . " body text(8192) default ''," . " thumb_img varchar(64) default ''," . " page_img_1 varchar(64) default ''," . " page_img_2 varchar(64) default ''," . " img_1_caption varchar(64) default ''," . " img_2_caption varchar(64) default ''," . " img_1_alt varchar(64) default ''," . " img_2_alt varchar(64) default ''," . " page_position varchar(32) default ''," . " link varchar(64) default ''," . " primary key(id)" . ')'; DBAS_MySQLQuery($sqlStr, $db); } After a while, that was kinda of a pain and I moved to something internal to the index.php?action=create_database file and cleaned up my database object code. /* Comments table. */ $dbObject->DatabaseCreateTable(DATABASE_TABLE_COMMENTS); $dbObject->DatabaseCreateField('comment_id', 'int(11)', 'NOT NULL', 'auto_increment'); $dbObject->DatabaseCreateField('video_id', 'int(11)', DEF_0); $dbObject->DatabaseCreateField('posted_time', 'varchar(32)', DEF_0); $dbObject->DatabaseCreateField('posted_by', $v64, $defE); $dbObject->DatabaseCreateField('comment', 'varchar(512)',$defE); $dbObject->DatabaseCreateField('primary', 'key(comment_id)'); $dbObject->DatabaseCreateCommit(LOG_LEVEL_DEBUG); Which I used for a while and I liked it. Except its a lot to type for larger databases. So I started messing with YAML and I've got my code down to this: emails: id: type: int(11) default: not null extra: auto_increment email: type: varchar(255) default: default 0 extra: contacted: type: tinyint(1) default: default 0 extra: primary: type: key(id, email) default: "" extra: Which I just feed into a method that creates the table. I have this code only execute when I pass a command line switch in, say php index.php -f db.yaml. If I don't have CL access then I'd have to move it to the URL. Do you all think agree this is a better direction ? What are some pitfalls I could run into doing db's this way? Thanks so much! - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pjlists at pobox.com Sun Oct 28 12:13:30 2007 From: pjlists at pobox.com (=?BIG5?B?UC4gSnUgKKa2un7moik=?=) Date: Sun, 28 Oct 2007 12:13:30 -0400 Subject: [nycphp-talk] Database creation (YAML VS hard coded PHP) In-Reply-To: <001301c81976$c424f1d0$6401a8c0@gamebox> References: <001301c81976$c424f1d0$6401a8c0@gamebox> Message-ID: <7fb2405d0710280913q446c5627u1d3923c066bdd83f@mail.gmail.com> Hi Ben, Is it a requirement that you use PHP? MySQL database creation/modification can be scripted by running mysql with the -e switch and passing it a file containing SQL commands. I also add -vvv to give me verbose output. PJ On 10/28/07, Ben Sgro (ProjectSkyLine) wrote: > > > Hello all, > > > #1 Thanks for the ideas on CSS (my last question). I still haven't been able > to invest the type of time > I would like to play around with the code, but I will. I got the CSS Mastery > book and I've got an APress > book on HTML/CSS design patterns. Both look promising. > > I started off doing db deployment code in a seperate file, say createdb.php > that I would run from > the URL. > > include ('PROS.php'); > include ('../LIBRARY/DBAS.php'); > > DBAS_InitDBHandle(PROS_SQLInfo( ), 'PROS.php', $db); > DBAS_MySQLUseDB(constPROSDBStr, $db); > > $tableSet = DBAS_FetchTables(constPROSDBStr, $db); > if ( @ !$tableSet[constContentStr]) > { > error_log("createdb.php: creating 'content' table"); > $sqlStr = "CREATE TABLE content " > . "(id int(11) NOT NULL auto_increment," > . " display_on int(11) default 0," > . " title varchar(64) default ''," > . " body text(8192) default ''," > . " thumb_img varchar(64) default ''," > . " page_img_1 varchar(64) default ''," > . " page_img_2 varchar(64) default ''," > . " img_1_caption varchar(64) default ''," > . " img_2_caption varchar(64) default ''," > . " img_1_alt varchar(64) default ''," > . " img_2_alt varchar(64) default ''," > . " page_position varchar(32) default ''," > . " link varchar(64) default ''," > . " primary key(id)" > . ')'; > DBAS_MySQLQuery($sqlStr, $db); > } > > After a while, that was kinda of a pain and I moved to something internal to > the index.php?action=create_database file > and cleaned up my database object code. > > /* Comments table. */ > > $dbObject->DatabaseCreateTable(DATABASE_TABLE_COMMENTS); > $dbObject->DatabaseCreateField('comment_id', > 'int(11)', 'NOT NULL', > 'auto_increment'); > $dbObject->DatabaseCreateField('video_id', > 'int(11)', DEF_0); > $dbObject->DatabaseCreateField('posted_time', > 'varchar(32)', DEF_0); > $dbObject->DatabaseCreateField('posted_by', $v64, > $defE); > $dbObject->DatabaseCreateField('comment', > 'varchar(512)',$defE); > $dbObject->DatabaseCreateField('primary', > 'key(comment_id)'); > $dbObject->DatabaseCreateCommit(LOG_LEVEL_DEBUG); > > Which I used for a while and I liked it. Except its a lot to type for larger > databases. > So I started messing with YAML and I've got my code down to this: > > emails: > id: > type: int(11) > default: not null > extra: auto_increment > email: > type: varchar(255) > default: default 0 > extra: > contacted: > type: tinyint(1) > default: default 0 > extra: > primary: > type: key(id, email) > default: "" > extra: > > Which I just feed into a method that creates the table. I have this code > only execute > when I pass a command line switch in, say php index.php -f db.yaml. If I > don't have > CL access then I'd have to move it to the URL. > > Do you all think agree this is a better direction ? What are some pitfalls I > could run into > doing db's this way? > > Thanks so much! > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use of the > individual to whom it is addressed. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Patricia Ju phj at pobox.com +1-646-717-3871 success = fn(perseverance) From elharo at metalab.unc.edu Sun Oct 28 16:58:52 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Sun, 28 Oct 2007 16:58:52 -0400 Subject: [nycphp-talk] Native XML Databases In-Reply-To: <20071024133914.AA9A1BC8245@gatekeeper.thettgroup.com> References: <010201c814c4$ddb8f210$6401a8c0@gamebox><23447-22126@sneakemail.com> <20071024131018.C4FC8BC8039@gatekeeper.thettgroup.com> <20071024133914.AA9A1BC8245@gatekeeper.thettgroup.com> Message-ID: <4724F80C.7080609@metalab.unc.edu> Halter, Shari wrote: > Great Native XML Database talk last night! Can you tell me where the > slides are posted so I can digest some of that material? > > The slides are online here: http://www.cafeconleche.org/slides/nyphp/xquery/Native_XML_Databases.html Enjoy! -- 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 ben at projectskyline.com Mon Oct 29 08:47:44 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 29 Oct 2007 08:47:44 -0400 Subject: [nycphp-talk] Database creation (YAML VS hard coded PHP) References: <001301c81976$c424f1d0$6401a8c0@gamebox> <7fb2405d0710280913q446c5627u1d3923c066bdd83f@mail.gmail.com> Message-ID: <003601c81a29$e75f1a50$6401a8c0@gamebox> Hello PJ, It is, only because I may not have CL access to certain hosts. I've thought about using a sql file and a few people have mentioned that too me as well. I guess I need to have flexiblity. - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "P. Ju (???)" To: "NYPHP Talk" Sent: Sunday, October 28, 2007 12:13 PM Subject: Re: [nycphp-talk] Database creation (YAML VS hard coded PHP) > Hi Ben, > > Is it a requirement that you use PHP? MySQL database > creation/modification can be scripted by running mysql with the -e > switch and passing it a file containing SQL commands. I also add -vvv > to give me verbose output. > > PJ > > On 10/28/07, Ben Sgro (ProjectSkyLine) wrote: >> >> >> Hello all, >> >> >> #1 Thanks for the ideas on CSS (my last question). I still haven't been >> able >> to invest the type of time >> I would like to play around with the code, but I will. I got the CSS >> Mastery >> book and I've got an APress >> book on HTML/CSS design patterns. Both look promising. >> >> I started off doing db deployment code in a seperate file, say >> createdb.php >> that I would run from >> the URL. >> >> include ('PROS.php'); >> include ('../LIBRARY/DBAS.php'); >> >> DBAS_InitDBHandle(PROS_SQLInfo( ), 'PROS.php', $db); >> DBAS_MySQLUseDB(constPROSDBStr, $db); >> >> $tableSet = DBAS_FetchTables(constPROSDBStr, $db); >> if ( @ !$tableSet[constContentStr]) >> { >> error_log("createdb.php: creating 'content' table"); >> $sqlStr = "CREATE TABLE content " >> . "(id int(11) NOT NULL auto_increment," >> . " display_on int(11) default 0," >> . " title varchar(64) default ''," >> . " body text(8192) default ''," >> . " thumb_img varchar(64) default ''," >> . " page_img_1 varchar(64) default ''," >> . " page_img_2 varchar(64) default ''," >> . " img_1_caption varchar(64) default ''," >> . " img_2_caption varchar(64) default ''," >> . " img_1_alt varchar(64) default ''," >> . " img_2_alt varchar(64) default ''," >> . " page_position varchar(32) default ''," >> . " link varchar(64) default ''," >> . " primary key(id)" >> . ')'; >> DBAS_MySQLQuery($sqlStr, $db); >> } >> >> After a while, that was kinda of a pain and I moved to something internal >> to >> the index.php?action=create_database file >> and cleaned up my database object code. >> >> /* Comments table. */ >> >> $dbObject->DatabaseCreateTable(DATABASE_TABLE_COMMENTS); >> $dbObject->DatabaseCreateField('comment_id', >> 'int(11)', 'NOT NULL', >> 'auto_increment'); >> $dbObject->DatabaseCreateField('video_id', >> 'int(11)', DEF_0); >> $dbObject->DatabaseCreateField('posted_time', >> 'varchar(32)', DEF_0); >> $dbObject->DatabaseCreateField('posted_by', $v64, >> $defE); >> $dbObject->DatabaseCreateField('comment', >> 'varchar(512)',$defE); >> $dbObject->DatabaseCreateField('primary', >> 'key(comment_id)'); >> $dbObject->DatabaseCreateCommit(LOG_LEVEL_DEBUG); >> >> Which I used for a while and I liked it. Except its a lot to type for >> larger >> databases. >> So I started messing with YAML and I've got my code down to this: >> >> emails: >> id: >> type: int(11) >> default: not null >> extra: auto_increment >> email: >> type: varchar(255) >> default: default 0 >> extra: >> contacted: >> type: tinyint(1) >> default: default 0 >> extra: >> primary: >> type: key(id, email) >> default: "" >> extra: >> >> Which I just feed into a method that creates the table. I have this code >> only execute >> when I pass a command line switch in, say php index.php -f db.yaml. If I >> don't have >> CL access then I'd have to move it to the URL. >> >> Do you all think agree this is a better direction ? What are some >> pitfalls I >> could run into >> doing db's this way? >> >> Thanks so much! >> >> - Ben >> >> Ben Sgro, President >> ProjectSkyLine - Defining New Horizons >> +1 718.487.9368 (N.Y. Office) >> >> Our company: www.projectskyline.com >> Our products: www.project-contact.com >> >> This e-mail is confidential information intended only for the use of the >> individual to whom it is addressed. >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> > > > -- > Patricia Ju > phj at pobox.com > +1-646-717-3871 > > success = fn(perseverance) > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ken at secdat.com Mon Oct 29 09:34:32 2007 From: ken at secdat.com (Kenneth Downs) Date: Mon, 29 Oct 2007 09:34:32 -0400 Subject: [nycphp-talk] Database creation (YAML VS hard coded PHP) In-Reply-To: <001301c81976$c424f1d0$6401a8c0@gamebox> References: <001301c81976$c424f1d0$6401a8c0@gamebox> Message-ID: <4725E168.2050306@secdat.com> Ben Sgro (ProjectSkyLine) wrote: > Hello all, > > > #1 Thanks for the ideas on CSS (my last question). I still haven't > been able to invest the type of time > I would like to play around with the code, but I will. I got the CSS > Mastery book and I've got an APress > book on HTML/CSS design patterns. Both look promising. > > I started off doing db deployment code in a seperate file, say > createdb.php that I would run from > the URL. > > include ('PROS.php'); > include ('../LIBRARY/DBAS.php'); > > DBAS_InitDBHandle(PROS_SQLInfo( ), 'PROS.php', $db); > DBAS_MySQLUseDB(constPROSDBStr, $db); > > $tableSet = DBAS_FetchTables(constPROSDBStr, $db); > if ( @ !$tableSet[constContentStr]) > { > error_log("createdb.php: creating 'content' table"); > $sqlStr = "CREATE TABLE content " > . "(id int(11) NOT NULL auto_increment," > . " display_on int(11) default 0," > > After a while, that was kinda of a pain and I moved to something > internal to the index.php?action=create_database file > and cleaned up my database object code. > > /* Comments table. */ > $dbObject->DatabaseCreateTable(DATABASE_TABLE_COMMENTS); > $dbObject->DatabaseCreateField('comment_id', 'int(11)', 'NOT > NULL', > 'auto_increment'); > > Which I used for a while and I liked it. Except its a lot to type for > larger databases. > So I started messing with YAML and I've got my code down to this: > > emails: > id: > type: int(11) > default: not null > extra: auto_increment > email: > type: varchar(255) > default: default 0 > extra: > Which I just feed into a method that creates the table. I have this > code only execute > when I pass a command line switch in, say php index.php -f db.yaml. If > I don't have > CL access then I'd have to move it to the URL. > > Do you all think agree this is a better direction ? It's the only way to fly! The next enhancement would be conditional building. Before the system builds a table, have it examine the server to see if the table exists, and then it should be smart enough to only add columns that need to be added. From there you get into more complex issues like changes to column widths, changes to column types. Then there are backfills.... In Andromeda this entire process is handled by "AndroBuild.php", which runs down the entire process, plus lots of other security and automation-related stuff. > What are some pitfalls I could run into > doing db's this way? None. Every computer program in the universe is meant to be moved from machine to machine. When you move a database app you've got to have a mechanism to ensure the structures are correct. IMHO it is the lack of these types of tools that is the main reason many people try to avoid getting rigorous with their database structures -- without the right tools it's just too much work and too error prone. > > Thanks so much! > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use of > the individual to whom it is addressed. > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 ken at secdat.com Mon Oct 29 10:16:43 2007 From: ken at secdat.com (Kenneth Downs) Date: Mon, 29 Oct 2007 10:16:43 -0400 Subject: [nycphp-talk] Some comments on the XML Talk Message-ID: <4725EB4B.7030302@secdat.com> Rusty et al, I had a great time at the XML database talk, it was very informative. I have a few comments, questions, and suggestions. First, I think after seeing the talk that I would have liked in the beginning to get a more complete description of the problem domain that XML databases are trying to solve. Specific examples here would be very productive. We know that publishing looms large here, what are some specific issues? This would have made the code example more meaningful to me. Second, there were ideas that came out during Q & A that might be expanded on to good purpose. Things that we might not know or take for granted, like the philosophy regarding types and structures. The audience seemed to be focusing on the need for structure, while the tool did not seem to want to do that. A couple of slides outlined the philosophy of types and structures might have been useful here. Finally, I would have liked to hear more of Rusty's ideas about the relationship between the file system, the web server, and the database. Rusty, do you want to expand on that here? -- 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 harry_kel at rogers.com Mon Oct 29 18:25:05 2007 From: harry_kel at rogers.com (harry_kel) Date: Mon, 29 Oct 2007 18:25:05 -0400 (Eastern Daylight Time) Subject: [nycphp-talk] www.harrykel.com Message-ID: <47265DC1.000009.01184@DD7VS1D1> Hi, As my web site had been hacked on numerous occasions my site designer closed it and then created a new one with the same web address: www.harrykel.com, with the following links, etc. 1) Holocaust links ( my parents were Holocaust Survivors) 2) Links to my illnesses ( Bipolar Disorder, Diabetes, Parkinson?s) My poetry manuscript about 1) my parents? experiences as Holocaust Survivors 2) my experiences as a sufferer of Bipolar Disorder 3) some examples of poems from my manuscript 4) News ( International, local, personal) 5) Photos of Family, Friends, etc. I?d greatly appreciate your registering on it and spreading the word to relatives, friends, associates, colleagues, etc. and encouraging them to register as well. Upon confirming your registration you will then be able to interact with all the options (e g. add links, news, photos, submit poetry, etc.) So that I may gauge the effectiveness of this email, kindly reply even if you don?t act on it. Thanking you for your prompt and courteous response, I remain, Yours very truly, Harry Finkelstein, www.harrykel.com Founder, harry_kel at rogers..com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 02.jpg Type: image/jpeg Size: 19157 bytes Desc: not available URL: From ali at vpproperty.com Tue Oct 30 01:20:45 2007 From: ali at vpproperty.com (ali mohammad) Date: Tue, 30 Oct 2007 01:20:45 -0400 Subject: [nycphp-talk] Some comments on the XML Talk In-Reply-To: <4725EB4B.7030302@secdat.com> References: <4725EB4B.7030302@secdat.com> Message-ID: <3E6F267FA8AEC34B88F8E679637000630C86D3@S48286.vpproperty.com> Hi, While I have not had the opportunity to listen in person to this great talk about XML database, I did have the good fortune of going through the slides after somebody recently posted the online links for the slides. At the risk of slightly sounding off topic (but it does base on Kenneth's question on specific examples), I would like anybody's views on the applicability of XML database to clinical databases where the information that needs to be stored comes from a domain that is largely undefined or unpredictable in advance (maybe the more precise term is unstructured data but I am not too sure as I am amateur programmer myself). I did have in the past developed clinical databases (data captured from clinical trials) using the EAV model out of relational tables. The queries turned out to be terribly slow so I was forced to used a combination of true relational tables and EAV tables out of hacked up relational tables. Even then, the performance levels sucked. I would appreciate it if you can throw light on what would be ideal alternatives (instead of just relational databases) to storing such disparate information items. Can object oriented database such as the commercial Cache be a solution? Or XML databases perhaps? Thanks in advance, Ali Mohammed. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Kenneth Downs Sent: Monday, October 29, 2007 9:17 AM To: NYPHP Talk Subject: [nycphp-talk] Some comments on the XML Talk Rusty et al, I had a great time at the XML database talk, it was very informative. I have a few comments, questions, and suggestions. First, I think after seeing the talk that I would have liked in the beginning to get a more complete description of the problem domain that XML databases are trying to solve. Specific examples here would be very productive. We know that publishing looms large here, what are some specific issues? This would have made the code example more meaningful to me. Second, there were ideas that came out during Q & A that might be expanded on to good purpose. Things that we might not know or take for granted, like the philosophy regarding types and structures. The audience seemed to be focusing on the need for structure, while the tool did not seem to want to do that. A couple of slides outlined the philosophy of types and structures might have been useful here. Finally, I would have liked to hear more of Rusty's ideas about the relationship between the file system, the web server, and the database. Rusty, do you want to expand on that here? -- 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 brian at realm3.com Tue Oct 30 08:28:16 2007 From: brian at realm3.com (Brian D.) Date: Tue, 30 Oct 2007 08:28:16 -0400 Subject: [nycphp-talk] Some comments on the XML Talk In-Reply-To: <4725EB4B.7030302@secdat.com> References: <4725EB4B.7030302@secdat.com> Message-ID: > Second, there were ideas that came out during Q & A that might be > expanded on to good purpose. Things that we might not know or take for > granted, like the philosophy regarding types and structures. The > audience seemed to be focusing on the need for structure, while the tool > did not seem to want to do that. That made me wonder if most people completely missed the point. The application of XML databases is, I think, in situations where structure is either not applicable or not possible. Trying to stamp a structure on an XML database (from what I can gather) destroys one of the primary reasons for employing the technology. XML is flexible. That's what makes it different. If you shoehorn an XML database into what Rusty called a "rectangular" format, why not just continue using relational databases? As far as uses go, I was nodding the entire time that Rusty was talking about the usefulness of structure-free systems in the medical industry. I've worked in the medical industry almost exclusively for seven years and there have been several times that I have had to force data (documents, specifically) into relational formats that obviously didn't work well. As Rusty pointed out, it makes a developer feel dirty. I've seen "documents" tables with over two hundred columns, and it took all sorts of work-arounds to fix the performance problems that it caused. I've also seen the EAV format that Ali M. mentions in his email. None of these solutions seem to fit the problem very well. Rusty's presentation interested me because it seems to hold the best answer I've seen yet to the free-flowing/constantly-changing data that medical software has to deal with. I still don't feel that the (open source, anyway) XML databases are a *mature* solution, but they certainly hold a lot of promise for an industry afflicted with poor containers to hold our data. The hybrid solutions hold the most possibility, I think, because it meets the need for both structural and non-structural data. I will be watching the maturation of the available software with much more attention than I have before. - Brian Dailey realm3 web applications [realm3.com] freelance consulting, application development (423) 506-0349 From ben at projectskyline.com Tue Oct 30 09:13:05 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Tue, 30 Oct 2007 09:13:05 -0400 Subject: [nycphp-talk] Some comments on the XML Talk References: <4725EB4B.7030302@secdat.com> Message-ID: <002a01c81af6$9c44ca10$6401a8c0@gamebox> Hello, Is the audio available for the slides? - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Brian D." To: "NYPHP Talk" Sent: Tuesday, October 30, 2007 8:28 AM Subject: Re: [nycphp-talk] Some comments on the XML Talk >> Second, there were ideas that came out during Q & A that might be >> expanded on to good purpose. Things that we might not know or take for >> granted, like the philosophy regarding types and structures. The >> audience seemed to be focusing on the need for structure, while the tool >> did not seem to want to do that. > > That made me wonder if most people completely missed the point. The > application of XML databases is, I think, in situations where > structure is either not applicable or not possible. Trying to stamp a > structure on an XML database (from what I can gather) destroys one of > the primary reasons for employing the technology. XML is flexible. > That's what makes it different. If you shoehorn an XML database into > what Rusty called a "rectangular" format, why not just continue using > relational databases? > > As far as uses go, I was nodding the entire time that Rusty was > talking about the usefulness of structure-free systems in the medical > industry. I've worked in the medical industry almost exclusively for > seven years and there have been several times that I have had to force > data (documents, specifically) into relational formats that obviously > didn't work well. As Rusty pointed out, it makes a developer feel > dirty. I've seen "documents" tables with over two hundred columns, and > it took all sorts of work-arounds to fix the performance problems that > it caused. I've also seen the EAV format that Ali M. mentions in his > email. None of these solutions seem to fit the problem very well. > > Rusty's presentation interested me because it seems to hold the best > answer I've seen yet to the free-flowing/constantly-changing data that > medical software has to deal with. I still don't feel that the (open > source, anyway) XML databases are a *mature* solution, but they > certainly hold a lot of promise for an industry afflicted with poor > containers to hold our data. The hybrid solutions hold the most > possibility, I think, because it meets the need for both structural > and non-structural data. I will be watching the maturation of the > available software with much more attention than I have before. > > - Brian Dailey > > > realm3 web applications [realm3.com] > freelance consulting, application development > (423) 506-0349 > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Tue Oct 30 09:49:43 2007 From: brian at realm3.com (Brian D.) Date: Tue, 30 Oct 2007 09:49:43 -0400 Subject: [nycphp-talk] Some comments on the XML Talk In-Reply-To: <002a01c81af6$9c44ca10$6401a8c0@gamebox> References: <4725EB4B.7030302@secdat.com> <002a01c81af6$9c44ca10$6401a8c0@gamebox> Message-ID: I don't think so. Rusty was a very engaged speaker - he was all over the room. It would have been difficult to get an audio copy of the talk. - Brian Dailey -- realm3 web applications [realm3.com] freelance consulting, application development (423) 506-0349 On 10/30/07, Ben Sgro (ProjectSkyLine) wrote: > Hello, > > Is the audio available for the slides? > > - Ben > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) From tgales at tgaconnect.com Tue Oct 30 12:25:03 2007 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 30 Oct 2007 12:25:03 -0400 Subject: [nycphp-talk] Some comments on the XML Talk In-Reply-To: References: <4725EB4B.7030302@secdat.com> Message-ID: <47275ADF.1000505@tgaconnect.com> Brian D. wrote: [snip] > That made me wonder if most people completely missed the point. The > application of XML databases is, I think, in situations where > structure is either not applicable or not possible... XML documents are structured. Look up well-formed XML and valid XML. ..Trying to stamp a > structure on an XML database (from what I can gather) destroys one of > the primary reasons for employing the technology. XML is flexible. > That's what makes it different... No need to 'stamp' a structure on XML records -- they've already got one (see above) ... If you shoehorn an XML database into > what Rusty called a "rectangular" format, why not just continue using > relational databases? > XML documents (and hence XML Databases) are not inherently less structured or more capable of handling unstructured data than a relational data model. (Consider, for example, a database with a text field which can be text-indexed like you can create in MySQL. That sort of a text field doesn't impose much structure on the data.) A relational schema can be as structured or unstructured as you create it to be -- same goes for DTD's and XSD's. What degree of structure you need, I would venture to say, is determined by your retrieval needs. If you really want even less structure -- throw all your data into text files and 'grep' for your information. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From brian at realm3.com Tue Oct 30 12:55:37 2007 From: brian at realm3.com (Brian D.) Date: Tue, 30 Oct 2007 12:55:37 -0400 Subject: [nycphp-talk] Some comments on the XML Talk In-Reply-To: <47275ADF.1000505@tgaconnect.com> References: <4725EB4B.7030302@secdat.com> <47275ADF.1000505@tgaconnect.com> Message-ID: Tim, I don't think I was clear. We're differing on semantics here, but by "structure" I mean set fields, e.g., an "employees" table would have: first name last name hired date etc. An XML document doesn't have a field definition (unless you tell it to, of course, using any of the methods you described). I'm aware that XML has "structure" (in the sense it is well-formed). A flat text file paired with grep doesn't have the same power because fields would not be defined. XML, at least, conveys information about the data contained in the field, whereas a completely unstructured text document lacks that. - Brian Dailey -- realm3 web applications [realm3.com] freelance consulting, application development (423) 506-0349 On 10/30/07, Tim Gales wrote: > Brian D. wrote: > [snip] > > > That made me wonder if most people completely missed the point. The > > application of XML databases is, I think, in situations where > > structure is either not applicable or not possible... > > XML documents are structured. > Look up well-formed XML and valid XML. > > ..Trying to stamp a > > structure on an XML database (from what I can gather) destroys one of > > the primary reasons for employing the technology. XML is flexible. > > That's what makes it different... > No need to 'stamp' a structure on XML records -- > they've already got one (see above) > > ... If you shoehorn an XML database into > > what Rusty called a "rectangular" format, why not just continue using > > relational databases? > > > > XML documents (and hence XML Databases) are not inherently > less structured or more capable of handling unstructured > data than a relational data model. > (Consider, for example, a database with a text field which > can be text-indexed like you can create in MySQL. > That sort of a text field doesn't impose much structure > on the data.) > > A relational schema can be as structured or unstructured > as you create it to be -- same goes for DTD's and XSD's. > What degree of structure you need, I would venture to say, > is determined by your retrieval needs. > > If you really want even less structure -- throw all > your data into text files and 'grep' for your > information. > > -- > > 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 rmarscher at beaffinitive.com Tue Oct 30 12:56:42 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 30 Oct 2007 12:56:42 -0400 Subject: [nycphp-talk] Zend Neon - (Zend Framework Project) In-Reply-To: <043522D9-17C5-43C8-BD7B-8EBE61E64FAE@jonbaer.com> References: <043522D9-17C5-43C8-BD7B-8EBE61E64FAE@jonbaer.com> Message-ID: On Oct 11, 2007, at 5:27 PM, Jon Baer wrote: > Im taking Zend Neon for a spin + am not sure if all the templates > being created for a framework project are actually working correctly. Just got a chance to check it out... I'm using the build dated 20071001. Definitely some things to be worked out with the templates. For example, the first thing I saw was the index.phtml view which has a line break before the doctype. I'm pretty sure that immediately sends IE (at least IE6) into quirks mode. > It looks like the index.php file is out of place Actually... I think it's in the right place... the docroot for the webserver would be set to the html directory which correctly separates the main application code from public access... but the include path is incorrect: Change: set_include_path('.' . PATH_SEPARATOR . './library' . PATH_SEPARATOR . './application/models/' . PATH_SEPARATOR . get_include_path()); To: set_include_path('..' . PATH_SEPARATOR . '../library' . PATH_SEPARATOR . '../application/models/' . PATH_SEPARATOR . get_include_path()); Right? > and creating new Zend controllers + Zend views dont seem to place > them properly unless you explicitly specify the path (as oppose to > the project folder itself). Yeah... when I do new controller/view/etc... it places it in whatever folder I initiated it from -- or makes me enter a path if I do it from the main menu. > All in all it's not bad but it seems some of the templates are > incomplete(?), has anyone tried it out yet + have feedback and / or > having same issues? The Zend View and Zend Model don't seem to be any different than a new regular php file as far as I can tell. I could be doing it wrong... but the files it created for me were empty. I'm trying to figure out what you really get here that the (free) PDT doesn't do? Obviously if you're using other Zend products - especially Zend Platform - this is well worth it. But I kept encountering stuff that didn't fully work without Zend Platform (BIRT reports seem to need the Platform's java bridge and some of the debugging features need it too, for example). PHPUnit and PHPDoc integration seems pretty cool... I wonder if those will make it into PDT at some point though. Also, there seems to be extra refactoring tools and overall it seems more focused on PHP than PDT on its own. I see a server tunneling feature too which could be great for when a quick fix is needed but would be faster to do in a gui editor than in vim. Hmm... I'm on the fence I guess... need to watch how this develops and figure out how much easier it will make my life than Eclipse with PDT/Web Tools/Subclipse before shelling out $254 (current 15% off price). From tgales at tgaconnect.com Tue Oct 30 14:47:16 2007 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 30 Oct 2007 14:47:16 -0400 Subject: [nycphp-talk] Some comments on the XML Talk In-Reply-To: References: <4725EB4B.7030302@secdat.com> <47275ADF.1000505@tgaconnect.com> Message-ID: <47277C34.6000504@tgaconnect.com> Brian D. wrote: > Tim, I don't think I was clear. > > We're differing on semantics here, but by "structure" I mean set > fields, e.g., an "employees" table would have: > > first name > last name > hired date > etc. I would argue that you should use the term 'attribute' and not fields. An relational attribute is generally accepted to be an ordered tuple like [ 'first name', 'varchar 20' ]. Now one of the key concepts of the relational model is that a table(relation) is an *unordered* collection of attributes -- that is there is no need for a given attribute to be conceptually next to another. Different 'relational' database management systems get this right to different degrees. But when it comes time to exchange data from one table in a database to another database -- even within the the same DBMS -- all bets about the "not-needing-to-be-next-to-another-attribute-ness" are off. (e.g. as in a comma separated file) > > An XML document doesn't have a field definition (unless you tell it > to, of course, using any of the methods you described). > No. Valid XML documents must adhere to their DTD/Schema and to that degree they have fields -- called 'elements'. like Alfred Wilson ... Of course you can get fancier and use 'XML attributes' like Alfred > I'm aware that XML has "structure" (in the sense it is well-formed). > > A flat text file paired with grep doesn't have the same power because > fields would not be defined. XML, at least, conveys information about > the data contained in the field... My point exactly (see above about) XML elements. But in XML, elements do not have to be ordered because each element can carry with it its own semantics. That is to say, each element in XML can carry with it the same meaning which is conveyed in a relational model by a 'relational attribute'. (Of course you can require elements to be ordered in XML if you want to) Thus XML frees you from the confines of having to carefully order your data when you want to exchange it. Now if during the exchange of XML data it has to stop on a system and be stored, it certainly makes sense to put it into an XML database. Or perhaps you want to avoid hitting and re-hitting some data store in order to exchange data. There again it would be a good idea to select a large amount of data and put it in an XML database and parcel it out later. Now I am not suggesting that the value of XML is confined to solely to exchanging data (though it might be possible to defend such a position) -- I'm just trying to describe the difference between XML 'structuring' and relational 'structuring' -- and to highlight (at least one case) when XML can be the superior choice. But I stick by what I said earlier that XML documents (and hence XML Databases) are not inherently less structured or more capable of handling unstructured data than a relational data model. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From brian at realm3.com Tue Oct 30 15:08:31 2007 From: brian at realm3.com (Brian D.) Date: Tue, 30 Oct 2007 15:08:31 -0400 Subject: [nycphp-talk] Some comments on the XML Talk In-Reply-To: <47277C34.6000504@tgaconnect.com> References: <4725EB4B.7030302@secdat.com> <47275ADF.1000505@tgaconnect.com> <47277C34.6000504@tgaconnect.com> Message-ID: > > An XML document doesn't have a field definition (unless you tell it > > to, of course, using any of the methods you described). > > > No. > Valid XML documents must adhere to their DTD/Schema and to that > degree they have fields -- called 'elements'. > like > > Alfred > Wilson > ... > What I mean is that it doesn't matter (unless you enforce it) whether you call it: or or What you put into the XML DB is irrelevant, unless you want it to be. Of course, it has be valid XML, but, as you pointed out, the flexibility allows you to carry the semantics along with the data. That's the point I think a lot of the questions at the presentation last Tuesday missed. - Brian Dailey -- realm3 web applications [realm3.com] freelance consulting, application development (423) 506-0349 From bz-gmort at beezifies.com Tue Oct 30 16:51:55 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Tue, 30 Oct 2007 16:51:55 -0400 Subject: [nycphp-talk] Some comments on the XML Talk In-Reply-To: <47277C34.6000504@tgaconnect.com> References: <4725EB4B.7030302@secdat.com> <47275ADF.1000505@tgaconnect.com> <47277C34.6000504@tgaconnect.com> Message-ID: <4727996B.2090404@beezifies.com> Tim Gales wrote: > > But when it comes time to exchange data from one table in a > database to another database -- even within the the same DBMS -- > all bets about the "not-needing-to-be-next-to-another-attribute-ness" > are off. (e.g. as in a comma separated file) > I've never run into this issue. I've run into the "if you don't specify the order, the database will use it's own default ordering" - and a lot of depending on "select *" to give things in the "correct" order. But one can hardly blame databases for having different defaults if you fail to specify one. > Thus XML frees you from the confines of having to carefully > order your data when you want to exchange it. > > Now if during the exchange of XML data it has to > stop on a system and be stored, it certainly makes sense > to put it into an XML database. This statement prompted my reason for replying. Is there a standalone set of tools for updating/editing an XML database? I'm thinking of something along the lines of Microsoft Access, where you have 1 tool which has forms, program logic, and a database and all the data ends up "together" from a user standpoint. So I can give someone a couple of access files and they have a complete application they can run locally? (In case one is curious, my father was demonstrating a little MSAccess app he is putting together for tracking/monitoring environmental data. Something along the lines of the life cycle of animals in an environment, the number of particular animals seen, yadda yadda yadda. I don't pretend to understand what it is he is doing, it's just his current crusade to organize his own data and give other people the ability to track the same data and share it with each other in an organized fashion. He was motivated to do so after he discovered how useful having such data organized and handy is when disputing the environmental impact statements of company paid environmental surveyors doing a 1 day study) Something non-Access based would be better, but since this basically is a tool for non-techies, it has to be simple and not dependent on a centralized server for the data to be housed. From ajai at bitblit.net Tue Oct 30 16:59:34 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 30 Oct 2007 16:59:34 -0400 (EDT) Subject: [nycphp-talk] PHP5 hosting? Message-ID: Probably asked many times: good places for PHP5+MySQL app hosting? (Good == reliable & not too expensive ;-) -- Aj. From ben at projectskyline.com Tue Oct 30 17:04:13 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Tue, 30 Oct 2007 17:04:13 -0400 Subject: [nycphp-talk] PHP5 hosting? References: Message-ID: <003e01c81b38$6dac3520$6401a8c0@gamebox> Hello Ajai, I've had an excellent experiance w/nexcess.net - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Ajai Khattri" To: Sent: Tuesday, October 30, 2007 4:59 PM Subject: [nycphp-talk] PHP5 hosting? > > Probably asked many times: good places for PHP5+MySQL app hosting? > > (Good == reliable & not too expensive ;-) > > -- > Aj. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ajai at bitblit.net Tue Oct 30 17:11:38 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 30 Oct 2007 17:11:38 -0400 (EDT) Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: Message-ID: On Tue, 30 Oct 2007, Ajai Khattri wrote: > > Probably asked many times: good places for PHP5+MySQL app hosting? > > (Good == reliable & not too expensive ;-) > > I should also point out, ssh access is a major plus (if anyone still offers that anymore?). -- Aj. From tgales at tgaconnect.com Tue Oct 30 18:34:17 2007 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 30 Oct 2007 18:34:17 -0400 Subject: [nycphp-talk] Some comments on the XML Talk In-Reply-To: <4727996B.2090404@beezifies.com> References: <4725EB4B.7030302@secdat.com> <47275ADF.1000505@tgaconnect.com> <47277C34.6000504@tgaconnect.com> <4727996B.2090404@beezifies.com> Message-ID: <4727B169.7000507@tgaconnect.com> bz-gmort at beezifies.com wrote: > Tim Gales wrote: >> >> But when it comes time to exchange data from one table in a >> database to another database -- even within the the same DBMS -- >> all bets about the "not-needing-to-be-next-to-another-attribute-ness" >> are off. (e.g. as in a comma separated file) >> > > I've never run into this issue. I've run into the "if you don't specify > the order, the database will use it's own default ordering" - and a lot > of depending on "select *" to give things in the "correct" order. Exactly -- ordering matters. It is possible that you can always get lucky and have the ordering match as it *might* between say Sybase and SQL Server. (their code base was the same a few years back) But just because it doesn't blow up, doesn't mean that ordering doesn't matter. > > But one can hardly blame databases for having different defaults if you > fail to specify one. I blame DBMS's for a lot of things -- but not that. > >> Thus XML frees you from the confines of having to carefully >> order your data when you want to exchange it. >> >> Now if during the exchange of XML data it has to >> stop on a system and be stored, it certainly makes sense >> to put it into an XML database. > > > This statement prompted my reason for replying. Is there a standalone > set of tools for updating/editing an XML database? You might be interested in looking at Authentic http://www.altova.com/products/authentic/xml_db_form_editor.html > > I'm thinking of something along the lines of Microsoft Access, where you > have 1 tool which has forms, program logic, and a database and all the > data ends up "together" from a user standpoint. So I can give someone a > couple of access files and they have a complete application they can run > locally? > I think the free edition of SQL Server (the express edition) supports the Microsoft XML extensions. [snip] -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From jcampbell1 at gmail.com Tue Oct 30 20:19:34 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 30 Oct 2007 20:19:34 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: References: Message-ID: <8f0676b40710301719s76efc307ud0d69bf15a78ba4e@mail.gmail.com> > (Good == reliable & not too expensive ;-) What does "not too expensive" mean? Is $150/mo too much? or are you looking for closer to $15? What does "reliable" mean? good support, or survives the front page of digg/slashdot? -jc From guilhermeblanco at gmail.com Tue Oct 30 21:50:12 2007 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Tue, 30 Oct 2007 22:50:12 -0300 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: <8f0676b40710301719s76efc307ud0d69bf15a78ba4e@mail.gmail.com> References: <8f0676b40710301719s76efc307ud0d69bf15a78ba4e@mail.gmail.com> Message-ID: Hi, I host with 2mhost.com... good, reliable and cheap! =) Regards, On 10/30/07, John Campbell wrote: > > (Good == reliable & not too expensive ;-) > > What does "not too expensive" mean? Is $150/mo too much? or are you > looking for closer to $15? > > What does "reliable" mean? good support, or survives the front page > of digg/slashdot? > > -jc > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 blackk16 at yahoo.com Wed Oct 31 09:46:25 2007 From: blackk16 at yahoo.com (Ken Black) Date: Wed, 31 Oct 2007 06:46:25 -0700 (PDT) Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: Message-ID: <439885.39781.qm@web36815.mail.mud.yahoo.com> I've recently heard 1and1.com was pretty good -ie your criteria, but I have never used it myself. Ajai Khattri wrote: Probably asked many times: good places for PHP5+MySQL app hosting? (Good == reliable & not too expensive ;-) -- 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 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Oct 31 10:00:17 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 31 Oct 2007 10:00:17 -0400 (EDT) Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: <8f0676b40710301719s76efc307ud0d69bf15a78ba4e@mail.gmail.com> Message-ID: Just to clarify my earlier request (thanks for all the suggestions BTW, some look really really good). I have a client that I need to move off my server onto a third-party server (mainly because Im too busy to deal with it). So Im looking for a package that allows at least 5 or more domains. (So maybe a reseller account would be good?) How cheap? Well, anything under $30/month that allows several domains is just fine. (A little over is OK if it has more features - there's some wiggle room). I need PHP5, MySQL (4.x or 5,x). I need to run Joomla, symfony and some static sites. Access via ssh would be nice but is not a deal-breaker (Im quite comfortable using a command-line but I can deal with a "control" panel if I must ;-). Need mailboxes for these domains too. Cheers, -- Aj. From sequethin at gmail.com Wed Oct 31 10:07:50 2007 From: sequethin at gmail.com (Michael Hernandez) Date: Wed, 31 Oct 2007 10:07:50 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: References: Message-ID: On Oct 31, 2007, at 10:00 AM, Ajai Khattri wrote: > > > Just to clarify my earlier request (thanks for all the suggestions > BTW, > some look really really good). > > I have a client that I need to move off my server onto a third-party > server (mainly because Im too busy to deal with it). So Im looking > for a > package that allows at least 5 or more domains. (So maybe a reseller > account would be good?) > > How cheap? Well, anything under $30/month that allows several > domains is > just fine. (A little over is OK if it has more features - there's some > wiggle room). > > I need PHP5, MySQL (4.x or 5,x). I need to run Joomla, symfony and > some > static sites. Access via ssh would be nice but is not a deal-breaker > (Im > quite comfortable using a command-line but I can deal with a "control" > panel if I must ;-). Need mailboxes for these domains too. > > > Cheers, > > -- > Aj. there's always dreamhost... though as I always say - check out their http://www.dreamhoststatus.com/ page, where their downtime is listed. If you see the frequency of issues and can handle it then it might be worth it? I like their choice of PHP 4 or 5, fast_cgi support, ruby on rails... (yes I said it! haha) --Mike H PS if you decide to go with dreamhost let me know and I'll send you a referral link... From jcampbell1 at gmail.com Wed Oct 31 10:12:18 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 31 Oct 2007 10:12:18 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: References: <8f0676b40710301719s76efc307ud0d69bf15a78ba4e@mail.gmail.com> Message-ID: <8f0676b40710310712y6d8cb495q3176306bf7becf39@mail.gmail.com> > How cheap? Well, anything under $30/month that allows several domains is > just fine. (A little over is OK if it has more features - there's some > wiggle room). > > I need PHP5, MySQL (4.x or 5,x). I need to run Joomla, symfony and some > static sites. Access via ssh would be nice but is not a deal-breaker (Im > quite comfortable using a command-line but I can deal with a "control" > panel if I must ;-). Need mailboxes for these domains too. I like Media Temple's gs service for $20 a month. You get SSH, unlimited domains, performance under load, and a clean control panel. No root access. Support is ticket/email based. No phone number to call, but they are pretty responsive to email. -jc From brian at realm3.com Wed Oct 31 10:16:12 2007 From: brian at realm3.com (Brian D.) Date: Wed, 31 Oct 2007 10:16:12 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: References: Message-ID: I'm just now leaving Dreamhost. If you're going the shared server route, I highly advise against them. I've had nothing but bad experiences with random slowdowns and whatnot. I guess it depends on how important it is to you that your website is up. (I'm moving to a different company but since the move isn't complete and I've not been on the new server long enough to tell, I can't recommend them yet with any authority.) - Brian Dailey On 10/31/07, Michael Hernandez wrote: > > On Oct 31, 2007, at 10:00 AM, Ajai Khattri wrote: > > > > > > > Just to clarify my earlier request (thanks for all the suggestions > > BTW, > > some look really really good). > > > > I have a client that I need to move off my server onto a third-party > > server (mainly because Im too busy to deal with it). So Im looking > > for a > > package that allows at least 5 or more domains. (So maybe a reseller > > account would be good?) > > > > How cheap? Well, anything under $30/month that allows several > > domains is > > just fine. (A little over is OK if it has more features - there's some > > wiggle room). > > > > I need PHP5, MySQL (4.x or 5,x). I need to run Joomla, symfony and > > some > > static sites. Access via ssh would be nice but is not a deal-breaker > > (Im > > quite comfortable using a command-line but I can deal with a "control" > > panel if I must ;-). Need mailboxes for these domains too. > > > > > > Cheers, > > > > -- > > Aj. > > there's always dreamhost... though as I always say - check out their http://www.dreamhoststatus.com/ > page, where their downtime is listed. If you see the frequency of > issues and can handle it then it might be worth it? I like their > choice of PHP 4 or 5, fast_cgi support, ruby on rails... (yes I said > it! haha) > > --Mike H > > PS if you decide to go with dreamhost let me know and I'll send you a > referral link... > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 rotsen at gmail.com Wed Oct 31 10:57:14 2007 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Wed, 31 Oct 2007 07:57:14 -0700 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: References: Message-ID: 1and1.com $9.99/month and domain registration $5.99 :-) On 10/31/07, Brian D. wrote: > > I'm just now leaving Dreamhost. If you're going the shared server > route, I highly advise against them. I've had nothing but bad > experiences with random slowdowns and whatnot. I guess it depends on > how important it is to you that your website is up. > > (I'm moving to a different company but since the move isn't complete > and I've not been on the new server long enough to tell, I can't > recommend them yet with any authority.) > > - Brian Dailey > > On 10/31/07, Michael Hernandez wrote: > > > > On Oct 31, 2007, at 10:00 AM, Ajai Khattri wrote: > > > > > > > > > > > Just to clarify my earlier request (thanks for all the suggestions > > > BTW, > > > some look really really good). > > > > > > I have a client that I need to move off my server onto a third-party > > > server (mainly because Im too busy to deal with it). So Im looking > > > for a > > > package that allows at least 5 or more domains. (So maybe a reseller > > > account would be good?) > > > > > > How cheap? Well, anything under $30/month that allows several > > > domains is > > > just fine. (A little over is OK if it has more features - there's some > > > wiggle room). > > > > > > I need PHP5, MySQL (4.x or 5,x). I need to run Joomla, symfony and > > > some > > > static sites. Access via ssh would be nice but is not a deal-breaker > > > (Im > > > quite comfortable using a command-line but I can deal with a "control" > > > panel if I must ;-). Need mailboxes for these domains too. > > > > > > > > > Cheers, > > > > > > -- > > > Aj. > > > > there's always dreamhost... though as I always say - check out their > http://www.dreamhoststatus.com/ > > page, where their downtime is listed. If you see the frequency of > > issues and can handle it then it might be worth it? I like their > > choice of PHP 4 or 5, fast_cgi support, ruby on rails... (yes I said > > it! haha) > > > > --Mike H > > > > PS if you decide to go with dreamhost let me know and I'll send you a > > referral link... > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/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 > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 sequethin at gmail.com Wed Oct 31 11:06:02 2007 From: sequethin at gmail.com (Michael Hernandez) Date: Wed, 31 Oct 2007 11:06:02 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: References: Message-ID: <74735C04-B394-42F6-9AA5-4A71CAC2846E@gmail.com> On Oct 31, 2007, at 10:16 AM, Brian D. wrote: > I'm just now leaving Dreamhost. If you're going the shared server > route, I highly advise against them. I've had nothing but bad > experiences with random slowdowns and whatnot. I guess it depends on > how important it is to you that your website is up. > > (I'm moving to a different company but since the move isn't complete > and I've not been on the new server long enough to tell, I can't > recommend them yet with any authority.) > > - Brian Dailey > thats why every time I mention dreamhost I mention http://www.dreamhoststatus.com ;) As for PHP related things I haven't had problems yet (been 2-3 years now). Though it seems I'm a lucky one in that regard? Joomla and wordpress have been running on a few domains I host with no issues, also phpBB and gallery. I'm looking forward to seeing some other viable alternatives in this thread as well... always good to have some references for hosts... --Mike H From wkamm at rvyriptide.org Wed Oct 31 11:23:21 2007 From: wkamm at rvyriptide.org (Bill Kamm) Date: Wed, 31 Oct 2007 11:23:21 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: References: Message-ID: <47289DE9.5070708@rvyriptide.org> 1and1 is OK. I wasn't too happy with Dreamhost. I have been with Nomanix (http://www.nomanix.com/) for several years now, and am extremely satisfied with them. Any time I have a question, I get a quick reply from David, usually within an hour. I like dealing with the same person who knows me. ssh, CPanel (including phpMyAdmin , PEAR configuration, ...), reseller accounts, SSL certificates, etc. My site is running PHP 4.4.7, but I believe they offer php 5 as well. Uptime is never a problem. I can highly recommend them. Bill N?stor wrote: > 1and1.com $9.99/month and domain registration $5.99 > > :-) > > On 10/31/07, *Brian D.* < brian at realm3.com > > wrote: > > I'm just now leaving Dreamhost. If you're going the shared server > route, I highly advise against them. I've had nothing but bad > experiences with random slowdowns and whatnot. I guess it depends on > how important it is to you that your website is up. > > (I'm moving to a different company but since the move isn't complete > and I've not been on the new server long enough to tell, I can't > recommend them yet with any authority.) > > - Brian Dailey > > On 10/31/07, Michael Hernandez < sequethin at gmail.com > > wrote: > > > > On Oct 31, 2007, at 10:00 AM, Ajai Khattri wrote: > > > > > > > > > > > Just to clarify my earlier request (thanks for all the suggestions > > > BTW, > > > some look really really good). > > > > > > I have a client that I need to move off my server onto a > third-party > > > server (mainly because Im too busy to deal with it). So Im looking > > > for a > > > package that allows at least 5 or more domains. (So maybe a > reseller > > > account would be good?) > > > > > > How cheap? Well, anything under $30/month that allows several > > > domains is > > > just fine. (A little over is OK if it has more features - > there's some > > > wiggle room). > > > > > > I need PHP5, MySQL (4.x or 5,x). I need to run Joomla, symfony > and > > > some > > > static sites. Access via ssh would be nice but is not a > deal-breaker > > > (Im > > > quite comfortable using a command-line but I can deal with a > "control" > > > panel if I must ;-). Need mailboxes for these domains too. > > > > > > > > > Cheers, > > > > > > -- > > > Aj. > > > > there's always dreamhost... though as I always say - check out > their http://www.dreamhoststatus.com/ > > page, where their downtime is listed. If you see the frequency of > > issues and can handle it then it might be worth it? I like their > > choice of PHP 4 or 5, fast_cgi support, ruby on rails... (yes I > said > > it! haha) > > > > --Mike H > > > > PS if you decide to go with dreamhost let me know and I'll send > you a > > referral link... > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/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 > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 gatzby3jr at gmail.com Wed Oct 31 12:29:57 2007 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Wed, 31 Oct 2007 12:29:57 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: <47289DE9.5070708@rvyriptide.org> References: <47289DE9.5070708@rvyriptide.org> Message-ID: <29da5d150710310929t58db12cbka8d494af2fe4868e@mail.gmail.com> I've been with www.hostdime.com for a few years now and they're a little pricey with their domain registrations, but their hosting is pretty cheap. I'm not entirely sure about the number of domains, but I believe I pay 6 dollars a month for my plan hosting. I also have a few accounts with dreamhost and I have noticed a bit of downtime with them. On 10/31/07, Bill Kamm wrote: > > 1and1 is OK. I wasn't too happy with Dreamhost. I have been with > Nomanix (http://www.nomanix.com/) for several years now, and am > extremely satisfied with them. Any time I have a question, I get a > quick reply from David, usually within an hour. I like dealing with the > same person who knows me. ssh, CPanel (including phpMyAdmin , PEAR > configuration, ...), reseller accounts, SSL certificates, etc. My site > is running PHP 4.4.7, but I believe they offer php 5 as well. Uptime is > never a problem. I can highly recommend them. > > Bill > > N?stor wrote: > > 1and1.com $9.99/month and domain registration $5.99 > > > > :-) > > > > On 10/31/07, *Brian D.* < brian at realm3.com > > > wrote: > > > > I'm just now leaving Dreamhost. If you're going the shared server > > route, I highly advise against them. I've had nothing but bad > > experiences with random slowdowns and whatnot. I guess it depends on > > how important it is to you that your website is up. > > > > (I'm moving to a different company but since the move isn't complete > > and I've not been on the new server long enough to tell, I can't > > recommend them yet with any authority.) > > > > - Brian Dailey > > > > On 10/31/07, Michael Hernandez < sequethin at gmail.com > > > wrote: > > > > > > On Oct 31, 2007, at 10:00 AM, Ajai Khattri wrote: > > > > > > > > > > > > > > > Just to clarify my earlier request (thanks for all the > suggestions > > > > BTW, > > > > some look really really good). > > > > > > > > I have a client that I need to move off my server onto a > > third-party > > > > server (mainly because Im too busy to deal with it). So Im > looking > > > > for a > > > > package that allows at least 5 or more domains. (So maybe a > > reseller > > > > account would be good?) > > > > > > > > How cheap? Well, anything under $30/month that allows several > > > > domains is > > > > just fine. (A little over is OK if it has more features - > > there's some > > > > wiggle room). > > > > > > > > I need PHP5, MySQL (4.x or 5,x). I need to run Joomla, symfony > > and > > > > some > > > > static sites. Access via ssh would be nice but is not a > > deal-breaker > > > > (Im > > > > quite comfortable using a command-line but I can deal with a > > "control" > > > > panel if I must ;-). Need mailboxes for these domains too. > > > > > > > > > > > > Cheers, > > > > > > > > -- > > > > Aj. > > > > > > there's always dreamhost... though as I always say - check out > > their http://www.dreamhoststatus.com/ > > > page, where their downtime is listed. If you see the frequency > of > > > issues and can handle it then it might be worth it? I like their > > > choice of PHP 4 or 5, fast_cgi support, ruby on rails... (yes I > > said > > > it! haha) > > > > > > --Mike H > > > > > > PS if you decide to go with dreamhost let me know and I'll send > > you a > > > referral link... > > > _______________________________________________ > > > New York PHP Community Talk Mailing List > > > http://lists.nyphp.org/mailman/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 > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Wed Oct 31 13:53:17 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 31 Oct 2007 13:53:17 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: References: Message-ID: On Oct 31, 2007, at 10:00 AM, Ajai Khattri wrote: > So Im looking for a package that allows at least 5 or more domains. > (So maybe a reseller account would be good?) Check out 10for10.com - that's where my personal account is - "Host ten websites with 1GB disk space and 25GB data transfer for $10/month" The numbers might seem low (disk space / bandwidth) - but they don't oversell at all so the QoS is very high. All of our corporate stuff is done with the parent company Empowering Media and I know the owner quite well... so I can definitely vouch for them. Currently though... the php5 on 10for10 accounts is done through fastcgi/suphp -- which has worked out fine for me. It might require config changes on your end but that's about it. -Rob From jonbaer at jonbaer.com Wed Oct 31 14:43:57 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 31 Oct 2007 14:43:57 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: References: Message-ID: <494B3B2F-B57E-4107-9CF2-FC45B7FD00C3@jonbaer.com> Ive only used 2 hosting setups so far (personal wise) ... PHPWebhosting (unmetered) http://www.phpwebhosting.com/host_details.html Joyent http://www.joyent.com/connector/pricing/ - Jon On Oct 31, 2007, at 1:53 PM, Rob Marscher wrote: > On Oct 31, 2007, at 10:00 AM, Ajai Khattri wrote: >> So Im looking for a package that allows at least 5 or more domains. >> (So maybe a reseller account would be good?) From dorgan at donaldorgan.com Wed Oct 31 15:06:55 2007 From: dorgan at donaldorgan.com (Donald Organ) Date: Wed, 31 Oct 2007 15:06:55 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: <494B3B2F-B57E-4107-9CF2-FC45B7FD00C3@jonbaer.com> References: <494B3B2F-B57E-4107-9CF2-FC45B7FD00C3@jonbaer.com> Message-ID: <1193857615.6278.1.camel@dorgan-mobile> > PHPWebhosting (unmetered) > http://www.phpwebhosting.com/host_details.html > I wouldnt trust a hosting company who's SSL Cert expired in January of 07 and they havent renewed it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsteplight at gmail.com Wed Oct 31 15:15:17 2007 From: dsteplight at gmail.com (Darryle steplight) Date: Wed, 31 Oct 2007 15:15:17 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: <494B3B2F-B57E-4107-9CF2-FC45B7FD00C3@jonbaer.com> References: <494B3B2F-B57E-4107-9CF2-FC45B7FD00C3@jonbaer.com> Message-ID: <47f4c4570710311215k6099aa82w8c117c204e0b3a7b@mail.gmail.com> I used www.1and1.com before but http://www.bluehost.com/ has better and quicker 24/7 customer service. With bluehost.com you will have to fax a photo ID over to them if you want SSH access. This isn't the case with 1and1.com . Also, with 1and1, you have to pay 3 months at a time. I don't believe bluehost has this option yet. I bought the two year hosting plan up front. I recommend bluehost.com. On 10/31/07, Jon Baer wrote: > > Ive only used 2 hosting setups so far (personal wise) ... > > PHPWebhosting (unmetered) > http://www.phpwebhosting.com/host_details.html > > Joyent > http://www.joyent.com/connector/pricing/ > > - Jon > > On Oct 31, 2007, at 1:53 PM, Rob Marscher wrote: > > > On Oct 31, 2007, at 10:00 AM, Ajai Khattri wrote: > >> So Im looking for a package that allows at least 5 or more domains. > >> (So maybe a reseller account would be good?) > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Wed Oct 31 15:37:47 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 31 Oct 2007 15:37:47 -0400 Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: <1193857615.6278.1.camel@dorgan-mobile> References: <494B3B2F-B57E-4107-9CF2-FC45B7FD00C3@jonbaer.com> <1193857615.6278.1.camel@dorgan-mobile> Message-ID: Yeah very good point ... in fact it's probably a good idea to remain a little (or super) skeptical of really *any* shared hosting type of setup. Your paranoia level around your app + business requirements usually dictates (or should) how you are going to initially setup. You do get what you pay for. Cheap hosting == cheap security (opinion). - Jon On Oct 31, 2007, at 3:06 PM, Donald Organ wrote: >> PHPWebhosting (unmetered) >> http://www.phpwebhosting.com/host_details.html >> > > I wouldnt trust a hosting company who's SSL Cert expired in January of > 07 and they havent renewed it. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Wed Oct 31 15:53:40 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 31 Oct 2007 15:53:40 -0400 Subject: [nycphp-talk] Zend Neon - (Zend Framework Project) In-Reply-To: References: <043522D9-17C5-43C8-BD7B-8EBE61E64FAE@jonbaer.com> Message-ID: > > Change: > set_include_path('.' . PATH_SEPARATOR . './library' . > PATH_SEPARATOR . './application/models/' . PATH_SEPARATOR . > get_include_path()); > To: > set_include_path('..' . PATH_SEPARATOR . '../library' . > PATH_SEPARATOR . '../application/models/' . PATH_SEPARATOR . > get_include_path()); I would find it extremely hard to believe they would release an initial IDE w/ a broken template like that. Either way I guess it's assumed that project structure is the recommend way of building your skeleton app ... @ least according to http://framework.zend.com/manual/en/zend.controller.html#zend.controller.quickstart.go It seems in line. Everything else seems ok, only annoying thing is my .eclipse_keyring keeps popping up every time I start. It should be possible to use one Eclipse for Java work and one for PHP / Web, does having J2EE / Neon / Aptana all conflict in someway? I also keep getting the update dialog box telling me updates are available w/o anything to download ... - Jon From ajai at bitblit.net Wed Oct 31 16:08:09 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 31 Oct 2007 16:08:09 -0400 (EDT) Subject: [nycphp-talk] PHP5 hosting? In-Reply-To: <494B3B2F-B57E-4107-9CF2-FC45B7FD00C3@jonbaer.com> Message-ID: On Wed, 31 Oct 2007, Jon Baer wrote: > Joyent > http://www.joyent.com/connector/pricing/ For Rails or PHP? :-) -- Aj.