Re: [PHP] Class and interface location

2011-01-18 Thread Adam Richardson
On Wed, Jan 19, 2011 at 2:07 AM, Larry Garfield wrote: > 3) Static analysis. Instead of reflection, either tokenize or string parse > all files to determine what classes implement what interfaces and then > cache > that information. We are actually using this method now to locate classes, > and

[PHP] Class and interface location

2011-01-18 Thread Larry Garfield
Hi all. I'm trying to come up with a solution to an architectural problem I could use some extra eyes on. I have (or will have) a large code base with lots of classes, spread out over many optional plugin components. These classes, of course, will have interfaces on them. These classes will,

Re: [PHP] switch case madness

2011-01-18 Thread Paul M Foster
On Tue, Jan 18, 2011 at 10:53:19PM -0600, Donovan Brooke wrote: > >Why not use one of the countless, not to mention secure and stable cookie > management systems available? If it's an exercise cool, I misunderstood. > > > >I'm not one to normally shun people rolling their own code, lord knows > I'

Re: [PHP] switch case madness

2011-01-18 Thread Donovan Brooke
Why not use one of the countless, not to mention secure and stable cookie management systems available? If it's an exercise cool, I misunderstood. I'm not one to normally shun people rolling their own code, lord knows I've done it more then once or twice, but there are some things I wouldn't to

Re: [PHP] switch case madness

2011-01-18 Thread Joshua Kehn
On Jan 18, 2011, at 11:33 PM, Donovan Brooke wrote: >>> -- >>> D Brooke >> >> I just died a bit on the inside. >> >> Why would you build that from scratch? >> >> Regards, >> >> -Josh > > > Alright, I'll bite (since I affected you that much) ;-), > > do tell... > > Why not? Would you rather

Re: [PHP] switch case madness

2011-01-18 Thread Donovan Brooke
-- D Brooke I just died a bit on the inside. Why would you build that from scratch? Regards, -Josh Alright, I'll bite (since I affected you that much) ;-), do tell... Why not? Would you rather I use PHP's session_start()? Donovan -- D Brooke -- PHP General Mailing List (http://www

Re: [PHP] switch case madness

2011-01-18 Thread Joshua Kehn
On Jan 18, 2011, at 11:01 PM, Donovan Brooke wrote: > Thanks. > > I had initialized $t_mssg as an empty string further up the chain out of old > habit.. removed that, and now it works... just built my first > basic cookie-based PHP/MySQL log-in script from scratch! ;-) > > Fun stuff, > Donovan

Re: [PHP] switch case madness

2011-01-18 Thread Donovan Brooke
Thanks. I had initialized $t_mssg as an empty string further up the chain out of old habit.. removed that, and now it works... just built my first basic cookie-based PHP/MySQL log-in script from scratch! ;-) Fun stuff, Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) T

Re: [PHP] switch case madness

2011-01-18 Thread Mujtaba Arshad
$t_mssg = 0 is different from $t_mssg = "0" (in all languages, as far as I know, maybe not in python, but I don't know python) On Tue, Jan 18, 2011 at 10:30 PM, Donovan Brooke wrote: > Hello, > > I must not understand PHP's switch/case.. > The case '0' below fires when $t_mssg = "" apparently. >

Re: [PHP] switch case madness

2011-01-18 Thread Joshua Kehn
On Jan 18, 2011, at 10:30 PM, Donovan Brooke wrote: > Hello, > > I must not understand PHP's switch/case.. > The case '0' below fires when $t_mssg = "" apparently. > Is this how it's suppose to work? I would think > it would only fire if it equaled "0". > > -- > print "-$t_mssg- "; >

Re: [PHP] switch case madness

2011-01-18 Thread Chen Dong
Hi, If it is a string "0", you should use: case "0". Because in PHP, 0 == false == null. You need to know the difference between == and ===. Regards, Dong Chen On Wed, Jan 19, 2011 at 2:30 PM, Donovan Brooke wrote: > Hello, > > I must not understand PHP's switch/case.. > The case '0' below fir

[PHP] switch case madness

2011-01-18 Thread Donovan Brooke
Hello, I must not understand PHP's switch/case.. The case '0' below fires when $t_mssg = "" apparently. Is this how it's suppose to work? I would think it would only fire if it equaled "0". -- print "-$t_mssg- "; if (isset($t_mssg)) { switch ($t_mssg) { case 0:

Re: [PHP]: permission problem www-data

2011-01-18 Thread Al
On 1/18/2011 4:44 AM, Moses wrote: Hi Everyone, I am creating a file in PHP script which takes a value from a form and writes it to a file. However, i don't have the mode permission for the file instead it is owned by www-data.What can i do to ensure that the file is owned by me. drwxr-xr-x

[PHP] Re: PHP Error logging

2011-01-18 Thread Carlos Medina
Am 18.01.2011 01:33, schrieb Jimmy Stewpot: Hello, I currently have a strange issue where we are seeing 'random errors' being displayed to end users. What I find most interesting is that in the php.ini file we have the following error settings. error_reporting = E_ALL& ~E_NOTICE display_er

Re: [PHP] 2nd Pair of eyes

2011-01-18 Thread Donovan Brooke
Daniel Brown wrote: On Tue, Jan 18, 2011 at 12:49, Donovan Brooke wrote: Hello, I warned the list that I may have questions! ;-) ...building a simple cookie-based log-in system, and have narrowed an error to this below: (sorry for email line breaks, if any) ---Start--- if ($_post['f_action']

Re: [PHP] 2nd Pair of eyes

2011-01-18 Thread Donovan Brooke
Simon J Welsh wrote: [snip] ---Start--- $query = "SELECT u_id FROM cms_users WHERE u_name = $_post['f_user'] AND u_pass = $_post['f_pass']"; Array indices either need to be accessed without quotes for the key, or by enclosing the variable in curly braces. --- Simon Welsh Admin of http://s

Re: [PHP] 2nd Pair of eyes

2011-01-18 Thread Simon J Welsh
On 19/01/2011, at 6:49 AM, Donovan Brooke wrote: > Hello, > > I warned the list that I may have questions! ;-) > > ...building a simple cookie-based log-in system, and have > narrowed an error to this below: (sorry for email line breaks, if any) > > ---Start--- >$query = "SELECT u_id FROM c

Re: [PHP] 2nd Pair of eyes

2011-01-18 Thread Richard Quadling
On 18 January 2011 17:49, Donovan Brooke wrote: >    $query = "SELECT u_id FROM cms_users WHERE u_name = $_post['f_user'] AND > u_pass = $_post['f_pass']"; Make sure you clean the inputs before using them. If the username entered was ... '' OR 1 -- you may have problems with security. -- Ri

Re: [PHP] 2nd Pair of eyes

2011-01-18 Thread Daniel Brown
On Tue, Jan 18, 2011 at 12:49, Donovan Brooke wrote: > Hello, > > I warned the list that I may have questions! ;-) > > ...building a simple cookie-based log-in system, and have > narrowed an error to this below: (sorry for email line breaks, if any) > > ---Start--- > if ($_post['f_action']=='login

[PHP] 2nd Pair of eyes

2011-01-18 Thread Donovan Brooke
Hello, I warned the list that I may have questions! ;-) ...building a simple cookie-based log-in system, and have narrowed an error to this below: (sorry for email line breaks, if any) ---Start--- if ($_post['f_action']=='login') { // connect to database (custom function) $r = dbconnect();

Re: [PHP] [PHP]: permission problem www-data

2011-01-18 Thread Daniel Brown
On Tue, Jan 18, 2011 at 10:55, Jim Lucas wrote: > > You could run PHP in FastCGI mode and start it as your user.  Then have your > web > server use that PHP instance for your web site to process all PHP requests. > > This is how we have our servers at the office setup.  Works great. My guess

Re: [PHP] [PHP]: permission problem www-data

2011-01-18 Thread Jim Lucas
On 1/18/2011 2:19 AM, a...@ashleysheridan.co.uk wrote: > Because the web server is what runs php as a module, and the web server has > its own user for security reasons. You could try chmod but that is generally > a last resort. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > - Repl

Re: [PHP] [PHP]: permission problem www-data

2011-01-18 Thread Jim Lucas
On 1/18/2011 1:44 AM, Moses wrote: > Hi Everyone, > > I am creating a file in PHP script which takes a value from a form and > writes it > to a file. However, i don't have the mode permission for the file instead it > is owned > by www-data.What can i do to ensure that the file is owned by me. >

Re: [PHP] [PHP]: permission problem www-data

2011-01-18 Thread Donovan Brooke
Moses wrote: Hi Everyone, I am creating a file in PHP script which takes a value from a form and writes it to a file. However, i don't have the mode permission for the file instead it is owned by www-data.What can i do to ensure that the file is owned by me. drwxr-xr-x 2 www-data www-data 4096

RE: [PHP] A bad design decision or pure genius?

2011-01-18 Thread Jay Blanchard
[snip] >> I have a application that I'm working on that uses google maps to >> display interactive maps (using javascript) on the website. [/snip] Have a look here; http://speckyboy.com/2010/02/03/10-jquery-plugins-for-easier-google-map- installation/ jQuery can take some of the pain out of work

Re: [PHP] [PHP]: permission problem www-data

2011-01-18 Thread a...@ashleysheridan.co.uk
Because the web server is what runs php as a module, and the web server has its own user for security reasons. You could try chmod but that is generally a last resort. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: "Moses" Date: Tue, Jan 18, 2011 10:17 Subject: [PH

Re: [PHP] [PHP]: permission problem www-data

2011-01-18 Thread Moses
Hi Ash, I have tried to use chown but i am getting the error Warning: chown() [function.chown]: Operation not permitted I would like to know why the apache(www-data) owns the file rather than the user (me). Thanks. On Tue, Jan 18, 2011 at 11:53 AM, a...@ashleysheridan.co.uk < a...@ashleysherid

Re: [PHP] [PHP]: permission problem www-data

2011-01-18 Thread a...@ashleysheridan.co.uk
you could use the chown method in php, which should do what you need. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: "Moses" Date: Tue, Jan 18, 2011 09:44 Subject: [PHP] [PHP]: permission problem www-data To: Hi Everyone, I am creating a file in PHP script which t

[PHP] [PHP]: permission problem www-data

2011-01-18 Thread Moses
Hi Everyone, I am creating a file in PHP script which takes a value from a form and writes it to a file. However, i don't have the mode permission for the file instead it is owned by www-data.What can i do to ensure that the file is owned by me. drwxr-xr-x 2 www-data www-data 4096 2011-01-17 22:

RE: [PHP] how to avoid using temporary?

2011-01-18 Thread Tommy Pham
> -Original Message- > From: I am on the top of the world! Borlange University > [mailto:michael3832...@gmail.com] > Sent: Monday, January 17, 2011 11:33 PM > To: php-general@lists.php.net > Subject: [PHP] how to avoid using temporary? > > heres my sql query: > EXPLAIN SELECT t1.szs_guige,

[PHP] Re: Help: Validate Domain Name by Regular Express

2011-01-18 Thread WalkinRaven
On 01/08/2011 04:55 PM, WalkinRaven wrote: PHP 5.3 PCRE Regular Express to match domain names format according to RFC 1034 - DOMAIN NAMES - CONCEPTS AND FACILITIES /^ ( [a-z] | [a-z] (?:[a-z]|[0-9]) | [a-z] (?:[a-z]|[0-9]|\-){1,61} (?:[a-z]|[0-9]) ) # One label (?:\.(?1))*+ # More labels \.? #