php-general Digest 11 Sep 2009 07:06:57 -0000 Issue 6333

2009-09-11 Thread php-general-digest-help
php-general Digest 11 Sep 2009 07:06:57 - Issue 6333 Topics (messages 297870 through 297885): Re: Hoping for a hand with a login script 297870 by: Robert Cummings 297871 by: Bob McConnell 297872 by: Bastien Koert 297874 by: Ben Dunlap 297875 by: Ben

[PHP] PHP configuration values

2009-09-11 Thread Arno Kuhl
I'm having some problems with the way my service provider is implementing FastCGI. My tests show that local configuration values are no longer used, even though those are the values reported by php when the script queries a setting (e.g. register_globals). In fact all settings done by script or in

Re: [PHP] Creating alphanumeric id for a table

2009-09-11 Thread Ashley Sheridan
On Fri, 2009-09-11 at 00:19 -0400, Phpster wrote: Note that this approach has risks around race conditions. Anytime you have a construct for the id you run the risk of having it create duplicate ids. You will need to handle that. Bastien Sent from my iPod On Sep 10, 2009, at 6:49

Re: [PHP] Creating alphanumeric id for a table

2009-09-11 Thread Marcus Gnaß
aveev wrote: ? function generate_id($num) { $start_dig = 4; $num_dig = strlen($num); $id = $num; if($num_dig = $start_dig) { $num_zero = $start_dig - $num_dig; for($i=0;$i $num_zero; $i++) { $id =

Re: [PHP] String scrambling

2009-09-11 Thread Tom Chubb
!niBgo /* $str = Bingo!; str_shuffle($str); */ :)

Re: [PHP] String scrambling

2009-09-11 Thread Ashley Sheridan
On Fri, 2009-09-11 at 11:03 +0100, Tom Chubb wrote: !niBgo /* $str = Bingo!; str_shuffle($str); */ :) No, that won't work at all, it's in comments ;) Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread tedd
At 5:06 PM -0700 9/10/09, Tommy Pham wrote: So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this release? Thanks, Steve BEGIN CODE -snip- Does anyone else see every line above ending with a

Re: [PHP] Creating alphanumeric id for a table

2009-09-11 Thread Phpster
On Sep 11, 2009, at 3:50 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2009-09-11 at 00:19 -0400, Phpster wrote: Note that this approach has risks around race conditions. Anytime you have a construct for the id you run the risk of having it create duplicate ids. You will

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread Ashley Sheridan
On Fri, 2009-09-11 at 08:04 -0400, tedd wrote: At 5:06 PM -0700 9/10/09, Tommy Pham wrote: So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this release? Thanks, Steve BEGIN CODE -snip-

[PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread tedd
At 11:35 PM +0200 9/10/09, Andrea Giammarchi wrote: Being something nobody thought before I was expecting some comment ... zero Ajax developers here? Andrea: No, I develop in ajax. Here's one of my demos: http://webbytedd.com/a/ajax-site/ Please note that the above site can be

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread tedd
At 1:15 PM +0100 9/11/09, Ashley Sheridan wrote: On Fri, 2009-09-11 at 08:04 -0400, tedd wrote: At 5:06 PM -0700 9/10/09, Tommy Pham wrote: So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread Tommy Pham
--- On Fri, 9/11/09, Ashley Sheridan a...@ashleysheridan.co.uk wrote: From: Ashley Sheridan a...@ashleysheridan.co.uk Subject: Re: [PHP] Reading files in PHP 5.3.0 To: tedd tedd.sperl...@gmail.com Cc: Tommy Pham tommy...@yahoo.com, php-general@lists.php.net Date: Friday, September 11, 2009,

Re: [PHP] Creating alphanumeric id for a table

2009-09-11 Thread tedd
At 3:17 PM -0700 9/10/09, aveev wrote: I want to create user generated id like this : AAA0001 AAA0002 ... AAA0009 AAA0010 where the id consists of 3 alphanumeric characters and 4 numerical digits in the beginning (for numerical digit, it can grow like this AAA10001). I try to use php script to

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread Andrea Giammarchi
That's a finished production site ... how did you debug during its development? 'Cause Formaldehyde is for development, not for production ... I guess you have implented your own error manager/debugger, right? Well, with Formaldehyde you do not need to implement anything. Moreover, ASAIK,

Re: [PHP] PHP configuration values

2009-09-11 Thread Andrew Ballard
On Fri, Sep 11, 2009 at 3:06 AM, Arno Kuhl ak...@telkomsa.net wrote: I'm having some problems with the way my service provider is implementing FastCGI. My tests show that local configuration values are no longer used, even though those are the values reported by php when the script queries a

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread Paul M Foster
On Fri, Sep 11, 2009 at 05:48:42AM -0700, Tommy Pham wrote: I just checked my 'Mail Options' again. It's always been 'compose as text'. But I can't guaranteed that Yahoo actually does it. Been having problems with Yahoo lately (both mail and Yahoo hosting of www.php.net). Maybe I

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread Andrew Ballard
On Fri, Sep 11, 2009 at 8:15 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2009-09-11 at 08:04 -0400, tedd wrote: At 5:06 PM -0700 9/10/09, Tommy Pham wrote:   So did anything change in PHP5.3.0 that would preclude the code below from working?  Am I going crazy?  Or did Apple

Re: [PHP] Creating alphanumeric id for a table

2009-09-11 Thread Ralph Deffke
I agree that this question could be just how to create an unique ID with leading letters like 'AAA'. At that point I want to mention that a timestamp does garanty a unique number at almost 100% formated with the given samples in the other posts will do the job. tedd tedd.sperl...@gmail.com wrote

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread Steve Brown
function parseResponseHeaders($header_file) {     $http_found = $error_found = false;     $http_reponse = $error_message = NULL;     $response = array();     $response['ResponseCode'] = NULL;     $response['ErrorMessage'] = NULL;     if (!is_file($header_file) ||

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread tedd
At 3:27 PM +0200 9/11/09, Andrea Giammarchi wrote: That's a finished production site ... how did you debug during its development? 'Cause Formaldehyde is for development, not for production ... I guess you have implented your own error manager/debugger, right? What's to debug? The site --

[PHP] htaccess question

2009-09-11 Thread tedd
Hi gang: Is there a way I can use a htaccess directive to require a php script to be included within each file contained within that directory? For example, let's say I have a directory with 100 scripts in it, but I want each script within that directory to pass through an authorization

RE: [PHP] PHP configuration values

2009-09-11 Thread Arno Kuhl
On Fri, Sep 11, 2009 at 3:06 AM, Arno Kuhl ak...@telkomsa.net wrote: I'm having some problems with the way my service provider is implementing FastCGI. My tests show that local configuration values are no longer used, even though those are the values reported by php when the script queries

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread Andrea Giammarchi
How do you debug Ajax calls? I am starting to think you do not do it, or your applications are extremely simple... do you transform only at the end the result? How do you debug the transformation if something go wrong? How do you test via client if something goes wrong? You simply do not care,

Re: [PHP] htaccess question

2009-09-11 Thread Sudheer Satyanarayana
Is there a way I can use a htaccess directive to require a php script to be included within each file contained within that directory? For example, let's say I have a directory with 100 scripts in it, but I want each script within that directory to pass through an authorization script

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread Andrea Giammarchi
So nobody here debugs interaction and nobody uses Selenium for application tests ... fair enough. Would be nice to receive some response for those developers whose deal everyday with big/complex applications, 'cause here seems nobody i susing FirePHP or frameworks debuggers while numbers tell

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread Ashley Sheridan
On Fri, 2009-09-11 at 10:35 -0400, tedd wrote: At 3:27 PM +0200 9/11/09, Andrea Giammarchi wrote: That's a finished production site ... how did you debug during its development? 'Cause Formaldehyde is for development, not for production ... I guess you have implented your own error

Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread Bipin Upadhyay
I do use FirePHP and your project looks interesting to evaluate. Will check it out in a couple of days. It would be more interesting if they really are complimentary. I think people who use FireBug's console API would be able to appreciate FirePHP/formaldehyde more. However, I do NOT deny the

Re: [PHP] htaccess question

2009-09-11 Thread J DeBord
On Fri, Sep 11, 2009 at 4:46 PM, tedd t...@sperling.com wrote: Hi gang: Is there a way I can use a htaccess directive to require a php script to be included within each file contained within that directory? For example, let's say I have a directory with 100 scripts in it, but I want each

[PHP] Re: htaccess question

2009-09-11 Thread Shawn McKenzie
tedd wrote: Hi gang: Is there a way I can use a htaccess directive to require a php script to be included within each file contained within that directory? For example, let's say I have a directory with 100 scripts in it, but I want each script within that directory to pass through an

Re: [PHP] PHP configuration values

2009-09-11 Thread Andrew Ballard
On Fri, Sep 11, 2009 at 10:49 AM, Arno Kuhl ak...@telkomsa.net wrote: You're right, you can't change register_globals in script but you can query it in script, which is what I was referring to. There aren't many settings you can change in script, about the only useful one that we use is

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread Tommy Pham
--- On Fri, 9/11/09, Paul M Foster pa...@quillandmouse.com wrote: From: Paul M Foster pa...@quillandmouse.com Subject: Re: [PHP] Reading files in PHP 5.3.0 To: php-general@lists.php.net Date: Friday, September 11, 2009, 8:57 AM On Fri, Sep 11, 2009 at 05:48:42AM -0700, Tommy Pham wrote:

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread Andrea Giammarchi
Agreed, I have never said that, but I cannot even think about a modern website developed without browser tools such Firebug or others. That is why I was kinda surprised by zero reaction. Your feedback will be more than welcome, thanks. Regards Date: Fri, 11 Sep 2009 20:39:21 +0530 From:

[PHP] Re: htaccess question

2009-09-11 Thread tedd
At 10:15 AM -0500 9/11/09, Shawn McKenzie wrote: .htaccess php_value auto_prepend_file /path/to/auth.php Thanks! -Shawn AND At 5:11 PM +0200 9/11/09, J DeBord wrote: Here is a link to the manual. http://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file *PHP_INI_PERDIR* Entry

Re: [PHP] APC - Upload progress problem. apc

2009-09-11 Thread Eddie Drapkin
On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc

Re: [PHP] Creating alphanumeric id for a table

2009-09-11 Thread hack988 hack988
You can use mysql's autoincrement ,but you must do some php for special display,follow is my method. 1.create an int or smallint mysql col. 2.set it autoincrement. 3.insert some dates to database. 4.select dates and display with letter prefix. for example: 12-AAA0012,AAA1234, you can make an php

Re: [PHP] Creating alphanumeric id for a table

2009-09-11 Thread Jo�o C�ndido de Souza Neto
I don´t know if it´d be the right way, but what about using trigger in this case? aveev nashrullah_a...@yahoo.com escreveu na mensagem news:25391939.p...@talk.nabble.com... I want to create user generated id like this : AAA0001 AAA0002 ... AAA0009 AAA0010 where the id consists of 3

Re: [PHP] APC - Upload progress problem. apc

2009-09-11 Thread tedd
At 2:17 PM -0400 9/11/09, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? Nope, I choose not to complicate my life. :-) Instead, I give the user one of these:

Re: [PHP] APC - Upload progress problem. apc

2009-09-11 Thread Nathan Nobbe
On Fri, Sep 11, 2009 at 3:01 PM, tedd tedd.sperl...@gmail.com wrote: At 2:17 PM -0400 9/11/09, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? Nope, I choose not to complicate

[PHP] User Account Management

2009-09-11 Thread Waynn Lue
Hello all, We're building out a system that allows for user account creation/password management, and we're hoping to use existing open source software so we don't have to reinvent the wheel. I know of Drupal, and Zend Framework (and maybe CodeIgniter?), but do people have specific preferences

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread Paul M Foster
On Fri, Sep 11, 2009 at 08:38:13AM -0700, Tommy Pham wrote: --- On Fri, 9/11/09, Paul M Foster pa...@quillandmouse.com wrote: From: Paul M Foster pa...@quillandmouse.com Subject: Re: [PHP] Reading files in PHP 5.3.0 To: php-general@lists.php.net Date: Friday, September 11, 2009, 8:57

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread Andrea Giammarchi
Date: Fri, 11 Sep 2009 12:37:30 -0400 To: an_...@hotmail.com; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger The only things that may go wrong are in the data I am sending to the ajax routine

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread Andrea Giammarchi
Exactly Ben, except when PHP fails, even with a Fatal Error, the page has status 200, we need to understand which call failed between hundreds of potential calls in the debugger, and errors could pass silently. With Formaldehyde, accordingly with your predefined error_reporting level, above

Re: [PHP] User Account Management

2009-09-11 Thread Paul M Foster
On Fri, Sep 11, 2009 at 02:43:15PM -0700, Waynn Lue wrote: Hello all, We're building out a system that allows for user account creation/password management, and we're hoping to use existing open source software so we don't have to reinvent the wheel. I know of Drupal, and Zend Framework

Re: [PHP] Creating alphanumeric id for a table

2009-09-11 Thread Lupus Michaelis
aveev wrote: where the id consists of 3 alphanumeric characters and 4 numerical digits in the beginning (for numerical digit, it can grow like this AAA10001). I try to use php script to generate id like this, where I use the following script. ? function generate_id($num) {

[PHP] get an object property

2009-09-11 Thread Tom Worster
if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properties, is there a tidy way to get it without setting another variable? to illustrate, here's something that doesn't work, but it would be convenient if

Re: [PHP] get an object property

2009-09-11 Thread John Corry
Wouldn't it be $o[1]-a? J Corry Sent from my iPhone On Sep 11, 2009, at 7:31 PM, Tom Worster f...@thefsb.org wrote: if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properties, is there a tidy way

Re: [PHP] User Account Management

2009-09-11 Thread Ben Dunlap
Honestly, whipping up a security scheme the way I have done it is a couple of days' work (including login and management screens). I'm not sure why people seem to be averse to it. You just work up your screens, I suppose it does depend on the use case. If you're building a system for internal

Re: [PHP] Creating alphanumeric id for a table

2009-09-11 Thread aveev
The reason why I used incremental value from the db is that I need a sequence number generator that can be used as an argument to my function. If I can generate sequence number myself, I don't need this incremental value from db. What I want is that the sequential alphanumeric id that increments

[PHP] Fixing the path

2009-09-11 Thread Rico Secada
Hi. Some time ago I developed a small web application that a bunch of users has installed. I have always used the DOCUMENT_ROOT for my includes, but the other day I installed the application in a subdirectory, and as you've guessed a lot of the includes didn't work. I have been reading up on

Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-11 Thread Paul M Foster
On Sat, Sep 12, 2009 at 12:23:44AM +0200, Andrea Giammarchi wrote: Exactly Ben, except when PHP fails, even with a Fatal Error, the page has status 200, we need to understand which call failed between hundreds of potential calls in the debugger, and errors could pass silently. With

Re: [PHP] get an object property

2009-09-11 Thread Paul M Foster
On Fri, Sep 11, 2009 at 07:31:01PM -0400, Tom Worster wrote: if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properties, is there a tidy way to get it without setting another variable? to illustrate,

Re: [PHP] Fixing the path

2009-09-11 Thread Paul M Foster
On Sat, Sep 12, 2009 at 06:18:50AM +0200, Rico Secada wrote: Hi. Some time ago I developed a small web application that a bunch of users has installed. I have always used the DOCUMENT_ROOT for my includes, but the other day I installed the application in a subdirectory, and as you've

Re: [PHP] User Account Management

2009-09-11 Thread Lester Caine
Waynn Lue wrote: Hello all, We're building out a system that allows for user account creation/password management, and we're hoping to use existing open source software so we don't have to reinvent the wheel. I know of Drupal, and Zend Framework (and maybe CodeIgniter?), but do people have

Re: [PHP] get an object property

2009-09-11 Thread Lars Torben Wilson
Tom Worster wrote: if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properties, is there a tidy way to get it without setting another variable? to illustrate, here's something that doesn't work, but it