php-general Digest 9 Sep 2009 12:09:07 -0000 Issue 6330

2009-09-09 Thread php-general-digest-help
php-general Digest 9 Sep 2009 12:09:07 - Issue 6330 Topics (messages 297798 through 297810): Re: Renaming a Directory 297798 by: Eddie Drapkin 297803 by: Paul M Foster 297805 by: Eddie Drapkin 297807 by: Ashley Sheridan 297810 by: Floyd Resler Re:

RE: [PHP] mysql user session handler

2009-09-09 Thread Ford, Mike
-Original Message- From: Tom Worster [mailto:f...@thefsb.org] Sent: 09 September 2009 02:29 thanks, Devendra, that's pretty much the same as my handler. (though i can't figure Rich Smith's $sess_save_path global. do you know what is for?) I think if you look at the comments on

Re: [PHP] Renaming a Directory

2009-09-09 Thread Ashley Sheridan
On Wed, 2009-09-09 at 00:08 -0400, Paul M Foster wrote: On Tue, Sep 08, 2009 at 05:39:43PM -0400, Floyd Resler wrote: How can I rename a directory with files in it? The rename function gives me a directory not empty error. I know I could do it be creating the directory, moving the

[PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Matthew Croud
Hiya, I'm writing an app that let's my client upload images, the image html code is added to an XML file. Take a look at the image element below: item Code=e1022 codee1022/code image![CDATA[img src=uploads/image2.jpg alt=Homepage Image width=124 height=70 /]]/image nameBlue

[PHP] hi, how can i join a php document translate team?

2009-09-09 Thread Hanjie Xu
thank you

Re: [PHP] Renaming a Directory

2009-09-09 Thread Floyd Resler
Nope, nothing wrong with that at all. Just didn't think of it! Thanks! Floyd On Sep 8, 2009, at 5:46 PM, Eddie Drapkin wrote: On Tue, Sep 8, 2009 at 5:39 PM, Floyd Reslerfres...@adex-intl.com wrote: How can I rename a directory with files in it? The rename function gives me a directory

Re: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Bastien Koert
On Wed, Sep 9, 2009 at 5:27 AM, Matthew Croudm...@obviousdigital.com wrote: Hiya, I'm writing an app that let's my client upload images, the image html code is added to an XML file. Take a look at the image element below: item Code=e1022    codee1022/code    image![CDATA[img

Re: [PHP] Renaming a Directory

2009-09-09 Thread Paul M Foster
On Wed, Sep 09, 2009 at 12:11:14AM -0400, Eddie Drapkin wrote: On Wed, Sep 9, 2009 at 12:08 AM, Paul M Fosterpa...@quillandmouse.com wrote: On Tue, Sep 08, 2009 at 05:39:43PM -0400, Floyd Resler wrote: How can I rename a directory with files in it?  The rename function gives me a

Re: [PHP] mysql user session handler

2009-09-09 Thread Tom Worster
On 9/9/09 4:16 AM, Ford, Mike m.f...@leedsmet.ac.uk wrote: -Original Message- From: Tom Worster [mailto:f...@thefsb.org] Sent: 09 September 2009 02:29 thanks, Devendra, that's pretty much the same as my handler. (though i can't figure Rich Smith's $sess_save_path global. do you

RE: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Bob McConnell
From: Bastien Koert On Wed, Sep 9, 2009 at 5:27 AM, Matthew Croudm...@obviousdigital.com wrote: Hiya, I'm writing an app that let's my client upload images, the image html code is added to an XML file. Take a look at the image element below: item Code=e1022    codee1022/code    

Re: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Matthew Croud
On 9 Sep 2009, at 14:26, Bastien Koert wrote: On Wed, Sep 9, 2009 at 5:27 AM, Matthew Croudm...@obviousdigital.com wrote: Hiya, I'm writing an app that let's my client upload images, the image html code is added to an XML file. Take a look at the image element below: item Code=e1022

Re: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Eddie Drapkin
On Wed, Sep 9, 2009 at 9:33 AM, Matthew Croud m...@obviousdigital.com wrote: On 9 Sep 2009, at 14:26, Bastien Koert wrote: On Wed, Sep 9, 2009 at 5:27 AM, Matthew Croudm...@obviousdigital.com wrote: Hiya, I'm writing an app that let's my client upload images, the image html code is added

Re: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Matthew Croud
On 9 Sep 2009, at 14:36, Bob McConnell wrote: From: Bastien Koert On Wed, Sep 9, 2009 at 5:27 AM, Matthew Croudm...@obviousdigital.com wrote: Hiya, I'm writing an app that let's my client upload images, the image html code is added to an XML file. Take a look at the image element below:

Re: [PHP] Renaming a Directory

2009-09-09 Thread Tom Worster
On 9/9/09 12:08 AM, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Sep 08, 2009 at 05:39:43PM -0400, Floyd Resler wrote: How can I rename a directory with files in it? The rename function gives me a directory not empty error. I know I could do it be creating the directory, moving

Re: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Ashley Sheridan
On Wed, 2009-09-09 at 14:46 +0100, Matthew Croud wrote: On 9 Sep 2009, at 14:36, Bob McConnell wrote: From: Bastien Koert On Wed, Sep 9, 2009 at 5:27 AM, Matthew Croudm...@obviousdigital.com wrote: Hiya, I'm writing an app that let's my client upload images, the image html

Re: [PHP] mysql user session handler

2009-09-09 Thread Tom Worster
good point, gabriel. i really need to stop procrastinating with the whole memcache project. perhaps i ought to postpone consideration of the session handler until i've learned something about memcache, which i need to do anyway. On 9/8/09 10:06 PM, Gabriel Sosa sosagabr...@gmail.com wrote:

Re: [PHP] Renaming a Directory

2009-09-09 Thread Lupus Michaelis
Paul M Foster a écrit : I would have thought so, but the man pages didn't mention it. I haven't use mv in ages. Makes sense that it would work, though. Moving/renaming a file would just change the name, not the inode number, which is the real key to *nix file systems. Ashley said it, a

[PHP] Class variable value lost

2009-09-09 Thread Sumit Sharma
Hi, I have developed a listing site which is totally class based. Now when it authenticates a user login and set appropriate class variables to true and set user info in user class variables, value of all the set variables are lost when I forward the user to members page. When I check the the

[PHP] Re: Class variable value lost

2009-09-09 Thread Shawn McKenzie
Sumit Sharma wrote: Hi, I have developed a listing site which is totally class based. Now when it authenticates a user login and set appropriate class variables to true and set user info in user class variables, value of all the set variables are lost when I forward the user to members

Re: [PHP] Re: Class variable value lost

2009-09-09 Thread Ashley Sheridan
On Wed, 2009-09-09 at 10:36 -0500, Shawn McKenzie wrote: Sumit Sharma wrote: Hi, I have developed a listing site which is totally class based. Now when it authenticates a user login and set appropriate class variables to true and set user info in user class variables, value of all the

Re: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Matthew Croud
On 9 Sep 2009, at 16:37, Ashley Sheridan wrote: On Wed, 2009-09-09 at 15:14 +0100, Matthew Croud wrote: On 9 Sep 2009, at 15:09, Ashley Sheridan wrote: On Wed, 2009-09-09 at 14:46 +0100, Matthew Croud wrote: On 9 Sep 2009, at 14:36, Bob McConnell wrote: From: Bastien Koert On Wed, Sep

Fwd: [PHP] Re: Class variable value lost

2009-09-09 Thread Sumit Sharma
What I have done is declared one User class in a separate file and created its object there only. After this included this file in all other file which are using its object. So the object is creating only once and included in every other file only once. Now when I over write its variable it value

Re: [PHP] Re: Class variable value lost

2009-09-09 Thread Andrew Ballard
On Wed, Sep 9, 2009 at 11:58 AM, Sumit Sharma sumitp...@gmail.com wrote: What I have done is declared one User class in a separate file and created its object there only. After this included this file in all other file which are using its object. So the object is creating only once and included

Re: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Ashley Sheridan
On Wed, 2009-09-09 at 16:51 +0100, Matthew Croud wrote: On 9 Sep 2009, at 16:37, Ashley Sheridan wrote: On Wed, 2009-09-09 at 15:14 +0100, Matthew Croud wrote: On 9 Sep 2009, at 15:09, Ashley Sheridan wrote: On Wed, 2009-09-09 at 14:46 +0100, Matthew Croud wrote: On 9 Sep 2009, at

Re: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Tony Marston
You need to look at disable_output_escaping at http://www.w3.org/TR/xslt#disable-output-escaping -- Tony Marston http://www.tonymarston.net http://www.radicore.org Matthew Croud m...@obviousdigital.com wrote in message news:2c4840c2-45db-4d6c-b5fa-2cb15b171...@obviousdigital.com... On 9 Sep

[PHP] preg_match()

2009-09-09 Thread Jan Reiter
Good Afternoon. This shouldn't be too complicated, but I can't come up with a solution for the problem right now. It's about RegEx in PHP (5.2) Is there a way to capture ALL sub elements of an expression like preg_match('@a(?[0-9])*b@' ,a2345678b , $matches); ?? This would produce

Re: [PHP] preg_match()

2009-09-09 Thread Ashley Sheridan
On Wed, 2009-09-09 at 18:18 +0200, Jan Reiter wrote: Good Afternoon. This shouldn't be too complicated, but I can't come up with a solution for the problem right now. It's about RegEx in PHP (5.2) Is there a way to capture ALL sub elements of an expression like

RE: [PHP] preg_match()

2009-09-09 Thread Jan Reiter
Not quite, I'm sorry. As the outer expression prim_states( [...] ) captures, the repetitive elements inside prim_state( [...] ) overwrite each other in the matches array. Of course I could get the first entry in matches, and search it again with preg_match_all(), but that is what I'm trying to

[PHP] Re: preg_match()

2009-09-09 Thread Shawn McKenzie
Jan Reiter wrote: Good Afternoon. This shouldn't be too complicated, but I can't come up with a solution for the problem right now. It's about RegEx in PHP (5.2) Is there a way to capture ALL sub elements of an expression like preg_match('@a(?[0-9])*b@' ,a2345678b , $matches);

RE: [PHP] preg_match()

2009-09-09 Thread Jan Reiter
Thanks! Thats about what I'm doing right now. function parse_prim_states($in) { preg_match('@prim_states[\s]*\((?number[0-9\s]*)@' ,$in , $matches); $this-num_prim_states = (int)$matches['number'];

Re: [PHP] Re: Class variable value lost

2009-09-09 Thread Martin Scotta
On Wed, Sep 9, 2009 at 12:58 PM, Sumit Sharma sumitp...@gmail.com wrote: What I have done is declared one User class in a separate file and created its object there only. After this included this file in all other file which are using its object. So the object is creating only once and

Re: Fwd: [PHP] Re: Class variable value lost

2009-09-09 Thread Shawn McKenzie
Sumit Sharma wrote: What I have done is declared one User class in a separate file and created its object there only. After this included this file in all other file which are using its object. So the object is creating only once and included in every other file only once. Now when I over

Re: [PHP] script failing at same line

2009-09-09 Thread Ben Dunlap
My solution was to add a table to my database, and add an insert job id into the table after the line that is causing the problem. When I submit the script I use setTimeout to run an AJAX query of the table 5 seconds later. If the line has failed the job id will not be in the table and I

Re: [PHP] Re: Class variable value lost

2009-09-09 Thread Ben Dunlap
The object only exists for that instance of the script, so when the user navigates to the next page, the object is freed up from the memory. There are a couple of ways you could get round this:      * don't navigate away from the page, and use AJAX calls to update        parts of the page

[PHP] dns lookups only half working in chroot

2009-09-09 Thread Samuel Vogel
Hey guys, I am cross-posting this to the PHP and the PHP-FPM lists, because both are applicable in my opinion. I have got a strange problem with my php-fpm chrooted PHP environment. PHP is chrooted to /var/www/. /var/www/etc looks like this: # ls -al /var/www/etc/ insgesamt 20 drwxr-xr-x 2

Re: [PHP] Encrypt then decrypt yields extra dots at end

2009-09-09 Thread Ben Dunlap
I thought this code: $enc=mcrypt_ecb(MCRYPT_RIJNDAEL_256,salt123,encrypt_me,MCRYPT_ENCRYPT); $dec=mcrypt_ecb(MCRYPT_RIJNDAEL_256,salt123,$enc,MCRYPT_DECRYPT); echo $dec; would yield encrypt_me. The actual result is encrypt_me.. (bunch of extra dots). Why, and how do I

Re: [PHP] XML. Prevent from turning into lt;

2009-09-09 Thread Ralph Deffke
give it a try with PDATA instead of CDATA and see what happns Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1252512252.2961.40.ca...@localhost... On Wed, 2009-09-09 at 16:51 +0100, Matthew Croud wrote: On 9 Sep 2009, at 16:37, Ashley Sheridan wrote: On Wed, 2009-09-09

Re: [PHP] dns lookups only half working in chroot

2009-09-09 Thread Ben Dunlap
?php echo gethostbyname('www.google.de').\n; print_r(dns_get_record('www.google.de', DNS_A)).\n; ? [8] I don't understand why the first lookup fails, but the second one succeeds. Unfortunately thinks like fsockopen() seem to use the same technique as gethostbyname(), so they don't work

Re: [PHP] new php script and sqlite

2009-09-09 Thread Ben Dunlap
I was under the impression that sqlite2 was supported widely by PHP, but sqlite3 seems only to be enabled on php 5.3.0 by default. My concern now is actually that users may find that their hosting service providers don't provide sqlite3 out of the box. PDO seems to support both versions:

[PHP] Little perl help?

2009-09-09 Thread Skip Evans
Hey all, I know this is a PHP list, but I could use a bit of Perl help, a language which just does not fit in my C/C++/Java/PHP trained brain. A directory is created with the following: mkdir($img_dir,$CHMOD_ON_FOLDER_CREATE); I need to replace spaces with the underscore character so the

Re: [PHP] new php script and sqlite

2009-09-09 Thread Ben Dunlap
  $dbh = new PDO('sqlite:$db_file'); [8]        $dbh = new PDO('sqlite2:$db_file'); But with double-quotes, not single-quotes. ;-) Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: [SPAM] [PHP] Little perl help?

2009-09-09 Thread Skip Evans
My Bad. It looks like I had some code in the wrong place. Will try again. Skip m...@elysianfieldssoftware.com wrote: Skip, That *should* work. The below works on my Linux box. $img_dir=This is an dir name with spaces; $img_dir =~ s/ /_/g; printf(%s\n,$img_dir);

[PHP] Performance of while(true) loop

2009-09-09 Thread APseudoUtopia
Hey list, I have a php cli script that listens on a UDP socket and, when data is sent to the socket, the script inserts it into a database. I'm using the real BSD socket functions, not fsock. The script runs socket_create(), then socket_bind(). Then it starts a while(TRUE) loop. Within the loop,

Re: [PHP] Performance of while(true) loop

2009-09-09 Thread Eddie Drapkin
On Wed, Sep 9, 2009 at 10:32 PM, APseudoUtopia apseudouto...@gmail.com wrote: Hey list, I have a php cli script that listens on a UDP socket and, when data is sent to the socket, the script inserts it into a database. I'm using the real BSD socket functions, not fsock. The script runs

Re: [PHP] Performance of while(true) loop

2009-09-09 Thread APseudoUtopia
On Wed, Sep 9, 2009 at 10:39 PM, Eddie Drapkinoorza...@gmail.com wrote: On Wed, Sep 9, 2009 at 10:32 PM, APseudoUtopia apseudouto...@gmail.com wrote: Hey list, I have a php cli script that listens on a UDP socket and, when data is sent to the socket, the script inserts it into a database.

Re: [PHP] Performance of while(true) loop

2009-09-09 Thread Eddie Drapkin
On Wed, Sep 9, 2009 at 10:53 PM, APseudoUtopia apseudouto...@gmail.com wrote: On Wed, Sep 9, 2009 at 10:39 PM, Eddie Drapkinoorza...@gmail.com wrote: On Wed, Sep 9, 2009 at 10:32 PM, APseudoUtopia apseudouto...@gmail.com wrote: Hey list, I have a php cli script that listens on a UDP socket

Re: [PHP] Performance of while(true) loop

2009-09-09 Thread Ben Dunlap
I have a php cli script that listens on a UDP socket and, when data is [8] So I think the the MSG_WAITALL is causing it to block until incoming data connection is closed (it never reaches the 512 byte mark before [8] your clients are not maintaining an open connection to the socket, so it'll