From glenn310b at mac.com Sat Mar 1 00:25:31 2008 From: glenn310b at mac.com (Glenn) Date: Sat, 1 Mar 2008 00:25:31 -0500 Subject: [nycphp-talk] PHP/MySQL environment problem?? In-Reply-To: <001801c87a3d$b54f3580$0200a8c0@X9183> References: <001801c87a3d$b54f3580$0200a8c0@X9183> Message-ID: <5d88c054cfeab41afb234323ad38f36c@mac.com> Just curious. Why not use an autoincrement ? I'm probably missing something...??? Back to your question; I think I remember reading something about last_insert_id() being different between mysql versions. Regards, Glenn On Feb 28, 2008, at 2:11 PM, PaulCheung wrote: > The application is a classic traditional computer applications of add, > update and read?selected record.? The add record routine lines up the > next record?to be?added by checking?what the last record added number > was. > > The application was developed on? ?localhost?, Windows environment, > and all working as expected,?adding, updating and reading records up > to a preset maximum of 100. > > Then thethe whole application?was transfered into its'??production > environment? on my web space, Linux environment for testing. > Everything works fine for the first record only. I cannot add? records > thereafter. I have ?desk checked? the coding and with the exception of > the MySQL database?parameters (host, user, password and?database). All > coding remains the same. > > I cannot understand what is wrong is it because of the different > operating environments or could it be something else? Has anybody got > any ideas > > ? > > . > > ?_______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1772 bytes Desc: not available URL: From cliff at pinestream.com Sun Mar 2 21:55:31 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Sun, 02 Mar 2008 21:55:31 -0500 Subject: [nycphp-talk] Any apc experts out there? Message-ID: I just increased from 1 to 2 shm segments (30M each). But the apc memory usage graph still indicates only 30M. Why isn?t apc taking advantage of the 2nd shm? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Sun Mar 2 22:07:05 2008 From: lists at zaunere.com (Hans Zaunere) Date: Sun, 2 Mar 2008 22:07:05 -0500 Subject: [nycphp-talk] Any apc experts out there? In-Reply-To: References: Message-ID: <016001c87cdb$a92d75f0$fb8861d0$@com> > I just increased from 1 to 2 shm segments (30M each). But the apc > memory usage graph still indicates only 30M. > > Why isn't apc taking advantage of the 2nd shm? Is APC using the first 30M to start with? If it's not needed, perhaps it won't allocate it, ie, the number of segments is the limit. H From asmith at observer.com Sun Mar 2 22:09:25 2008 From: asmith at observer.com (Austin Smith) Date: Sun, 2 Mar 2008 22:09:25 -0500 Subject: [nycphp-talk] Any apc experts out there? In-Reply-To: References: Message-ID: <68a246880803021909q2dbc6828m1da6f851093301c0@mail.gmail.com> I fought this battle awhile back building machine images for EC2 servers. If memory serves, in the end I just had to boost the shm_size because shm_segments is deprecated (or just broken and soon-to-be-deprecated). I recall being a little annoyed at the discussions about this issue in bug trackers which mostly ended with someone sniping, "why would you want to use multiple segments?" Good luck, Austin On Sun, Mar 2, 2008 at 9:55 PM, Cliff Hirsch wrote: > > I just increased from 1 to 2 shm segments (30M each). But the apc memory > usage graph still indicates only 30M. > > Why isn't apc taking advantage of the 2nd shm? > > Cliff From cliff at pinestream.com Sun Mar 2 22:28:52 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Sun, 02 Mar 2008 22:28:52 -0500 Subject: [nycphp-talk] Any apc experts out there? In-Reply-To: <68a246880803021909q2dbc6828m1da6f851093301c0@mail.gmail.com> Message-ID: > On Sun, Mar 2, 2008 at 9:55 PM, Cliff Hirsch wrote: >> >> I just increased from 1 to 2 shm segments (30M each). But the apc memory >> usage graph still indicates only 30M. >> >> Why isn't apc taking advantage of the 2nd shm? >>Is APC using the first 30M to start with? If it's not needed, perhaps it >>won't allocate it, ie, the number of segments is the limit. On 3/2/08 10:09 PM, "Austin Smith" wrote: > I fought this battle awhile back building machine images for EC2 > servers. If memory serves, in the end I just had to boost the shm_size > because shm_segments is deprecated (or just broken and > soon-to-be-deprecated). I recall being a little annoyed at the > discussions about this issue in bug trackers which mostly ended with > someone sniping, "why would you want to use multiple segments?" > > Good luck, > Austin My apc memory usage is near 100%, so I assumed it would role into the 2nd shm. Deprecated, eh. Well that explains things. Sure, increasing the shm_size param would be trivial, but I thought max shm size was defined by the OS and couldn't be set arbitrarily. From anoland at indigente.net Mon Mar 3 09:54:04 2008 From: anoland at indigente.net (Adrian Noland) Date: Mon, 03 Mar 2008 09:54:04 -0500 Subject: [nycphp-talk] PHP5.3 adds EU date formatting. Message-ID: <47CC110C.2000400@indigente.net> Check it out here: http://derickrethans.nl/british_date_format_parsing.php From brian at realm3.com Mon Mar 3 10:20:19 2008 From: brian at realm3.com (Brian D.) Date: Mon, 3 Mar 2008 10:20:19 -0500 Subject: [Norton AntiSpam] [nycphp-talk] error message when I run http://localhost/phpmyadmin/index.php In-Reply-To: <003201c87b1a$0450a7e0$0cf1f7a0$@com> References: <003201c87b1a$0450a7e0$0cf1f7a0$@com> Message-ID: Have you enabled the MySQL extension in your php.ini file? > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of chad qian > Sent: Friday, February 29, 2008 4:19 PM > To: talk at lists.nyphp.org > Subject: [Norton AntiSpam] [nycphp-talk] error message when I run > http://localhost/phpmyadmin/index.php > > > > > > Hi, > I install apache,php5,mysql6 and phpmyadmin on windows. > When I run http://localhost/phpmyadmin/index.php, > I get the error message > "phpmyadmin Error > Cannot load mysql extension. Please check your PHP configuration. - > Documentation" > > How to solve this problem? > > Thanks! > > chad > ________________________________ > > > Need to know the score, the latest news, or you need your Hotmail(R)-get your > "fix". Check it out. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594 From nynj.tech at hotmail.com Mon Mar 3 10:27:11 2008 From: nynj.tech at hotmail.com (chad qian) Date: Mon, 3 Mar 2008 10:27:11 -0500 Subject: [Norton AntiSpam] [nycphp-talk] error message when I run http://localhost/phpmyadmin/index.php In-Reply-To: References: <003201c87b1a$0450a7e0$0cf1f7a0$@com> Message-ID: Maybe I don't enable Mysql extension in php.ini.What should I do about php.ini? Thanks! chad> Date: Mon, 3 Mar 2008 10:20:19 -0500> From: brian at realm3.com> To: talk at lists.nyphp.org> Subject: Re: [Norton AntiSpam] [nycphp-talk] error message when I run http://localhost/phpmyadmin/index.php> > Have you enabled the MySQL extension in your php.ini file?> > > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On> > Behalf Of chad qian> > Sent: Friday, February 29, 2008 4:19 PM> > To: talk at lists.nyphp.org> > Subject: [Norton AntiSpam] [nycphp-talk] error message when I run> > http://localhost/phpmyadmin/index.php> >> >> >> >> >> > Hi,> > I install apache,php5,mysql6 and phpmyadmin on windows.> > When I run http://localhost/phpmyadmin/index.php,> > I get the error message> > "phpmyadmin Error> > Cannot load mysql extension. Please check your PHP configuration. -> > Documentation"> >> > How to solve this problem?> >> > Thanks!> >> > chad> > ________________________________> >> >> > Need to know the score, the latest news, or you need your Hotmail(R)-get your> > "fix". Check it out.> > _______________________________________________> > New York PHP Community Talk Mailing List> > http://lists.nyphp.org/mailman/listinfo/talk> >> > NYPHPCon 2006 Presentations Online> > http://www.nyphpcon.com> >> > Show Your Participation in New York PHP> > http://www.nyphp.org/show_participation.php> >> > > > -- > realm3 web applications [realm3.com]> freelance consulting, application development> (917) 512-3594> _______________________________________________> New York PHP Community Talk Mailing List> http://lists.nyphp.org/mailman/listinfo/talk> > NYPHPCon 2006 Presentations Online> http://www.nyphpcon.com> > Show Your Participation in New York PHP> http://www.nyphp.org/show_participation.php _________________________________________________________________ Helping your favorite cause is as easy as instant messaging.?You IM, we give. http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at realm3.com Mon Mar 3 11:05:41 2008 From: brian at realm3.com (Brian D.) Date: Mon, 3 Mar 2008 11:05:41 -0500 Subject: [Norton AntiSpam] [nycphp-talk] error message when I run http://localhost/phpmyadmin/index.php In-Reply-To: References: <003201c87b1a$0450a7e0$0cf1f7a0$@com> Message-ID: Not to be snippy, but Mr. Google is your friend. I searched for "mysql" and "php.ini" and this is the first result with lots of useful information: http://us.php.net/mysql What you'll be modifying in php.ini is dependent on your operating system, but usually you'll be looking for the line that looks something like this: ; extension=mysql.so It may be a DLL file if you're using Windows. Remove the semi-colon. Restart apache. That's usually all you need to do. On Mon, Mar 3, 2008 at 10:27 AM, chad qian wrote: > > Maybe I don't enable Mysql extension in php.ini.What should I do about > php.ini? > > Thanks! > > chad > > > Date: Mon, 3 Mar 2008 10:20:19 -0500 > > From: brian at realm3.com > > > To: talk at lists.nyphp.org > > Subject: Re: [Norton AntiSpam] [nycphp-talk] error message when I run > http://localhost/phpmyadmin/index.php > > > > > > Have you enabled the MySQL extension in your php.ini file? > > > > > > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On > > > Behalf Of chad qian > > > Sent: Friday, February 29, 2008 4:19 PM > > > To: talk at lists.nyphp.org > > > Subject: [Norton AntiSpam] [nycphp-talk] error message when I run > > > http://localhost/phpmyadmin/index.php > > > > > > > > > > > > > > > > > > Hi, > > > I install apache,php5,mysql6 and phpmyadmin on windows. > > > When I run http://localhost/phpmyadmin/index.php, > > > I get the error message > > > "phpmyadmin Error > > > Cannot load mysql extension. Please check your PHP configuration. - > > > Documentation" > > > > > > How to solve this problem? > > > > > > Thanks! > > > > > > chad > > > ________________________________ > > > > > > > > > Need to know the score, the latest news, or you need your Hotmail(R)-get > your > > > "fix". Check it out. > > > _______________________________________________ > > > New York PHP Community Talk Mailing List > > > http://lists.nyphp.org/mailman/listinfo/talk > > > > > > NYPHPCon 2006 Presentations Online > > > http://www.nyphpcon.com > > > > > > Show Your Participation in New York PHP > > > http://www.nyphp.org/show_participation.php > > > > > > > > > > > -- > > realm3 web applications [realm3.com] > > freelance consulting, application development > > (917) 512-3594 > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > ________________________________ > Helping your favorite cause is as easy as instant messaging. You IM, we > give. Learn more. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594 From paulcheung at tiscali.co.uk Mon Mar 3 00:58:07 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Mon, 3 Mar 2008 05:58:07 -0000 Subject: [nycphp-talk] PHP/MySQL environment problem?? Message-ID: <000001c87d4d$24fa5b00$0300a8c0@X9183> HELP - I have tried everything I can think of, taken onboard suggestions and still cannot understand why my record counter works in the Windows Environment and not in Linus Environment. Here is the code can anybody see what is wrong?? Thanks - Paul From ramons at gmx.net Mon Mar 3 12:50:51 2008 From: ramons at gmx.net (David Krings) Date: Mon, 03 Mar 2008 12:50:51 -0500 Subject: [nycphp-talk] PHP5.3 adds EU date formatting. In-Reply-To: <47CC110C.2000400@indigente.net> References: <47CC110C.2000400@indigente.net> Message-ID: <47CC3A7B.5030009@gmx.net> Adrian Noland wrote: > Check it out here: > > http://derickrethans.nl/british_date_format_parsing.php Nice to see that as that appears to be the most common date format used in the world. Nevertheless, it also does not adhere to the ISO standards for date and time. In regards to date, the Canadian notation of year/month/day is what comes closest. I do agree that the US notation doesn't make any sense, but what can one expect from people who intentionally make themselves suffer from inches and fluid ounces or the worst of them all AWG (instead of cross-section). But isn't there already a way to format a date any way one likes to? David From radalapsker at yahoo.com Mon Mar 3 13:12:54 2008 From: radalapsker at yahoo.com (-- rada --) Date: Mon, 3 Mar 2008 10:12:54 -0800 (PST) Subject: [nycphp-talk] What does this code do? Message-ID: <554696.55142.qm@web54110.mail.re2.yahoo.com> Hi all, I am trying to implement a user-input scrubbing function, more specifically, normalize linebreaks from windows/mac to unix. I can just do preg_replace but I saw this piece of code somewhere and don't understand it enough to even know what to google. supposedly converts Windows CRLF to Unix LF: $str =~ s/\r\n/\n/g; What does =~ do? I can RTFM if you point me to it :) ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Mon Mar 3 13:13:05 2008 From: ramons at gmx.net (David Krings) Date: Mon, 03 Mar 2008 13:13:05 -0500 Subject: [nycphp-talk] PHP/MySQL environment problem?? In-Reply-To: <000001c87d4d$24fa5b00$0300a8c0@X9183> References: <000001c87d4d$24fa5b00$0300a8c0@X9183> Message-ID: <47CC3FB1.9080002@gmx.net> PaulCheung wrote: I looked over the code and a few things struck me odd (which doesn't mean they are wrong!). > // You add this between each handful of lines without adding any informative comment. I'd remove those slashes and make the code easier to read - or even better add commentary. > @ $cps; //Current Page Starting row number > @ $lps; //Last Page Starting row number > @ $rpp; //Records Per Page I have no idea what the significance of these lines is. The @ is usually used to suppress error message output (IMHO a bad idea), but the statement (or lack thereof) doesn't do anything. > $q="SELECT SQL_CALC_FOUND_ROWS * > FROM tr_test_record > WHERE $access = tr_access"; > // > $rs=mysql_query($q) or die(mysql_error()); > // > $q0="Select FOUND_ROWS()"; When you run the query in the MySQL query editor, how many rows does MySQL return? I always burn extra cycles and read the query results in a loop and increase a counter. All the MySQL functions that return a count do that for the last query run under the current connection, which may or may not be the last query that your code ran. I am not that familiar with all the SQL keywords, but it strikes me that SQL_CALC_FOUND_ROWS returns already the count that you are looking for, which is one result row. So counting that result later on will always be 1. I rather have some of the SQL epxerts chime in here as I quickly move into an area that I have no clue about. > // > $rs0=mysql_query($q0) or die(mysql_error()); > // > $row0=mysql_fetch_array($rs0); > // > $nr0 = $row0["FOUND_ROWS()"]; //Number of rows found without LIMIT in > action > ?> As mentioned above, I run a plain simple select query and increase a counter while looping through the results returned. May not be as elegant and efficient, but works reliably. I just don't gtee away from thinking that SELECT SQL_CALC_FOUND_ROWS * FROM tr_test_record WHERE $access = tr_access doesn't return what you expect it should (as far as I understand it thsi already counts the rows that would be returned when running the query without SQL_CALC_FOUND_ROWS). Plug that into the query browser and see what happens. My uneducated guss is that you basically count how many row counts (not rows!!!) there were in the last query, which should always be 1. But then again, you say it works on Windoze.... David From sequethin at gmail.com Mon Mar 3 13:18:25 2008 From: sequethin at gmail.com (Michael Hernandez) Date: Mon, 3 Mar 2008 13:18:25 -0500 Subject: [nycphp-talk] What does this code do? In-Reply-To: <554696.55142.qm@web54110.mail.re2.yahoo.com> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> Message-ID: on windows a new line is really 2 characters, carriage return and line feed. In unix it's 2-in-1. The idea is to convert them you need to replace the carriage return and line feed with a newline character. if you don't know what \r or \n are you should most definitely do some rtfmming :) Good luck :) --Mike H On Mar 3, 2008, at 1:12 PM, -- rada -- wrote: > Hi all, > > I am trying to implement a user-input scrubbing function, more > specifically, normalize linebreaks from windows/mac to unix. I can > just do preg_replace but I saw this piece of code somewhere and > don't understand it enough to even know what to google. > > supposedly converts Windows CRLF to Unix LF: > $str =~ s/\r\n/\n/g; > > What does =~ do? I can RTFM if you point me to it :) > > > Never miss a thing. Make Yahoo your homepage. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From rolan at omnistep.com Mon Mar 3 13:20:25 2008 From: rolan at omnistep.com (Rolan Yang) Date: Mon, 03 Mar 2008 13:20:25 -0500 Subject: [nycphp-talk] What does this code do? In-Reply-To: <554696.55142.qm@web54110.mail.re2.yahoo.com> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> Message-ID: <47CC4169.1080805@omnistep.com> -- rada -- wrote: > Hi all, > > I am trying to implement a user-input scrubbing function, more > specifically, normalize linebreaks from windows/mac to unix. I can > just do preg_replace but I saw this piece of code somewhere and don't > understand it enough to even know what to google. > > supposedly converts Windows CRLF to Unix LF: > $str =~ s/\r\n/\n/g; > > What does =~ do? I can RTFM if you point me to it :) > > That is perl code which searches $str for "\r\n" and replaces it with '\n". The same code in php would be preg_replace('/\r\n/',"\n",$str); ~Rolan From dirn at dirnonline.com Mon Mar 3 13:25:17 2008 From: dirn at dirnonline.com (dirn at dirnonline.com) Date: Mon, 03 Mar 2008 11:25:17 -0700 Subject: [nycphp-talk] What does this code do? Message-ID: <20080303112517.9562cbc3556ac68f081dfda387a9f4ab.2a19c26215.wbe@email.secureserver.net> An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Mon Mar 3 13:25:39 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 3 Mar 2008 13:25:39 -0500 Subject: [nycphp-talk] What does this code do? In-Reply-To: <554696.55142.qm@web54110.mail.re2.yahoo.com> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> Message-ID: <8f0676b40803031025p9a66279l80d89b089bf83792@mail.gmail.com> On Mon, Mar 3, 2008 at 1:12 PM, -- rada -- wrote: > > Hi all, > > I am trying to implement a user-input scrubbing function, more specifically, > normalize linebreaks from windows/mac to unix. I can just do preg_replace > but I saw this piece of code somewhere and don't understand it enough to > even know what to google. > > supposedly converts Windows CRLF to Unix LF: > $str =~ s/\r\n/\n/g; > > What does =~ do? I can RTFM if you point me to it :) That is perl code, and will not work in php. The php equivalent is: $str = preg_replace('/\r\n/',"\n",$str); It means replace all carriage returns followed by a linefeed with just a linefeed. Regards, John Campbell From scott at crisscott.com Mon Mar 3 13:25:59 2008 From: scott at crisscott.com (Scott Mattocks) Date: Mon, 03 Mar 2008 13:25:59 -0500 Subject: [nycphp-talk] What does this code do? In-Reply-To: <554696.55142.qm@web54110.mail.re2.yahoo.com> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> Message-ID: <47CC42B7.5060308@crisscott.com> -- rada -- wrote: > supposedly converts Windows CRLF to Unix LF: > $str =~ s/\r\n/\n/g; That's not any PHP that I have ever seen (especially if you didn't mistakenly leave out the quotes). You might be looking at a bit of Perl code there. -- Scott Mattocks Author: Pro PHP-GTK http://www.crisscott.com From chsnyder at gmail.com Mon Mar 3 13:54:31 2008 From: chsnyder at gmail.com (csnyder) Date: Mon, 3 Mar 2008 13:54:31 -0500 Subject: [nycphp-talk] PHP5.3 adds EU date formatting. In-Reply-To: <47CC3A7B.5030009@gmx.net> References: <47CC110C.2000400@indigente.net> <47CC3A7B.5030009@gmx.net> Message-ID: On Mon, Mar 3, 2008 at 12:50 PM, David Krings wrote: > But isn't there already a way to format a date any way one likes to? > The desired magic was parsing, not formatting, British dates. Unfortunately, date_create_from_format() isn't a replacement for strtotime(), because it assumes you know exactly what format the date is in. The best thing about strtotime() is that you can throw anything at it (um, except for a British date) and it will work. > In regards to date, the Canadian notation of year/month/day is what > comes closest Or the MySQL date, 2008-03-02. Again, the month-day order throws non-US, non-engineers off. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Mon Mar 3 13:59:31 2008 From: chsnyder at gmail.com (csnyder) Date: Mon, 3 Mar 2008 13:59:31 -0500 Subject: [nycphp-talk] PHP/MySQL environment problem?? In-Reply-To: <47CC3FB1.9080002@gmx.net> References: <000001c87d4d$24fa5b00$0300a8c0@X9183> <47CC3FB1.9080002@gmx.net> Message-ID: On Mon, Mar 3, 2008 at 1:13 PM, David Krings wrote: > PaulCheung wrote: > I looked over the code and a few things struck me odd (which doesn't mean they > are wrong!). I didn't have that much patience. ;-) I wonder why you're trying to count the rows in the database in order to set up a simple auto-increment? http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html If for some reason your table can't include an AUTO INCREMENT field, perhaps you could just "SELECT id FROM table ORDER BY id DESC LIMIT 1" to get the highest id number, and then add one to it. -- Chris Snyder http://chxo.com/ From smanes at magpie.com Mon Mar 3 14:32:18 2008 From: smanes at magpie.com (Steve Manes) Date: Mon, 03 Mar 2008 14:32:18 -0500 Subject: [nycphp-talk] What does this code do? In-Reply-To: <554696.55142.qm@web54110.mail.re2.yahoo.com> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> Message-ID: <47CC5242.20202@magpie.com> -- rada -- wrote: > > supposedly converts Windows CRLF to Unix LF: > $str =~ s/\r\n/\n/g; Perl sed function. There's no need to use a regex function unless you have a regex pattern to match. If you just need to remove the carriage returns, this will be two or three times faster: $str = str_replace("\r", "", $str); From dcech at phpwerx.net Mon Mar 3 14:48:21 2008 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 03 Mar 2008 14:48:21 -0500 Subject: [nycphp-talk] What does this code do? In-Reply-To: <47CC5242.20202@magpie.com> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> <47CC5242.20202@magpie.com> Message-ID: <47CC5605.7010603@phpwerx.net> Steve Manes wrote: > -- rada -- wrote: >> >> supposedly converts Windows CRLF to Unix LF: >> $str =~ s/\r\n/\n/g; > > Perl sed function. > > There's no need to use a regex function unless you have a regex pattern > to match. If you just need to remove the carriage returns, this will be > two or three times faster: > > $str = str_replace("\r", "", $str); While this is indeed faster than using preg, it suffers from a slightly different version of the same bug in the original version. On Mac, a newline is \r, so this will remove all newlines from a mac-formatted string...not what you want. The original version is only marginally better in that it leaves the mac newlines unconverted. A simple and efficient way to convert both windows and mac newlines to the unix style is: $str = str_replace(array("\r\n","\r"),"\n",$str); This will first replace all windows newline sequences with the unix version, then any mac-style carriage returns. Dan From dcech at phpwerx.net Mon Mar 3 14:51:42 2008 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 03 Mar 2008 14:51:42 -0500 Subject: [nycphp-talk] What does this code do? In-Reply-To: <47CC5605.7010603@phpwerx.net> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> <47CC5242.20202@magpie.com> <47CC5605.7010603@phpwerx.net> Message-ID: <47CC56CE.40308@phpwerx.net> Dan Cech wrote: > Steve Manes wrote: >> -- rada -- wrote: >>> >>> supposedly converts Windows CRLF to Unix LF: >>> $str =~ s/\r\n/\n/g; >> >> Perl sed function. >> >> There's no need to use a regex function unless you have a regex >> pattern to match. If you just need to remove the carriage returns, >> this will be two or three times faster: >> >> $str = str_replace("\r", "", $str); > > While this is indeed faster than using preg, it suffers from a slightly > different version of the same bug in the original version. On Mac, a > newline is \r, so this will remove all newlines from a mac-formatted > string...not what you want. The original version is only marginally > better in that it leaves the mac newlines unconverted. > > A simple and efficient way to convert both windows and mac newlines to > the unix style is: > > $str = str_replace(array("\r\n","\r"),"\n",$str); > > This will first replace all windows newline sequences with the unix > version, then any mac-style carriage returns. Before the flames begin, let me assure the Mac users out there that I meant to say *old* Mac newlines are simply \r. OSX uses unix-style \n newlines. Dan From smanes at magpie.com Mon Mar 3 15:02:27 2008 From: smanes at magpie.com (Steve Manes) Date: Mon, 03 Mar 2008 15:02:27 -0500 Subject: [nycphp-talk] What does this code do? In-Reply-To: <47CC5605.7010603@phpwerx.net> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> <47CC5242.20202@magpie.com> <47CC5605.7010603@phpwerx.net> Message-ID: <47CC5953.1080701@magpie.com> Dan Cech wrote: > While this is indeed faster than using preg, it suffers from a slightly > different version of the same bug in the original version. On Mac, a > newline is \r, so this will remove all newlines from a mac-formatted > string...not what you want. The original version is only marginally > better in that it leaves the mac newlines unconverted. What about my EBCDIC and CDC NOS files?!! From paulcheung at tiscali.co.uk Mon Mar 3 15:22:15 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Mon, 3 Mar 2008 20:22:15 -0000 Subject: [nycphp-talk] PHP/MySQL environment problem?? References: <000001c87d4d$24fa5b00$0300a8c0@X9183> <47CC3FB1.9080002@gmx.net> Message-ID: <000901c87d6c$465c6760$0300a8c0@X9183> Can't believe I wrote Linus instead of Linux. Anyway, you are correct the application is working under windows. ----- Original Message ----- From: "David Krings" To: "NYPHP Talk" Sent: Monday, March 03, 2008 6:13 PM Subject: Re: [nycphp-talk] PHP/MySQL environment problem?? > PaulCheung wrote: > I looked over the code and a few things struck me odd (which doesn't mean > they are wrong!). > > >> // > > You add this between each handful of lines without adding any informative > comment. I'd remove those slashes and make the code easier to read - or > even better add commentary. > >> @ $cps; //Current Page Starting row number >> @ $lps; //Last Page Starting row number >> @ $rpp; //Records Per Page > > I have no idea what the significance of these lines is. The @ is usually > used to suppress error message output (IMHO a bad idea), but the statement > (or lack thereof) doesn't do anything. > > >> $q="SELECT SQL_CALC_FOUND_ROWS * >> FROM tr_test_record >> WHERE $access = tr_access"; >> // >> $rs=mysql_query($q) or die(mysql_error()); >> // >> $q0="Select FOUND_ROWS()"; > > When you run the query in the MySQL query editor, how many rows does MySQL > return? > I always burn extra cycles and read the query results in a loop and > increase a counter. All the MySQL functions that return a count do that > for the last query run under the current connection, which may or may not > be the last query that your code ran. > I am not that familiar with all the SQL keywords, but it strikes me that > SQL_CALC_FOUND_ROWS returns already the count that you are looking for, > which is one result row. So counting that result later on will always be > 1. > I rather have some of the SQL epxerts chime in here as I quickly move into > an area that I have no clue about. > >> // >> $rs0=mysql_query($q0) or die(mysql_error()); >> // >> $row0=mysql_fetch_array($rs0); >> // >> $nr0 = $row0["FOUND_ROWS()"]; //Number of rows found without LIMIT in >> action >> ?> > > As mentioned above, I run a plain simple select query and increase a > counter while looping through the results returned. May not be as elegant > and efficient, but works reliably. I just don't gtee away from thinking > that SELECT SQL_CALC_FOUND_ROWS * FROM tr_test_record WHERE $access = > tr_access doesn't return what you expect it should (as far as I understand > it thsi already counts the rows that would be returned when running the > query without SQL_CALC_FOUND_ROWS). Plug that into the query browser and > see what happens. My uneducated guss is that you basically count how many > row counts (not rows!!!) there were in the last query, which should always > be 1. But then again, you say it works on Windoze.... > > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From paulcheung at tiscali.co.uk Mon Mar 3 15:25:08 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Mon, 3 Mar 2008 20:25:08 -0000 Subject: Fw: [nycphp-talk] PHP/MySQL environment problem?? Message-ID: <000d01c87d6c$acda8080$0300a8c0@X9183> Sorry I sent an incomplete email. please disregard. Thanks Paul ----- Original Message ----- From: "PaulCheung" To: "NYPHP Talk" Sent: Monday, March 03, 2008 8:22 PM Subject: Re: [nycphp-talk] PHP/MySQL environment problem?? > Can't believe I wrote Linus instead of Linux. Anyway, you are correct the > application is working under windows. > > > ----- Original Message ----- > From: "David Krings" > To: "NYPHP Talk" > Sent: Monday, March 03, 2008 6:13 PM > Subject: Re: [nycphp-talk] PHP/MySQL environment problem?? > > >> PaulCheung wrote: >> I looked over the code and a few things struck me odd (which doesn't mean >> they are wrong!). >> >> >>> // >> >> You add this between each handful of lines without adding any informative >> comment. I'd remove those slashes and make the code easier to read - or >> even better add commentary. >> >>> @ $cps; //Current Page Starting row number >>> @ $lps; //Last Page Starting row number >>> @ $rpp; //Records Per Page >> >> I have no idea what the significance of these lines is. The @ is usually >> used to suppress error message output (IMHO a bad idea), but the >> statement (or lack thereof) doesn't do anything. >> >> >>> $q="SELECT SQL_CALC_FOUND_ROWS * >>> FROM tr_test_record >>> WHERE $access = tr_access"; >>> // >>> $rs=mysql_query($q) or die(mysql_error()); >>> // >>> $q0="Select FOUND_ROWS()"; >> >> When you run the query in the MySQL query editor, how many rows does >> MySQL return? >> I always burn extra cycles and read the query results in a loop and >> increase a counter. All the MySQL functions that return a count do that >> for the last query run under the current connection, which may or may not >> be the last query that your code ran. >> I am not that familiar with all the SQL keywords, but it strikes me that >> SQL_CALC_FOUND_ROWS returns already the count that you are looking for, >> which is one result row. So counting that result later on will always be >> 1. >> I rather have some of the SQL epxerts chime in here as I quickly move >> into an area that I have no clue about. >> >>> // >>> $rs0=mysql_query($q0) or die(mysql_error()); >>> // >>> $row0=mysql_fetch_array($rs0); >>> // >>> $nr0 = $row0["FOUND_ROWS()"]; //Number of rows found without LIMIT in >>> action >>> ?> >> >> As mentioned above, I run a plain simple select query and increase a >> counter while looping through the results returned. May not be as elegant >> and efficient, but works reliably. I just don't gtee away from thinking >> that SELECT SQL_CALC_FOUND_ROWS * FROM tr_test_record WHERE $access = >> tr_access doesn't return what you expect it should (as far as I >> understand it thsi already counts the rows that would be returned when >> running the query without SQL_CALC_FOUND_ROWS). Plug that into the query >> browser and see what happens. My uneducated guss is that you basically >> count how many row counts (not rows!!!) there were in the last query, >> which should always be 1. But then again, you say it works on Windoze.... >> >> >> David >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > From ramons at gmx.net Mon Mar 3 15:31:31 2008 From: ramons at gmx.net (David Krings) Date: Mon, 03 Mar 2008 15:31:31 -0500 Subject: [nycphp-talk] PHP5.3 adds EU date formatting. In-Reply-To: References: <47CC110C.2000400@indigente.net> <47CC3A7B.5030009@gmx.net> Message-ID: <47CC6023.5070702@gmx.net> csnyder wrote: > Or the MySQL date, 2008-03-02. Again, the month-day order throws > non-US, non-engineers off. I don't think that it has to do with being and engineer or not. Not meaning it personal, but writing month/day/year is just suboptimal. I really wonder where that comes from. David From chsnyder at gmail.com Mon Mar 3 17:00:08 2008 From: chsnyder at gmail.com (csnyder) Date: Mon, 3 Mar 2008 17:00:08 -0500 Subject: [nycphp-talk] PHP5.3 adds EU date formatting. In-Reply-To: <47CC6023.5070702@gmx.net> References: <47CC110C.2000400@indigente.net> <47CC3A7B.5030009@gmx.net> <47CC6023.5070702@gmx.net> Message-ID: On Mon, Mar 3, 2008 at 3:31 PM, David Krings wrote: > csnyder wrote: > > Or the MySQL date, 2008-03-02. Again, the month-day order throws > > non-US, non-engineers off. > > I don't think that it has to do with being and engineer or not. Not meaning it > personal, but writing month/day/year is just suboptimal. I really wonder where > that comes from. > I bet there's a Wikipedia article with the answer. We've been putting the month first since at least the Declaration of Independence: "In CONGRESS, July 4, 1776" -- Chris Snyder http://chxo.com/ From danielc at analysisandsolutions.com Mon Mar 3 18:44:53 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 3 Mar 2008 18:44:53 -0500 Subject: [nycphp-talk] PHP/MySQL environment problem?? In-Reply-To: References: <000001c87d4d$24fa5b00$0300a8c0@X9183> <47CC3FB1.9080002@gmx.net> Message-ID: <20080303234453.GA16106@panix.com> On Mon, Mar 03, 2008 at 01:59:31PM -0500, csnyder wrote: > If for some reason your table can't include an AUTO INCREMENT field, > perhaps you could just "SELECT id FROM table ORDER BY id DESC LIMIT 1" > to get the highest id number, and then add one to it. And if you need to go that route, read up on MySQL's "FOR UPDATE" syntax. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at zaunere.com Mon Mar 3 23:29:16 2008 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 3 Mar 2008 23:29:16 -0500 Subject: [nycphp-talk] SEO Presentation Online Message-ID: <047301c87db0$4f08c4f0$ed1a4ed0$@com> All, We have last week's SEO presentation from David online, including some code we didn't get a chance to dive into much during the talk: http://www.nyphp.org/content/presentations/ Thanks David for presenting. And we'll see everyone at March's meeting on Sun/MySQL. --- Hans Zaunere / President / New York PHP www.nyphp.org / ?www.nyphp.com From rotsen at gmail.com Tue Mar 4 02:43:51 2008 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Mon, 3 Mar 2008 23:43:51 -0800 Subject: [nycphp-talk] OT - PHP portlet in Java's Liferay portal Message-ID: I am in need of help. I have created a chart PHP portlet and I am able to deploy. The problem is that the PNG image file displays as binary. I know that the file is created and is there and I can open it with my browser and it displays the Pie chart My php code: Libchart pie chart demonstration Pie chart I read in some articles that you need to use the jsp code <%= renderRequest.getContextPath()%> but is not working. I also try it without the JSP code and I get the same result. This is what is displayed ----------------- ?PNG  ??? IHDR??X????????O?G??]IDATx???}?U?????pI??]?"???KE"l*Y?X?T?&Z?BL?????E;? !m?1?HcT???n0 Q?? ??M6??d??5?Y???Rl?p???q?3s?s?s??''f? 3?? ???w???@?z?'?@@@@?u?????8x???.????Zv?sNM????v??g?ye???T!???Y?`L3????O???m??p?!< ?o4*8??l?m;?????>?`??B@5B8??????M?7=??? ??!?H?1{?m?va2?????"g#B???ag'???O??Z?l? ?u?KZ 3,b?Kp????#,o5????_??`???0?????0?(?2~)??6B?\6?h?a]?X?????FX??fQ?G???FX?? Q?A?*???FX???u?h???F??vX?4V?yU?m?`#?n;?D ?]??@!?????v?N???h#??0?#????(?`#4 a?'@!?-?B???g#?Q???l?`#4" a??l??D!?w????(???~6B??s???l???*???6B?R???g#!?f?2Z?l? ?6?H????F6BB!?Am?`#!?????F6BB!??F??F??F??F??F??F???!??$???????Y?!!?R@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B?B?B?B?????9??(e?????IEND?B`? Pie chart document.getElementById("p_p_id_libchartportlet_WAR_libchartportlet_").portletId = "libchartportlet_WAR_libchartportlet"; document.getElementById("p_p_id_libchartportlet_WAR_libchartportlet_").columnPos = 5; if (!Liferay.Portlet.isAjax("libchartportlet_WAR_libchartportlet")) { Liferay.Portlet.process("libchartportlet_WAR_libchartportlet"); } jQuery( function() { Liferay.Util.portletTitleEdit( { obj: jQuery("#p_p_id_libchartportlet_WAR_libchartportlet_"), plid: "10133", doAsUserId: "", portletId: "libchartportlet_WAR_libchartportlet" } ); } ); ----------------- I do not get all of the the javascript stuff after "Pie chart" above if I do not use the JSP code. Any ideas of what is wrong with my PHP displaying of the PNG file. Thanks, rotseN -------------- next part -------------- An HTML attachment was scrubbed... URL: From urb at e-government.com Tue Mar 4 06:42:49 2008 From: urb at e-government.com (Urb LeJeune) Date: Tue, 04 Mar 2008 06:42:49 -0500 Subject: [nycphp-talk] Rewrite rule functionality In-Reply-To: <47CC5242.20202@magpie.com> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> <47CC5242.20202@magpie.com> Message-ID: <7.0.1.0.2.20080304063601.02aa73c0@e-government.com> An Apache a rewrite rule in the form of: /country/(..)\.html returns the two characters enclosed between the parenthesis as $1. If there a PHP function with the same functionality? I want to use PHP to return the digits in a string like: stuff [mailid=1234] more stuff. Thanks Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. From dcech at phpwerx.net Tue Mar 4 07:18:38 2008 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 04 Mar 2008 07:18:38 -0500 Subject: [nycphp-talk] Rewrite rule functionality In-Reply-To: <7.0.1.0.2.20080304063601.02aa73c0@e-government.com> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> <47CC5242.20202@magpie.com> <7.0.1.0.2.20080304063601.02aa73c0@e-government.com> Message-ID: <47CD3E1E.3040308@phpwerx.net> Urb LeJeune wrote: > An Apache a rewrite rule in the form of: > > /country/(..)\.html > > returns the two characters enclosed between the parenthesis as $1. > If there a PHP function with the same functionality? > > I want to use PHP to return the digits in a string like: > > stuff [mailid=1234] more stuff. Urb, The function you are looking for is preg_match http://php.net/preg_match Also, don't start a new thread by responding to an existing thread and deleting the text, create a new email. Dan From brian at realm3.com Tue Mar 4 09:08:18 2008 From: brian at realm3.com (Brian D.) Date: Tue, 4 Mar 2008 09:08:18 -0500 Subject: [nycphp-talk] SEO Presentation Online In-Reply-To: <047301c87db0$4f08c4f0$ed1a4ed0$@com> References: <047301c87db0$4f08c4f0$ed1a4ed0$@com> Message-ID: Also wanted to mention that we have an NYPHP Flickr group. I've taken a few pictures from the last two months and they are online here: http://www.flickr.com/groups/nyphp If you take any pictures & upload them to Flickr, feel free to add them! - Brian D. On Mon, Mar 3, 2008 at 11:29 PM, Hans Zaunere wrote: > All, > > We have last week's SEO presentation from David online, including some code > we didn't get a chance to dive into much during the talk: > > http://www.nyphp.org/content/presentations/ > > Thanks David for presenting. And we'll see everyone at March's meeting on > Sun/MySQL. > > > --- > Hans Zaunere / President / New York PHP > www.nyphp.org / www.nyphp.com > > > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594 From brian at realm3.com Tue Mar 4 09:12:31 2008 From: brian at realm3.com (Brian D.) Date: Tue, 4 Mar 2008 09:12:31 -0500 Subject: [nycphp-talk] OT - PHP portlet in Java's Liferay portal In-Reply-To: References: Message-ID: Why are you using JSP (Java servlet pages) alongside PHP? Either way, your problem is probably related to not sending headers along with the image. If you're generating the chart, make sure it's sending mime-type (Content-type) headers before sending the binary PNG data. Otherwise the browser doesn't know what it's receiving and it will garble it. It's been a couple of years since I've written Java applications, but the relevant PHP function is here: http://us3.php.net/header Take a look at Example #1. - Brian On Tue, Mar 4, 2008 at 2:43 AM, N?stor wrote: > I am in need of help. I have created a chart PHP portlet and I am able to > deploy. The problem is that the PNG image file > displays as binary. I know that the file is created and is there and I can > open it with my browser and it displays the Pie chart > > My php code: > > > Libchart pie chart demonstration > > > > Pie chart > > > > I read in some articles that you need to use the jsp code > <%=renderRequest.getContextPath()%> > but is not working. I also try it without the JSP code and I get the same > result. > > This is what is displayed > ----------------- > ?PNG ??? IHDR?? X???? ????O?G?? ]IDATx???}?U??? ??pI??]?" ???KE" > l*Y?X?T?&Z?BL? ????E;? !m?1?HcT ???n0 Q?? ??M6??d??5?Y ???R > l?p???q?3s?s?s??''f? 3?? ???w??? @?z?'?@ @ @ @ ?u??? ?? > 8x???.????Zv?sN ?eW??I3>M????v??g?ye? ?? T!???Y?`L 3????O?? ?m??p?!< ?o4*8??l?m; ?? ??? > >?`??B @5B8????? ?M?7=??? > > ??!?H ?1{?m? va2?????" g# B??? ag'???O??Z ?l? ?u? KZ 3,b ?Kp ?? ? ? > #,o5????_??`?? ?0?????0?(?2~)??6B ?\6?h?a]?X??? ? ?FX??fQ?G? ? ?FX?? Q?A?*? > ? ?FX???u?h? ? ?F??vX?4V?yU? m?`#?n;?D ?]??@ !? ?? ? ?v?N??? h# ??0?#???? > (?`#4 a?'@ !? -?B???g# ? Q ???l?`#4" a?? l??D!?w? ???(???~6B? ? s ??? > l???*???6B? R???g# !? f?2Z?l? ?6? H?? ??F 6B B !? A m?`# !? ?? ??F 6B B !? > ?F ? ?F ? ?F ? ?F ? ?F ? ?F ? ??! ?? $ ? ??? ???Y? ! !?R @ @ @ @ @ @ @ @ @ @ > @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ B? B? B? B?????9??(e?????IEND?B`? > Pie chart > document.getElementById("p_p_id_libchartportlet_WAR_libchartportlet_").portletId > = "libchartportlet_WAR_libchartportlet"; > document.getElementById("p_p_id_libchartportlet_WAR_libchartportlet_").columnPos > = 5; if (!Liferay.Portlet.isAjax("libchartportlet_WAR_libchartportlet")) { > Liferay.Portlet.process("libchartportlet_WAR_libchartportlet"); } jQuery( > function() { Liferay.Util.portletTitleEdit( { obj: > jQuery("#p_p_id_libchartportlet_WAR_libchartportlet_"), plid: "10133", > doAsUserId: "", portletId: "libchartportlet_WAR_libchartportlet" } ); } ); > ----------------- > > I do not get all of the the javascript stuff after "Pie chart" above if I do > not use the JSP code. > > > Any ideas of what is wrong with my PHP displaying of the PNG file. > > Thanks, > > rotseN > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594 From rotsen at gmail.com Tue Mar 4 11:51:01 2008 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Tue, 4 Mar 2008 08:51:01 -0800 Subject: [nycphp-talk] OT - PHP portlet in Java's Liferay portal In-Reply-To: References: Message-ID: Brian, I actually set the 'Content-Type' to 'image/png' and 'image/x-png' while testing and realized that the '' tag took care of the content type weather it was set to test/html or image/png. Why am I using PHP and Java. Liferay is a Java Portal and it is very good, I do not know of something like it written in PHP. Liferay allows you to create portlets using the QUERCUS tecnology, which converts PHP code to Java byte code. I have created a couple of portlets and they work. My problem at this moment is that the portlet I have develop works to the point that the pie chart file is created as a PNG but I am having problem displaying it as a graph and it displays as binary. The php file works if I run it from my apache server but it displays binary if I run it from within the Liferay portal. Thanks, Nestor :-) On Tue, Mar 4, 2008 at 6:12 AM, Brian D. wrote: > Why are you using JSP (Java servlet pages) alongside PHP? > > Either way, your problem is probably related to not sending headers > along with the image. If you're generating the chart, make sure it's > sending mime-type (Content-type) headers before sending the binary PNG > data. Otherwise the browser doesn't know what it's receiving and it > will garble it. > > It's been a couple of years since I've written Java applications, but > the relevant PHP function is here: > http://us3.php.net/header > Take a look at Example #1. > > - Brian > > On Tue, Mar 4, 2008 at 2:43 AM, N?stor wrote: > > I am in need of help. I have created a chart PHP portlet and I am able > to > > deploy. The problem is that the PNG image file > > displays as binary. I know that the file is created and is there and I > can > > open it with my browser and it displays the Pie chart > > > > My php code: > > > > > > Libchart pie chart demonstration > > > > > > > > Pie chart /> > > > > > > > > I read in some articles that you need to use the jsp code > > <%=renderRequest.getContextPath()%> > > but is not working. I also try it without the JSP code and I get the > same > > result. > > > > This is what is displayed > > ----------------- > > ?PNG ??? IHDR?? X???? ????O?G?? ]IDATx???}?U??? ??pI??]?" ???KE" > > l*Y?X?T?&Z?BL? ????E;? !m?1?HcT ???n0 Q?? ??M6??d??5?Y ???R > > l?p???q?3s?s?s??''f? 3?? ???w??? @?z?'?@ @ @ @ ?u??? ?? > > 8x???.????Zv?sN > ?eW??I3>M????v??g?ye? ?? T!???Y?`L 3????O?? ?m??p?!< ?o4*8??l?m; ?? ??? > > >?`??B @5B8????? ?M?7=??? > > > > ??!?H ?1{?m? va2?????" g# B??? ag'???O??Z ?l? ?u? KZ 3,b ?Kp ?? ? ? > > #,o5????_??`?? ?0?????0?(?2~)??6B ?\6?h?a]?X??? ? ?FX??fQ?G? ? ?FX?? > Q?A?*? > > ? ?FX???u?h? ? ?F??vX?4V?yU? m?`#?n;?D ?]??@ !? ?? ? ?v?N??? h# > ??0?#???? > > (?`#4 a?'@ !? -?B???g# ? Q ???l?`#4" a?? l??D!?w? ???(???~6B? ? s ??? > > l???*???6B? R???g# !? f?2Z?l? ?6? H?? ??F 6B B !? A m?`# !? ?? ??F 6B B > !? > > ?F ? ?F ? ?F ? ?F ? ?F ? ?F ? ??! ?? $ ? ??? ???Y? ! !?R @ @ @ @ @ @ @ @ > @ @ > > @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ B? B? B? > B?????9??(e?????IEND?B`? > > Pie chart > > document.getElementById > ("p_p_id_libchartportlet_WAR_libchartportlet_").portletId > > = "libchartportlet_WAR_libchartportlet"; > > document.getElementById > ("p_p_id_libchartportlet_WAR_libchartportlet_").columnPos > > = 5; if (!Liferay.Portlet.isAjax("libchartportlet_WAR_libchartportlet")) > { > > Liferay.Portlet.process("libchartportlet_WAR_libchartportlet"); } > jQuery( > > function() { Liferay.Util.portletTitleEdit( { obj: > > jQuery("#p_p_id_libchartportlet_WAR_libchartportlet_"), plid: "10133", > > doAsUserId: "", portletId: "libchartportlet_WAR_libchartportlet" } ); } > ); > > ----------------- > > > > I do not get all of the the javascript stuff after "Pie chart" above if > I do > > not use the JSP code. > > > > > > Any ideas of what is wrong with my PHP displaying of the PNG file. > > > > Thanks, > > > > rotseN > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > > -- > realm3 web applications [realm3.com] > freelance consulting, application development > (917) 512-3594 > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 urb at e-government.com Tue Mar 4 12:23:55 2008 From: urb at e-government.com (Urb LeJeune) Date: Tue, 04 Mar 2008 12:23:55 -0500 Subject: [nycphp-talk] Rewrite rule functionality In-Reply-To: <47CD3E1E.3040308@phpwerx.net> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> <47CC5242.20202@magpie.com> <7.0.1.0.2.20080304063601.02aa73c0@e-government.com> <47CD3E1E.3040308@phpwerx.net> Message-ID: <7.0.1.0.2.20080304121944.02b8f738@e-government.com> >The function you are looking for is preg_match > >http://php.net/preg_match preg_match only returns the entire match. To my knowledge you can not have a portion, enclosed in parenthesis, of the regular expression enclosed. >Also, don't start a new thread by responding to an existing thread >and deleting the text, create a new email. I'm sorry I though changing the subject accomplished starting a new thread. Urb Dr. Urban A. LeJeune, President E-Government.com 609-294-0320 800-204-9545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E-Government.com lowers you costs while increasing your expectations. From dcech at phpwerx.net Tue Mar 4 13:00:55 2008 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 04 Mar 2008 13:00:55 -0500 Subject: [nycphp-talk] Rewrite rule functionality In-Reply-To: <7.0.1.0.2.20080304121944.02b8f738@e-government.com> References: <554696.55142.qm@web54110.mail.re2.yahoo.com> <47CC5242.20202@magpie.com> <7.0.1.0.2.20080304063601.02aa73c0@e-government.com> <47CD3E1E.3040308@phpwerx.net> <7.0.1.0.2.20080304121944.02b8f738@e-government.com> Message-ID: <47CD8E57.3020202@phpwerx.net> Urb LeJeune wrote: > >> The function you are looking for is preg_match >> >> http://php.net/preg_match > > preg_match only returns the entire match. To my knowledge you can not > have a portion, enclosed in parenthesis, of the regular expression > enclosed. From the above url: > If matches is provided, then it is filled with the results of > search. $matches[0] will contain the text that matched the full > pattern, $matches[1] will have the text that matched the first > captured parenthesized subpattern, and so on. If I understand your question correctly, this should be what you are after. Dan From dorgan at donaldorgan.com Wed Mar 5 10:18:11 2008 From: dorgan at donaldorgan.com (Donald J Organ IV) Date: Wed, 05 Mar 2008 10:18:11 -0500 Subject: [nycphp-talk] Wiki Style Links Message-ID: <47CEB9B3.3080405@donaldorgan.com> I was wondering if anyone else has done this and if they have the code readily available. I want to be able to parse wiki style links such as [[page|title]] [[page]] Any suggestions ?? From brian at realm3.com Wed Mar 5 10:27:22 2008 From: brian at realm3.com (Brian D.) Date: Wed, 5 Mar 2008 10:27:22 -0500 Subject: [nycphp-talk] Wiki Style Links In-Reply-To: <47CEB9B3.3080405@donaldorgan.com> References: <47CEB9B3.3080405@donaldorgan.com> Message-ID: I can't say right off the top of my head, but if all else fails there are several open source PHP-based wiki's - you could always take look at their code and see what's involved. - B. On Wed, Mar 5, 2008 at 10:18 AM, Donald J Organ IV wrote: > I was wondering if anyone else has done this and if they have the code > readily available. > I want to be able to parse wiki style links such as > > [[page|title]] > [[page]] > > Any suggestions ?? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594 From dcech at phpwerx.net Wed Mar 5 10:36:30 2008 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 05 Mar 2008 10:36:30 -0500 Subject: [nycphp-talk] Wiki Style Links In-Reply-To: <47CEB9B3.3080405@donaldorgan.com> References: <47CEB9B3.3080405@donaldorgan.com> Message-ID: <47CEBDFE.6020801@phpwerx.net> Donald J Organ IV wrote: > I was wondering if anyone else has done this and if they have the code > readily available. > I want to be able to parse wiki style links such as > > [[page|title]] > [[page]] > > Any suggestions ?? Something like this might be a start: $str = preg_replace( array( '/\[\[([^|\]]+)\]\]/U', '/\[\[([^|\]]+)|([^\]]+)\]\]/U', ), array( '$1', '$2', ), $str ); Disclaimer: I haven't tried running this code. Dan From ken at secdat.com Wed Mar 5 10:39:54 2008 From: ken at secdat.com (Kenneth Downs) Date: Wed, 05 Mar 2008 10:39:54 -0500 Subject: [nycphp-talk] Wiki Style Links In-Reply-To: <47CEB9B3.3080405@donaldorgan.com> References: <47CEB9B3.3080405@donaldorgan.com> Message-ID: <47CEBECA.3060704@secdat.com> Donald J Organ IV wrote: > I was wondering if anyone else has done this and if they have the code > readily available. > I want to be able to parse wiki style links such as > > [[page|title]] > [[page]] > > Any suggestions ?? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php One thing I try is to explode on "|", then I count the results. Two results means a page/title split, one result means only the page. -- 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 yitzchas at touro.edu Wed Mar 5 12:31:51 2008 From: yitzchas at touro.edu (Yitzchak Schaffer) Date: Wed, 05 Mar 2008 12:31:51 -0500 Subject: [nycphp-talk] Wiki Style Links Message-ID: <47CED907.4060505@touro.edu> I was wondering if anyone else has done this and if they have the code readily available. I want to be able to parse wiki style links such as [[page|title]] [[page]] ========= Also check out the PEAR Text_Wiki package. From tedd at sperling.com Wed Mar 5 13:27:04 2008 From: tedd at sperling.com (tedd) Date: Wed, 5 Mar 2008 13:27:04 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: <20080227000645.GA23398@panix.com> References: <20080227000645.GA23398@panix.com> Message-ID: At 7:06 PM -0500 2/26/08, Daniel Convissor wrote: >Hi Cliff: > >On Tue, Feb 26, 2008 at 05:46:15PM -0500, Cliff Hirsch wrote: >> It?s amazing how many people cut and paste from MS Word. > >Tell me about it. Here's what we use: -snip- That seems to work very well, see here: http://www.webbytedd.com/b1/char-replace/index.php Cut/paste Word text TO the top text-box, click Convert, and cut/paste FROM the bottom text-box. If anyone see's any problem, please let me know. Thanks for the function. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From bob.siegel at verizon.net Wed Mar 5 13:38:14 2008 From: bob.siegel at verizon.net (Bob/Jules) Date: Wed, 05 Mar 2008 12:38:14 -0600 (CST) Subject: [nycphp-talk] Charsets are still driving me nuts Message-ID: <5388649.244041204742294217.JavaMail.root@vms068.mailsrvcs.net> Where is the code for the function? >http://www.webbytedd.com/b1/char-replace/index.php > >Cut/paste Word text TO the top text-box, click Convert, and cut/paste >FROM the bottom text-box. > >If anyone see's any problem, please let me know. > >Thanks for the function. > >Cheers, > >tedd > > >-- >------- >http://sperling.com http://ancientstones.com http://earthstones.com >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >NYPHPCon 2006 Presentations Online >http://www.nyphpcon.com > >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php Robert Jules Siegel ColdFusion and PHP Web programming From chsnyder at gmail.com Wed Mar 5 17:56:54 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 5 Mar 2008 17:56:54 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: References: <459E5F07-662F-47E2-8F86-B6EEB85E4D6D@beaffinitive.com> Message-ID: On Wed, Feb 27, 2008 at 8:35 PM, Cliff Hirsch wrote: > > b 26, 2008, at 5:46 PM, Cliff Hirsch wrote: > I have been validating textareas using ctype_print > > > > Are you using utf-8 encoding? What do you need to validate/sanitize with > the textareas? That the input is using the correct character set? Need to > strip html from it? I've had pretty good luck with using utf-8 and having > text cut and pasted from MS Word come through fine. > > I have been waffling between 8859-1 and utf-8. Regarding validating a text > area ? good question. No stripping necessary. I though ctype_print looked > good ? any reasonable printable character. Maybe textarea doesn't need to be > validated/sanitized if everything is escaping properly? I thought the > browser took care of the charset, but don't know for sure. Is there a downside to using utf-8? If you use 8859-1 you're practically making the application English-only, or at least limiting the ability of people to express themselves. ?????? -- Chris Snyder http://chxo.com/ From cliff at pinestream.com Wed Mar 5 18:19:41 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 05 Mar 2008 18:19:41 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: Message-ID: Is there a downside to using utf-8? If you use 8859-1 you're > practically making the application English-only, or at least limiting the > ability of people to express themselves. ?????? -- Chris Point well taken. Did you just place a sushi order? From cliff at pinestream.com Wed Mar 5 18:28:28 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 05 Mar 2008 18:28:28 -0500 Subject: [nycphp-talk] Detecting send email bounces Message-ID: How do you detect bad email errors? Pear mail provides errors messages, but most deal with things like bad formatting, sendmail problems, etc. What is the best way to detect failed delivery or bouncers. Detect them by parsing messages in a bounce folder? Start with Pear Mail_Mbox? Anything easier? Anyone have a favorite open source script? Best regards, Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From rolan at omnistep.com Wed Mar 5 18:39:45 2008 From: rolan at omnistep.com (Rolan Yang) Date: Wed, 05 Mar 2008 18:39:45 -0500 Subject: [nycphp-talk] Detecting send email bounces In-Reply-To: References: Message-ID: <47CF2F41.2030106@omnistep.com> If you examine the manual and the code in phplist (http://www.phplist.com) , that will offer some good ideas on email bounce management. ~Rolan Cliff Hirsch wrote: > How do you detect bad email errors? Pear mail provides errors > messages, but most deal with things like bad formatting, sendmail > problems, etc. What is the best way to detect failed delivery or > bouncers. Detect them by parsing messages in a bounce folder? Start > with Pear Mail_Mbox? Anything easier? Anyone have a favorite open > source script? > > Best regards, > 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 jcampbell1 at gmail.com Wed Mar 5 19:25:31 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 5 Mar 2008 19:25:31 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: References: Message-ID: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> 2008/3/5 Cliff Hirsch : > Is there a downside to using utf-8? No, but there are issues with some string functions. In php4/5 functions like substr() operate on bytes, and may break UTF-8 strings that contain multibyte characters. I'd search your code for things like "substr" and "pos", and make sure they are not operating on userdata in an unsafe way. see: http://www.phpwact.org/php/i18n/utf-8 Regards, John Campbell From chsnyder at gmail.com Wed Mar 5 20:19:38 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 5 Mar 2008 20:19:38 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: References: Message-ID: 2008/3/5 Cliff Hirsch : > Point well taken. Did you just place a sushi order? http://translate.google.com/translate_t?langpair=ja|en&text=%E3%81%9D%E3%81%86%E3%81%8B%E3%81%AA%E3%81%82 And yeah, John Campbell's point about multibyte strings is nicely illustrated by my example, which was five characters long but required 15 urlencoded bytes in the url. This hasn't been a big deal in my applications, but you may want to make sure you're using a version of php with the mbstring functions enabled in case you need them. And where is php 6, anyway? -- Chris Snyder http://chxo.com/ From cliff at pinestream.com Wed Mar 5 20:21:40 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 05 Mar 2008 20:21:40 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> Message-ID: On 3/5/08 7:25 PM, "John Campbell" wrote: > 2008/3/5 Cliff Hirsch : >> Is there a downside to using utf-8? > > No, but there are issues with some string functions. In php4/5 > functions like substr() operate on bytes, and may break UTF-8 strings > that contain multibyte characters. I'd search your code for things > like "substr" and "pos", and make sure they are not operating on > userdata in an unsafe way. > > see: > http://www.phpwact.org/php/i18n/utf-8 Doesn't the multibyte string extension overload these functions? From cliff at pinestream.com Wed Mar 5 20:22:33 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 05 Mar 2008 20:22:33 -0500 Subject: [nycphp-talk] Detecting send email bounces In-Reply-To: <47CF2F41.2030106@omnistep.com> Message-ID: On 3/5/08 6:39 PM, "Rolan Yang" wrote: > If you examine the manual and the code in phplist > (http://www.phplist.com) , that will offer some good ideas on email > bounce management. Perfect! Thanks. From cliff at pinestream.com Wed Mar 5 20:26:31 2008 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 05 Mar 2008 20:26:31 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: Message-ID: > http://translate.google.com/translate_t?langpair=ja|en&text=%E3%81%9D%E3%81%86 > %E3%81%8B%E3%81%AA%E3%81%82 That is way, way cool. I though you meant ??. I'm always thinking of food. This Bostonian indulged in Zabars, Crumbs, and the best slice of pasta bolognaise pizza last weekend! Only in NY.... From jcampbell1 at gmail.com Wed Mar 5 21:27:30 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 5 Mar 2008 21:27:30 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: References: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> Message-ID: <8f0676b40803051827t69399e1aya3084cad75838037@mail.gmail.com> > Doesn't the multibyte string extension overload these functions? > They don't overload by default, but that is an option. I don't have any experience using it that way, but it feels like a bad idea. Frankly, I rarely find the need to use the multibyte functions (or any string functions for that matter) on user data. From ioplex at gmail.com Wed Mar 5 22:19:57 2008 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 5 Mar 2008 22:19:57 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: <8f0676b40803051827t69399e1aya3084cad75838037@mail.gmail.com> References: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> <8f0676b40803051827t69399e1aya3084cad75838037@mail.gmail.com> Message-ID: <78c6bd860803051919m2bd750fev239ae1e0e1d2f1ec@mail.gmail.com> On 3/5/08, John Campbell wrote: > Frankly, I rarely find the need to use the multibyte functions (or any > string functions for that matter) on user data. Agreed. It is rare that the multibyte functions are necessary. The problem area is when you want to iterate over each character and evaluate them independently. But in 99% of those scenarios you are just searching for an ASCII character and ASCII characters cannot appear within a UTF-8 sequence [1] and therefore the standard bytewise iteration is ok (e.g. strchr is ok if the needle is a single ASCII character). Some example issues with multibyte encodings are chopping a string to a fixed length or doing a case insensitive string comparison. If you want to display a summary of some search results (e.g. where the string is chopped off with an ellipsis at the end) you cannot just use substr because the last character may be incomplete. In that case you would need to use mb_substr($str, $start, $length, 'UTF-8'). Mike [1] ASCII characters can appear within multibyte sequences of encodings other than UTF-8. For example the backslash (\) can appear within a certain Japanese encoding (I don't recall which, I think it was SHIFT-JIS). -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From tedd at sperling.com Thu Mar 6 09:14:03 2008 From: tedd at sperling.com (tedd) Date: Thu, 6 Mar 2008 09:14:03 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: <5388649.244041204742294217.JavaMail.root@vms068.mailsrvcs.net> References: <5388649.244041204742294217.JavaMail.root@vms068.mailsrvcs.net> Message-ID: At 12:38 PM -0600 3/5/08, Bob/Jules wrote: >Where is the code for the function? Just for you. http://www.webbytedd.com/b1/char-replace1/index.php Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From brian at realm3.com Thu Mar 6 11:03:34 2008 From: brian at realm3.com (Brian D.) Date: Thu, 6 Mar 2008 11:03:34 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> References: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> Message-ID: Same thing goes for strlen(). It won't break, but it reports bytes, so be aware any validation you're doing using strlen may break. Check out mb_strlen() for an alternative. http://us2.php.net/manual/en/function.mb-strlen.php On Wed, Mar 5, 2008 at 7:25 PM, John Campbell wrote: > 2008/3/5 Cliff Hirsch : > > > Is there a downside to using utf-8? > > No, but there are issues with some string functions. In php4/5 > functions like substr() operate on bytes, and may break UTF-8 strings > that contain multibyte characters. I'd search your code for things > like "substr" and "pos", and make sure they are not operating on > userdata in an unsafe way. > > see: > http://www.phpwact.org/php/i18n/utf-8 > > Regards, > John Campbell > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594 From tkachenkoa at hotmail.com Thu Mar 6 12:51:08 2008 From: tkachenkoa at hotmail.com (alexey tkachenko) Date: Thu, 6 Mar 2008 17:51:08 +0000 Subject: [nycphp-talk] displaying error messages from PHP 5.2.4 Message-ID: Could anyone explain to me how my php.ini file needs to be configured so that can see PHP errors and warnings during script execution? Right now, if access a PHP script with a syntax error, all I see is a blank page in the browser. Here's the error section of my php.ini file: error_reporting = E_ALL ; Print out errors (as a part of the output). For production web sites, ; you're strongly encouraged to turn this feature off, and use error logging ; instead (see below). Keeping display_errors enabled on a production web site ; may reveal security information to end users, such as file paths on your Web ; server, your database schema or other information. display_errors = On ; Even when display_errors is on, errors that occur during PHP's startup ; sequence are not displayed. It's strongly recommended to keep ; display_startup_errors off, except for when debugging. display_startup_errors = On ; Log errors into a log file (server-specific log, stderr, or error_log (below)) ; As stated above, you're strongly advised to use error logging in place of ; error displaying on production web sites. log_errors = On ; Set maximum length of log_errors. In error_log information about the source is ; added. The default is 1024 and 0 allows to not apply any maximum length at all. log_errors_max_len = 1024 ; Do not log repeated messages. Repeated errors must occur in same file on same ; line until ignore_repeated_source is set true. ignore_repeated_errors = Off ; Ignore source of message when ignoring repeated messages. When this setting ; is On you will not log errors with repeated messages from different files or ; source lines. ignore_repeated_source = Off ; If this parameter is set to Off, then memory leaks will not be shown (on ; stdout or in the log). This has only effect in a debug compile, and if ; error reporting includes E_WARNING in the allowed list report_memleaks = On ;report_zend_debug = 0 ; Store the last error/warning message in $php_errormsg (boolean). track_errors = Off ; Disable the inclusion of HTML tags in error messages. ; Note: Never use this feature for production boxes. html_errors = Off ... _________________________________________________________________ Need to know the score, the latest news, or you need your Hotmail?-get your "fix". http://www.msnmobilefix.com/Default.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ka at kacomputerconsulting.com Thu Mar 6 13:55:47 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Thu, 6 Mar 2008 10:55:47 -0800 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY Message-ID: <1204829747.14538@coral.he.net> Hiring the outsourcing programmers with the cheap rates and the poorish skills in English may be leading to coding errors and redo of website ? :0) > > I am seeking job on PHP MySQL Web Development in NY > > I am 6 years experienced in PHP MySQL > > wat? > > webseos SEO Consultancy Services wrote: > > I am seeking job on PHP MySQL Web Development in NY > > > > I am 6 years experienced in PHP MySQL > > > > My resume is here - http://www.geocities.com/bikuboyus/ > > > > Also i am the owner of the following sites > > > > http://www.rankingoogle.com : Top 10 Search Engine Ranking in Google > > YAHOO! > > > > http://www.rankingoogle.com/seo_services.html - Check Our SEO > > Portfolio & Google Rankings > > > > http://phpdevelopers.rankingoogle.com - Freelance Web Developer in PHP > > MySQL.....Shopping Cart , Ecommerce Site etc > > ------------------------------------------------------------------- ----- > > > > _______________________________________________ > > New York PHP Community Jobs Mailing List > > http://lists.nyphp.org/mailman/listinfo/jobs > > > > 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 Jobs Mailing List > http://lists.nyphp.org/mailman/listinfo/jobs > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From consult at covenantedesign.com Thu Mar 6 14:07:39 2008 From: consult at covenantedesign.com (Webmaster) Date: Thu, 06 Mar 2008 14:07:39 -0500 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY In-Reply-To: <1204829747.14538@coral.he.net> References: <1204829747.14538@coral.he.net> Message-ID: <47D040FB.6090101@covenantedesign.com> Heh, Almost Scary. -Edward Kristina Anderson wrote: > Hiring the outsourcing programmers with the cheap rates and the > poorish skills in English may be leading to coding errors and redo of > website ? > > :0) > > >> > I am seeking job on PHP MySQL Web Development in NY >> > I am 6 years experienced in PHP MySQL >> >> wat? >> >> webseos SEO Consultancy Services wrote: >> >>> I am seeking job on PHP MySQL Web Development in NY >>> >>> I am 6 years experienced in PHP MySQL >>> >>> My resume is here - http://www.geocities.com/bikuboyus/ >>> >>> Also i am the owner of the following sites >>> >>> http://www.rankingoogle.com : Top 10 Search Engine Ranking in >>> > Google > >>> YAHOO! >>> >>> http://www.rankingoogle.com/seo_services.html - Check Our SEO >>> Portfolio & Google Rankings >>> >>> http://phpdevelopers.rankingoogle.com - Freelance Web Developer in >>> > PHP > >>> MySQL.....Shopping Cart , Ecommerce Site etc >>> ------------------------------------------------------------------- >>> > ----- > >>> _______________________________________________ >>> New York PHP Community Jobs Mailing List >>> http://lists.nyphp.org/mailman/listinfo/jobs >>> >>> 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 Jobs Mailing List >> http://lists.nyphp.org/mailman/listinfo/jobs >> >> 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 jbaltz at altzman.com Thu Mar 6 14:30:14 2008 From: jbaltz at altzman.com (Jerry B. Altzman) Date: Thu, 06 Mar 2008 14:30:14 -0500 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY In-Reply-To: <47D040FB.6090101@covenantedesign.com> References: <1204829747.14538@coral.he.net> <47D040FB.6090101@covenantedesign.com> Message-ID: <47D04646.9080603@altzman.com> on 2008-03-06 13:55 Kristina Anderson said the following: > Hiring the outsourcing programmers with the cheap rates and the > poorish skills in English may be leading to coding errors and redo of > website ? > > :0) It's too much to ask people to READ things, much less to write well any more. Nobody remembers Emily Postnews: > Q: I cant spell worth a dam. I hope your going too tell me what to do? > > A: Don't worry about how your articles look. Remember it's the message that counts, not the way it's presented. Ignore the fact that sloppy spelling in a purely written forum sends out the same silent messages that soiled clothing would when addressing an audience. on 2008-03-06 14:07 Webmaster said the following: > Almost Scary. No, really scary. This gent is going to be writing code on a website that you might visit...or worse, one that ends up hosting malware that you'll end up cleaning off of someone's PC. //jbaltz -- jerry b. altzman jbaltz at altzman.com www.jbaltz.com thank you for contributing to the heat death of the universe. From ka at kacomputerconsulting.com Thu Mar 6 14:36:05 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Thu, 6 Mar 2008 11:36:05 -0800 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY Message-ID: <1204832165.28820@coral.he.net> Or, he could end up building something that doesn't work right, take 80% of the budget, and leave me to reengineer it for the crumbs in the budget that are left....? ! > on 2008-03-06 13:55 Kristina Anderson said the following: > > Hiring the outsourcing programmers with the cheap rates and the > > poorish skills in English may be leading to coding errors and redo of > > website ? > > > > :0) > > It's too much to ask people to READ things, much less to write well any > more. > Nobody remembers Emily Postnews: > > Q: I cant spell worth a dam. I hope your going too tell me what to do? > > > > A: Don't worry about how your articles look. Remember it's the message that counts, not the way it's presented. Ignore the fact that sloppy spelling in a purely written forum sends out the same silent messages that soiled clothing would when addressing an audience. > > > on 2008-03-06 14:07 Webmaster said the following: > > Almost Scary. > > No, really scary. This gent is going to be writing code on a website > that you might visit...or worse, one that ends up hosting malware that > you'll end up cleaning off of someone's PC. > > //jbaltz > -- > jerry b. altzman jbaltz at altzman.com www.jbaltz.com > thank you for contributing to the heat death of the universe. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 sailer at bnl.gov Thu Mar 6 14:48:58 2008 From: sailer at bnl.gov (Tim Sailer) Date: Thu, 6 Mar 2008 14:48:58 -0500 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY In-Reply-To: <1204832165.28820@coral.he.net> References: <1204832165.28820@coral.he.net> Message-ID: <20080306194858.GA6368@bnl.gov> On Thu, Mar 06, 2008 at 11:36:05AM -0800, Kristina Anderson wrote: > Or, he could end up building something that doesn't work right, take > 80% of the budget, and leave me to reengineer it for the crumbs in the > budget that are left....? /me yearns for the days where Information Engineering was actually a practised and respected discipline! ERDs, Data Definitions, Data Flow Diagrams... Yourdon was my hero! Clearly defined specs, phases, payment based on the passing of the predefined unit testing... final payment after documentation is finished and delivered. Those days are gone forever... Tim From beef at psyop.tv Thu Mar 6 14:58:13 2008 From: beef at psyop.tv (Wellington Fan) Date: Thu, 6 Mar 2008 14:58:13 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: References: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> Message-ID: Does anyone have experience with using the the "accept-charset" attribute on FORMs? http://www.w3.org/TR/REC-html40/interact/forms.html#adef-accept-charset I read this, but I am not sure what the net result is: "The client must interpret this list as an exclusive-or list, i.e., the server is able to accept any single character encoding per entity received." So guess it's not solving the initial question, but might be part of the solution...? -- Wellington -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Thu Mar 6 15:10:52 2008 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 06 Mar 2008 15:10:52 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: References: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> Message-ID: <47D04FCC.6040107@phpwerx.net> Wellington Fan wrote: > Does anyone have experience with using the the "accept-charset" attribute on > FORMs? > > http://www.w3.org/TR/REC-html40/interact/forms.html#adef-accept-charset > > I read this, but I am not sure what the net result is: > "The client must interpret this list as an exclusive-or list, i.e., the > server is able to accept any single character encoding per entity received." > > So guess it's not solving the initial question, but might be part of the > solution...? In theory the data sent by the client should be in one of the 'acceptable' character sets. In practice I am sure there are plenty of clients which either don't obey this directive or ignore it altogether. I'm not sure if it might be useful as a way of hinting to modern clients that you would like input in utf-8 (or another character set), though I believe that most browsers will attempt to provide form data in the same character set as the containing page anyway. Dan From chsnyder at gmail.com Thu Mar 6 15:28:22 2008 From: chsnyder at gmail.com (csnyder) Date: Thu, 6 Mar 2008 15:28:22 -0500 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY In-Reply-To: <20080306194858.GA6368@bnl.gov> References: <1204832165.28820@coral.he.net> <20080306194858.GA6368@bnl.gov> Message-ID: On Thu, Mar 6, 2008 at 2:48 PM, Tim Sailer wrote: > Clearly defined specs, phases, payment based on the passing of the > predefined unit testing... final payment after documentation is > finished and delivered. Those days are gone forever... Welcome to the World On Rails. Teach developers not to think, and pretty soon they won't... but they sure can build a lot of nightmares in a short amount of time. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Thu Mar 6 15:31:53 2008 From: chsnyder at gmail.com (csnyder) Date: Thu, 6 Mar 2008 15:31:53 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: <47D04FCC.6040107@phpwerx.net> References: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> <47D04FCC.6040107@phpwerx.net> Message-ID: On Thu, Mar 6, 2008 at 3:10 PM, Dan Cech wrote: > I'm not sure if it might be useful as a way of hinting to modern clients > that you would like input in utf-8 (or another character set), though I > believe that most browsers will attempt to provide form data in the same > character set as the containing page anyway. Anecdotally this has always been the case, but come to think of it I have no idea if it is required behavior or not. I can imagine that there might be some mobile browser out there that returns forms in iso-8859-1 even if the page was rendered utf-8. Nevertheless, the mainstream browsers can be relied on to submit forms using the character set with which the page is rendered. -- Chris Snyder http://chxo.com/ From sailer at bnl.gov Thu Mar 6 15:37:35 2008 From: sailer at bnl.gov (Tim Sailer) Date: Thu, 6 Mar 2008 15:37:35 -0500 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY In-Reply-To: References: <1204832165.28820@coral.he.net> <20080306194858.GA6368@bnl.gov> Message-ID: <20080306203735.GA7469@bnl.gov> On Thu, Mar 06, 2008 at 03:28:22PM -0500, csnyder wrote: > On Thu, Mar 6, 2008 at 2:48 PM, Tim Sailer wrote: > > > Clearly defined specs, phases, payment based on the passing of the > > predefined unit testing... final payment after documentation is > > finished and delivered. Those days are gone forever... > > Welcome to the World On Rails. > > Teach developers not to think, and pretty soon they won't... but they > sure can build a lot of nightmares in a short amount of time. You know you're old when *everyone* thinks that the only IE relating to computers is MS Internet Exploder... I'll go bury myself now and turn into oil... :( Tim From consult at covenantedesign.com Thu Mar 6 16:16:33 2008 From: consult at covenantedesign.com (Webmaster) Date: Thu, 06 Mar 2008 16:16:33 -0500 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY In-Reply-To: <1204832165.28820@coral.he.net> References: <1204832165.28820@coral.he.net> Message-ID: <47D05F31.1020103@covenantedesign.com> Brother Baltz... didn't you JUST blog on this very topic? LOL http://www.jbaltz.com/weblog/ Too funny. Or is is Two funny? -Ed Kristina Anderson wrote: > Or, he could end up building something that doesn't work right, take > 80% of the budget, and leave me to reengineer it for the crumbs in the > budget that are left....? > > ! > > >> on 2008-03-06 13:55 Kristina Anderson said the following: >> >>> Hiring the outsourcing programmers with the cheap rates and the >>> poorish skills in English may be leading to coding errors and redo >>> > of > >>> website ? >>> >>> :0) >>> >> It's too much to ask people to READ things, much less to write well >> > any > >> more. >> Nobody remembers Emily Postnews: >> >>> Q: I cant spell worth a dam. I hope your going too tell me what to >>> > do? > >>> A: Don't worry about how your articles look. Remember it's the >>> > message that counts, not the way it's presented. Ignore the fact that > sloppy spelling in a purely written forum sends out the same silent > messages that soiled clothing would when addressing an audience. > >> on 2008-03-06 14:07 Webmaster said the following: >> >>> Almost Scary. >>> >> No, really scary. This gent is going to be writing code on a website >> that you might visit...or worse, one that ends up hosting malware >> > that > >> you'll end up cleaning off of someone's PC. >> >> //jbaltz >> -- >> jerry b. altzman jbaltz at altzman.com www.jbaltz.com >> thank you for contributing to the heat death of the universe. >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/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 tedd at sperling.com Thu Mar 6 16:55:12 2008 From: tedd at sperling.com (tedd) Date: Thu, 6 Mar 2008 16:55:12 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: References: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> Message-ID: >Does anyone have experience with using the the "accept-charset" >attribute on FORMs? > >http://www.w3.org/TR/REC-html40/interact/forms.html#adef-accept-charset > >I read this, but I am not sure what the net result is: >"The client must interpret this list as an exclusive-or list, i.e., >the server is able to accept any single character encoding per >entity received." > >So guess it's not solving the initial question, but might be part of >the solution...? > >-- >Wellington As I understand it, all it's doing is establishing what char-sets are required for the form. Not that this is a definitive or totally correct answer, but a char-set contain the glyphs for rendering the characters (code points) contain within that set. Like Basic Latin contains the glyphs sufficient to render the code points for English (like your email application). If your form is in Hebrew, you can't expect the browser to render Hebrew glyphs in the form properly unless your browser has that char-set installed or knows that's what required. It's just a way to get everyone in sync with rendering the same glyphs. HTH's tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Thu Mar 6 17:15:40 2008 From: chsnyder at gmail.com (csnyder) Date: Thu, 6 Mar 2008 17:15:40 -0500 Subject: [nycphp-talk] Charsets are still driving me nuts In-Reply-To: References: <8f0676b40803051625o379438f6oda86fdbb65079bb5@mail.gmail.com> <47D04FCC.6040107@phpwerx.net> Message-ID: I just found another potential gotcha when using Unicode throughout your application: byte order marks in uploaded text files. http://en.wikipedia.org/wiki/Byte_Order_Mark Turns out Word puts a byte order mark (BOM) at the beginning of all Unicode files. Unicode-friendly tools ignore it. PHP's fgets() doesn't. Detecting and stripping the BOM is an interesting exercise, because strlen('???') == 6, but it's really only 3 bytes long... not sure if this is a bug or what, but it's certainly an annoyance. -- Chris Snyder http://chxo.com/ From ramons at gmx.net Thu Mar 6 18:35:26 2008 From: ramons at gmx.net (David Krings) Date: Thu, 06 Mar 2008 18:35:26 -0500 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY In-Reply-To: <47D05F31.1020103@covenantedesign.com> References: <1204832165.28820@coral.he.net> <47D05F31.1020103@covenantedesign.com> Message-ID: <47D07FBE.5040804@gmx.net> Webmaster wrote: > Brother Baltz... didn't you JUST blog on this very topic? LOL > http://www.jbaltz.com/weblog/ > > Too funny. Or is is Two funny? > -Ed And he could have at least spell checked and proof read his post... From sjmci at optonline.net Fri Mar 7 08:32:20 2008 From: sjmci at optonline.net (Steve Solomon) Date: Fri, 07 Mar 2008 08:32:20 -0500 Subject: [nycphp-talk] Re: [nycphp-jobs] I am seeking job on PHP MySQL Web Development in NY In-Reply-To: <20080306203735.GA7469@bnl.gov> Message-ID: <000201c88057$ad1e18c0$6601a8c0@T1400> "Clearly defined specs, phases, payment based on the passing of the predefined unit testing... final payment after documentation is finished and delivered..." Wait a minute, you said he only wants $XXX/hour...??? Hired! No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.21.4/1310 - Release Date: 3/4/2008 8:35 AM From dorgan at donaldorgan.com Sat Mar 8 13:20:22 2008 From: dorgan at donaldorgan.com (Donald Organ) Date: Sat, 08 Mar 2008 13:20:22 -0500 Subject: [nycphp-talk] PHP Conferences Message-ID: <47D2D8E6.1040702@donaldorgan.com> Are there any PHP or open source conferences coming to NY anytime soon?? I know about AjaxWold but because of a current project I dont see that one happening. Are there any others coming up?? Is there anything in the works for another NYPHP Con?? From lists at zaunere.com Sat Mar 8 14:35:33 2008 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 8 Mar 2008 14:35:33 -0500 Subject: [nycphp-talk] PHP Conferences In-Reply-To: <47D2D8E6.1040702@donaldorgan.com> References: <47D2D8E6.1040702@donaldorgan.com> Message-ID: <014a01c88153$93f9f600$bbede200$@com> > Is there anything in the works for another NYPHP Con?? We're thinking about a conference before Memorial Day, but depending on scheduling I'm not sure that can happen. If it doesn't happen, then certainly we'll be doing another NYPHPCon after Labor Day. H From dorgan at donaldorgan.com Sat Mar 8 14:38:17 2008 From: dorgan at donaldorgan.com (Donald Organ) Date: Sat, 08 Mar 2008 14:38:17 -0500 Subject: [nycphp-talk] PHP Conferences In-Reply-To: <014a01c88153$93f9f600$bbede200$@com> References: <47D2D8E6.1040702@donaldorgan.com> <014a01c88153$93f9f600$bbede200$@com> Message-ID: <47D2EB29.5010401@donaldorgan.com> An HTML attachment was scrubbed... URL: From ioplex at gmail.com Sat Mar 8 18:32:09 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sat, 8 Mar 2008 18:32:09 -0500 Subject: [nycphp-talk] Is @$arr['key'] ok? Message-ID: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> Is there any preference for: $val = isset($arr['key']) ? $arr['key'] : null; vs: $val = @$arr['key']; ? -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ben at projectskyline.com Sat Mar 8 18:50:28 2008 From: ben at projectskyline.com (Ben Sgro) Date: Sat, 08 Mar 2008 18:50:28 -0500 Subject: [nycphp-talk] Is @$arr['key'] ok? In-Reply-To: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> References: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> Message-ID: <47D32644.6090703@projectskyline.com> Hello, Personally, I don't like suppressing warnings, even in this case. I would think, somewhere previously in your code, when you could have set $arr['key'] to a value, you should (maybe) set it to null (0, empty string, etc) when you create it, or somewhere else. I think it is bad practice to not know if an index is set in array. Anyways, to answer your questions, I'd vote for the first statement you provided. - Ben ie: $arr = array( ); ...code... $arr['key'] = ($something == TRUE) ? null : $somethingElse; or $arr['key'] == null; Michael B Allen wrote: > Is there any preference for: > > $val = isset($arr['key']) ? $arr['key'] : null; > > vs: > > $val = @$arr['key']; > > ? > > From lists at zaunere.com Sat Mar 8 19:37:41 2008 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 8 Mar 2008 19:37:41 -0500 Subject: [nycphp-talk] Is @$arr['key'] ok? In-Reply-To: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> References: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> Message-ID: <006101c8817d$c8e1de80$5aa59b80$@com> > Is there any preference for: > > $val = isset($arr['key']) ? $arr['key'] : null; This is preferred - it's actually doing something correct. > vs: > > $val = @$arr['key']; This is a hack, which causes an error, which you're then suppressing Marcus and I discussed a shortcut for the first example at the last Montreal PHP Conference, but I don't think it's been implemented yet. H From ioplex at gmail.com Sat Mar 8 21:14:13 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sat, 8 Mar 2008 21:14:13 -0500 Subject: [nycphp-talk] Is @$arr['key'] ok? In-Reply-To: <006101c8817d$c8e1de80$5aa59b80$@com> References: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> <006101c8817d$c8e1de80$5aa59b80$@com> Message-ID: <78c6bd860803081814l373d3bse3bf3146a423ee13@mail.gmail.com> On 3/8/08, Hans Zaunere wrote: > > Is there any preference for: > > > > $val = isset($arr['key']) ? $arr['key'] : null; > > > This is preferred - it's actually doing something correct. > > > vs: > > > > $val = @$arr['key']; > > This is a hack, which causes an error, which you're then suppressing > > Marcus and I discussed a shortcut for the first example at the last Montreal > PHP Conference, but I don't think it's been implemented yet. Actually I've been using the following function a lot too: function _array_val($a, $k, $d = null) { if (array_key_exists($k, $a)) return $a[$k]; if (func_num_args() == 3) return $d; throw new Exception("No such array key: $k"); } --8<-- example --8<-- $val = _array_val($arr, 'key', false); Of course it's a little slower but it makes for clean code. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From paulcheung at tiscali.co.uk Sun Mar 9 14:21:38 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Sun, 9 Mar 2008 18:21:38 -0000 Subject: [nycphp-talk] PHP/MySQL environment problem?? References: <000001c87d4d$24fa5b00$0300a8c0@X9183> <47CC3FB1.9080002@gmx.net> Message-ID: <000f01c88212$6ab88940$0300a8c0@X9183> Hi, Thanks to all those that took the time to help me. As it turns out my problem had nothing to do with PHP; but the way I initialised a MySQL interger field. Paul ----- Original Message ----- From: "csnyder" To: "NYPHP Talk" Sent: Monday, March 03, 2008 6:59 PM Subject: Re: [nycphp-talk] PHP/MySQL environment problem?? > On Mon, Mar 3, 2008 at 1:13 PM, David Krings wrote: >> PaulCheung wrote: >> I looked over the code and a few things struck me odd (which doesn't >> mean they >> are wrong!). > > I didn't have that much patience. ;-) > > I wonder why you're trying to count the rows in the database in order > to set up a simple auto-increment? > http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html > > If for some reason your table can't include an AUTO INCREMENT field, > perhaps you could just "SELECT id FROM table ORDER BY id DESC LIMIT 1" > to get the highest id number, and then add one to it. > > > -- > 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 ken at secdat.com Mon Mar 10 09:28:29 2008 From: ken at secdat.com (Kenneth Downs) Date: Mon, 10 Mar 2008 09:28:29 -0400 Subject: [nycphp-talk] Is @$arr['key'] ok? In-Reply-To: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> References: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> Message-ID: <47D5377D.5010108@secdat.com> Michael B Allen wrote: > Is there any preference for: > > $val = isset($arr['key']) ? $arr['key'] : null; > > vs: > > $val = @$arr['key']; > > ? > > Oftentimes I like to check for a key value, and then supply a default if it is not there. It can be useful to make up a routine that does this for you all in one step: $rowsPerPage = arraySafe($options,'rowsperpage',25); $orderLines = arraySafe($orders,'lines',array()); The function is: function arraySafe($array,$key,$default='') { if(isset($array[$key])) return $array[$key]; else return $default; } -- 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 anoland at indigente.net Mon Mar 10 10:02:39 2008 From: anoland at indigente.net (anoland at indigente.net) Date: Mon, 10 Mar 2008 07:02:39 -0700 (PDT) Subject: [nycphp-talk] displaying error messages from PHP 5.2.4 Message-ID: <3287988127.12782@smtp.gmail.com> Alexy, Turn on HTML errors. >; Disable the inclusion of HTML tags in error messages. >; Note: Never use this feature for production boxes. >html_errors = Off > From chsnyder at gmail.com Mon Mar 10 10:33:20 2008 From: chsnyder at gmail.com (csnyder) Date: Mon, 10 Mar 2008 10:33:20 -0400 Subject: [nycphp-talk] Is @$arr['key'] ok? In-Reply-To: <47D5377D.5010108@secdat.com> References: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> <47D5377D.5010108@secdat.com> Message-ID: On Mon, Mar 10, 2008 at 9:28 AM, Kenneth Downs wrote: > > function arraySafe($array,$key,$default='') { > if(isset($array[$key])) > return $array[$key]; > else > return $default; > } > Yes, very useful pattern. Handy for grabbing input out of $_GET and $_POST arrays. -- Chris Snyder http://chxo.com/ From tkachenkoa at hotmail.com Mon Mar 10 11:04:17 2008 From: tkachenkoa at hotmail.com (alexey tkachenko) Date: Mon, 10 Mar 2008 15:04:17 +0000 Subject: [nycphp-talk] displaying error messages from PHP 5.2.4 In-Reply-To: <3287988127.12782@smtp.gmail.com> References: <3287988127.12782@smtp.gmail.com> Message-ID: Thanks for your help! It seems like what I needed was a reboot of the system. The changes I made to php.ini file were applied after I rebooted, so I'm able to see the errors displayed properly now. > Subject: Re: [nycphp-talk] displaying error messages from PHP 5.2.4 > To: talk at lists.nyphp.org > From: anoland at indigente.net > Date: Mon, 10 Mar 2008 07:02:39 -0700 > > Alexy, > Turn on HTML errors. > > >; Disable the inclusion of HTML tags in error messages. > >; Note: Never use this feature for production boxes. > >html_errors = Off > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _________________________________________________________________ Connect and share in new ways with Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From rolan at omnistep.com Mon Mar 10 11:25:14 2008 From: rolan at omnistep.com (Rolan Yang) Date: Mon, 10 Mar 2008 10:25:14 -0500 Subject: [nycphp-talk] displaying error messages from PHP 5.2.4 In-Reply-To: References: <3287988127.12782@smtp.gmail.com> Message-ID: <47D552DA.5010400@omnistep.com> You shouldn't have to reboot. Restarting (or stopping, then starting) apache should do the job. ~Rolan alexey tkachenko wrote: > Thanks for your help! > > It seems like what I needed was a reboot of the system. The changes I > made to php.ini file were applied after I rebooted, so I'm able to > see the errors displayed properly now. > > > > Subject: Re: [nycphp-talk] displaying error messages from PHP 5.2.4 > > To: talk at lists.nyphp.org > > From: anoland at indigente.net > > Date: Mon, 10 Mar 2008 07:02:39 -0700 > > > > Alexy, > > Turn on HTML errors. > > > > >; Disable the inclusion of HTML tags in error messages. > > >; Note: Never use this feature for production boxes. > > >html_errors = Off > > > > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > ------------------------------------------------------------------------ > Connect and share in new ways with Windows Live. Get it now! > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From tkachenkoa at hotmail.com Mon Mar 10 11:27:55 2008 From: tkachenkoa at hotmail.com (alexey tkachenko) Date: Mon, 10 Mar 2008 15:27:55 +0000 Subject: [nycphp-talk] displaying error messages from PHP 5.2.4 In-Reply-To: <47D552DA.5010400@omnistep.com> References: <3287988127.12782@smtp.gmail.com> <47D552DA.5010400@omnistep.com> Message-ID: I am actually using IIS in this particular installation. But I guess restarting it would do the job as well? > Date: Mon, 10 Mar 2008 10:25:14 -0500 > From: rolan at omnistep.com > To: talk at lists.nyphp.org > Subject: Re: [nycphp-talk] displaying error messages from PHP 5.2.4 > > You shouldn't have to reboot. Restarting (or stopping, then starting) > apache should do the job. > > ~Rolan > > alexey tkachenko wrote: > > Thanks for your help! > > > > It seems like what I needed was a reboot of the system. The changes I > > made to php.ini file were applied after I rebooted, so I'm able to > > see the errors displayed properly now. > > > > > > > Subject: Re: [nycphp-talk] displaying error messages from PHP 5.2.4 > > > To: talk at lists.nyphp.org > > > From: anoland at indigente.net > > > Date: Mon, 10 Mar 2008 07:02:39 -0700 > > > > > > Alexy, > > > Turn on HTML errors. > > > > > > >; Disable the inclusion of HTML tags in error messages. > > > >; Note: Never use this feature for production boxes. > > > >html_errors = Off > > > > > > > > > > _______________________________________________ > > > New York PHP Community Talk Mailing List > > > http://lists.nyphp.org/mailman/listinfo/talk > > > > > > NYPHPCon 2006 Presentations Online > > > http://www.nyphpcon.com > > > > > > Show Your Participation in New York PHP > > > http://www.nyphp.org/show_participation.php > > > > ------------------------------------------------------------------------ > > Connect and share in new ways with Windows Live. Get it now! > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _________________________________________________________________ Connect and share in new ways with Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Mon Mar 10 13:27:37 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 10 Mar 2008 13:27:37 -0400 Subject: [nycphp-talk] Is @$arr['key'] ok? In-Reply-To: <47D5377D.5010108@secdat.com> References: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> <47D5377D.5010108@secdat.com> Message-ID: <20080310172736.GA19231@panix.com> On Mon, Mar 10, 2008 at 09:28:29AM -0400, Kenneth Downs wrote: > > function arraySafe($array,$key,$default='') { > if(isset($array[$key])) > return $array[$key]; > else > return $default; > } Though this does get tripped up by $array[$key] being NULL. array_key_exists() is more accurate. --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 ken at secdat.com Mon Mar 10 13:31:12 2008 From: ken at secdat.com (Kenneth Downs) Date: Mon, 10 Mar 2008 13:31:12 -0400 Subject: [nycphp-talk] Is @$arr['key'] ok? In-Reply-To: <20080310172736.GA19231@panix.com> References: <78c6bd860803081532l4745fd04w76c9a87c25a71fb2@mail.gmail.com> <47D5377D.5010108@secdat.com> <20080310172736.GA19231@panix.com> Message-ID: <47D57060.3070507@secdat.com> Daniel Convissor wrote: > On Mon, Mar 10, 2008 at 09:28:29AM -0400, Kenneth Downs wrote: > >> function arraySafe($array,$key,$default='') { >> if(isset($array[$key])) >> return $array[$key]; >> else >> return $default; >> } >> > > Though this does get tripped up by $array[$key] being NULL. > array_key_exists() is more accurate. > > --Dan > > Good point. -- 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 czech at npgroup.net Wed Mar 12 17:24:05 2008 From: czech at npgroup.net (Pete Czech - New Possibilities Group, LLC) Date: Wed, 12 Mar 2008 17:24:05 -0400 Subject: [nycphp-talk] Slightly OT - Apache Stress Test Message-ID: <47D849F5.7050500@npgroup.net> Does anyone have good resources to perform a stress test on apache? From ramons at gmx.net Wed Mar 12 17:45:21 2008 From: ramons at gmx.net (David Krings) Date: Wed, 12 Mar 2008 17:45:21 -0400 Subject: [nycphp-talk] Slightly OT - Apache Stress Test In-Reply-To: <47D849F5.7050500@npgroup.net> References: <47D849F5.7050500@npgroup.net> Message-ID: <47D84EF1.5070109@gmx.net> Post the URL on many web sites and claim your site has adult content. If it makes it through the day I'd call it reliable. Pete Czech - New Possibilities Group, LLC wrote: > Does anyone have good resources to perform a stress test on apache? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From ioplex at gmail.com Wed Mar 12 19:14:04 2008 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 12 Mar 2008 19:14:04 -0400 Subject: [nycphp-talk] Slightly OT - Apache Stress Test In-Reply-To: <47D849F5.7050500@npgroup.net> References: <47D849F5.7050500@npgroup.net> Message-ID: <78c6bd860803121614t70eddb3dt5ba26c01789f1b91@mail.gmail.com> On 3/12/08, Pete Czech - New Possibilities Group, LLC wrote: > Does anyone have good resources to perform a stress test on apache? Apache Bench ships with every standard Apache package. For example: $ ab -n 1000 -c 3 http://www.example.com/some/script.php The above command retrieves the supplied URL 1000 times with at most 3 concurrent requests at one time. It's not very comprehensive but it's great for sanity testing. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From mikesz at qualityadvantages.com Thu Mar 13 22:21:15 2008 From: mikesz at qualityadvantages.com (mikesz at qualityadvantages.com) Date: Fri, 14 Mar 2008 10:21:15 +0800 Subject: [nycphp-talk] Form not working as expected Message-ID: <1289907876.20080314102115@qualityadvantages.com> Hello and Warm Greetings, I have a form that I have been asked to modify and thought it was a straight forward and simple MOD but it seems to have some a condition that I didn't count on when I agreed to make the change and I need some advice. The situation is that the form (which is using the output buffer)has a birthday input. Almost forgot, this is a complex login form that has an IP Address check in it. If the "expected" IP address is different that the one stored in the database, it loops back and adds a test for the users birthdate which does a different database lookup. This one form is used to manage both conditions. The form was originally designed to use a text box and the request was to replace it with a drop down because his users didn't follow the instructions for formatting most of the time, even with an example provided. The form does a lookup to see if the birthdate matches the one that is stored in the database. In the lookup, it compares the value in $_POST['birthdate'] with the value in the database. The text box works fine if you enter the correct yyyy-mm-dd format. The replacement dropdown has three $_POST values very creatively assigned, $_POST['year'],$_POST['month'],$_POST['day']. To compensate for the replacement of $_POST['birthdate'] and try to make the change transparent to the rest of the script I generated it manually in a hidden field (I actually thought this one WAS creative until I discovered that it didn't work as I expected, lol), " name="birthdate"> The problem, as you may have already guessed is that $_POST['birthdate'] gets no date values until AFTER the submit button and that is too late for it to do its database compare so it fails. If you rerun the form entry a second time the script works, no problem but the first time through nada. I have placed several print_r statements to see what is going on and the very last I have just after the submit and just after the ob_get_content and just before the return and $_POST['birthdate'] has the correct value in it but apparently the script compare function isn't see it for some reason. If, like I say, I run the input again, it works fine? I have tried replacing the $_POST['birthdate'] with a variable $birthdate that I generate manually with the correct data and pass it to the diff function but that breaks the script so that it doesn't work at all no matter how many times you run it. I would really appreciate someone who might have done something like this and solved it to give me an idea of where I need to go with it. Many thanks for your attention, -- Best regards, mikesz mailto:mikesz at qualityadvantages.com From rolan at omnistep.com Fri Mar 14 01:02:21 2008 From: rolan at omnistep.com (Rolan Yang) Date: Fri, 14 Mar 2008 00:02:21 -0500 Subject: [nycphp-talk] Form not working as expected In-Reply-To: <1289907876.20080314102115@qualityadvantages.com> References: <1289907876.20080314102115@qualityadvantages.com> Message-ID: <47DA06DD.1070701@omnistep.com> mikesz at qualityadvantages.com wrote: > Hello and Warm Greetings, > > I have a form that I have been asked to modify and thought it was a > straight forward and simple MOD but it seems to have some a condition > that I didn't count on when I agreed to make the change and I need > some advice. > =instructions for formatting most of the time, even with an example > provided. The form does a lookup to see if the birthdate matches the > one that is stored in the database. In the lookup, it compares the > value in $_POST['birthdate'] with the value in the database. The text > box works fine if you enter the correct yyyy-mm-dd format. > > The replacement dropdown has three $_POST values very creatively > assigned, $_POST['year'],$_POST['month'],$_POST['day']. To compensate > for the replacement of $_POST['birthdate'] and try to make the change > transparent to the rest of the script I generated it manually in a > hidden field (I actually thought this one WAS creative until I > discovered that it didn't work as I expected, lol), > > " name="birthdate"> > > The problem, as you may have already guessed is that > $_POST['birthdate'] gets no date values until AFTER the submit button > and that is too late for it to do its database compare so it fails. If > you rerun the form entry a second time the script works, no problem > but the first time through nada. > ... > I have tried replacing the $_POST['birthdate'] with a variable > $birthdate that I generate manually with the correct data and pass it > to the diff function but that breaks the script so that it doesn't work > > Try adding this to the top of your script: if ($POST['year']) { $_POST['birthdate']=$_POST['year'].$_POST['month'].$_POST['day']; } From rolan at omnistep.com Fri Mar 14 01:30:36 2008 From: rolan at omnistep.com (Rolan Yang) Date: Fri, 14 Mar 2008 00:30:36 -0500 Subject: [nycphp-talk] Form not working as expected In-Reply-To: <47DA06DD.1070701@omnistep.com> References: <1289907876.20080314102115@qualityadvantages.com> <47DA06DD.1070701@omnistep.com> Message-ID: <47DA0D7C.9080706@omnistep.com> Rolan Yang wrote: > mikesz at qualityadvantages.com wrote: >> Hello and Warm Greetings, >> >> I have a form that I have been asked to modify and thought it was a >> straight forward and simple MOD but it seems to have some a condition >> that I didn't count on when I agreed to make the change and I need >> some advice. >> =instructions for formatting most of the time, even with an example >> provided. The form does a lookup to see if the birthdate matches the >> one that is stored in the database. In the lookup, it compares the >> value in $_POST['birthdate'] with the value in the database. The text >> box works fine if you enter the correct yyyy-mm-dd format. >> >> The replacement dropdown has three $_POST values very creatively >> assigned, $_POST['year'],$_POST['month'],$_POST['day']. To compensate >> for the replacement of $_POST['birthdate'] and try to make the change >> transparent to the rest of the script I generated it manually in a >> hidden field (I actually thought this one WAS creative until I >> discovered that it didn't work as I expected, lol), >> >> > $_POST['month'] . "-" . $_POST['day'];?>" name="birthdate"> >> >> The problem, as you may have already guessed is that >> $_POST['birthdate'] gets no date values until AFTER the submit button >> and that is too late for it to do its database compare so it fails. If >> you rerun the form entry a second time the script works, no problem >> but the first time through nada. >> ... >> I have tried replacing the $_POST['birthdate'] with a variable >> $birthdate that I generate manually with the correct data and pass it >> to the diff function but that breaks the script so that it doesn't work >> >> > Correction: if ($POST['year']) { $_POST['birthdate']=$_POST['year'].'-'.$_POST['month'].'-'.$_POST['day']; } From mikesz at qualityadvantages.com Fri Mar 14 01:41:57 2008 From: mikesz at qualityadvantages.com (mikesz at qualityadvantages.com) Date: Fri, 14 Mar 2008 13:41:57 +0800 Subject: [nycphp-talk] Form not working as expected In-Reply-To: <47DA0D7C.9080706@omnistep.com> References: <1289907876.20080314102115@qualityadvantages.com> <47DA06DD.1070701@omnistep.com> <47DA0D7C.9080706@omnistep.com> Message-ID: <588741631.20080314134157@qualityadvantages.com> Hello Rolan, Friday, March 14, 2008, 1:30:36 PM, you wrote: > Correction: > if ($POST['year']) { > > $_POST['birthdate']=$_POST['year'].'-'.$_POST['month'].'-'.$_POST['day']; > } Thanks Rolan, I appreciate the suggestion. For some reason that variable is not getting updating even with your suggestion. The print_r results just before the $ret = ob_get_contents(); are as follows: Array ( [ID] => test [Password] => test [birth_trial] => 1 [birthdate] => -- [year] => 1933 [month] => 01 [day] => 01 ) If I enter the input again, it works perfectly. Because it redirects to another page, it clears the $_POST array so I can't check what was in it to cause it to work? Thanks for the idea anyway. -- Best regards, mikesz mailto:mikesz at qualityadvantages.com From chsnyder at gmail.com Fri Mar 14 12:14:37 2008 From: chsnyder at gmail.com (csnyder) Date: Fri, 14 Mar 2008 12:14:37 -0400 Subject: [nycphp-talk] Splitting multi-page PDFs Message-ID: I'd like to be able to split multi-page PDFs into single pages on the server. My first choice for doing this would be a command-line tool, unless this is ridiculously easy within PHP using the PDFLib functions... but those seem more concerned with building documents rather than tearing them apart... Anyone know how to do this? -- Chris Snyder http://chxo.com/ From ashaw at polymerdb.org Fri Mar 14 12:21:13 2008 From: ashaw at polymerdb.org (Allen Shaw) Date: Fri, 14 Mar 2008 11:21:13 -0500 Subject: [nycphp-talk] Splitting multi-page PDFs In-Reply-To: References: Message-ID: <47DAA5F9.9090809@polymerdb.org> csnyder wrote: > I'd like to be able to split multi-page PDFs into single pages on the server. My best experience with this has been using convert (imagemagick) to pump them out into individual images. You have to specify the resolution and density, and in the end what you have is images, so that even if you pump them back into pdf files, the usual pdf text search features wouldn't work. I hope something better is suggested in this thread -- I'd love to see it. - Allen -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From andrew at plexpod.com Fri Mar 14 12:24:06 2008 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 14 Mar 2008 12:24:06 -0400 Subject: [nycphp-talk] Splitting multi-page PDFs In-Reply-To: References: Message-ID: <20080314162357.GH23596@desario.homelinux.net> On Fri, Mar 14, 2008 at 12:14:37PM -0400, csnyder wrote: > I'd like to be able to split multi-page PDFs into single pages on the server. > > My first choice for doing this would be a command-line tool, unless > this is ridiculously easy within PHP using the PDFLib functions... but > those seem more concerned with building documents rather than tearing > them apart... > > Anyone know how to do this? I believe the PDI functions allow you to do that. You can "import" an existing PDF or page from a PDF and place it into the doc you're constructing. HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From chsnyder at gmail.com Fri Mar 14 12:57:19 2008 From: chsnyder at gmail.com (csnyder) Date: Fri, 14 Mar 2008 12:57:19 -0400 Subject: [nycphp-talk] Splitting multi-page PDFs In-Reply-To: <47DAA5F9.9090809@polymerdb.org> References: <47DAA5F9.9090809@polymerdb.org> Message-ID: On Fri, Mar 14, 2008 at 12:21 PM, Allen Shaw wrote: > My best experience with this has been using convert (imagemagick) to > pump them out into individual images. I kind of like that approach, actually, despite the non-textiness of it. It give you the ability to display the pages alongside HTML content such as annotations and message threads. > I hope something better is suggested in this > thread -- I'd love to see it. Minutes after posting this (isn't this always the way?) I found the pdftoolkit, for which there is already a Debian package: http://www.accesspdf.com/pdftk/ Example command to split a document into pages: pdftk mydoc.pdf burst -- Chris Snyder http://chxo.com/ From ioplex at gmail.com Fri Mar 14 13:00:10 2008 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 14 Mar 2008 13:00:10 -0400 Subject: [nycphp-talk] Splitting multi-page PDFs In-Reply-To: References: Message-ID: <78c6bd860803141000h62e86289k93321b7be8037a81@mail.gmail.com> On 3/14/08, csnyder wrote: > I'd like to be able to split multi-page PDFs into single pages on the server. > > My first choice for doing this would be a command-line tool, unless > this is ridiculously easy within PHP using the PDFLib functions... but > those seem more concerned with building documents rather than tearing > them apart... > > Anyone know how to do this? Zend_Pdf from Zend Framework can import PDFs. But I've never used it so I have no idea if it can do what you want or if it's worth using. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ajai at bitblit.net Fri Mar 14 17:06:48 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 14 Mar 2008 17:06:48 -0400 (EDT) Subject: [nycphp-talk] Splitting multi-page PDFs In-Reply-To: <78c6bd860803141000h62e86289k93321b7be8037a81@mail.gmail.com> Message-ID: On Fri, 14 Mar 2008, Michael B Allen wrote: > Zend_Pdf from Zend Framework can import PDFs. But I've never used it > so I have no idea if it can do what you want or if it's worth using. Actually this should be easy to do with Zend_pdf. Loading the PDF gives you a PHP array of "PDF page" objects. Create another new PDF object and then loop through the pages of the already loaded PDF object, adding each page to the second object, writing the new PDF out (with appropriate filename), then removing the page you just added to make way for the next one. -- Aj. From nynj.tech at hotmail.com Sun Mar 16 17:46:18 2008 From: nynj.tech at hotmail.com (chad qian) Date: Sun, 16 Mar 2008 17:46:18 -0400 Subject: [nycphp-talk] a question about uploading pictures Message-ID: I will let user upload 3 pictures to the backend database first.Then these 3 pictures will be displayed on the web page later. My question is: Do I have to setup rules about uploading pictures,like the size,the pixels?I want these 3 pictures to be the same format(size,pixels..) when displayed on internet.So do I need to tell user how pictures should be when they do upload or I program php to change the properties of pictures?Of course,pictures must be visable,not too big or too small, on the web page. Thanks! chad _________________________________________________________________ Need to know the score, the latest news, or you need your Hotmail?-get your "fix". http://www.msnmobilefix.com/Default.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Sun Mar 16 18:06:10 2008 From: ramons at gmx.net (David Krings) Date: Sun, 16 Mar 2008 18:06:10 -0400 Subject: [nycphp-talk] a question about uploading pictures In-Reply-To: References: Message-ID: <47DD99D2.2080906@gmx.net> chad qian wrote: > I will let user upload 3 pictures to the backend database first.Then > these 3 pictures will be displayed on the web page later. > > My question is: > Do I have to setup rules about uploading pictures,like the size,the > pixels?I want these 3 pictures to be the same format(size,pixels..) when > displayed on internet.So do I need to tell user how pictures should be > when they do upload or I program php to change the properties of > pictures?Of course,pictures must be visable,not too big or too small, on > the web page. No, picture uploads work the same as any other file uploads and you cannot dictate image type, size, pixel depth, or such on the client side using PHP. PHP is server side only and by the time PHP has a chance to get hold of the image file it is already uploaded. There are a few checks you can put into place, such as checking for the exif headers in jpegs or checking for the magic number, which tells you of what type the file is. I once asked about this a long time ago and examples were given by fellow NYPHPlers, so you want to search for that in the archives. I never got around to implement this, but it is not forgotten. You can also look for file uploaders that were written using JavaScript or Flash, which is both client side code and may accept or reject an image file before uploading. David From tim_lists at o2group.com Sun Mar 16 18:57:39 2008 From: tim_lists at o2group.com (Tim Lieberman) Date: Sun, 16 Mar 2008 16:57:39 -0600 Subject: [nycphp-talk] a question about uploading pictures In-Reply-To: References: Message-ID: <47DDA5E3.3080706@o2group.com> You have options, of course. As David said in his reply -- to do this in PHP, you'll need to get the file onto the server before doing any checking/fixing. Assuming you're already familiar with php file uploading, you can start here: http://www.php.net/gd -- gd is pretty handy. Read the docs for gd, and decide how to proceed. The easiest way for you to go is to just enforce some rules on the user. Tell the user that the files must be (for example) jpeg or png, 300 pixels wide by 300 pixels tall. Your form-processing script can inspect the files, and either accept them if they meet requirements, or display an error and tell the user to try again. However, there's really no reason you shouldn't help the user out. If you want 300x300 images, there's no reason to reject a 600-pixel-square image. You can use the gd functions to scale it down on the server. Having done this about a dozen times with different rules, I can warn you up front -- give yourself plenty of time to implement this -- and do your best to think through your requirements and how to approach enforcing them before you start to code. There are lots of decisions you'll need to make. HTH -Tim chad qian wrote: > I will let user upload 3 pictures to the backend database first.Then > these 3 pictures will be displayed on the web page later. > > My question is: > Do I have to setup rules about uploading pictures,like the size,the > pixels?I want these 3 pictures to be the same format(size,pixels..) > when displayed on internet.So do I need to tell user how pictures > should be when they do upload or I program php to change the > properties of pictures?Of course,pictures must be visable,not too big > or too small, on the web page. > > Thanks! > > chad > > ------------------------------------------------------------------------ > Need to know the score, the latest news, or you need your Hotmail?-get > your "fix". Check it out. > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From mikesz at qualityadvantages.com Sun Mar 16 22:05:19 2008 From: mikesz at qualityadvantages.com (mikesz at qualityadvantages.com) Date: Mon, 17 Mar 2008 10:05:19 +0800 Subject: [nycphp-talk] a question about uploading pictures In-Reply-To: References: Message-ID: <1386688669.20080317100519@qualityadvantages.com> An HTML attachment was scrubbed... URL: From suzerain at suzerain.com Mon Mar 17 14:34:20 2008 From: suzerain at suzerain.com (Marc Antony Vose) Date: Tue, 18 Mar 2008 02:34:20 +0800 Subject: [nycphp-talk] safari and sessions? In-Reply-To: References: <20070701.215701.25801.0@webmail14.dca.untd.com> Message-ID: <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> Hi there: At the moment, I'm only speculating as to the cause of my problem, but I operate an online store, and we have a custom-built cart (which is complex, and so could therefore have issues in any number of places that I can't explain here), but we've got a new and problematic trend. The trend is that some of our carts are ending up with information missing (inventories of items, specifically)...but the thing is, it seems to be happening only to Safari users. This is a store that's been live for almost 4 years, and we've had our share of bugs here and there, but generally it's been functioning properly. This is new, and I just am at this point thinking it has something to do with the proliferation of Safari 3.x, although I haven't definitively concluded this yet. I should point out that I use OS X, and so Safari is often my primary test browser, and I can't actually replicate any of the problems users are reporting to us, but it seems that every one that is reporting a problem is a Safari user, so there's something fishy going on somewhere. Is anyone aware of any subtle changes in Safari 3 that could cause problems with maintaining sessions or cookies? Thanks for any insight. Cheers, Marc From chsnyder at gmail.com Mon Mar 17 15:26:54 2008 From: chsnyder at gmail.com (csnyder) Date: Mon, 17 Mar 2008 15:26:54 -0400 Subject: [nycphp-talk] safari and sessions? In-Reply-To: <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> Message-ID: On Mon, Mar 17, 2008 at 2:34 PM, Marc Antony Vose wrote: > Is anyone aware of any subtle changes in Safari 3 that could cause > problems with maintaining sessions or cookies? Have you tested with the "private browsing" feature turned on? Doesn't seem a likely culprit but maybe some people have it enabled all the time... -- Chris Snyder http://chxo.com/ From brenttech at gmail.com Mon Mar 17 15:48:15 2008 From: brenttech at gmail.com (Brent Baisley) Date: Mon, 17 Mar 2008 15:48:15 -0400 Subject: [nycphp-talk] safari and sessions? In-Reply-To: <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> Message-ID: <5d515c620803171248q110b84c6ra322042940514d37@mail.gmail.com> My first thought is that perhaps users are coming to your site with Private Browsing turned on. Sessions and cookie would then not be maintained across sessions. Although this should not be a problem as long as you are creating a new session/cookie after the user logs in. If Safari is working for you, I tend to think it would be an extra setting that is enabled. This should be easy enough to test though. I use Safari on both Mac and Windows and never had a problem with shopping carts on the big etailers. Brent On Mon, Mar 17, 2008 at 2:34 PM, Marc Antony Vose wrote: > Hi there: > > At the moment, I'm only speculating as to the cause of my problem, but > I operate an online store, and we have a custom-built cart (which is > complex, and so could therefore have issues in any number of places > that I can't explain here), but we've got a new and problematic trend. > > The trend is that some of our carts are ending up with information > missing (inventories of items, specifically)...but the thing is, it > seems to be happening only to Safari users. This is a store that's > been live for almost 4 years, and we've had our share of bugs here and > there, but generally it's been functioning properly. This is new, and > I just am at this point thinking it has something to do with the > proliferation of Safari 3.x, although I haven't definitively concluded > this yet. > > I should point out that I use OS X, and so Safari is often my primary > test browser, and I can't actually replicate any of the problems users > are reporting to us, but it seems that every one that is reporting a > problem is a Safari user, so there's something fishy going on somewhere. > > Is anyone aware of any subtle changes in Safari 3 that could cause > problems with maintaining sessions or cookies? > > Thanks for any insight. > > Cheers, > > Marc > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From jcampbell1 at gmail.com Mon Mar 17 15:50:03 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 17 Mar 2008 15:50:03 -0400 Subject: [nycphp-talk] safari and sessions? In-Reply-To: <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> Message-ID: <8f0676b40803171250l705043dbi847cf89a7c1a7d4e@mail.gmail.com> > Is anyone aware of any subtle changes in Safari 3 that could cause > problems with maintaining sessions or cookies? Safari has a default cookie policy of "only allow cookies for sites I navigate to". As far as I know, this is unique to Safari. This boils down to only allowing HTTP cookies to be set by the page in the address bar. My guess is that your session cookie ids are getting created/regenerated on pages with 301/302 redirects or on pages inside a frame and Safari is rejecting the cookies. Check the preferences on our test computer and make sure your cookie policy is set to the default. John Campbell From ramons at gmx.net Mon Mar 17 15:56:12 2008 From: ramons at gmx.net (David Krings) Date: Mon, 17 Mar 2008 15:56:12 -0400 Subject: [nycphp-talk] safari and sessions? In-Reply-To: <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> Message-ID: <47DECCDC.5030707@gmx.net> Marc Antony Vose wrote: > Is anyone aware of any subtle changes in Safari 3 that could cause > problems with maintaining sessions or cookies? Well, is it an Apple Safari or a Windows Safari browser? The Windows version is in beta since forever and doesn't seem to get much attention from Apple. Maybe you are looking at issues that people have with this half-baked zombie. David From felix.shnir at gmail.com Mon Mar 17 15:57:50 2008 From: felix.shnir at gmail.com (Felix Shnir) Date: Mon, 17 Mar 2008 15:57:50 -0400 Subject: [nycphp-talk] safari and sessions? In-Reply-To: <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> Message-ID: Well, dunno if this is going to be very helpful, but Safari tends to chew on cookies if it crashes... http://www.37signals.com/svn/posts/891-safari-why-must-you-be-such-a-cookie-monster Felix. On Mon, Mar 17, 2008 at 2:34 PM, Marc Antony Vose wrote: > Hi there: > > At the moment, I'm only speculating as to the cause of my problem, but > I operate an online store, and we have a custom-built cart (which is > complex, and so could therefore have issues in any number of places > that I can't explain here), but we've got a new and problematic trend. > > The trend is that some of our carts are ending up with information > missing (inventories of items, specifically)...but the thing is, it > seems to be happening only to Safari users. This is a store that's > been live for almost 4 years, and we've had our share of bugs here and > there, but generally it's been functioning properly. This is new, and > I just am at this point thinking it has something to do with the > proliferation of Safari 3.x, although I haven't definitively concluded > this yet. > > I should point out that I use OS X, and so Safari is often my primary > test browser, and I can't actually replicate any of the problems users > are reporting to us, but it seems that every one that is reporting a > problem is a Safari user, so there's something fishy going on somewhere. > > Is anyone aware of any subtle changes in Safari 3 that could cause > problems with maintaining sessions or cookies? > > Thanks for any insight. > > Cheers, > > Marc > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 suzerain at suzerain.com Mon Mar 17 16:31:18 2008 From: suzerain at suzerain.com (Marc Antony Vose) Date: Tue, 18 Mar 2008 04:31:18 +0800 Subject: [nycphp-talk] safari and sessions? In-Reply-To: <47DECCDC.5030707@gmx.net> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> <47DECCDC.5030707@gmx.net> Message-ID: These issues appear to not be platform-specific. Because we cater to designers and creative types, we have a disproportionately higher percentage of Mac users than, say, amazon or eBay probably do. I've had some of our customers submit info to me, and I can see that the browser strings are OS X versions of Safari. I'm looking into the private browsing thing. It would be a convenient answer, since it's not a feature I use by default, and I'm not seeing the problems and other people are, but we'll see. Marc Le 18 mars 08 ? 03:56, David Krings a ?crit : > Marc Antony Vose wrote: >> Is anyone aware of any subtle changes in Safari 3 that could cause >> problems with maintaining sessions or cookies? > > Well, is it an Apple Safari or a Windows Safari browser? The Windows > version is in beta since forever and doesn't seem to get much > attention from Apple. Maybe you are looking at issues that people > have with this half-baked zombie. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From rmarscher at beaffinitive.com Tue Mar 18 15:20:55 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 18 Mar 2008 15:20:55 -0400 Subject: [nycphp-talk] safari and sessions? In-Reply-To: References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> <47DECCDC.5030707@gmx.net> Message-ID: <59BA2EFA-388A-4660-A8C4-F994DC314CBF@beaffinitive.com> One other possibility... do you use browser user-agents as part of your session security? And if so, do you have rss feeds? I found that the Safari RSS reader and Mail app share cookies with Safari itself but use different user-agent strings. I had to throw user- agents out of the session security equation because of cases like this. From rmarscher at beaffinitive.com Tue Mar 18 16:16:47 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 18 Mar 2008 16:16:47 -0400 Subject: [nycphp-talk] best practice for detecting ip Message-ID: <234DCD7F-0E69-499F-A442-8461AA2A8965@beaffinitive.com> Hey everyone, Does someone know the best practice for detecting ip addresses with php/apache for use in reporting/metrics? I'm re-evaluating our code for detecting ips and I see it's built towards getting a unique browser ip without regard for how easily it can be spoofed. For example, we're using X-FORWARDED-FOR which I know can be very easily spoofed by proxy servers so it should only be done with trusted proxies like AOL. Does anyone know where to find a good list of ips of trusted proxies (as well as maybe a list of known anonymous proxy servers)? Also, is there any reason to use HTTP_CLIENT_IP? The current code we have looks to use that first if it's available. But I'm not exactly sure the difference between that header and REMOTE_ADDR. Thanks a lot, Rob From anoland at indigente.net Tue Mar 18 18:29:33 2008 From: anoland at indigente.net (Adrian Noland) Date: Tue, 18 Mar 2008 18:29:33 -0400 Subject: [nycphp-talk] SOAP error Message-ID: <1d8a0e930803181529x6507cc04l8e0dc214c83aec3c@mail.gmail.com> Hello everybody, Can anybody help me figure out this error: Fatal error: SOAP-ERROR: Encoding: External reference 'ref1' in /var/www/www-trunk/intranet/soap.php on line 21 The only reference I found is on bugs.php.net: http://bugs.php.net/bug.php?id=41566 which says it is fixed in CVS. I tried the same on both 5.2.3 and 5.2.4 with the same results. This is a showstopper for a project I'm on so any input will be appreciated. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From suzerain at suzerain.com Tue Mar 18 18:46:27 2008 From: suzerain at suzerain.com (Marc Antony Vose) Date: Wed, 19 Mar 2008 06:46:27 +0800 Subject: [nycphp-talk] safari and sessions? In-Reply-To: <59BA2EFA-388A-4660-A8C4-F994DC314CBF@beaffinitive.com> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> <47DECCDC.5030707@gmx.net> <59BA2EFA-388A-4660-A8C4-F994DC314CBF@beaffinitive.com> Message-ID: <28460CCF-7547-45DC-A9DF-E975C95A99ED@suzerain.com> Wow... That's not causing my issue here, but that's very good information to know. Thanks, Marc Le 19 mars 08 ? 03:20, Rob Marscher a ?crit : > One other possibility... do you use browser user-agents as part of > your session security? And if so, do you have rss feeds? I found > that the Safari RSS reader and Mail app share cookies with Safari > itself but use different user-agent strings. I had to throw user- > agents out of the session security equation because of cases like > this. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Wed Mar 19 12:16:34 2008 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Wed, 19 Mar 2008 12:16:34 -0400 Subject: [nycphp-talk] safari and sessions? In-Reply-To: <59BA2EFA-388A-4660-A8C4-F994DC314CBF@beaffinitive.com> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> <47DECCDC.5030707@gmx.net> <59BA2EFA-388A-4660-A8C4-F994DC314CBF@beaffinitive.com> Message-ID: <330532b60803190916w4a8ccf3fhb5f37d67ff5fcaf1@mail.gmail.com> On Tue, Mar 18, 2008 at 3:20 PM, Rob Marscher wrote: > One other possibility... do you use browser user-agents as part of > your session security? And if so, do you have rss feeds? I found > that the Safari RSS reader and Mail app share cookies with Safari > itself but use different user-agent strings. I had to throw user- > agents out of the session security equation because of cases like this. Crap. Totally unrelated to this thread, but still, crap. -- Mitch slaps forehead, goes back under the hood From chsnyder at gmail.com Wed Mar 19 13:03:42 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 19 Mar 2008 13:03:42 -0400 Subject: [nycphp-talk] safari and sessions? In-Reply-To: <330532b60803190916w4a8ccf3fhb5f37d67ff5fcaf1@mail.gmail.com> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> <47DECCDC.5030707@gmx.net> <59BA2EFA-388A-4660-A8C4-F994DC314CBF@beaffinitive.com> <330532b60803190916w4a8ccf3fhb5f37d67ff5fcaf1@mail.gmail.com> Message-ID: Rob Marscher wrote: > I found that the Safari RSS reader and Mail app share cookies with Safari > itself but use different user-agent strings. That sounds like a bug / vulnerability to me. Why does Mail.app need my cookies? Also, that implies that _any_ app using WebKit for rendering is going to share cookies, and that should definitely not be the case. Ew. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Wed Mar 19 13:22:15 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 19 Mar 2008 13:22:15 -0400 Subject: [nycphp-talk] safari and sessions? In-Reply-To: References: <20070701.215701.25801.0@webmail14.dca.untd.com> <02CE988F-58C1-440E-99E9-B4C6B5FFF5E7@suzerain.com> <47DECCDC.5030707@gmx.net> <59BA2EFA-388A-4660-A8C4-F994DC314CBF@beaffinitive.com> <330532b60803190916w4a8ccf3fhb5f37d67ff5fcaf1@mail.gmail.com> Message-ID: On Wed, Mar 19, 2008 at 1:03 PM, csnyder wrote: > > Also, that implies that _any_ app using WebKit for rendering is going > to share cookies, and that should definitely not be the case. Ew. ... and that is exactly what happens, even when using Fluid.app browsers that are supposed to be isolated from Safari. Session cookies are not shared (thanks for that) but stored cookies are. That means most other Mac apps that display HTML, including Dashboard widgets and newsreaders, share cookies with Safari. -- Chris Snyder http://chxo.com/ From paulcheung at tiscali.co.uk Wed Mar 19 16:40:06 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Wed, 19 Mar 2008 20:40:06 -0000 Subject: [nycphp-talk] PHP, Browser or MySQL Problem Message-ID: <001301c88a01$6ac98050$0300a8c0@X9183> Has anybody run across this before? I am using three different browsers to test the same PHP scripts and MySQL database. The application's scripts work by sharing/passing SESSIONS variables. Here is the problem, in one browser (Explorer) all works as expected and the session variable named $_SESSION['access'] retains its integrity However in the other two browsers (Firefox & Opera) the $_SESSION['access'] variable is corrupted - set to null It just doesn't make any sense, this session variable is filled in once after user validation and from then on it is a read only session variable, why works in one browser and not the others. all three browsers access the the same scripts and same database. I have really racked my brains on this one - Can anybody point me in the right direction? Paul From matt at atopia.net Wed Mar 19 16:48:38 2008 From: matt at atopia.net (Matt Juszczak) Date: Wed, 19 Mar 2008 16:48:38 -0400 (EDT) Subject: [nycphp-talk] PHP, Browser or MySQL Problem In-Reply-To: <001301c88a01$6ac98050$0300a8c0@X9183> References: <001301c88a01$6ac98050$0300a8c0@X9183> Message-ID: <20080319164817.C54076@mercury.atopia.net> Most likely a cookies issue. Are cookies turned on in one browser but not in another? Configured differently? On Wed, 19 Mar 2008, PaulCheung wrote: > Has anybody run across this before? > > > > I am using three different browsers to test the same PHP scripts and MySQL > database. The application's scripts work by sharing/passing SESSIONS > variables. > > > > Here is the problem, in one browser (Explorer) all works as expected and the > session variable named $_SESSION['access'] retains its integrity However in > the other two browsers (Firefox & Opera) the $_SESSION['access'] variable is > corrupted - set to null > > > > It just doesn't make any sense, this session variable is filled in once > after user validation and from then on it is a read only session variable, > why works in one browser and not the others. all three browsers access the > the same scripts and same database. > > > > I have really racked my brains on this one - Can anybody point me in the > right direction? > > > > 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 > > > !DSPAM:47e17a29536885368818224! > From tom at supertom.com Wed Mar 19 17:26:17 2008 From: tom at supertom.com (Tom Melendez) Date: Wed, 19 Mar 2008 14:26:17 -0700 Subject: [nycphp-talk] PHP, Browser or MySQL Problem In-Reply-To: <20080319164817.C54076@mercury.atopia.net> References: <001301c88a01$6ac98050$0300a8c0@X9183> <20080319164817.C54076@mercury.atopia.net> Message-ID: <117286890803191426i79ad312fw68b7fbfc4ee14ca3@mail.gmail.com> Since you've said they all access the same scripts, I'll assume that there is no instances of redirection or function calls based on browser, then? Can you pinpoint where it is that you are losing the session var (which page)? Have you looked at the sites with Live Headers (FF) and Fiddler (IE) to examine the cookies as Matt suggested? Tom http://www.liphp.org On Wed, Mar 19, 2008 at 1:48 PM, Matt Juszczak wrote: > Most likely a cookies issue. > > Are cookies turned on in one browser but not in another? Configured > differently? > > > > On Wed, 19 Mar 2008, PaulCheung wrote: > > > Has anybody run across this before? > > > > > > > > I am using three different browsers to test the same PHP scripts and MySQL > > database. The application's scripts work by sharing/passing SESSIONS > > variables. > > > > > > > > Here is the problem, in one browser (Explorer) all works as expected and the > > session variable named $_SESSION['access'] retains its integrity However in > > the other two browsers (Firefox & Opera) the $_SESSION['access'] variable is > > corrupted - set to null > > > > > > > > It just doesn't make any sense, this session variable is filled in once > > after user validation and from then on it is a read only session variable, > > why works in one browser and not the others. all three browsers access the > > the same scripts and same database. > > > > > > > > I have really racked my brains on this one - Can anybody point me in the > > right direction? > > > > > > > > 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 > > > > > > !DSPAM:47e17a29536885368818224! > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 leam at reuel.net Wed Mar 19 21:09:53 2008 From: leam at reuel.net (leam) Date: Wed, 19 Mar 2008 21:09:53 -0400 Subject: [nycphp-talk] Distance PHP training? Message-ID: <1205975393.2853.4.camel@leam> O'Reilly has their PHP and MySQL training. I have a work sponsored business re-imbursement of $250 twice per year for training (staggeringly big budget, eh?). Anyone know of any other PHP training I can look at that's delivered over a distance? O'Reilly: http://www.oreillyschool.com/courses/php-sql-programming.php Leam From anoland at indigente.net Thu Mar 20 09:37:58 2008 From: anoland at indigente.net (anoland at indigente.net) Date: Thu, 20 Mar 2008 06:37:58 -0700 (PDT) Subject: [nycphp-talk] PHP, Browser or MySQL Problem Message-ID: <3288850638.904657@smtp.gmail.com> Paul, When setting your cookies, try setting all params, including domain & path. I've come across instances similar to yours that were fixed by setting everything. Adrian -----Original Message----- From: "PaulCheung" Date: Wednesday, Mar 19, 2008 4:40 pm Subject: [nycphp-talk] PHP, Browser or MySQL Problem To: Reply-To: NYPHP Talk Has anybody run across this before? > > > >I am using three different browsers to test the same PHP scripts and MySQL >database. The application's scripts work by sharing/passing SESSIONS >variables. > > > >Here is the problem, in one browser (Explorer) all works as expected and the >session variable named $_SESSION['access'] retains its integrity However in >the other two browsers (Firefox & Opera) the $_SESSION['access'] variable is >corrupted - set to null > > > >It just doesn't make any sense, this session variable is filled in once >after user validation and from then on it is a read only session variable, >why works in one browser and not the others. all three browsers access the >the same scripts and same database. > > > >I have really racked my brains on this one - Can anybody point me in the >right direction? > > > >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 Thu Mar 20 11:39:17 2008 From: tedd at sperling.com (tedd) Date: Thu, 20 Mar 2008 11:39:17 -0400 Subject: [nycphp-talk] Distance PHP training? In-Reply-To: <1205975393.2853.4.camel@leam> References: <1205975393.2853.4.camel@leam> Message-ID: At 9:09 PM -0400 3/19/08, leam wrote: >O'Reilly has their PHP and MySQL training. I have a work sponsored >business re-imbursement of $250 twice per year for training >(staggeringly big budget, eh?). Anyone know of any other PHP training I >can look at that's delivered over a distance? > >O'Reilly: http://www.oreillyschool.com/courses/php-sql-programming.php > >Leam Answering/asking questions on this list is distance training -- and it's free. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From codebowl at gmail.com Thu Mar 20 11:47:49 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 20 Mar 2008 11:47:49 -0400 Subject: [nycphp-talk] Distance PHP training? In-Reply-To: References: <1205975393.2853.4.camel@leam> Message-ID: <9972878F-C68E-4D4C-9289-FEEFA9CB6166@gmail.com> tedd, check out zend's courses on www.zend.com On Mar 20, 2008, at 11:39 AM, tedd wrote: > At 9:09 PM -0400 3/19/08, leam wrote: >> O'Reilly has their PHP and MySQL training. I have a work sponsored >> business re-imbursement of $250 twice per year for training >> (staggeringly big budget, eh?). Anyone know of any other PHP >> training I >> can look at that's delivered over a distance? >> >> O'Reilly: http://www.oreillyschool.com/courses/php-sql-programming.php >> >> Leam > > > Answering/asking questions on this list is distance training -- and > it's free. > > Cheers, > > tedd > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From codebowl at gmail.com Thu Mar 20 11:49:00 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 20 Mar 2008 11:49:00 -0400 Subject: [nycphp-talk] Distance PHP training? In-Reply-To: References: <1205975393.2853.4.camel@leam> Message-ID: Tedd, I have taken both oreilly and zend's courses (not the php one for oreilly) and I must say that Zend is a much better way to learn. From leam at reuel.net Thu Mar 20 20:39:46 2008 From: leam at reuel.net (leam) Date: Thu, 20 Mar 2008 20:39:46 -0400 Subject: [nycphp-talk] Distance PHP training? In-Reply-To: References: <1205975393.2853.4.camel@leam> Message-ID: <1206059986.2909.0.camel@leam> On Thu, 2008-03-20 at 11:39 -0400, tedd wrote: > At 9:09 PM -0400 3/19/08, leam wrote: > >O'Reilly has their PHP and MySQL training. I have a work sponsored > >business re-imbursement of $250 twice per year for training > >(staggeringly big budget, eh?). Anyone know of any other PHP training I > >can look at that's delivered over a distance? > > > >O'Reilly: http://www.oreillyschool.com/courses/php-sql-programming.php > > > >Leam > > > Answering/asking questions on this list is distance training -- and it's free. > > Cheers, > > tedd If I could figure out how to have work pay for it, you betcha! Leam From ramons at gmx.net Thu Mar 20 21:38:07 2008 From: ramons at gmx.net (David Krings) Date: Thu, 20 Mar 2008 21:38:07 -0400 Subject: [nycphp-talk] OT: IBM servers Message-ID: <47E3117F.2060908@gmx.net> Hi! Does anyone of you know more about IBM servers than I do? I bought two for dirt cheap. One is a 325 and it works great. And the other one is a 235 and acting a bit up. I bought them as study objects to learn what this server stuff is all about, but getting the box to work first is a plus. Feel free to contact me off list or not at all. Thanks in advance, David From lists at zaunere.com Fri Mar 21 14:15:40 2008 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 21 Mar 2008 14:15:40 -0400 Subject: [nycphp-talk] PHP Wiki Message-ID: <002901c88b7f$92e1acf0$b8a506d0$@com> Hello all, As an FYI, I want to mention the new Wiki at PHP.net: http://wiki.php.net/ It's still new and undergoing development, but certainly something to watch. --- Hans Zaunere / President / New York PHP www.nyphp.org / ?www.nyphp.com From dorgan at donaldorgan.com Fri Mar 21 14:49:46 2008 From: dorgan at donaldorgan.com (Donald J Organ IV) Date: Fri, 21 Mar 2008 14:49:46 -0400 Subject: [nycphp-talk] SAomething on nyphp.com website Message-ID: <47E4034A.60509@donaldorgan.com> An HTML attachment was scrubbed... URL: From paulcheung at tiscali.co.uk Fri Mar 21 16:35:56 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Fri, 21 Mar 2008 20:35:56 -0000 Subject: [nycphp-talk] PHP, Browser or MySQL Problem References: <3288850638.904657@smtp.gmail.com> Message-ID: <000401c88b93$313ddb90$0300a8c0@X9183> Thanks Everybody for all your help Paul ----- Original Message ----- From: To: Sent: Thursday, March 20, 2008 1:37 PM Subject: Re: [nycphp-talk] PHP, Browser or MySQL Problem > Paul, > When setting your cookies, try setting all params, including domain & > path. I've come across instances similar to yours that were fixed by > setting everything. > > Adrian > -----Original Message----- > From: "PaulCheung" > Date: Wednesday, Mar 19, 2008 4:40 pm > Subject: [nycphp-talk] PHP, Browser or MySQL Problem > To: Reply-To: NYPHP Talk > > Has anybody run across this before? >> >> >> >>I am using three different browsers to test the same PHP scripts and MySQL >>database. The application's scripts work by sharing/passing SESSIONS >>variables. >> >> >> >>Here is the problem, in one browser (Explorer) all works as expected and >>the >>session variable named $_SESSION['access'] retains its integrity However >>in >>the other two browsers (Firefox & Opera) the $_SESSION['access'] variable >>is >>corrupted - set to null >> >> >> >>It just doesn't make any sense, this session variable is filled in once >>after user validation and from then on it is a read only session variable, >>why works in one browser and not the others. all three browsers access the >>the same scripts and same database. >> >> >> >>I have really racked my brains on this one - Can anybody point me in the >>right direction? >> >> >> >>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 leam at reuel.net Fri Mar 21 17:39:24 2008 From: leam at reuel.net (leam) Date: Fri, 21 Mar 2008 17:39:24 -0400 Subject: [nycphp-talk] PHP Wiki In-Reply-To: <002901c88b7f$92e1acf0$b8a506d0$@com> References: <002901c88b7f$92e1acf0$b8a506d0$@com> Message-ID: <1206135564.2856.6.camel@leam> Perfect timing, I had an idea about the training question. :) I'm going off the hopeful assumption that I'm not the only wanna-be programmer that has a hard time making the leap from reading a book to production code. One of the things I think would help is a set of 10-15 workbook type exercises that are explained elsewhere. The use of controlled challenges should help me and hopefully others like me grow our programming skills. So my thought would be to coordinate. We pick a PHP book and come up with a series of workbook type questions for each chapter of the book. Folks can come to the NYPHP list for deeper explinations. The "challenge" of the questions can be graduated by the book's intended audience and by the particular chapter. Later chapters can include material from the previous chapters, etc. Does this sound like a reasonable idea and what would the challenges be? Leam On Fri, 2008-03-21 at 14:15 -0400, Hans Zaunere wrote: > Hello all, > > As an FYI, I want to mention the new Wiki at PHP.net: > > http://wiki.php.net/ > > It's still new and undergoing development, but certainly something to watch. From dorgan at donaldorgan.com Fri Mar 21 17:44:12 2008 From: dorgan at donaldorgan.com (Donald J Organ IV) Date: Fri, 21 Mar 2008 17:44:12 -0400 Subject: [nycphp-talk] PHP Wiki In-Reply-To: <1206135564.2856.6.camel@leam> References: <002901c88b7f$92e1acf0$b8a506d0$@com> <1206135564.2856.6.camel@leam> Message-ID: <47E42C2C.7000702@donaldorgan.com> An HTML attachment was scrubbed... URL: From leam at reuel.net Fri Mar 21 17:51:37 2008 From: leam at reuel.net (leam) Date: Fri, 21 Mar 2008 17:51:37 -0400 Subject: [nycphp-talk] PHP Wiki In-Reply-To: <47E42C2C.7000702@donaldorgan.com> References: <002901c88b7f$92e1acf0$b8a506d0$@com> <1206135564.2856.6.camel@leam> <47E42C2C.7000702@donaldorgan.com> Message-ID: <1206136297.2856.9.camel@leam> Nothing. However, I wasn't aware the Wiki was restricted to Dev as Hans didn't mention that in the note. Leam On Fri, 2008-03-21 at 17:44 -0400, Donald J Organ IV wrote: > What does this have to do with the PHP Development Wiki?? > > > leam wrote: > > Perfect timing, I had an idea about the training question. :) From lists at zaunere.com Sat Mar 22 10:26:33 2008 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 22 Mar 2008 10:26:33 -0400 Subject: [nycphp-talk] SAomething on nyphp.com website In-Reply-To: <47E4034A.60509@donaldorgan.com> References: <47E4034A.60509@donaldorgan.com> Message-ID: <028801c88c28$bacf08d0$306d1a70$@com> > I was just looking on the NYPHP.com website and noticed one of the > products listed is pFork, is this product opensource?? If so where They are now... > would i find the code? Attached; pDaemonize() to become a daemon process. pFork() to fork out external processes. There are some other variations that work better in different environments, but this is good for general purpose stuff. H -------------- next part -------------- A non-text attachment was scrubbed... Name: pfork.pcom Type: application/octet-stream Size: 1470 bytes Desc: not available URL: From ken at secdat.com Sat Mar 22 16:47:18 2008 From: ken at secdat.com (Kenneth Downs) Date: Sat, 22 Mar 2008 16:47:18 -0400 Subject: [nycphp-talk] [ANNOUNCE] Andromeda demo (finally) available Message-ID: <47E57056.70104@secdat.com> Well, we've (finally) got a fully functional public demo of Andromeda out there: http://www.andromeda-project.org/demo It is the start of a basic accounting system, with about a dozen tables populated with test data. Feel free to insert, delete, etc. The entire app has only 5 source files, and you can view them right after logging in. The largest of course is the bookkeep.dd.yaml file, the heart of the whole 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 From lists at zaunere.com Mon Mar 24 09:25:15 2008 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 24 Mar 2008 09:25:15 -0400 Subject: [nycphp-talk] PHP Argentina Message-ID: <010d01c88db2$7f1225d0$7d367170$@com> All, I'd like to quickly announce the formation of PHP Argentina. http://www.php-ar.com.ar They're just starting out, so if you or anyone you know is in that area, please help spread the word. --- Hans Zaunere / President / New York PHP www.nyphp.org / ?www.nyphp.com From nynj.tech at hotmail.com Mon Mar 24 16:04:43 2008 From: nynj.tech at hotmail.com (chad qian) Date: Mon, 24 Mar 2008 16:04:43 -0400 Subject: [nycphp-talk] one question about resize the image Message-ID: I run php to upload/resize images now.But I have one question: After people upload images, if we want to resize the image,we must maintain the original aspect ratio. This prevents the image from being "stretched" or "squashed". Now people upload two images.And I need to resize these two images 1) "1.jpg" 40*50 2) "2.jpg" 10*20 My thought:(size is height and width here) "1.jpg" or "2.jpg" will be "stretched" or "squashed" if we keep them as same size. "1.jpg" and "2.jpg" will maintain the original aspect ratio but different size Is it right? Thanks! chad _________________________________________________________________ Watch ?Cause Effect,? a show about real people making a real difference. Learn more. http://im.live.com/Messenger/IM/MTV/?source=text_watchcause -------------- next part -------------- An HTML attachment was scrubbed... URL: From dorgan at donaldorgan.com Mon Mar 24 16:17:01 2008 From: dorgan at donaldorgan.com (Donald J Organ IV) Date: Mon, 24 Mar 2008 16:17:01 -0400 Subject: [nycphp-talk] one question about resize the image In-Reply-To: References: Message-ID: <47E80C3D.3080309@donaldorgan.com> An HTML attachment was scrubbed... URL: From ken at secdat.com Mon Mar 24 16:23:10 2008 From: ken at secdat.com (Kenneth Downs) Date: Mon, 24 Mar 2008 16:23:10 -0400 Subject: [nycphp-talk] one question about resize the image In-Reply-To: <47E80C3D.3080309@donaldorgan.com> References: <47E80C3D.3080309@donaldorgan.com> Message-ID: <47E80DAE.3030804@secdat.com> I think there is a call to get image stats without loading it into memory. Donald J Organ IV wrote: > The best way to do this and keep the same scale is, a quick example of > this would be; > > $maxWidth = 100; > $maxHeight = 100; > > $im = imagecreatefromjpeg( 'path/to/file' ); //This of course would > be for a jpeg > > $scale = min(100/imagesx( $im ), 100/imagesy($im) ); > $newHeight = $scale * imagesy( $im ); > $newWidth = $scale * imagesx( $im ); > > those will give you the new height and width(to scale); > > > > chad qian wrote: >> I run php to upload/resize images now.But I have one question: >> >> After people upload images, if we want to resize the image,we must >> maintain the original aspect ratio. This prevents the image from >> being "stretched" or "squashed". >> >> Now people upload two images.And I need to resize these two images >> 1) "1.jpg" 40*50 >> 2) "2.jpg" 10*20 >> >> My thought:(size is height and width here) >> "1.jpg" or "2.jpg" will be "stretched" or "squashed" if we keep them >> as same size. >> "1.jpg" and "2.jpg" will maintain the original aspect ratio but >> different size >> >> Is it right? >> >> Thanks! >> >> chad >> >> >> ------------------------------------------------------------------------ >> Watch ?Cause Effect,? a show about real people making a real >> difference. Learn more. >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Mon Mar 24 16:28:12 2008 From: chsnyder at gmail.com (csnyder) Date: Mon, 24 Mar 2008 16:28:12 -0400 Subject: [nycphp-talk] one question about resize the image In-Reply-To: <47E80DAE.3030804@secdat.com> References: <47E80C3D.3080309@donaldorgan.com> <47E80DAE.3030804@secdat.com> Message-ID: http://php.net/getimagesize On Mon, Mar 24, 2008 at 4:23 PM, Kenneth Downs wrote: > > I think there is a call to get image stats without loading it into memory. > > > From dorgan at donaldorgan.com Mon Mar 24 16:28:47 2008 From: dorgan at donaldorgan.com (Donald J Organ IV) Date: Mon, 24 Mar 2008 16:28:47 -0400 Subject: [nycphp-talk] one question about resize the image In-Reply-To: <47E80DAE.3030804@secdat.com> References: <47E80C3D.3080309@donaldorgan.com> <47E80DAE.3030804@secdat.com> Message-ID: <47E80EFF.6080407@donaldorgan.com> An HTML attachment was scrubbed... URL: From ken at secdat.com Mon Mar 24 16:36:03 2008 From: ken at secdat.com (Kenneth Downs) Date: Mon, 24 Mar 2008 16:36:03 -0400 Subject: [nycphp-talk] one question about resize the image In-Reply-To: <47E80EFF.6080407@donaldorgan.com> References: <47E80C3D.3080309@donaldorgan.com> <47E80DAE.3030804@secdat.com> <47E80EFF.6080407@donaldorgan.com> Message-ID: <47E810B3.2070309@secdat.com> yeah I guess not everybody is running linux.... Donald J Organ IV wrote: > yess but you will have to load the image into memory anyway to create > the alternate sizes. > > Kenneth Downs wrote: >> I think there is a call to get image stats without loading it into >> memory. >> >> Donald J Organ IV wrote: >>> The best way to do this and keep the same scale is, a quick example >>> of this would be; >>> >>> $maxWidth = 100; >>> $maxHeight = 100; >>> >>> $im = imagecreatefromjpeg( 'path/to/file' ); //This of course would >>> be for a jpeg >>> >>> $scale = min(100/imagesx( $im ), 100/imagesy($im) ); >>> $newHeight = $scale * imagesy( $im ); >>> $newWidth = $scale * imagesx( $im ); >>> >>> those will give you the new height and width(to scale); >>> >>> >>> >>> chad qian wrote: >>>> I run php to upload/resize images now.But I have one question: >>>> >>>> After people upload images, if we want to resize the image,we must >>>> maintain the original aspect ratio. This prevents the image from >>>> being "stretched" or "squashed". >>>> >>>> Now people upload two images.And I need to resize these two images >>>> 1) "1.jpg" 40*50 >>>> 2) "2.jpg" 10*20 >>>> >>>> My thought:(size is height and width here) >>>> "1.jpg" or "2.jpg" will be "stretched" or "squashed" if we keep >>>> them as same size. >>>> "1.jpg" and "2.jpg" will maintain the original aspect ratio but >>>> different size >>>> >>>> Is it right? >>>> >>>> Thanks! >>>> >>>> chad >>>> >>>> >>>> ------------------------------------------------------------------------ >>>> Watch ?Cause Effect,? a show about real people making a real >>>> difference. Learn more. >>>> >>>> ------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> New York PHP Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> NYPHPCon 2006 Presentations Online >>>> http://www.nyphpcon.com >>>> >>>> Show Your Participation in New York PHP >>>> http://www.nyphp.org/show_participation.php >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> >> -- >> Kenneth Downs >> Secure Data Software, Inc. >> www.secdat.com www.andromeda-project.org >> 631-689-7200 Fax: 631-689-0527 >> cell: 631-379-0010 >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nate at cakephp.org Mon Mar 24 17:41:56 2008 From: nate at cakephp.org (Nate Abele) Date: Mon, 24 Mar 2008 17:41:56 -0400 Subject: [nycphp-talk] Re: PHP Argentina In-Reply-To: <20080324155718.2E6CE50837@mail.cakephp.org> References: <20080324155718.2E6CE50837@mail.cakephp.org> Message-ID: <9248C5C9-1AFB-40EF-9BB1-65525E8B77E0@cakephp.org> > Date: Mon, 24 Mar 2008 09:25:15 -0400 > From: "Hans Zaunere" > Subject: [nycphp-talk] PHP Argentina > To: "'NYPHP Talk'" > > All, > > I'd like to quickly announce the formation of PHP Argentina. > > http://www.php-ar.com.ar > > They're just starting out, so if you or anyone you know is in that > area, > please help spread the word. > As a self-aggrandizing follow-up, the first Spanish CakePHP conference is going to be held in Argentina the first week of December. http://es.cakefest.org/ - Nate From adlermedrado at gmail.com Mon Mar 24 17:51:44 2008 From: adlermedrado at gmail.com (Adler Medrado) Date: Mon, 24 Mar 2008 18:51:44 -0300 Subject: [nycphp-talk] PHP Argentina In-Reply-To: <010d01c88db2$7f1225d0$7d367170$@com> References: <010d01c88db2$7f1225d0$7d367170$@com> Message-ID: Hermanos, saludos desde Brasil. I hope the best for the Argentinian PHP Users Group. I am a member of the coordination board of the PHPDF, an PHP user group from Bras?lia, capital of Brazil, and one of the another coordinators is a argentinian dude from Rosario. Best regards, -- adler medrado Consultant http://www.neshertech.net/adler http://www.phpdf.org.br 2008/3/24, Hans Zaunere : > > All, > > I'd like to quickly announce the formation of PHP Argentina. > > http://www.php-ar.com.ar > > They're just starting out, so if you or anyone you know is in that area, > please help spread the word. > > > --- > Hans Zaunere / President / New York PHP > www.nyphp.org / www.nyphp.com > > > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > 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 joeleo724 at gmail.com Mon Mar 24 18:13:52 2008 From: joeleo724 at gmail.com (Joe Leo) Date: Mon, 24 Mar 2008 17:13:52 -0500 Subject: [nycphp-talk] Apache Proxy restart error Message-ID: <799abcd40803241513y1964e561ke0ac5c7434709bf6@mail.gmail.com> Hi all, I am new to the list.... I hope I could get some help with a problem getting mod_proxy working. I've installed mod_proxy on a debian etch server and enabled it and set my proxy directives per some how-to doc's... (new to linux) - All seems to have worked fine until I configured the proxy settting in directives shown below. And, When I attempt to restart apache I get this error: Forcing reload of web server (apache2)...Syntax error on line 10 of /etc/apache2/sites-enabled/MyDomain.com: Invalid ProxyPass parameter. Parameter must be in the form 'key=value' failed! Below is my Vhost settings: NameVirtualHost 192.168.100.10:80 ServerAdmin webmaster at localhost DocumentRoot /var/www/MyDomain/public_html Options FollowSymLinks AllowOverride None ProxyPass /projects/dc http://h111.MyDomain ProxyPassReverse /projects/dc http://h111.MyDomain Options Indexes FollowSymLinks MultiViews AllowOverride AuthConfig Order allow,deny allow from all # This directive allows us to have apache2's default start page # in /apache2-default/, but still have / go to the right place #RedirectMatch ^/$ /apache2-default/ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On Alias /doc/ "/usr/share/doc/" Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 Below is my Proxy.Conf settings: #turning ProxyRequests on and allowing proxying from all may allow #spammers to use your proxy to send email. ProxyRequests Off AddDefaultCharset off Order deny,allow #Deny from all Allow from all #Allow from .example.com # Define the character set for proxied FTP directory listings ProxyFtpDirCharset UTF-8 # Enable/disable the handling of HTTP/1.1 "Via:" headers. # ("Full" adds the server version; "Block" removes all outgoing Via: headers) # Set to one of: Off | On | Full | Block ProxyVia On Per the error msg reported above, I am not sure what this refers to and where to look to even try to fix: "Parameter must be in the form 'key=value'" Appreciate any comments/suggestions: Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Mon Mar 24 18:33:08 2008 From: leam at reuel.net (leam) Date: Mon, 24 Mar 2008 18:33:08 -0400 Subject: [nycphp-talk] Writing "workbook" type questions? Message-ID: <1206397989.2822.14.camel@leam> Guess the question got lost in the wiki question. Does anyone feel writing workbook type questions to help newbies bridge the gap between reading a book and being able to help in an actual project? What might some of the challenges be? Leam From wizard at wizardcomputing.com Mon Mar 24 18:56:41 2008 From: wizard at wizardcomputing.com (Francis Gulotta) Date: Mon, 24 Mar 2008 18:56:41 -0400 Subject: [nycphp-talk] RSVP Check Message-ID: <809F141A-1678-47C5-8249-418E8DFAFC3E@wizardcomputing.com> Hi everybody, I'm not sure I actually rsvped or not for tomorrows talk. (I just recently had a bad case of the flu.) I just did again (as the page says it doesn't hurt) but I fear I may be too late. Is there someone I can talk to who can check? -Francis From lists at zaunere.com Tue Mar 25 11:21:02 2008 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 25 Mar 2008 11:21:02 -0400 Subject: [nycphp-talk] FW: NYPHP Contact Inquiry Message-ID: <053701c88e8b$d6107420$82315c60$@com> All, This may be useful to some on these lists so I'm passing on the word. > Higher Education Web Symposium @ Penn > > When: July 15-16 > Where: University of Pennsylvania, Philadelphia > Focus: Usability and user centered design in the academic workplace > > Speakers: Jared Spool, Eric Meyer, Dana Chisnell, Stephanie Sullivan, > and others. > > Cost: $299 > > Website: http://www.med.upenn.edu/uiconf/ From joeleo724 at gmail.com Tue Mar 25 13:20:27 2008 From: joeleo724 at gmail.com (Joe Leo) Date: Tue, 25 Mar 2008 12:20:27 -0500 Subject: [nycphp-talk] Re: Apache Proxy restart error In-Reply-To: <799abcd40803241513y1964e561ke0ac5c7434709bf6@mail.gmail.com> References: <799abcd40803241513y1964e561ke0ac5c7434709bf6@mail.gmail.com> Message-ID: <799abcd40803251020w236d5e1cq1cab7f9cf0208178@mail.gmail.com> Hi All, Any linux/Apache guru's that can help me with problem below? I need to be able to get a mod-proxy working. Some additional info: The error problem reported in my last email only happens when I enter the following config statements in my apache Vhost setting in my conf file. ProxyPass /projects/dc http://h111.MyDomain ProxyPassReverse /projects/dc http://h111.MyDomain If I remove or uncomment the above statement apache restarts fine and works fine. I can load my site and everything seems to work. What I'm aiming to do is have my proxy service web request to other servers via the proxy. But, I need to get pass the problem. I'd be willing to pay someone for help with this. Joe On Mon, Mar 24, 2008 at 5:13 PM, Joe Leo wrote: > Hi all, I am new to the list.... I hope I could get some help with a > problem getting mod_proxy working. > I've installed mod_proxy on a debian etch server and enabled it and set my > proxy directives per some how-to doc's... (new to linux) - All seems to have > worked fine until I configured the proxy settting in directives shown below. > And, When I attempt to restart apache I get this error: > > Forcing reload of web server (apache2)...Syntax error on line 10 of > /etc/apache2/sites-enabled/MyDomain.com: > Invalid ProxyPass parameter. Parameter must be in the form 'key=value' > failed! > > Below is my Vhost settings: > > NameVirtualHost 192.168.100.10:80 > > ServerAdmin webmaster at localhost > > DocumentRoot /var/www/MyDomain/public_html > > Options FollowSymLinks > AllowOverride None > > ProxyPass /projects/dc http://h111.MyDomain > ProxyPassReverse /projects/dc http://h111.MyDomain > > > > Options Indexes FollowSymLinks MultiViews > AllowOverride AuthConfig > Order allow,deny > allow from all > # This directive allows us to have apache2's default start > page > # in /apache2-default/, but still have / go to the right > place > #RedirectMatch ^/$ /apache2-default/ > > > ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ > > AllowOverride None > Options ExecCGI -MultiViews +SymLinksIfOwnerMatch > Order allow,deny > Allow from all > > > ErrorLog /var/log/apache2/error.log > > # Possible values include: debug, info, notice, warn, error, crit, > # alert, emerg. > LogLevel warn > > CustomLog /var/log/apache2/access.log combined > ServerSignature On > > Alias /doc/ "/usr/share/doc/" > > Options Indexes MultiViews FollowSymLinks > AllowOverride None > Order deny,allow > Deny from all > Allow from 127.0.0.0/255.0.0.0 ::1/128 > > > > > > Below is my Proxy.Conf settings: > > > > #turning ProxyRequests on and allowing proxying from all may allow > #spammers to use your proxy to send email. > > > ProxyRequests Off > > > AddDefaultCharset off > Order deny,allow > #Deny from all > Allow from all > #Allow from .example.com > > # Define the character set for proxied FTP directory > listings > ProxyFtpDirCharset UTF-8 > > > # Enable/disable the handling of HTTP/1.1 "Via:" headers. > # ("Full" adds the server version; "Block" removes all outgoing > Via: headers) > # Set to one of: Off | On | Full | Block > > ProxyVia On > > > > Per the error msg reported above, I am not sure what this refers to and > where to look to even try to fix: > > "Parameter must be in the form 'key=value'" > > Appreciate any comments/suggestions: > > Joe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashaw at polymerdb.org Tue Mar 25 14:25:19 2008 From: ashaw at polymerdb.org (Allen Shaw) Date: Tue, 25 Mar 2008 13:25:19 -0500 Subject: [nycphp-talk] Re: Apache Proxy restart error In-Reply-To: <799abcd40803251020w236d5e1cq1cab7f9cf0208178@mail.gmail.com> References: <799abcd40803241513y1964e561ke0ac5c7434709bf6@mail.gmail.com> <799abcd40803251020w236d5e1cq1cab7f9cf0208178@mail.gmail.com> Message-ID: <47E9438F.2030402@polymerdb.org> Joe Leo wrote: > Hi All, Any linux/Apache guru's that can help me with problem below? > I need to be able to get a mod-proxy working. Hi Joe, Completely outside my experience, but some googling turned up this: Comments #94 and #98 at http://ircarc.com/freenode-apache/368.html#94 seem to indicate that using ProxyPass inside a directional container (like or ) causes it to expect only one parameter, whereas you're giving it two. The first parameter is being automatically determined based on the value of . In the httpd manual I found only one example (http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#envsettings) of using ProxyPass inside a container, and it indeed does use only one parameter. So it seems what you'd want to do is something like this: Options FollowSymLinks AllowOverride None ProxyPass http://h111.MyDomain ProxyPassReverse http://h111.MyDomain Also, whether you can even use ProxyPass inside of is unknown to me, as the only examples I've seen are inside or nothing at all. Remember, what I'm telling you is strictly raw Internet research using Google. I have no idea what I'm actually talking about here. - Allen -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From leam at reuel.net Wed Mar 26 06:27:38 2008 From: leam at reuel.net (leam) Date: Wed, 26 Mar 2008 06:27:38 -0400 Subject: [nycphp-talk] Reading just a couple lines of a file? Message-ID: <1206527258.2865.18.camel@leam> Is there a performance benefit and way to read just the first few lines of a 5k-10k file? I'm dealing with 20-300 files at a time. Pseudo code would look something like this: DirectoryIterator (Thank you PHP CookBook!) for each file: open file to read match $title to stuff between title HTML tags put $title into an array based on catagory put filename into an array (index matches the $title array) close file Go through the $title arrays in Catagory sequence Echo $Catagory sort $title array alphabetically echo "a href filename" $title "/a" Leam From ben at projectskyline.com Wed Mar 26 11:39:11 2008 From: ben at projectskyline.com (Ben Sgro) Date: Wed, 26 Mar 2008 11:39:11 -0400 Subject: [nycphp-talk] Reading just a couple lines of a file? In-Reply-To: <1206527258.2865.18.camel@leam> References: <1206527258.2865.18.camel@leam> Message-ID: <47EA6E1F.6050409@projectskyline.com> Hello, Performance: Yeah, you don't have to hold the entire file in memory. Use fopen/fread and iterate through with a buffer size. - Ben leam wrote: > Is there a performance benefit and way to read just the first few lines > of a 5k-10k file? I'm dealing with 20-300 files at a time. > > Pseudo code would look something like this: > > DirectoryIterator (Thank you PHP CookBook!) > for each file: > open file to read > match $title to stuff between title HTML tags > put $title into an array based on catagory > put filename into an array (index matches the $title array) > close file > > Go through the $title arrays in Catagory sequence > Echo $Catagory > sort $title array alphabetically > echo "a href filename" $title "/a" > > Leam > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From chsnyder at gmail.com Wed Mar 26 11:51:40 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 26 Mar 2008 11:51:40 -0400 Subject: [nycphp-talk] Reading just a couple lines of a file? In-Reply-To: <47EA6E1F.6050409@projectskyline.com> References: <1206527258.2865.18.camel@leam> <47EA6E1F.6050409@projectskyline.com> Message-ID: On 3/26/08, Ben Sgro wrote: > > Hello, > > Performance: Yeah, you don't have to hold the entire file in memory. Use > fopen/fread and iterate through > with a buffer size. > > > - Ben And since you're searching for something specific, you can even just go line by line using fgets() till you find what you want: $fp = fopen( $file, r ); while( !feof($fp) ) { $line = fgets( $fp ); if ( strpos( $line, ' References: <1206527258.2865.18.camel@leam> <47EA6E1F.6050409@projectskyline.com> Message-ID: <47EA79AB.6080609@donaldorgan.com> An HTML attachment was scrubbed... URL: From tom at supertom.com Wed Mar 26 13:26:48 2008 From: tom at supertom.com (Tom Melendez) Date: Wed, 26 Mar 2008 10:26:48 -0700 Subject: [nycphp-talk] Reading just a couple lines of a file? In-Reply-To: <47EA79AB.6080609@donaldorgan.com> References: <1206527258.2865.18.camel@leam> <47EA6E1F.6050409@projectskyline.com> <47EA79AB.6080609@donaldorgan.com> Message-ID: <117286890803261026y62510e7amd24be9ad9d662c9d@mail.gmail.com> Only going to do this once? Any chance that you'll want to extract/manipulate data from these files later on? Would it make sense to batch load them into a DB and work with them via SQL somehow so you could work with them later? Or process in the background? Thanks, Tom http://www.liphp.org On Wed, Mar 26, 2008 at 9:28 AM, Donald J Organ IV wrote: > > if its valid xhtml you could always use SimpleXML, and just get the title. > http://www.php.net/SimpleXML > > > csnyder wrote: > On 3/26/08, Ben Sgro wrote: > > > Hello, > > Performance: Yeah, you don't have to hold the entire file in memory. Use > fopen/fread and iterate through > with a buffer size. > > > - Ben > > And since you're searching for something specific, you can even just > go line by line using fgets() till you find what you want: > > $fp = fopen( $file, r ); > while( !feof($fp) ) { > $line = fgets( $fp ); > if ( strpos( $line, ' break; > } > } > if ( !feof( $fp ) ) { > // get title out of $line here > } > > Since you're working with big files, it makes sense to build a better > limit into the while loop, to bail out if the title isn't found after > 99 lines or something. > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 susan_shemin at yahoo.com Wed Mar 26 15:49:23 2008 From: susan_shemin at yahoo.com (Susan Shemin) Date: Wed, 26 Mar 2008 12:49:23 -0700 (PDT) Subject: [nycphp-talk] sun and mysql acquisition for non-enterprise users Message-ID: <973417.90809.qm@web50201.mail.re2.yahoo.com> A ZDNet newsletter today announced, "Sun introduced immediate availability of 7X24 year round global, enterprise-class database subscriptions and services for the entire MySQL product line." I am wondering if with Sun's emphasis on enterprise-class DB, will there be changes for the non-enterprise users? Or will there always be open-sourced MySQL available for us non-enterprise users with our "measly" shared, web host accounts? Susan -------------- next part -------------- An HTML attachment was scrubbed... URL: From joeleo724 at gmail.com Wed Mar 26 16:04:06 2008 From: joeleo724 at gmail.com (Joe Leo) Date: Wed, 26 Mar 2008 15:04:06 -0500 Subject: [nycphp-talk] Re: Apache Proxy restart error In-Reply-To: <47E9438F.2030402@polymerdb.org> References: <799abcd40803241513y1964e561ke0ac5c7434709bf6@mail.gmail.com> <799abcd40803251020w236d5e1cq1cab7f9cf0208178@mail.gmail.com> <47E9438F.2030402@polymerdb.org> Message-ID: <799abcd40803261304u484bf201k9f07bb06125fbe9b@mail.gmail.com> Hi Allen, thanks for the tips... I was able to get it working but not sure if the way it is working is the best or right way. Basically, I removed the virtualhost directives all together and I was able to restart apache. The proxy seems to be working as well but I am still having some problems and think it's now with mod-rewrite. But, it looks like I'm getting close. Thanks, joe On Tue, Mar 25, 2008 at 1:25 PM, Allen Shaw wrote: > Joe Leo wrote: > > Hi All, Any linux/Apache guru's that can help me with problem below? > > I need to be able to get a mod-proxy working. > Hi Joe, > > Completely outside my experience, but some googling turned up this: > > Comments #94 and #98 at http://ircarc.com/freenode-apache/368.html#94 > seem to indicate that using ProxyPass inside a directional container > (like or ) causes it to expect only one parameter, > whereas you're giving it two. The first parameter is being > automatically determined based on the value of . > > In the httpd manual I found only one example > (http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#envsettings) of > using ProxyPass inside a container, and it indeed does use > only one parameter. > > So it seems what you'd want to do is something like this: > > Options FollowSymLinks > AllowOverride None > > ProxyPass http://h111.MyDomain > ProxyPassReverse http://h111.MyDomain > > > > Also, whether you can even use ProxyPass inside of is > unknown to me, as the only examples I've seen are inside or > nothing at all. Remember, what I'm telling you is strictly raw Internet > research using Google. I have no idea what I'm actually talking about > here. > > - 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rotsen at gmail.com Wed Mar 26 16:28:16 2008 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Wed, 26 Mar 2008 13:28:16 -0700 Subject: [nycphp-talk] sun and mysql acquisition for non-enterprise users In-Reply-To: <973417.90809.qm@web50201.mail.re2.yahoo.com> References: <973417.90809.qm@web50201.mail.re2.yahoo.com> Message-ID: Sun is Open sourcing al of there software, following this example, I bet that mysql will continue being available and in the long it will be open sourced. :-) On Wed, Mar 26, 2008 at 12:49 PM, Susan Shemin wrote: > A ZDNet newsletter today announced, "Sun introduced immediate availability > of 7X24 year round global, enterprise-class database subscriptions and > services for the entire MySQL product line." > > I am wondering if with Sun's emphasis on enterprise-class DB, will there > be changes for the non-enterprise users? Or will there always be > open-sourced MySQL available for us non-enterprise users with our "measly" > shared, web host accounts? > > Susan > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Wed Mar 26 16:37:22 2008 From: ramons at gmx.net (David Krings) Date: Wed, 26 Mar 2008 16:37:22 -0400 Subject: [nycphp-talk] sun and mysql acquisition for non-enterprise users In-Reply-To: <973417.90809.qm@web50201.mail.re2.yahoo.com> References: <973417.90809.qm@web50201.mail.re2.yahoo.com> Message-ID: <47EAB402.7070409@gmx.net> Susan Shemin wrote: > A ZDNet newsletter today announced, "Sun introduced immediate > availability of 7X24 year round global, enterprise-class database > subscriptions and services for the entire MySQL product line." > > I am wondering if with Sun's emphasis on enterprise-class DB, will there > be changes for the non-enterprise users? Or will there always be > open-sourced MySQL available for us non-enterprise users with our > "measly" shared, web host accounts? > > Susan I think that the plain simple MySQL that we mainly use will remain available at no cost with a favourable license for some time. One never knows what a company will do, but I cannot recall anyone ver releasing a product under GPL and then taking it proprietary. MySQL is released with two licenses, one is the GPL and another one is a 'proprietary' enterprise license so that companies can use MySQL in ways that would violate the GPL. AFAIK MySQL and now Sun charge for that commercial license and of course for any professional support. And I think that is what the announcement aims at. Sun/MySQL try to place MySQL in the enterprise as a viable alternative to other (SQL) databases, such as MSSQL, DB/2, Oracle and such. I think that is a promising endeavour and a nice example where the GPL helps a company to make money by not applying the GPL. Quite bizarre! David From lists at zaunere.com Wed Mar 26 16:48:31 2008 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 26 Mar 2008 16:48:31 -0400 Subject: [nycphp-talk] sun and mysql acquisition for non-enterprise users In-Reply-To: <973417.90809.qm@web50201.mail.re2.yahoo.com> References: <973417.90809.qm@web50201.mail.re2.yahoo.com> Message-ID: <043901c88f82$c0a13550$41e39ff0$@com> > A ZDNet newsletter today announced, "Sun introduced immediate > availability of 7X24 year round global, enterprise-class database > subscriptions and services for the entire MySQL product line." > > I am wondering if with Sun's emphasis on enterprise-class DB, will > there be changes for the non-enterprise users? Or will there always be > open-sourced MySQL available for us non-enterprise users with our > "measly" shared, web host accounts? While no one really knows for sure, all indications, by both Sun and MySQL (and perhaps last night's meeting), is that MySQL will stay available, and in fact be improved by Sun's mindshare. In other similar news, we can't forget about PostgreSQL: http://www.internetnews.com/software/article.php/3736336 H From chsnyder at gmail.com Wed Mar 26 16:55:46 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 26 Mar 2008 16:55:46 -0400 Subject: [nycphp-talk] sun and mysql acquisition for non-enterprise users In-Reply-To: <043901c88f82$c0a13550$41e39ff0$@com> References: <973417.90809.qm@web50201.mail.re2.yahoo.com> <043901c88f82$c0a13550$41e39ff0$@com> Message-ID: On Wed, Mar 26, 2008 at 4:48 PM, Hans Zaunere wrote: > While no one really knows for sure, all indications, by both Sun and MySQL > (and perhaps last night's meeting), is that MySQL will stay available, and > in fact be improved by Sun's mindshare. As David pointed out, any MySQL release covered by GPL will be available forever. MySQL has been playing the dual license game for a while... if anything, Sun will probably open things even more than they have been. Pure speculation of course, but momentum at Sun in recent years has been in favor of freedom. > In other similar news, we can't forget about PostgreSQL Why not? We have for years. (ducks) -- Chris Snyder http://chxo.com/ From paul at devonianfarm.com Wed Mar 26 17:38:30 2008 From: paul at devonianfarm.com (paul at devonianfarm.com) Date: Wed, 26 Mar 2008 17:38:30 -0400 (EDT) Subject: [nycphp-talk] sun and mysql acquisition for non-enterprise users Message-ID: <40964.192.168.1.35.1206567510.webmail@192.168.1.35> Commercial support for a database is important for "enterprise" customers -- although my experience with MySQL is that I don't ever need it. That said, I've been dragged in the Microsoft world lately and I must say I've been quite impressed with Microsoft's support for SQL Server... They've been pretty good at solving problems that seem really impossible. However, most of the SQL Server problems I've encountered have to do with gimmicky features that cause more trouble than they're worth. ---------- Paul Houle http://gen5.info/q/ From jellicle at gmail.com Wed Mar 26 22:09:57 2008 From: jellicle at gmail.com (Michael Sims) Date: Wed, 26 Mar 2008 22:09:57 -0400 Subject: [nycphp-talk] sun and mysql acquisition for non-enterprise users In-Reply-To: <47EAB402.7070409@gmx.net> References: <973417.90809.qm@web50201.mail.re2.yahoo.com> <47EAB402.7070409@gmx.net> Message-ID: <200803262209.57101.jellicle@gmail.com> On Wednesday 26 March 2008, David Krings wrote: > I think that the plain simple MySQL that we mainly use will remain > available at no cost with a favourable license for some time. One never > knows what a company will do, but I cannot recall anyone ver releasing a > product under GPL and then taking it proprietary. Well, it has been attempted: http://linuxmafia.com/faq/Apps/sourceforge-forks.html The above is somewhat biased but largely accurate in its facts. VA Linux had a GPL software product and an Open Source-based business model. (I have a VA Linux t-shirt which says: "Open Source: it's the difference between trust and anti-trust.") The company then did a complete u-turn and decided to produce a proprietary product. (To my knowledge, they never produced a t-shirt extolling the virtues of proprietariness and anti-trust lawsuits.) They converted it to a proprietary product, however, by definition, the previous code remained free to use indefinitely under the GPL. The community, not entirely happy with this path, maintained and upgraded the product, working from the GPL'ed codebase. VA Software (renamed) then faced the interesting business model of selling a proprietary product that was competing against virtually the same product, GPL'ed and available for free. It's challenging to sell meatballs when someone is giving away the exact same meatballs next door for free. Despite pouring quite a lot of money into the effort, this did not work out well. And today, the open source fork remains: http://gforge.org/ Anyway, the upshot is this... there are a few questions to ask. 1) Is there a large community interested in the GPL version of this product? 2) Are there sufficient programmers who would work on it and keep it going if the primary company abandoned the product? If the answers to both these questions are "yes", it is essentially impossible for a company to successfully take an open source codebase and privatize it, no matter how stupid their management may be. For MySQL, I'd say the answers are clearly yes. So have no fear! MySQL, or some derivative of it, will remain available as long as people care about it. Michael Sims From larrylud at gmail.com Thu Mar 27 00:34:56 2008 From: larrylud at gmail.com (Larry Ludwig) Date: Thu, 27 Mar 2008 00:34:56 -0400 Subject: [nycphp-talk] best practice for detecting ip Message-ID: <00eb01c88fc3$e93a0eb0$0605a8c0@tank> Hey everyone, Does someone know the best practice for detecting ip addresses with php/apache for use in reporting/metrics? I'm re-evaluating our code for detecting ips and I see it's built towards getting a unique browser ip without regard for how easily it can be spoofed. For example, we're using X-FORWARDED-FOR which I know can be very easily spoofed by proxy servers so it should only be done with trusted proxies like AOL. Does anyone know where to find a good list of ips of trusted proxies (as well as maybe a list of known anonymous proxy servers)? Also, is there any reason to use HTTP_CLIENT_IP? The current code we have looks to use that first if it's available. But I'm not exactly sure the difference between that header and REMOTE_ADDR. Thanks a lot, Rob Hi Rob, Yes I assuming you are partly asking this based upon the amount of form spam and the amount of people using anonymous proxing. Some RBLs that might be of help Some of the public ones out there (not complete) http://www.dronebl.org/ http://www.stopforumspam.com/ (which we have converted into a local RBL) http://rbl.efnetrbl.org/ As of previous RBLs were designed to be for only SMTP but as the botnets progress to web based attacks/spam they are being reused for other proposes. Here is the obligatory PHP code to test RBLs and if a proxy service http://www.jhurliman.org/index.php/2005/open-proxy-rbl-lookups-in-php/ http://w-shadow.com/blog/2007/11/23/detect-users-accessing-your-site-via-a-p roxy/ There also exists apache plugins to block/redirect to other web pages if on a specified RBLs Offline I can discuss other things we are developing to help protect our network by using RBLs RBLs aren't just for SMTP anymore. -L -- Larry Ludwig Empowering Media 1-866-792-0489 x600 Managed and Unmanaged Xen VPSes http://www.hostcube.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at nopersonal.info Thu Mar 27 14:16:56 2008 From: lists at nopersonal.info (BAS) Date: Thu, 27 Mar 2008 14:16:56 -0400 Subject: [nycphp-talk] CMS - Estimating Hours Message-ID: <47EBE498.5010309@nopersonal.info> Okay, I've got a very general estimating question here. Here are the basics: The focus of the site will be selling products to people with autistic children. I'm still waiting for an answer on how many products there will be in the beginning, so let's just say a dozen for now. The client wants to be able to maintain the site themselves (i.e. add new products as the need arises), create a newsletter, and also integrate a discussion forum to build a sort of community. Accessibility is important for this site (not necessarily the admin part, but the public front-end). This is the list of requirements that I think I'll need to take to consideration when giving an estimate: 1. Install & configure CMS 2. Design custom templates (I typically spend about 10 hours on this) 3. Code custom templates 4. Find, install & configure shopping cart a. Product photos b. Product descriptions/details c. Pricing d. Shipping e. Tax f. Create/modify shopping cart templates? (Not sure if this has to be done or if the cart can use CMS templates?) 5. SSL cert (requires static IP) 6. Payment gateway 7. Find, install & configure forum 8. Testing & debugging 9. Training client to use CMS Did I overlook anything? I've downloaded and am getting ready to install both Drupal & Joomla to test drive them, but after much reading I've gotten the impression that Drupal is the better overall product in terms of code & flexibility. I know that Joomla has a "prettier" admin interface that the client may like better, but I don't want to sacrifice functionality for cosmetics. Can anyone possibly give me even a ballpark estimate on how many hours you think the above might take? I'm assuming they'll also have the standard About Us and Contact Us pages. FYI, a static site that I recently did involved about 65 hours total (design + coding + content porting + testing + client phone calls, emails, etc.) for a 17-page site. But I can't really estimate a CMS per page, so... help! Any advice would be greatly appreciated. Regards, Bev From andre at pitanga.org Thu Mar 27 14:40:00 2008 From: andre at pitanga.org (=?UTF-8?B?QW5kcsOpIFBpdGFuZ2E=?=) Date: Thu, 27 Mar 2008 14:40:00 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <47EBE498.5010309@nopersonal.info> References: <47EBE498.5010309@nopersonal.info> Message-ID: <47EBEA00.80702@pitanga.org> I'll take a stab, BAS: I noticed that on your numbered list you didn't repeat the need for a newsletter. That can take significant time as well. (I've been using POMMO as a mailing list manager at work and it's been great.) I would say add at least another 10 hours just for that. I not sure why I'm a bit reluctant to say this, but from what you describe (including testing, and even training), I'd say more or less 250hrs. That may sound too high for some, but what I'm talking about here is solid quality work delivered as promised: firm deadlines (no excuses), fully web standards based (may require tweaking the CMS), etc. It really depends on how much your client has it together as well. Are they gonna deliver the content to you in a timely basis. How tech-savvy is the staff you are training to run the CMS? Surprisingly, even the simple admin interfaces generated by CMSs are enough to scare most folks. Have a detailed, signed contract before you begin work. Oh, and please don't charge less than, say, $60/hr. It wouldn't be fair. Hope this helps, -Andre BAS wrote: > Okay, I've got a very general estimating question here. > > Here are the basics: The focus of the site will be selling products to > people with autistic children. I'm still waiting for an answer on how > many products there will be in the beginning, so let's just say a dozen > for now. The client wants to be able to maintain the site themselves > (i.e. add new products as the need arises), create a newsletter, and > also integrate a discussion forum to build a sort of community. > Accessibility is important for this site (not necessarily the admin > part, but the public front-end). > > This is the list of requirements that I think I'll need to take to > consideration when giving an estimate: > > 1. Install & configure CMS > 2. Design custom templates (I typically spend about 10 hours on this) > 3. Code custom templates > 4. Find, install & configure shopping cart > a. Product photos > b. Product descriptions/details > c. Pricing > d. Shipping > e. Tax > f. Create/modify shopping cart templates? (Not sure > if this has to be done or if the cart can use CMS templates?) > 5. SSL cert (requires static IP) > 6. Payment gateway > 7. Find, install & configure forum > 8. Testing & debugging > 9. Training client to use CMS > > Did I overlook anything? I've downloaded and am getting ready to > install both Drupal & Joomla to test drive them, but after much > reading I've gotten the impression that Drupal is the better overall > product in terms of code & flexibility. > > I know that Joomla has a "prettier" admin interface that the client > may like better, but I don't want to sacrifice functionality for > cosmetics. > > Can anyone possibly give me even a ballpark estimate on how many hours > you think the above might take? I'm assuming they'll also have the > standard About Us and Contact Us pages. > > FYI, a static site that I recently did involved about 65 hours total > (design + coding + content porting + testing + client phone calls, > emails, etc.) for a 17-page site. But I can't really estimate a CMS per > page, so... help! > > Any advice would be greatly appreciated. > > Regards, > Bev > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From jmcgraw1 at gmail.com Thu Mar 27 14:45:02 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Thu, 27 Mar 2008 14:45:02 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <47EBE498.5010309@nopersonal.info> References: <47EBE498.5010309@nopersonal.info> Message-ID: Well it really depends... do you have experience doing any of this: 4. Find, install & configure shopping cart a. Product photos b. Product descriptions/details c. Pricing d. Shipping e. Tax f. Create/modify shopping cart templates? (Not sure if this has to be done or if the cart can use CMS templates?) 5. SSL cert (requires static IP) 6. Payment gateway Because it can be quite a learning experience (adds time) if you don't. My best suggestion is to find an all-in-one solution or a developer who has proven experience with these kind of transactions. 3. Code custom templates I haven't worked with Joomla, but I have worked with Drupal. There is a bit of a learning curve for following the best practices template design. I'd suggest getting Pro Drupal Development to help you along with this. 7. Find, install & configure forum Drupal can be a forum, see how they use it at groups.drupal.org. I'd put the work at the very least 80 hours. Any integration that they'd like to do between the shopping cart and the CMS will add many hours. -jake On Thu, Mar 27, 2008 at 2:16 PM, BAS wrote: > Okay, I've got a very general estimating question here. > > Here are the basics: The focus of the site will be selling products to > people with autistic children. I'm still waiting for an answer on how > many products there will be in the beginning, so let's just say a dozen > for now. The client wants to be able to maintain the site themselves > (i.e. add new products as the need arises), create a newsletter, and > also integrate a discussion forum to build a sort of community. > Accessibility is important for this site (not necessarily the admin > part, but the public front-end). > > This is the list of requirements that I think I'll need to take to > consideration when giving an estimate: > > 1. Install & configure CMS > 2. Design custom templates (I typically spend about 10 hours on this) > 3. Code custom templates > 4. Find, install & configure shopping cart > a. Product photos > b. Product descriptions/details > c. Pricing > d. Shipping > e. Tax > f. Create/modify shopping cart templates? (Not sure > if this has to be done or if the cart can use CMS templates?) > 5. SSL cert (requires static IP) > 6. Payment gateway > 7. Find, install & configure forum > 8. Testing & debugging > 9. Training client to use CMS > > Did I overlook anything? I've downloaded and am getting ready to install > both Drupal & Joomla to test drive them, but after much reading I've > gotten the impression that Drupal is the better overall product in terms > of code & flexibility. > > I know that Joomla has a "prettier" admin interface that the client may > like better, but I don't want to sacrifice functionality for cosmetics. > > Can anyone possibly give me even a ballpark estimate on how many hours > you think the above might take? I'm assuming they'll also have the > standard About Us and Contact Us pages. > > FYI, a static site that I recently did involved about 65 hours total > (design + coding + content porting + testing + client phone calls, > emails, etc.) for a 17-page site. But I can't really estimate a CMS per > page, so... help! > > Any advice would be greatly appreciated. > > Regards, > Bev > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From lists at nopersonal.info Thu Mar 27 15:27:01 2008 From: lists at nopersonal.info (BAS) Date: Thu, 27 Mar 2008 15:27:01 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <47EBEA00.80702@pitanga.org> References: <47EBE498.5010309@nopersonal.info> <47EBEA00.80702@pitanga.org> Message-ID: <47EBF505.5010506@nopersonal.info> Andr? Pitanga wrote: > I noticed that on your numbered list you didn't repeat the need for a > newsletter. That can take significant time as well. (I've been using > POMMO as a mailing list manager at work and it's been great.) I would > say add at least another 10 hours just for that. Good catch; thanks! > I not sure why I'm a bit reluctant to say this, but from what you > describe (including testing, and even training), I'd say more or less > 250hrs. > That may sound too high for some, but what I'm talking about here is > solid quality work delivered as promised: firm deadlines (no excuses), > fully web standards based (may require tweaking the CMS), etc. Good points, all. I'd rather overestimate than underestimate. > It really depends on how much your client has it together as well. Are > they gonna deliver the content to you in a timely basis. How tech-savvy > is the staff you are training to run the CMS? Surprisingly, even the > simple admin interfaces generated by CMSs are enough to scare most folks. So true. They were confused by the term "web hosting" so... ;-) With that in mind, I think I may need to get a better handle on the client's expectations. > Have a detailed, signed contract before you begin work. Oh, and please > don't charge less than, say, $60/hr. It wouldn't be fair. I never, ever worked without a contract when I was freelancing. Thankfully, now that I'm working for someone else I don't have to worry about that part, I just have to worry about getting the estimated time right. Thanks for the heads-up on the hourly rate though. > Hope this helps, It does indeed - thanks a million. From andre at pitanga.org Thu Mar 27 15:41:37 2008 From: andre at pitanga.org (=?UTF-8?B?QW5kcsOpIFBpdGFuZ2E=?=) Date: Thu, 27 Mar 2008 15:41:37 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <47EBF505.5010506@nopersonal.info> References: <47EBE498.5010309@nopersonal.info> <47EBEA00.80702@pitanga.org> <47EBF505.5010506@nopersonal.info> Message-ID: <47EBF871.3010402@pitanga.org> I unfortunately made that mistake once when I was starting to freelance. It quickly got really bad... Now I don't miss an opportunity to pass on this warning to others in case it may save someone the headache. :-) BAS wrote: > I never, ever worked without a contract when I was freelancing. > Thankfully, now that I'm working for someone else I don't have to > worry about that part, I just have to worry about getting the > estimated time right. Thanks for the heads-up on the hourly rate though. From lists at nopersonal.info Thu Mar 27 15:49:19 2008 From: lists at nopersonal.info (BAS) Date: Thu, 27 Mar 2008 15:49:19 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: References: <47EBE498.5010309@nopersonal.info> Message-ID: <47EBFA3F.6020107@nopersonal.info> Jake McGraw wrote: > Well it really depends... do you have experience doing any of this: > > 4. Find, install & configure shopping cart > a. Product photos > b. Product descriptions/details > c. Pricing > d. Shipping > e. Tax > f. Create/modify shopping cart templates? (Not sure > if this has to be done or if the cart can use CMS templates?) > 5. SSL cert (requires static IP) > 6. Payment gateway > > Because it can be quite a learning experience (adds time) if you > don't. My best suggestion is to find an all-in-one solution or a > developer who has proven experience with these kind of transactions. Re the shopping cart, not really. I did install osCommerce once as it was available via my cpanel. I set up a few items and played around with the shipping & tax stuff, but that was about it. Re SSL, I've purchased my own SSL certs before, generated the keys, then had my hosting company actually install them. Re payment gateways, It's my understanding that the handling of credit card transactions is done via the payment gateway's servers--i.e. if the client has a merchant account (or pays for gateway services that provide one for a fee), then all I need to be concerned with is that the shopping cart can interface securely with the gateway? Please do correct me if I'm wrong. > 3. Code custom templates > > I haven't worked with Joomla, but I have worked with Drupal. There is > a bit of a learning curve for following the best practices template > design. I'd suggest getting Pro Drupal Development to help you along > with this. I'll definitely order that. > 7. Find, install & configure forum > > Drupal can be a forum, see how they use it at groups.drupal.org. > > I'd put the work at the very least 80 hours. Any integration that > they'd like to do between the shopping cart and the CMS will add many > hours. I'll check out how Drupal uses their forum. Thanks for the estimate & warning re added hours for integration; bot are a great help. Regards, Bev From lists at nopersonal.info Thu Mar 27 16:09:49 2008 From: lists at nopersonal.info (BAS) Date: Thu, 27 Mar 2008 16:09:49 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <47EBF871.3010402@pitanga.org> References: <47EBE498.5010309@nopersonal.info> <47EBEA00.80702@pitanga.org> <47EBF505.5010506@nopersonal.info> <47EBF871.3010402@pitanga.org> Message-ID: <47EBFF0D.6060805@nopersonal.info> Andr? Pitanga wrote: > I unfortunately made that mistake once when I was starting to freelance. > It quickly got really bad... > Now I don't miss an opportunity to pass on this warning to others in > case it may save someone the headache. :-) I always try to pass along the warning too. When I was freelancing, detailed proposals accompanied by very specific contracts saved me on more than one occasion. Only once did someone out & out try to cheat me, but there were plenty of times that clients "forgot" what the scope of a project entailed. Having a signed acceptance of proposal & contract on hand immediately silenced any disagreements. ;-) Regards, Bev From jmcgraw1 at gmail.com Thu Mar 27 16:23:34 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Thu, 27 Mar 2008 16:23:34 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <47EBFA3F.6020107@nopersonal.info> References: <47EBE498.5010309@nopersonal.info> <47EBFA3F.6020107@nopersonal.info> Message-ID: > Re payment gateways, It's my understanding that the handling of credit > card transactions is done via the payment gateway's servers--i.e. if the > client has a merchant account (or pays for gateway services that provide > one for a fee), then all I need to be concerned with is that the > shopping cart can interface securely with the gateway? That is correct, but if the shopping cart doesn't natively support your gateway, well, then you've got some work to do. Integration is where you're going to find the biggest headaches, because then you'll have to get into custom module development for Drupal, which isn't as bad as it sounds, but it is not something you should do when you're "on the clock" and haven't tried it yet. My first suggestion is to find out what is the MINIMUM feature set your client is willing to launch with. It sounds like they want to start an e-commerce store + some CMS features, perhaps the best place to start would be: http://drupal.org/project/ecommerce In fact, you'll find there are TON of well supported modules available for Drupal, I'd hit up Google (drupal + ) before attempting to create anything from stratch. - jake On Thu, Mar 27, 2008 at 3:49 PM, BAS wrote: > Jake McGraw wrote: > > Well it really depends... do you have experience doing any of this: > > > > 4. Find, install & configure shopping cart > > a. Product photos > > b. Product descriptions/details > > c. Pricing > > d. Shipping > > e. Tax > > f. Create/modify shopping cart templates? (Not sure > > if this has to be done or if the cart can use CMS templates?) > > 5. SSL cert (requires static IP) > > 6. Payment gateway > > > > Because it can be quite a learning experience (adds time) if you > > don't. My best suggestion is to find an all-in-one solution or a > > developer who has proven experience with these kind of transactions. > > Re the shopping cart, not really. I did install osCommerce once as it > was available via my cpanel. I set up a few items and played around with > the shipping & tax stuff, but that was about it. > > Re SSL, I've purchased my own SSL certs before, generated the keys, then > had my hosting company actually install them. > > Re payment gateways, It's my understanding that the handling of credit > card transactions is done via the payment gateway's servers--i.e. if the > client has a merchant account (or pays for gateway services that provide > one for a fee), then all I need to be concerned with is that the > shopping cart can interface securely with the gateway? Please do correct > me if I'm wrong. > > > > 3. Code custom templates > > > > I haven't worked with Joomla, but I have worked with Drupal. There is > > a bit of a learning curve for following the best practices template > > design. I'd suggest getting Pro Drupal Development to help you along > > with this. > > I'll definitely order that. > > > > 7. Find, install & configure forum > > > > Drupal can be a forum, see how they use it at groups.drupal.org. > > > > I'd put the work at the very least 80 hours. Any integration that > > they'd like to do between the shopping cart and the CMS will add many > > hours. > > I'll check out how Drupal uses their forum. Thanks for the estimate & > warning re added hours for integration; bot are a great help. > > > > Regards, > Bev > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From lists at nopersonal.info Thu Mar 27 16:50:38 2008 From: lists at nopersonal.info (BAS) Date: Thu, 27 Mar 2008 16:50:38 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: References: <47EBE498.5010309@nopersonal.info> <47EBFA3F.6020107@nopersonal.info> Message-ID: <47EC089E.2060401@nopersonal.info> Thanks for the additional info & caveats, Jake. Looks like I've got a bit more searching & reading to do... Regards, Bev Jake McGraw wrote: >> Re payment gateways, It's my understanding that the handling of credit >> card transactions is done via the payment gateway's servers--i.e. if the >> client has a merchant account (or pays for gateway services that provide >> one for a fee), then all I need to be concerned with is that the >> shopping cart can interface securely with the gateway? > > That is correct, but if the shopping cart doesn't natively support > your gateway, well, then you've got some work to do. > > Integration is where you're going to find the biggest headaches, > because then you'll have to get into custom module development for > Drupal, which isn't as bad as it sounds, but it is not something you > should do when you're "on the clock" and haven't tried it yet. > > My first suggestion is to find out what is the MINIMUM feature set > your client is willing to launch with. It sounds like they want to > start an e-commerce store + some CMS features, perhaps the best place > to start would be: > > http://drupal.org/project/ecommerce > > In fact, you'll find there are TON of well supported modules > available for Drupal, I'd hit up Google (drupal + researching>) before attempting to create anything from stratch. > > - jake From suzerain at suzerain.com Thu Mar 27 17:08:36 2008 From: suzerain at suzerain.com (Marc Antony Vose) Date: Fri, 28 Mar 2008 05:08:36 +0800 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <47EBFF0D.6060805@nopersonal.info> References: <47EBE498.5010309@nopersonal.info> <47EBEA00.80702@pitanga.org> <47EBF505.5010506@nopersonal.info> <47EBF871.3010402@pitanga.org> <47EBFF0D.6060805@nopersonal.info> Message-ID: Hi: It sounded like in the beginning that you had some experience with a static site, and now you're going to build something that's dynamic and has a shopping component. If I had to pass along any advice about this in general, I'd say that actually sometimes templating things instead of laying them out statically can be quicker, in terms of building. But when you move into dynamic stuff, and especially e-commerce-related stuff, do not underestimate the time needed for testing. You are going to make mistakes. Lots of them. And, you'll have situations where to get to problem x, you might need to go through steps a, b and c to get there, which takes time and is mind-numbingly boring. You don't need to do this kind of stuff on static or simple sites. And when it comes to e-commerce, it has to work; bugs are not acceptable because you're dealing with people's private data and all that, and customers will get nasty when things don't work right. (For example, I decided to drop Zen Cart into a project once circa 2006 or so. It's basically a steaming pile, as I discovered, but that's beside the point. They had an authorize.net module, which it turned out after a ton of testing had a bug in it with respect to error reporting. This couldn't be ignored; I had to go into the module and fix it. So, if you're using Drupal, and something in Drupal or some third-party module doesn't work like it should, you need to be prepared to go in there and get your hands dirty if necessary.) So, budget for testing. Whatever time you think you'll spend building; add on another 200% for the back and forth, the testing, the unexpected client requests, etc. and so on. If you can swing it, pay your most anal-retentive friend or perhaps a professional tester some money to test things for you; just like it's very hard to edit your own writing, it's often very difficult to spot bugs in a system you are building, because you naturally tend to fall into certain usage patterns that don't test everything. Oh, and remember to budget for testing. Did I mention that? Cheers, Marc Vose http://www.suzerain.com From andre at pitanga.org Thu Mar 27 17:33:11 2008 From: andre at pitanga.org (=?UTF-8?B?QW5kcsOpIFBpdGFuZ2E=?=) Date: Thu, 27 Mar 2008 17:33:11 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: References: <47EBE498.5010309@nopersonal.info> <47EBEA00.80702@pitanga.org> <47EBF505.5010506@nopersonal.info> <47EBF871.3010402@pitanga.org> <47EBFF0D.6060805@nopersonal.info> Message-ID: <47EC1297.6020307@pitanga.org> Marc Antony Vose wrote: > You are going to make mistakes. Lots of them. And, you'll have > situations where to get to problem x, you might need to go through > steps a, b and c to get there, which takes time and is mind-numbingly > boring. So, so true... > when it comes to e-commerce, it has to work; bugs are not acceptable > because you're dealing with people's private data and all that, and > customers will get nasty when things don't work right. Specially if there's any kind of time constrain. For example, I am building a small payroll application for a client. Unexpected (or overlooked) bugs = people don't get paid in time = epic fail. If one can avoid having to deal with user's sensitive data (credit card, etc) by using a third-party service like paypal and avoid the possible nightmares, why not do it? > > (For example, I decided to drop Zen Cart into a project once circa > 2006 or so. It's basically a steaming pile, as I discovered, but > that's beside the point. Good to know ;-) > They had an authorize.net module, which it turned out after a ton of > testing had a bug in it with respect to error reporting. This couldn't > be ignored; I had to go into the module and fix it. So, if you're > using Drupal, and something in Drupal or some third-party module > doesn't work like it should, you need to be prepared to go in there > and get your hands dirty if necessary.) Bingo. That's why CMSs can be more problematic than helpful, specially when dealing with clueless clients. 1. CMS vendors promise the world: innumerable "cool" features, "ease of use", etc.. 2. Client thinks: "wow.. this web stuff is getting so easy. I can have my unbelievably complex website done in about a couple of days work!" 3. Developers' work misunderstood and unappreciated. > > So, budget for testing. Whatever time you think you'll spend > building; add on another 200% for the back and forth, the testing, the > unexpected client requests, etc. and so on. If you can swing it, pay > your most anal-retentive friend or perhaps a professional tester some > money to test things for you; just like it's very hard to edit your > own writing, it's often very difficult to spot bugs in a system you > are building, because you naturally tend to fall into certain usage > patterns that don't test everything. > > Oh, and remember to budget for testing. Did I mention that? There was a recent episode of the Boagworld podcast where they go into detail with suggestions on how to run a testing session. Well worth a listen. -Andr? From lists at nopersonal.info Thu Mar 27 17:38:43 2008 From: lists at nopersonal.info (BAS) Date: Thu, 27 Mar 2008 17:38:43 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: References: <47EBE498.5010309@nopersonal.info> <47EBEA00.80702@pitanga.org> <47EBF505.5010506@nopersonal.info> <47EBF871.3010402@pitanga.org> <47EBFF0D.6060805@nopersonal.info> Message-ID: <47EC13E3.3060805@nopersonal.info> Hi Marc, Yes, I've got 11 years of experience with static sites and I've even done some simple custom CMS work, but I've never tried integrating an existing CMS package with a bunch of other stuff. My PHP skills are at the lower end of intermediate, so this is going to be a challenge & learning experience for me. Your practical example and advice re testing & other possible gotchas is much appreciated (as is your humor). The only other dynamic site I've worked with was for a real estate agent. I used Open-Realty and modifying the templates was a PITA--it wasn't difficult, just (as you mentioned) mind-numbingly boring having to pick through gobs of PHP code to find the template bits & HTML, make a change, upload, test, try again. Ugh. Many thanks, Bev Marc Antony Vose wrote: > Hi: > > It sounded like in the beginning that you had some experience with a > static site, and now you're going to build something that's dynamic and > has a shopping component. > > If I had to pass along any advice about this in general, I'd say that > actually sometimes templating things instead of laying them out > statically can be quicker, in terms of building. But when you move into > dynamic stuff, and especially e-commerce-related stuff, do not > underestimate the time needed for testing. > > You are going to make mistakes. Lots of them. And, you'll have > situations where to get to problem x, you might need to go through steps > a, b and c to get there, which takes time and is mind-numbingly boring. > You don't need to do this kind of stuff on static or simple sites. And > when it comes to e-commerce, it has to work; bugs are not acceptable > because you're dealing with people's private data and all that, and > customers will get nasty when things don't work right. > > (For example, I decided to drop Zen Cart into a project once circa 2006 > or so. It's basically a steaming pile, as I discovered, but that's > beside the point. They had an authorize.net module, which it turned out > after a ton of testing had a bug in it with respect to error reporting. > This couldn't be ignored; I had to go into the module and fix it. So, > if you're using Drupal, and something in Drupal or some third-party > module doesn't work like it should, you need to be prepared to go in > there and get your hands dirty if necessary.) > > So, budget for testing. Whatever time you think you'll spend building; > add on another 200% for the back and forth, the testing, the unexpected > client requests, etc. and so on. If you can swing it, pay your most > anal-retentive friend or perhaps a professional tester some money to > test things for you; just like it's very hard to edit your own writing, > it's often very difficult to spot bugs in a system you are building, > because you naturally tend to fall into certain usage patterns that > don't test everything. > > Oh, and remember to budget for testing. Did I mention that? > > Cheers, > > Marc Vose > http://www.suzerain.com From ka at kacomputerconsulting.com Thu Mar 27 18:09:02 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Thu, 27 Mar 2008 15:09:02 -0700 Subject: [nycphp-talk] CMS - Estimating Hours Message-ID: <1206655742.28782@coral.he.net> Exactly. The operative words here being "unexpected client requests". No matter how thoroughly you spec things out and try to anticipate everything you will be spending a LOT of time dealing with client saying "OH, but I thought the site would do XYZ..." or "OH, but I thought that it would be better if we did it like this instead" or just plain obnoxious behavior like, "GUESS WHAT, we decided that we need 4 additional reports of sales activity but we can't extend your deadline"...so allow as much extra time as your client will agree to. Explain to them that by your allowing for a sufficient amount of time and careful planning and testing, you are guaranteeing delivery of a quality application to them, and you don't want to cut corners in any way. Also make sure to get a percentage of payment up front or within the first couple of weeks, that way if things drag out during the client approval phase, you won't be left holding 100% of the bag waiting. And I totally 100% agree, it's nearly impossible to effectively test you own code to production-quality perfection, you need to plan to bring someone else in on that. -- Kristina > Hi: > > It sounded like in the beginning that you had some experience with a > static site, and now you're going to build something that's dynamic > and has a shopping component. > > If I had to pass along any advice about this in general, I'd say that > actually sometimes templating things instead of laying them out > statically can be quicker, in terms of building. But when you move > into dynamic stuff, and especially e-commerce-related stuff, do not > underestimate the time needed for testing. > > You are going to make mistakes. Lots of them. And, you'll have > situations where to get to problem x, you might need to go through > steps a, b and c to get there, which takes time and is mind- numbingly > boring. You don't need to do this kind of stuff on static or simple > sites. And when it comes to e-commerce, it has to work; bugs are not > acceptable because you're dealing with people's private data and all > that, and customers will get nasty when things don't work right. > > (For example, I decided to drop Zen Cart into a project once circa > 2006 or so. It's basically a steaming pile, as I discovered, but > that's beside the point. They had an authorize.net module, which it > turned out after a ton of testing had a bug in it with respect to > error reporting. This couldn't be ignored; I had to go into the module > and fix it. So, if you're using Drupal, and something in Drupal or > some third-party module doesn't work like it should, you need to be > prepared to go in there and get your hands dirty if necessary.) > > So, budget for testing. Whatever time you think you'll spend > building; add on another 200% for the back and forth, the testing, the > unexpected client requests, etc. and so on. If you can swing it, pay > your most anal-retentive friend or perhaps a professional tester some > money to test things for you; just like it's very hard to edit your > own writing, it's often very difficult to spot bugs in a system you > are building, because you naturally tend to fall into certain usage > patterns that don't test everything. > > Oh, and remember to budget for testing. Did I mention that? > > Cheers, > > Marc Vose > http://www.suzerain.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > ------------------- From rmarscher at beaffinitive.com Thu Mar 27 18:42:04 2008 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 27 Mar 2008 18:42:04 -0400 Subject: [nycphp-talk] best practice for detecting ip In-Reply-To: <00eb01c88fc3$e93a0eb0$0605a8c0@tank> References: <00eb01c88fc3$e93a0eb0$0605a8c0@tank> Message-ID: <86ACB811-BE1A-4E6B-A5DC-F38C89E594F6@beaffinitive.com> On Mar 27, 2008, at 12:34 AM, Larry Ludwig wrote: > On Mar 18, 2008, at 4:16 PM, Rob Marscher wrote: >> Hey everyone, >> >> Does someone know the best practice for detecting ip addresses with >> php/apache for use in reporting/metrics? >> >> I'm re-evaluating our code for detecting ips and I see it's built >> towards getting a unique browser ip without regard for how easily >> it can be spoofed. For example, we're using X-FORWARDED-FOR which >> I know can be very easily spoofed by proxy servers so it should >> only be done with trusted proxies like AOL. Does anyone know where >> to find a good list of ips of trusted proxies (as well as maybe a >> list of known anonymous proxy servers)? >> [snip] > > Yes I assuming you are partly asking this based upon the amount of > form spam and the amount of people using anonymous proxing. Yeah... that and also things like unique click/impression tracking, identifying people creating multiple accounts on sites, etc. Those links were pretty helpful. It would be nice if there was a whitelist maintained of ips for trusted proxies from major ISPs as well. Thanks, Rob From tedd at sperling.com Thu Mar 27 20:47:23 2008 From: tedd at sperling.com (tedd) Date: Thu, 27 Mar 2008 20:47:23 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <47EC13E3.3060805@nopersonal.info> References: <47EBE498.5010309@nopersonal.info> <47EBEA00.80702@pitanga.org> <47EBF505.5010506@nopersonal.info> <47EBF871.3010402@pitanga.org> <47EBFF0D.6060805@nopersonal.info> <47EC13E3.3060805@nopersonal.info> Message-ID: At 5:38 PM -0400 3/27/08, BAS wrote: >Hi Marc, > >Yes, I've got 11 years of experience with static sites and I've even >done some simple custom CMS work, but I've never tried integrating >an existing CMS package with a bunch of other stuff. My PHP skills >are at the lower end of intermediate, so this is going to be a >challenge & learning experience for me. > >Your practical example and advice re testing & other possible >gotchas is much appreciated (as is your humor). The only other >dynamic site I've worked with was for a real estate agent. I used >Open-Realty and modifying the templates was a PITA--it wasn't >difficult, just (as you mentioned) mind-numbingly boring having to >pick through gobs of PHP code to find the template bits & HTML, make >a change, upload, test, try again. Ugh. > >Many thanks, >Bev Bev: Some of the biggest problems I've had with clients is getting them to agree and adhere to a certain layout. Without a solid foundation, your site can fall apart very quickly -- especially when your client starts to add and change stuff. I had one client recently who had a front page that had a static six item menu on the left and a variable (0-16 items) "things of interest" link list on the right. The client said that he wanted the top and bottom of both (the menu and "things of interest") to line-up. The client hadn't really thought this out. So, that took time for me to explain the problem and I billed for it. This was an example of how a client can waste your time if you allow it. Bill for everything (including emails explaining things), but deliver what you say you will on time, without problems, and clients will respect your work and come back. As for contracts, a letter agreement outlining what is going to be done for what money is good to reflect back on for reference. But, if you want an iron-clad legal contract so you can take someone to court for not paying for a $5k project, then you haven't sued anyone before. My last suit cost me $20k over a $10k dispute. IMO, it's not worth it. So, get 50% up front and the remainder when done. If the client won't pay (been stung two times in the last 12 years), then just don't work for him again and move on. Simple, but effective. If you run into problems coding, organize and illustrate the problem and drop it on us. Usually someone has been there before. You see, doing CMS and dynamic sites are really simple things to accomplish. Most of us have done it more than once. Good luck. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From lists at nopersonal.info Thu Mar 27 21:50:00 2008 From: lists at nopersonal.info (BAS) Date: Thu, 27 Mar 2008 21:50:00 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <1206655742.28782@coral.he.net> References: <1206655742.28782@coral.he.net> Message-ID: <47EC4EC8.9020507@nopersonal.info> Kristina, thanks for adding to Marc's advice. I'm putting everyone's feedback together so I can sort through it, organize it, and use is as a guide to try and work my way through this project with as few gotchas as possible. Though I'm no longer working freelance, I'll advise my employer that it would be best to get an up-front payment on this lest it start to drag out (which tends to happen even with static sites--it really gets absurd sometimes). Regards, Bev Kristina Anderson wrote: > Exactly. The operative words here being "unexpected client requests". > No matter how thoroughly you spec things out and try to anticipate > everything you will be spending a LOT of time dealing with client > saying "OH, but I thought the site would do XYZ..." or "OH, but I > thought that it would be better if we did it like this instead" or just > plain obnoxious behavior like, "GUESS WHAT, we decided that we need 4 > additional reports of sales activity but we can't extend your > deadline"...so allow as much extra time as your client will agree to. > > Explain to them that by your allowing for a sufficient amount of time > and careful planning and testing, you are guaranteeing delivery of a > quality application to them, and you don't want to cut corners in any > way. > > Also make sure to get a percentage of payment up front or within the > first couple of weeks, that way if things drag out during the client > approval phase, you won't be left holding 100% of the bag waiting. > > And I totally 100% agree, it's nearly impossible to effectively test > you own code to production-quality perfection, you need to plan to > bring someone else in on that. > > -- Kristina From lists at nopersonal.info Thu Mar 27 22:55:16 2008 From: lists at nopersonal.info (BAS) Date: Thu, 27 Mar 2008 22:55:16 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: References: <47EBE498.5010309@nopersonal.info> <47EBEA00.80702@pitanga.org> <47EBF505.5010506@nopersonal.info> <47EBF871.3010402@pitanga.org> <47EBFF0D.6060805@nopersonal.info> <47EC13E3.3060805@nopersonal.info> Message-ID: <47EC5E14.4020107@nopersonal.info> Hi tedd, I agree, getting the layout nailed down can be a problem. It seems that no matter how many content reviews, mock-ups and wireframes I do, most clients can never quite "get it" until they see an actual live site, so they usually end up being billed for post-launch changes. With a static site using semantic HTML code, well-formed CSS, and includes that's usually not a big problem, but I can see how it might get more complicated with a template-based CMS. You're right, I've never had to sue anyone before. When I was freelancing I always required a 50% non-refundable up front deposit with 50% due upon completion (but before delivery), which worked well for me. I'm sorry to hear you've been burned in the past, and will keep in mind how expensive lawsuits can get should I ever find myself freelancing again and feel an urge to let the deposit slide. As for running into coding problems, I'm pretty persistent when I don't understand something and will usually keep working at it until I figure things out, but that's when I'm doing my own coding--this first attempt at working with a CMS will likely result in me needing assistance at some point or other, so it's comforting to know you guys are here if I need you! Regards, Bev tedd wrote: > Bev: > > Some of the biggest problems I've had with clients is getting them to > agree and adhere to a certain layout. Without a solid foundation, your > site can fall apart very quickly -- especially when your client starts > to add and change stuff. > > I had one client recently who had a front page that had a static six > item menu on the left and a variable (0-16 items) "things of interest" > link list on the right. The client said that he wanted the top and > bottom of both (the menu and "things of interest") to line-up. The > client hadn't really thought this out. So, that took time for me to > explain the problem and I billed for it. This was an example of how a > client can waste your time if you allow it. Bill for everything > (including emails explaining things), but deliver what you say you will > on time, without problems, and clients will respect your work and come > back. > > As for contracts, a letter agreement outlining what is going to be done > for what money is good to reflect back on for reference. But, if you > want an iron-clad legal contract so you can take someone to court for > not paying for a $5k project, then you haven't sued anyone before. My > last suit cost me $20k over a $10k dispute. IMO, it's not worth it. So, > get 50% up front and the remainder when done. > > If the client won't pay (been stung two times in the last 12 years), > then just don't work for him again and move on. Simple, but effective. > > If you run into problems coding, organize and illustrate the problem and > drop it on us. Usually someone has been there before. You see, doing CMS > and dynamic sites are really simple things to accomplish. Most of us > have done it more than once. > > Good luck. > > tedd > From ka at kacomputerconsulting.com Fri Mar 28 17:10:14 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Fri, 28 Mar 2008 14:10:14 -0700 Subject: [nycphp-talk] CMS - Estimating Hours Message-ID: <1206738614.27142@coral.he.net> Bev -- Absolutely, especially if you have to answer to both an employer AND the client as to the agreed upon amount of time, make sure that you are really comfortable with the timeline you agree to. Also, if you have any programming questions, put them out there now rather than later so that you can educate yourself and be able to back up your employer's request to justify why it will take the amount of time it will take. Good luck! You will learn a lot doing this and have fun too :) Kristina > Kristina, thanks for adding to Marc's advice. I'm putting everyone's > feedback together so I can sort through it, organize it, and use is as a > guide to try and work my way through this project with as few gotchas as > possible. > > Though I'm no longer working freelance, I'll advise my employer that it > would be best to get an up-front payment on this lest it start to drag > out (which tends to happen even with static sites--it really gets absurd > sometimes). > > Regards, > Bev > > Kristina Anderson wrote: > > Exactly. The operative words here being "unexpected client requests". > > No matter how thoroughly you spec things out and try to anticipate > > everything you will be spending a LOT of time dealing with client > > saying "OH, but I thought the site would do XYZ..." or "OH, but I > > thought that it would be better if we did it like this instead" or just > > plain obnoxious behavior like, "GUESS WHAT, we decided that we need 4 > > additional reports of sales activity but we can't extend your > > deadline"...so allow as much extra time as your client will agree to. > > > > Explain to them that by your allowing for a sufficient amount of time > > and careful planning and testing, you are guaranteeing delivery of a > > quality application to them, and you don't want to cut corners in any > > way. > > > > Also make sure to get a percentage of payment up front or within the > > first couple of weeks, that way if things drag out during the client > > approval phase, you won't be left holding 100% of the bag waiting. > > > > And I totally 100% agree, it's nearly impossible to effectively test > > you own code to production-quality perfection, you need to plan to > > bring someone else in on that. > > > > -- Kristina > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > From lists at nopersonal.info Sat Mar 29 03:11:46 2008 From: lists at nopersonal.info (BAS) Date: Sat, 29 Mar 2008 03:11:46 -0400 Subject: [nycphp-talk] CMS - Estimating Hours In-Reply-To: <1206738614.27142@coral.he.net> References: <1206738614.27142@coral.he.net> Message-ID: <47EDEBB2.9090408@nopersonal.info> Kristina Anderson wrote: > Also, if you have any programming questions, put them out there now > rather than later so that you can educate yourself and be able to back > up your employer's request to justify why it will take the amount of > time it will take. Good advice. As a matter fact, I installed both Drupal & Joomla Thursday in the hopes that I can take a good long peek under the hood this weekend to see what I'm up against before I submit my estimate to her. > Good luck! You will learn a lot doing this and have fun too :) Thanks--I'll probably need all the luck, caffeine, and nicotine I can get my hands on! Bev ;-) From hans at cyberxdesigns.com Sun Mar 30 14:55:27 2008 From: hans at cyberxdesigns.com (Hans Kaspersetz) Date: Sun, 30 Mar 2008 13:55:27 -0500 Subject: [nycphp-talk] is_executable() returns false? Message-ID: <47EFE21F.4040608@cyberxdesigns.com> Hi guys and gals, I have a weird problem with is_executble(), it is returning false when it seems like it should return true. This is on a cpanel server with the following: Apache 1.3.x PHP 5.2.5 RHE Here is my test script:
"; exec("curl --version", $output); // Actually executing it to make sure it is there. print_r($output); ?> Here is my output: ---- out put to the browser ----- Is Exec: False Array ( [0] => curl 7.15.3 (i686-pc-linux-gnu) libcurl/7.15.3 OpenSSL/0.9.7a zlib/1.1.4 [1] => Protocols: tftp ftp telnet dict ldap http file https ftps [2] => Features: Largefile NTLM SSL libz ) ---- end of output --------------- I am not sure where to go from here. I wish I didn't have to deal with this, but the is_executable function is buried in xcart and I don't want to start moding the core. It seems like I might have some other problem that I am just not seeing. Thanks in advance, Hans K From paulcheung at tiscali.co.uk Sun Mar 30 16:18:10 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Sun, 30 Mar 2008 21:18:10 +0100 Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP Message-ID: <000f01c892a3$2db28d60$0300a8c0@X9183> HELP!! - The application uses PHP sessions and not cookies as well as a PHP Include to bring in a Javascript date routine, which is works fine. The problem is I cannot transfer the Javascript variable needed in to PHP. I have checked on the Net; But cannot find any solution that uses Includes and Sessions. From hans at cyberxdesigns.com Sun Mar 30 15:32:11 2008 From: hans at cyberxdesigns.com (Hans Kaspersetz) Date: Sun, 30 Mar 2008 14:32:11 -0500 Subject: [nycphp-talk] is_executable() returns false? - Solution In-Reply-To: <47EFE21F.4040608@cyberxdesigns.com> References: <47EFE21F.4040608@cyberxdesigns.com> Message-ID: <47EFEABB.2080504@cyberxdesigns.com> Hans Kaspersetz wrote: > Hi guys and gals, > > I have a weird problem with is_executble(), it is returning false when > it seems like it should return true. This is on a cpanel server with > the following: > > Apache 1.3.x > PHP 5.2.5 > RHE > > > Here is my test script: > > clearstatcache(); > > $r = is_executable("curl"); // The offending function. > > echo "Is Exec: "; > echo ($r)? "True":"False"; //Getting printable output. > echo "

"; > > exec("curl --version", $output); // Actually executing it to make > sure it is there. > print_r($output); > ?> > > Here is my output: > > ---- out put to the browser ----- > > Is Exec: False > > Array ( [0] => curl 7.15.3 (i686-pc-linux-gnu) libcurl/7.15.3 > OpenSSL/0.9.7a zlib/1.1.4 [1] => Protocols: tftp ftp telnet dict ldap > http file https ftps [2] => Features: Largefile NTLM SSL libz ) > > ---- end of output --------------- > > I am not sure where to go from here. I wish I didn't have to deal > with this, but the is_executable function is buried in xcart and I > don't want to start moding the core. It seems like I might have some > other problem that I am just not seeing. > > Thanks in advance, > Hans K > > > The solution was that I needed to modify my open_basedir line in http.conf for the virtual host and include /usr/bin. After I did this for http, I struggled with why it wasn't working still reliably. Dur! I also had to make this change in the SSL config for the site. I think it is amazing that after being completely frustrated and after I post to the list, minutes later I find the solution. Oh well...... Hans K From tom at supertom.com Sun Mar 30 16:49:28 2008 From: tom at supertom.com (Tom Melendez) Date: Sun, 30 Mar 2008 13:49:28 -0700 Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP In-Reply-To: <000f01c892a3$2db28d60$0300a8c0@X9183> References: <000f01c892a3$2db28d60$0300a8c0@X9183> Message-ID: <117286890803301349n15083bcblde6bc2ebbc7ee67d@mail.gmail.com> Hi Paul, Please slow down and provide us with some more information. 1. What is the problem? Meaning, what is the end result? Application doesn't work? Which parts? Explain the flow of the part that doesn't work 2. Sounds like you might be moving this application from somewhere else. What is different about the architecture of each. A phpinfo on each server would go a long way in determining this. 3. Have you narrowed it down to a piece of code? Can you share that code with us? Thanks, Tom http://www.liphp.org On Sun, Mar 30, 2008 at 1:18 PM, PaulCheung wrote: > HELP!! - The application uses PHP sessions and not cookies as well as a PHP > Include to bring in a Javascript date routine, which is works fine. The > problem is I cannot transfer the Javascript variable needed in to PHP. > > I have checked on the Net; But cannot find any solution that uses Includes > and Sessions. > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/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 Mar 30 17:13:59 2008 From: ramons at gmx.net (David Krings) Date: Sun, 30 Mar 2008 17:13:59 -0400 Subject: [nycphp-talk] is_executable() returns false? - Solution In-Reply-To: <47EFEABB.2080504@cyberxdesigns.com> References: <47EFE21F.4040608@cyberxdesigns.com> <47EFEABB.2080504@cyberxdesigns.com> Message-ID: <47F00297.9040201@gmx.net> Hans Kaspersetz wrote: > I think it is amazing that after being completely frustrated and after I > post to the list, minutes later I find the solution. Oh well...... This happens to me all the time. I start wiriting an email to the list and in order to provide as much detail as possible I eventually come across something that doesn't look right and find the solution. David From danielc at analysisandsolutions.com Sun Mar 30 18:07:58 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sun, 30 Mar 2008 18:07:58 -0400 Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP In-Reply-To: <000f01c892a3$2db28d60$0300a8c0@X9183> References: <000f01c892a3$2db28d60$0300a8c0@X9183> Message-ID: <20080330220758.GA27670@panix.com> Hi Paul: On Sun, Mar 30, 2008 at 09:18:10PM +0100, PaulCheung wrote: > The problem is I cannot transfer the Javascript variable needed in to PHP. JavaScript is client side. PHP is server side. This has been discussed on this list a couple times, and on the web too many times to count. You either need to submit the JS data to the server as part of a form or via an AJAX request. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From tedd at sperling.com Mon Mar 31 09:27:31 2008 From: tedd at sperling.com (tedd) Date: Mon, 31 Mar 2008 09:27:31 -0400 Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP In-Reply-To: <20080330220758.GA27670@panix.com> References: <000f01c892a3$2db28d60$0300a8c0@X9183> <20080330220758.GA27670@panix.com> Message-ID: At 6:07 PM -0400 3/30/08, Daniel Convissor wrote: >Hi Paul: > >On Sun, Mar 30, 2008 at 09:18:10PM +0100, PaulCheung wrote: > >> The problem is I cannot transfer the Javascript variable needed in to PHP. > >JavaScript is client side. PHP is server side. This has been discussed >on this list a couple times, and on the web too many times to count. > >You either need to submit the JS data to the server as part of a form or >via an AJAX request. > >--Dan --Dan: And don't forget this way: :-) var a = 1; (new Image()).src = '/myscript.php?a='+ a; Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From brian at realm3.com Mon Mar 31 09:32:33 2008 From: brian at realm3.com (Brian D.) Date: Mon, 31 Mar 2008 09:32:33 -0400 Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP In-Reply-To: References: <000f01c892a3$2db28d60$0300a8c0@X9183> <20080330220758.GA27670@panix.com> Message-ID: > And don't forget this way: :-) > > var a = 1; > (new Image()).src = '/myscript.php?a='+ a; I'm going to recommend *against* that. That works, but it's an ugly hack, and often when you're trying to do something like this you're not addressing a deeper architectural problem. [snip] -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594 From ps at sun-code.com Mon Mar 31 17:23:52 2008 From: ps at sun-code.com (Peter Sawczynec) Date: Mon, 31 Mar 2008 17:23:52 -0400 Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP In-Reply-To: References: <000f01c892a3$2db28d60$0300a8c0@X9183><20080330220758.GA27670@panix.com> Message-ID: <000501c89375$8528a7f0$8f79f7d0$@com> To complicate this little ole back to basics essential item. Here lies crude but doable intermingling of php into js on the fly as a web page is being created. So you are passing php vars to js, you just do all of it 100% in advance before you even output a single drop of final scripts or html. ...Happy coding. Pseudo code of sorts follows: \n"; echo "var allowed_dates[] = "; for each $allowed_dates_array echo $allowed_dates array item . ", \n" ... ... ... ... echo "function validate_dates_with_js(date_to_check){\n" echo " if (date_to_check in allowed_dates){ " echo " //then do stuff" echo " }\n" echo "}\n" ... ... ... ... //in further html to echo down below create links, drop down lists or sets of needed check boxes or radio buttons //by iterating through the same above master php arrays, e.g.: echo "\n"; echo "\n"; for each $allowed_dates_array echo "\n"; echo ""; //so now the javascript arrays and validation functions generated above are totally coordinated with //the web page html items that need to be validated or linked or associated in harmony //You can use the same logic to create custom links, custom announcements, whatever... that is exactly //coordinated to this user, e.g: echo "Go get your data, ".$user_name." now!"; turn off output buffering output all the content created above ?> -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of tedd Sent: Monday, March 31, 2008 9:28 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Passing JAVASCRIPT variables to PHP At 6:07 PM -0400 3/30/08, Daniel Convissor wrote: >Hi Paul: > >On Sun, Mar 30, 2008 at 09:18:10PM +0100, PaulCheung wrote: > >> The problem is I cannot transfer the Javascript variable needed in to PHP. > >JavaScript is client side. PHP is server side. This has been discussed >on this list a couple times, and on the web too many times to count. > >You either need to submit the JS data to the server as part of a form or >via an AJAX request. > >--Dan --Dan: And don't forget this way: :-) var a = 1; (new Image()).src = '/myscript.php?a='+ a; Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From paulcheung at tiscali.co.uk Mon Mar 31 15:43:33 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Mon, 31 Mar 2008 20:43:33 +0100 Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP References: <000f01c892a3$2db28d60$0300a8c0@X9183> <117286890803301349n15083bcblde6bc2ebbc7ee67d@mail.gmail.com> Message-ID: <003401c89367$8f7c9440$0300a8c0@X9183> Hi Tom, Not a problem. Here is the "Capture Client Date Routine" which I "include" into the main PHP script. It was here I thought by using an include I could overcome the problem with transfer of Javascript data to PHP. Unless there is a simpler way I will have to swat up on AJAX Paul ----- Original Message ----- From: "Tom Melendez" To: "NYPHP Talk" Sent: Sunday, March 30, 2008 9:49 PM Subject: Re: [nycphp-talk] Passing JAVASCRIPT variables to PHP > Hi Paul, > > Please slow down and provide us with some more information. > > 1. What is the problem? Meaning, what is the end result? > Application doesn't work? Which parts? Explain the flow of the part > that doesn't work > 2. Sounds like you might be moving this application from somewhere > else. What is different about the architecture of each. A phpinfo on > each server would go a long way in determining this. > 3. Have you narrowed it down to a piece of code? Can you share that > code with us? > > Thanks, > > Tom > http://www.liphp.org > > > On Sun, Mar 30, 2008 at 1:18 PM, PaulCheung > wrote: >> HELP!! - The application uses PHP sessions and not cookies as well as a >> PHP >> Include to bring in a Javascript date routine, which is works fine. The >> problem is I cannot transfer the Javascript variable needed in to PHP. >> >> I have checked on the Net; But cannot find any solution that uses >> Includes >> and Sessions. >> >> >> >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/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 tedd at sperling.com Mon Mar 31 18:30:56 2008 From: tedd at sperling.com (tedd) Date: Mon, 31 Mar 2008 18:30:56 -0400 Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP In-Reply-To: References: <000f01c892a3$2db28d60$0300a8c0@X9183> <20080330220758.GA27670@panix.com> Message-ID: At 9:32 AM -0400 3/31/08, Brian D. wrote: > > And don't forget this way: :-) >> >> var a = 1; >> (new Image()).src = '/myscript.php?a='+ a; > >I'm going to recommend *against* that. That works, but it's an ugly >hack, and often when you're trying to do something like this you're >not addressing a deeper architectural problem. > >[snip] Brian: Ugly is relative and "hacks" are common -- ever use css? The solution I provided is simple and works. The point here -- however -- is that Dan said: >You either need to submit the JS data to the server as part of a form or >via an AJAX request. And, I provided a third way. I think there are probably others. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From susan_shemin at yahoo.com Mon Mar 31 18:51:26 2008 From: susan_shemin at yahoo.com (Susan Shemin) Date: Mon, 31 Mar 2008 15:51:26 -0700 (PDT) Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP Message-ID: <688499.15038.qm@web50211.mail.re2.yahoo.com> I'm watching this discussion with interest since I asked a similar question last month (about sending PHP stats from a JS onclick event). The answer that came up was to put a redirect to the link page, run the PHP script on a redirect.php page and then send it on to the destination. I've set it up this way and it's working fantastically, but I have tons of links and I'm beginning to feel hesitant about sending users to a redirect when there's so many harmful redirects out there. (Of course, not mine...) Just as this question came up here, I was again researching it on the internet, and very clearly saw that the crux of the problem is that Javascript is client side and PHP server side, meaning the 2 don't mix unless in Ajax. So I'm off to brush up on my Ajax and get it working, because except for the redirect, I can only see that Ajax will work. Susan -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at realm3.com Mon Mar 31 19:25:14 2008 From: brian at realm3.com (Brian D.) Date: Mon, 31 Mar 2008 19:25:14 -0400 Subject: [nycphp-talk] Passing JAVASCRIPT variables to PHP In-Reply-To: <688499.15038.qm@web50211.mail.re2.yahoo.com> References: <688499.15038.qm@web50211.mail.re2.yahoo.com> Message-ID: Susan hit the nail on the head. She's pointing out why I said it was a "hack" - if you're not understanding the problem correctly (the difference between client-side and server-side) then the proposed solution might be "simple and workable" but it's still wrong. More to the point, what exactly are your goals with this code, Paul? Are you just trying to get the exact time on the client's computer? Are you just trying to create a timestamp in their timezone? On Mon, Mar 31, 2008 at 6:51 PM, Susan Shemin wrote: > > > > I'm watching this discussion with interest since I asked a similar question > last month (about sending PHP stats from a JS onclick event). The answer > that came up was to put a redirect to the link page, run the PHP script on a > redirect.php page and then send it on to the destination. > > > > I've set it up this way and it's working fantastically, but I have tons of > links and I'm beginning to feel hesitant about sending users to a redirect > when there's so many harmful redirects out there. (Of course, not mine...) > > > > Just as this question came up here, I was again researching it on the > internet, and very clearly saw that the crux of the problem is that > Javascript is client side and PHP server side, meaning the 2 don't mix > unless in Ajax. > > > > So I'm off to brush up on my Ajax and get it working, because except for the > redirect, I can only see that Ajax will work. > > > > Susan > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- realm3 web applications [realm3.com] freelance consulting, application development (917) 512-3594