Re: [PHP] Mystery foreach error

2013-03-13 Thread Angela Barone
On Mar 13, 2013, at 5:02 PM, David Harkness wrote: > isset() will return false for an array key 'foo' mapped to a null value > whereas array_key_exists() will return true. The latter asks "Is this key in > the array?" whereas isset() adds "and is its value not null?" While isset() > is every-so-

Re: [PHP] Mystery foreach error

2013-03-13 Thread Sebastian Krebs
2013/3/14 David Harkness > > On Wed, Mar 13, 2013 at 5:10 PM, Sebastian Krebs wrote: > >> Because 'null' is the representation of "nothing" array_key_exists() and >> isset() can be treated as semantically equivalent. > > > As I said, these functions return different results for null values. It >

Re: [PHP] Mystery foreach error

2013-03-13 Thread David Harkness
On Wed, Mar 13, 2013 at 5:10 PM, Sebastian Krebs wrote: > Because 'null' is the representation of "nothing" array_key_exists() and > isset() can be treated as semantically equivalent. As I said, these functions return different results for null values. It won't matter for Angela since she isn't

Re: [PHP] Mystery foreach error

2013-03-13 Thread Sebastian Krebs
2013/3/14 David Harkness > On Wed, Mar 13, 2013 at 4:44 PM, Angela Barone > wrote: > > > I ran across if(array_key_exists) and it seems to work. How does that > > differ from if(isset($states[$state]))? > > > Hi Angela, > > isset() will return false for an array key 'foo' mapped to a null value

Re: FW: [PHP] Accessing Files Outside the Web Root

2013-03-13 Thread David Robley
"Dale H. Cook" wrote: > At 05:04 PM 3/13/2013, Dan McCullough wrote > : >>Web bots can ignore the robots.txt file, most scrapers would. > > and at 05:06 PM 3/13/2013, Marc Guay wrote: > >>These don't sound like robots that would respect a txt file to me. > > Dan and Marc are correct. Although I

Re: [PHP] Mystery foreach error

2013-03-13 Thread David Harkness
On Wed, Mar 13, 2013 at 4:44 PM, Angela Barone wrote: > I ran across if(array_key_exists) and it seems to work. How does that > differ from if(isset($states[$state]))? Hi Angela, isset() will return false for an array key 'foo' mapped to a null value whereas array_key_exists() will return true

Re: [PHP] Mystery foreach error

2013-03-13 Thread Angela Barone
On Mar 13, 2013, at 4:24 PM, Matijn Woudt wrote: > That wouldn't work, in_array checks the values, and your states are in the > keys. Use: > if(isset($states[$state])) Hi Matijn, Before I received your email, I ran across if(array_key_exists) and it seems to work. How does that differ

Re: [PHP] Mystery foreach error

2013-03-13 Thread Matijn Woudt
On Thu, Mar 14, 2013 at 12:18 AM, Angela Barone wrote: > On Mar 13, 2013, at 9:07 AM, Jim Giner wrote: > > Why not just check if the $state exists as a key of the array $states > before doing this? > > Jim, > > Are you thinking about the in_array function? > > Angela That wouldn't work,

Re: [PHP] Mystery foreach error

2013-03-13 Thread Angela Barone
On Mar 13, 2013, at 9:07 AM, Jim Giner wrote: > Why not just check if the $state exists as a key of the array $states before > doing this? Jim, Are you thinking about the in_array function? Angela

Re: [PHP] Mystery foreach error

2013-03-13 Thread Matijn Woudt
On Wed, Mar 13, 2013 at 5:07 PM, Jim Giner wrote: > On 3/12/2013 9:04 PM, Angela Barone wrote: > >> On Mar 12, 2013, at 5:16 PM, David Robley wrote: >> >>> Presumably there is a fixed list of State - those are US states? - >>> >> >> so why not provide a drop down list of the possible choices? >>>

Re: FW: [PHP] Accessing Files Outside the Web Root

2013-03-13 Thread Dale H. Cook
At 05:04 PM 3/13/2013, Dan McCullough wrote : >Web bots can ignore the robots.txt file, most scrapers would. and at 05:06 PM 3/13/2013, Marc Guay wrote: >These don't sound like robots that would respect a txt file to me. Dan and Marc are correct. Although I used the terms "spiders" and "pirates"

Re: FW: [PHP] Accessing Files Outside the Web Root

2013-03-13 Thread Dale H. Cook
At 04:58 PM 3/13/2013, Jen Rasmussen wrote: >Have you tried keeping all of your documents in one directory and blocking >that directory via a robots.txt file? A spider used by a pirate site does not have to honor robots.txt, just as a non-Adobe PDF utility does not have to honor security setting

Re: FW: [PHP] Accessing Files Outside the Web Root

2013-03-13 Thread Marc Guay
> Have you tried keeping all of your documents in one directory and blocking > that directory via a robots.txt file? These don't sound like robots that would respect a txt file to me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: FW: [PHP] Accessing Files Outside the Web Root

2013-03-13 Thread Dan McCullough
Web bots can ignore the robots.txt file, most scrapers would. On Mar 13, 2013 4:59 PM, "Jen Rasmussen" wrote: > -Original Message- > From: Dale H. Cook [mailto:radiot...@plymouthcolony.net] > Sent: Wednesday, March 13, 2013 3:38 PM > To: php-general@lists.php.net > Subject: [PHP] Accessin

FW: [PHP] Accessing Files Outside the Web Root

2013-03-13 Thread Jen Rasmussen
-Original Message- From: Dale H. Cook [mailto:radiot...@plymouthcolony.net] Sent: Wednesday, March 13, 2013 3:38 PM To: php-general@lists.php.net Subject: [PHP] Accessing Files Outside the Web Root Let me preface my question by noting that I am virtually a PHP novice. Although I am a long

[PHP] Accessing Files Outside the Web Root

2013-03-13 Thread Dale H. Cook
Let me preface my question by noting that I am virtually a PHP novice. Although I am a long-time webmaster, and have used PHP for some years to give visitors access to information in my SQL database, this is my first attempt to use it for another purpose. I have browsed the mailing list archives

Re: [PHP] Re: Generating CRUD code for normalized db

2013-03-13 Thread Bastien Koert
On Wed, Mar 13, 2013 at 2:55 PM, Ashley Sheridan wrote: > On Wed, 2013-03-13 at 19:24 +0100, Marco Behnke wrote: > >> Am 13.03.13 12:57, schrieb Gary: >> > ma...@behnke.biz wrote: >> > >> >> Do us all a favor abnd stay away from open source if you do not honor >> >> the work >> >> us wannabes put

Re: [PHP] mysql custom global defined variable

2013-03-13 Thread Marco Behnke
Am 13.03.13 10:35, schrieb Kevin Peterson: > In my database design, I tend to store some variable that is meant to be > acting as a ROLE or TYPE as SMALLINT. For example : > > CREATE TABLE `house` ( >`id` int(11) NOT NULL AUTO_INCREMENT, >`type` smallint(11) NOT NULL, > )

Re: [PHP] Re: Generating CRUD code for normalized db

2013-03-13 Thread Ashley Sheridan
On Wed, 2013-03-13 at 19:24 +0100, Marco Behnke wrote: > Am 13.03.13 12:57, schrieb Gary: > > ma...@behnke.biz wrote: > > > >> Do us all a favor abnd stay away from open source if you do not honor > >> the work > >> us wannabes put into it. > > As I said before "I wasn't aware you would feel that

Re: [PHP] Re: Generating CRUD code for normalized db

2013-03-13 Thread Marco Behnke
Am 13.03.13 12:57, schrieb Gary: > ma...@behnke.biz wrote: > >> Do us all a favor abnd stay away from open source if you do not honor >> the work >> us wannabes put into it. > As I said before "I wasn't aware you would feel that the cap fitted." > If you do feel that, then perhaps instead of compla

Re: [PHP] Mystery foreach error

2013-03-13 Thread Jim Giner
On 3/12/2013 9:04 PM, Angela Barone wrote: On Mar 12, 2013, at 5:16 PM, David Robley wrote: Presumably there is a fixed list of State - those are US states? - so why not provide a drop down list of the possible choices? There is, but the problem must have been that if someone didn't

[PHP] Re: Generating CRUD code for normalized db

2013-03-13 Thread Jim Giner
On 3/13/2013 7:57 AM, Gary wrote: ma...@behnke.biz wrote: Do us all a favor abnd stay away from open source if you do not honor the work us wannabes put into it. As I said before "I wasn't aware you would feel that the cap fitted." If you do feel that, then perhaps instead of complaining at m

[PHP] Traits - Is it stable to use get_class_methods on a trait?

2013-03-13 Thread NaMarPi
Hello All, there is a trait which sits in a class. I need the names of the trait methods, and get_class_methods does this job. I am happy with that, but is it safe/stable? Is there a better way to get trait method names? Thanks a lot. Working example (My_Class and My_Trait are in different fi

Re: [PHP] imap_open use to read the sent mail using gmail

2013-03-13 Thread TR Shaw
On Mar 13, 2013, at 10:20 AM, Kevin Peterson wrote: > Hi, > > I am using imap_open > ("{imap.gmail.com:993/imap/ssl/novalidate-cert/norsh}Inbox, $user, pass) but > want to access gmail sent box not the inbox. Please suggest how to proceed. > Use $mboxes = imap_getmailboxes($imap, "{imap.

Re: [PHP] mysql custom global defined variable

2013-03-13 Thread Camilo Sperberg
On Mar 13, 2013, at 10:35 AM, Kevin Peterson wrote: > In my database design, I tend to store some variable that is meant to be > acting as a ROLE or TYPE as SMALLINT. For example : > >CREATE TABLE `house` ( > `id` int(11) NOT NULL AUTO_INCREMENT, > `type` smallint(11) NOT NULL,

[PHP] mysql custom global defined variable

2013-03-13 Thread Kevin Peterson
In my database design, I tend to store some variable that is meant to be acting as a ROLE or TYPE as SMALLINT. For example : CREATE TABLE `house` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type` smallint(11) NOT NULL, ) And in php, I do define('HOUSE_SMALL_TYPE', '0');