php-general Digest 15 Feb 2011 16:52:10 -0000 Issue 7183

2011-02-15 Thread php-general-digest-help
php-general Digest 15 Feb 2011 16:52:10 - Issue 7183 Topics (messages 311301 through 311306): Correct file permissions for a website 311301 by: Ashim Kapoor 311302 by: Camilo Sperberg Re: 2 submit buttons. 311303 by: Floyd Resler 311304 by: Steve Staples

[PHP] Correct file permissions for a website

2011-02-15 Thread Ashim Kapoor
Dear All, The book PHP and MySQL bible says that the php directory should be world executable ? I remember posting a different question earlier to this list and one person suggesting this and another person replying that that was incorrect. Could someone clear the smoke on this one ? Many

Re: [PHP] Correct file permissions for a website

2011-02-15 Thread Camilo Sperberg
On Tue, Feb 15, 2011 at 08:35, Ashim Kapoor ashimkap...@gmail.com wrote: Dear All, The book PHP and MySQL bible says that the php directory should be world executable ? I remember posting a different question earlier to this list and one person suggesting this and another person replying

Re: [PHP] 2 submit buttons.

2011-02-15 Thread Floyd Resler
On Feb 14, 2011, at 5:24 PM, Paul M Foster wrote: On Mon, Feb 14, 2011 at 05:15:11PM -0500, Floyd Resler wrote: On Feb 14, 2011, at 4:18 PM, Paul M Foster wrote: On Mon, Feb 14, 2011 at 03:35:02PM -0400, Paul Halliday wrote: I have 2 buttons on a page: if

Re: [PHP] 2 submit buttons.

2011-02-15 Thread Steve Staples
On Tue, 2011-02-15 at 08:07 -0500, Floyd Resler wrote: On Feb 14, 2011, at 5:24 PM, Paul M Foster wrote: On Mon, Feb 14, 2011 at 05:15:11PM -0500, Floyd Resler wrote: On Feb 14, 2011, at 4:18 PM, Paul M Foster wrote: On Mon, Feb 14, 2011 at 03:35:02PM -0400, Paul Halliday wrote:

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Daniel Brown
On Mon, Feb 14, 2011 at 20:26, Brian Waters brianmwat...@gmail.com wrote: Hi everyone! I'm just starting out with PHP so I'm looking for a good place to ask some questions, have my code critiqued (read: visciously ripped apart), and generally BS about PHP and programming in general (if that's

Re: [PHP] Howdy (new in here)

2011-02-15 Thread tedd
At 8:26 PM -0500 2/14/11, Brian Waters wrote: Hi everyone! I'm just starting out with PHP so I'm looking for a good place to ask some questions, have my code critiqued (read: visciously ripped apart), and generally BS about PHP and programming in general (if that's OK). I know that PHP sometimes

[PHP] Re:[PHP] code quest

2011-02-15 Thread Kirk Bailey
Frankly, while that modulo looks like something worthy of learning, for my immediate time critical need I went with a quicker method, which is working. The complete script is below. It simply counts cells and resets the row when a number is exceeded. ?php # The next several lines declare an

Re: [PHP] Howdy (new in here)

2011-02-15 Thread David Harkness
Welcome to the list, Brian. I'm fairly new to PHP and the list myself, and I've found it to be a great resource. Another is stackoverflow.com, especially for How do I do X? type questions. I often find someone else has already provided an answer. On Tue, Feb 15, 2011 at 8:51 AM, tedd

[PHP] Howdy (new in here)

2011-02-15 Thread Daniel Brown
Back to the list for Kirk ;-P -- Forwarded message -- From: Kirk Bailey kbai...@howlermonkey.net Date: Tue, Feb 15, 2011 at 12:09 Subject: Re: [PHP] Howdy (new in here) To: Daniel Brown danbr...@php.net On 2/15/2011 10:03 AM, Daniel Brown wrote: On Mon, Feb 14, 2011

Re: [PHP] using BOTH GET and POST in the same page.

2011-02-15 Thread tedd
At 4:32 PM -0500 2/14/11, Paul M Foster wrote: Understood. It sounded like you were saying you could only get back POST or GET values from a page, which isn't true. The form itself, yes, can only have one or the other method attribute. What it sounded like was: What others have not

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Nicholas Kell
On Feb 15, 2011, at 10:51 AM, tedd wrote: At 8:26 PM -0500 2/14/11, Brian Waters wrote: Hi everyone! I'm just starting out with PHP so I'm looking for a good place to ask some questions, have my code critiqued (read: visciously ripped apart), and generally BS about PHP and programming in

Re: [PHP] Howdy (new in here)

2011-02-15 Thread tedd
Welcome to the list, Brian. I'm fairly new to PHP and the list myself, and I've found it to be a great resource. Another is http://stackoverflow.comstackoverflow.com, especially for How do I do X? type questions. I often find someone else has already provided an answer. On Tue, Feb 15, 2011

Re: [PHP] Howdy (new in here)

2011-02-15 Thread tedd
At 11:37 AM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 10:51 AM, tedd wrote: At 8:26 PM -0500 2/14/11, Brian Waters wrote: (if that's OK). I know that PHP sometimes has a reputation for having (some) lousy developers, and I'd like to avoid becoming one of those We don't

[PHP] Mysql 5.5 and PHP Mysql API Version 5.1.41

2011-02-15 Thread Matthias Laug
Hey there, I've just migrated to Mysql 5.5 from source and it works like a charm. Still every now and then (in intervals of approximatly an hour) I get the following error: Error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2013] Lost connection to MySQL server at

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Nicholas Kell
On Feb 15, 2011, at 11:52 AM, tedd wrote: At 11:37 AM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 10:51 AM, tedd wrote: At 8:26 PM -0500 2/14/11, Brian Waters wrote: (if that's OK). I know that PHP sometimes has a reputation for having (some) lousy developers, and I'd like to

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Brian Waters
On Tue, Feb 15, 2011 at 12:52 PM, tedd tedd.sperl...@gmail.com wrote: At 11:37 AM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 10:51 AM, tedd wrote: At 8:26 PM -0500 2/14/11, Brian Waters wrote: (if that's OK). I know that PHP sometimes has a reputation for having (some)

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Mujtaba Arshad
I would say all languages have their 'lousy developers', however, since very few schools focus on teaching the 'proper coding style' for PHP it leads to people learning from a variety of resources available online, and this leads to them receiving mixed messages from the tutorials and allowing

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Nicholas Kell
On Feb 15, 2011, at 1:20 PM, Mujtaba Arshad wrote: I would say all languages have their 'lousy developers', however, since very few schools focus on teaching the 'proper coding style' for PHP it leads to people learning from a variety of resources available online, and this leads to them

[PHP] Displaying Results

2011-02-15 Thread Ethan Rosenberg
Dear List - I have a form. In one field, the customer types the name of a product. The first seven(7) results of the MySQL query that the entry generates should be displayed as a clickable drop down list. How do I do it? Thanks. Ethan MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)]

Re: [PHP] Displaying Results

2011-02-15 Thread Peter Lind
On 15 February 2011 20:28, Ethan Rosenberg eth...@earthlink.net wrote: Dear List -  I have a form.  In one field, the customer types the name of a product.  The first seven(7) results of the MySQL query that the entry generates should be displayed as a clickable drop down list. How do I do

Re: [PHP] Howdy (new in here)

2011-02-15 Thread tedd
At 2:03 PM -0500 2/15/11, Brian Waters wrote: On Tue, Feb 15, 2011 at 12:52 PM, tedd tedd.sperl...@gmail.com wrote: I guess that we run in different worlds. Most of the PHP programmers I know are very good. I didn't mean to suggest anything. Nor do I necessarily subscribe to the idea

Re: [PHP] Howdy (new in here)

2011-02-15 Thread tedd
At 12:52 PM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 11:52 AM, tedd wrote: I guess that we run in different worlds. Most of the PHP programmers I know are very good. I have to agree with you, tedd. Most of the PHP devs that I know are also quite good. But, the fact that

Re: [PHP] Howdy (new in here)

2011-02-15 Thread tedd
At 2:20 PM -0500 2/15/11, Mujtaba Arshad wrote: I would say all languages have their 'lousy developers', however, since very few schools focus on teaching the 'proper coding style' for PHP it leads to people learning from a variety of resources available online, and this leads to them receiving

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Brian Waters
On Tue, Feb 15, 2011 at 3:37 PM, tedd tedd.sperl...@gmail.com wrote: So, I took a *weekend* and programmed about 90 percent of application in FutureBasic. I then created a shell application and forwarded it to the client. After receiving the application, the client said Yes, this is exactly

[PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Brian Dunning
Hey all - I've got long articles, the HTML for which comes out of MySQL. Works great. I want to split it up so that I can insert ad blocks at various points within it. The articles are all pretty long but they're of variable length. I want to chop them up into three close-to-equal (doesn't

[PHP] Re: PHP -- using without installing

2011-02-15 Thread Michelle Konzack
Hello Steve Staples, Am 2011-02-14 12:32:51, hacktest Du folgendes herunter: Is there such a thing? or will I have to have a pre-req of php and php-cgi must be installed on linux disclaimer? If you are a OVER-GEEK, youc can compile the php and php-cli 100% static, which I have done some

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Steve Staples
On Tue, 2011-02-15 at 15:54 -0500, tedd wrote: At 2:20 PM -0500 2/15/11, Mujtaba Arshad wrote: I would say all languages have their 'lousy developers', however, since very few schools focus on teaching the 'proper coding style' for PHP it leads to people learning from a variety of resources

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Simon J Welsh
On 16/02/2011, at 10:03 AM, Brian Dunning wrote: Hey all - I've got long articles, the HTML for which comes out of MySQL. Works great. I want to split it up so that I can insert ad blocks at various points within it. The articles are all pretty long but they're of variable length. I want

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Robert Cummings
On 11-02-15 04:03 PM, Brian Dunning wrote: Hey all - I've got long articles, the HTML for which comes out of MySQL. Works great. I want to split it up so that I can insert ad blocks at various points within it. The articles are all pretty long but they're of variable length. I want to chop

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Robert Cummings
On 11-02-15 04:08 PM, Steve Staples wrote: Tedd: Your bracing style is WRONG. Whitesmiths Style sucks... and Allman Style is the best way to do it. :) My personal bracing style is the Allman Style... I've been doing it that way forever, it just made sense to me (even before I knew there was

Re: [PHP] Howdy (new in here)

2011-02-15 Thread David Harkness
On Tue, Feb 15, 2011 at 1:08 PM, Steve Staples sstap...@mnsi.net wrote: My personal bracing style is the Allman Style. I use KR. I started with it just as shown but as monitors increased in size I stopped cuddling the else so it's now on its own line, aligning the if, elseif, and else nicely.

Re: [PHP] Rate my (really) simple template class

2011-02-15 Thread Brian Waters
On Mon, Feb 14, 2011 at 11:49 PM, Paul M Foster pa...@quillandmouse.com wrote: Advice: don't use eval() this way. It's slow and dangerous. Could you elaborate, or provide a link? ...read in the file and pass it to you on the stack, which is really an abuse of the stack if you can avoid it.

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Mujtaba Arshad
@tedd I was interested about the reasons why people perceive php as a poor language. I came across the following stackoverflow thread: http://stackoverflow.com/questions/309300/defend-php-convince-me-it-isnt-horrible The guy answering him immediately after brought up some very good rebuttals,

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Robert Cummings
On 11-02-15 04:59 PM, Brian Waters wrote: On Tue, Feb 15, 2011 at 4:50 PM, Robert Cummingsrob...@interjinn.com wrote: I started with KR and quickly migrated to Allman style. The advantage I see with Allman is that the braces form a visual pocket into which the associated code gets placed :)

Re: [PHP] Jquery

2011-02-15 Thread David Harkness
I see firebug-lite-debug.js but not jquery.js. Does firebug include jquery? David

RE: [PHP] Howdy (new in here)

2011-02-15 Thread Jay Blanchard
[snip] Allman Style is the best way to do it. [/snip] Only if you're playing guitar Junior. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Donovan Brooke
[snip] This is what I show my students: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php Cheers, tedd I didn't know there were names for bracing styles... but I used the KR Style on my last project, which I would call the Larry Ullman style since that is where I took it from.

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Brian Dunning
Yes, thanks, what I'm looking for is how to do that. On Feb 15, 2011, at 1:38 PM, Simon J Welsh wrote: Assuming you're only using p tags, count the number of opening p tags, divide by three. First ad block goes after the round($amount/3)-th /p, second ad block goes after the

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Andre Polykanine
Hello David, As for me, I use KR style, also. I find it the most readable, accessible and maintainable. -- With best regards from Ukraine, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter: http://twitter.com/m_elensule Facebook:

Re: [PHP] Custom function

2011-02-15 Thread Andre Polykanine
Hello Ron, Give it a default (possible empty) value: function MyFunction($x, $y, $z=) { // function goes here if (!empty($z)) { // The optional parameter is given } } -- With best regards from Ukraine, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter:

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Richard Quadling
On 15 February 2011 20:42, tedd tedd.sperl...@gmail.com wrote: At 12:52 PM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 11:52 AM, tedd wrote:   I guess that we run in different worlds. Most of the PHP programmers I know are very good. I have to agree with you, tedd. Most of the

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Richard Quadling
On 15 February 2011 21:08, Steve Staples sstap...@mnsi.net wrote: Your bracing style is WRONG.  Whitesmiths Style sucks... and Allman Style is the best way to do it. It's not Friday. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread David Robley
Brian Dunning wrote: Yes, thanks, what I'm looking for is how to do that. On Feb 15, 2011, at 1:38 PM, Simon J Welsh wrote: Assuming you're only using p tags, count the number of opening p tags, divide by three. First ad block goes after the round($amount/3)-th /p, second ad block goes

Re: [PHP] Custom function

2011-02-15 Thread Mark Kelly
Hi. On Tuesday 15 Feb 2011 at 23:41 Andre Polykanine wrote: Give it a default (possible empty) value: function MyFunction($x, $y, $z=) { // function goes here if (!empty($z)) { // The optional parameter is given } } Using an empty string and the empty() function in this way can lead to

Re: [PHP] Custom function

2011-02-15 Thread Richard Quadling
On 16 February 2011 00:21, Mark Kelly p...@wastedtimes.net wrote: Hi. On Tuesday 15 Feb 2011 at 23:41 Andre Polykanine wrote: Give it a default (possible empty) value: function MyFunction($x, $y, $z=) { // function goes here if (!empty($z)) { // The optional parameter is given } }

Re: [PHP] Custom function

2011-02-15 Thread Andre Polykanine
Hello Mark, Hm... will if ($z) evaluate to true if $z==0? I thought no... Actually, we can use if (isset($z)) -- With best regards from Ukraine, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter: http://twitter.com/m_elensule Facebook:

Re: [PHP] Custom function

2011-02-15 Thread Simon J Welsh
On 16/02/2011, at 1:21 PM, Mark Kelly wrote: In this way almost any value in $z will trigger the conditional code, including 0 or an empty string. The exceptions are FALSE and NULL. If you explicitly need to react to a NULL value, use is_null() to detect it.

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Micky Hulse
On Tue, Feb 15, 2011 at 2:00 PM, David Harkness davi...@highgearmedia.com wrote: I use KR. I started with it just as shown but as monitors increased in size I stopped cuddling the else so it's now on its own line, aligning the if, elseif, and else nicely. One of the developers at my company

[PHP] Re: PHP arguments getting lost in call!?

2011-02-15 Thread Florin Jurcovici
Hi. I had no idea you were using Xdebug. When you said Zend Studio i assumed you were using the standard Zend debugger. My bad. Been trying to get Xdebug working in combination with Zend Studio 8. The two seem to talk to each other. But Zend Studio doesn't display any data, no breakpoints,

Re: [PHP] Rate my (really) simple template class

2011-02-15 Thread Paul M Foster
On Tue, Feb 15, 2011 at 05:02:51PM -0500, Brian Waters wrote: On Mon, Feb 14, 2011 at 11:49 PM, Paul M Foster pa...@quillandmouse.com wrote: Advice: don't use eval() this way. It's slow and dangerous. Could you elaborate, or provide a link? A year or two on this list. The comments in the

Re: [PHP] Rate my (really) simple template class

2011-02-15 Thread Adam Richardson
On Tue, Feb 15, 2011 at 5:02 PM, Brian Waters brianmwat...@gmail.comwrote: On Mon, Feb 14, 2011 at 11:49 PM, Paul M Foster pa...@quillandmouse.com wrote: Advice: don't use eval() this way. It's slow and dangerous. Could you elaborate, or provide a link? Hi Brian, Here's a dated but still

Re: [PHP] Rate my (really) simple template class

2011-02-15 Thread David Hutto
On Mon, Feb 14, 2011 at 9:52 PM, Brian Waters brianmwat...@gmail.com wrote: So I decided to write a template class in order to get myself going on learning PHP. Of course I wrote the simplest thing possible: class Template {        protected $template;        protected $vars;        

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Tamara Temple
On Feb 15, 2011, at 4:32 PM, Brian Dunning wrote: Yes, thanks, what I'm looking for is how to do that. On Feb 15, 2011, at 1:38 PM, Simon J Welsh wrote: Assuming you're only using p tags, count the number of opening p tags, divide by three. First ad block goes after the

Re: [PHP] Howdy (new in here)

2011-02-15 Thread Tamara Temple
On Feb 15, 2011, at 4:17 PM, Donovan Brooke wrote: [snip] This is what I show my students: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php Cheers, tedd I didn't know there were names for bracing styles... but Neither did I -- just the KR style was the only name I recognized. (I