php-general Digest 10 Mar 2008 19:08:53 -0000 Issue 5340

2008-03-10 Thread php-general-digest-help
php-general Digest 10 Mar 2008 19:08:53 - Issue 5340 Topics (messages 271189 through 271219): Re: Unexcepted $this 271189 by: Anup Shukla 271192 by: Murat BEÞER 271193 by: Murat BEÞER 271197 by: Ray Hauge 271205 by: Philip Thompson 271218 by:

Re: [PHP] Unexcepted $this

2008-03-10 Thread Anup Shukla
Murat BEŞER wrote: Thank you Anup, But why I getting this error ? is this a bug ? Its not a bug. It has to do with operator precindence and associativity. -- Regards, Anup Shukla -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Unexcepted $this

2008-03-10 Thread Anup Shukla
I am sorry. Please disregard my previous post. I think i am wrong on that. -- Regards, Anup Shukla -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] SMTP

2008-03-10 Thread Alain Roger
Hi Ray, in my php.ini i have : SMTP = localhost smtp_port = 25 sendmail_from = [EMAIL PROTECTED] but my website (testing machine) is on localhost (which has also the IP 195.126.5.1) i think the problem is not in php.ini but more on SMTP server side (in settings, maybe password for

Re: [PHP] Links hierarchy maintenance

2008-03-10 Thread Per Jessen
Adil Drissi wrote: should be displayed differently. I was wondering if there is a way to do the same thing without the overhead of all that if statements. If you're using PHP (or any other interpreted language) overhead is a fact of life, there's little you can do about it. /Per Jessen,

Re: [PHP] Unexcepted $this

2008-03-10 Thread Murat BEŞER
So what do you thing about on this thing ? Anup Shukla yazmış: I am sorry. Please disregard my previous post. I think i am wrong on that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP5 strtotime

2008-03-10 Thread Samuel Marshall
I use PayPal as my ecommerce solution and I have a PHP script that captures variables posted from PayPal to populate my database. The time variable string is sent in the following format: HH:MM:SS DD Mmm YY, PST. The script worked fine but since I upgraded to PHP5 the dates inputted into my

[PHP] SESSION Array problem - possibly different PHP versions?

2008-03-10 Thread Angelo Zanetti
Hi All, I have a problem that only occurs on our live server and not our local server. It works fine locally. Basically I am using a session array to store values of product colours. A user can add colours to the session array. The session is defined as follows: $_SESSION['color'][$counter]

Re: [PHP] Unexcepted $this

2008-03-10 Thread Ray Hauge
Murat BEŞER wrote: I can't under stood but PHP gaves me an error: UnExcepted $this for || $this-getFileExtension($file) == 'jpg' When I removed jpg extension check it's okay... PHP script runs well. What is the problem :) public function loadImages($folder) { $result =

Re: [PHP] cart in a session

2008-03-10 Thread Daniel Brown
On Sat, Mar 8, 2008 at 4:18 PM, Bill [EMAIL PROTECTED] wrote: Hi Is it a good idea to put a cart in a session var since the cart will be an array ? Yes, and it's far more secure than putting the actual data into a cookie, since that can be changed on the client-side to alter prices and

RE: [PHP] SMTP

2008-03-10 Thread Andrés Robinet
-Original Message- From: Alain Roger [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2008 3:16 AM To: Ray Hauge Cc: PHP General List Subject: Re: [PHP] SMTP Hi Ray, in my php.ini i have : SMTP = localhost smtp_port = 25 sendmail_from = [EMAIL PROTECTED] but my website

Re: [PHP] SESSION Array problem - possibly different PHP versions?

2008-03-10 Thread Daniel Brown
On Mon, Mar 10, 2008 at 9:22 AM, Angelo Zanetti [EMAIL PROTECTED] wrote: There fore it isn't an array of colors within the session array. How can PHP change this? Also the strange thing is that locally it works fine but not live. So I am guessing that there is a problem with a certain

Re: [PHP] PHP5 strtotime

2008-03-10 Thread Larry Garfield
On Monday 10 March 2008, Samuel Marshall wrote: I use PayPal as my ecommerce solution and I have a PHP script that captures variables posted from PayPal to populate my database. The time variable string is sent in the following format: HH:MM:SS DD Mmm YY, PST. The script worked fine but

Re: [PHP] SMTP

2008-03-10 Thread Daniel Brown
On Sun, Mar 9, 2008 at 4:38 PM, Alain Roger [EMAIL PROTECTED] wrote: Hi, i know that this is not necessary the best forum for that, but i need to get a real feedback and i guess you already faced the same issue as mine. basically, i develop php web application on windows XP platform. So

Re: [PHP] path_info in fastcgi setting

2008-03-10 Thread Daniel Brown
On Sun, Mar 9, 2008 at 7:54 AM, Ian M. Evans [EMAIL PROTECTED] wrote: Under Apache and the PHP module: a) test.php path_info is blank b) test.php/ppp path_info=/ppp Under PHP FastCGI: c) test.php path_info is test.php d) test.php/ppp path_info=/ppp Not sure why it's not blank in

Re: [PHP] Whats faster? simplexml_load_string or simplexml_load_file?

2008-03-10 Thread Daniel Brown
On Sat, Mar 8, 2008 at 11:18 PM, Lamonte [EMAIL PROTECTED] wrote: I was wondering this because at the moment using simplexml_load_file makes my script go at about 2 seconds per page load, in a loop. Then I created a cache system so it doesn't keep loading the xml file, but I'm wondering if

Re: [PHP] Unexcepted $this

2008-03-10 Thread Philip Thompson
On Mar 10, 2008, at 8:32 AM, Ray Hauge wrote: Murat BEŞER wrote: I can't under stood but PHP gaves me an error: UnExcepted $this for || $this-getFileExtension($file) == 'jpg' When I removed jpg extension check it's okay... PHP script runs well. What is the problem :) public function

RE: [PHP] SESSION Array problem - possibly different PHP versions?

2008-03-10 Thread Angelo Zanetti
-Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: 10 March 2008 16:04 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] SESSION Array problem - possibly different PHP versions? On Mon, Mar 10, 2008 at 9:22 AM, Angelo Zanetti [EMAIL PROTECTED]

[PHP] Why use session_register()?

2008-03-10 Thread Lamonte H
Is it necessary to use session_register()? What exactly was the point of this function if you can set sessions using $_SESSION it self?

Re: [PHP] Why use session_register()?

2008-03-10 Thread Greg Donald
On 3/10/08, Lamonte H [EMAIL PROTECTED] wrote: Is it necessary to use session_register()? What exactly was the point of this function if you can set sessions using $_SESSION it self? session_register() accepts a variable parameter list and does not require a call to session_start() prior to

Re: [PHP] Why use session_register()?

2008-03-10 Thread Daniel Brown
On Mon, Mar 10, 2008 at 12:08 PM, Lamonte H [EMAIL PROTECTED] wrote: Is it necessary to use session_register()? What exactly was the point of this function if you can set sessions using $_SESSION it self? RTFM: http://php.net/session-register.php It's the old way of doing it, and

Re: [PHP] Why use session_register()?

2008-03-10 Thread Daniel Brown
On Mon, Mar 10, 2008 at 12:15 PM, Daniel Brown [EMAIL PROTECTED] wrote: On Mon, Mar 10, 2008 at 12:08 PM, Lamonte H [EMAIL PROTECTED] wrote: Is it necessary to use session_register()? What exactly was the point of this function if you can set sessions using $_SESSION it self?

[PHP] Re: SESSION Array problem - possibly different PHP versions?

2008-03-10 Thread Al
Put a print_r($_SESSION) at the top and bottom of your page code so you can see what's happening. Also check your code that updates the session assignment by the GET value. It appears your code maybe unset()ing the session assignments. Are you using Cookies? If so, check this code carefully

[PHP] Re: Why use session_register()?

2008-03-10 Thread Al
Read the current php manual. Lamonte H wrote: Is it necessary to use session_register()? What exactly was the point of this function if you can set sessions using $_SESSION it self? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Why use session_register()?

2008-03-10 Thread Lamonte H
So you wouldn't need to use session_start() when dealing with session_register()? On 3/10/08, Daniel Brown [EMAIL PROTECTED] wrote: On Mon, Mar 10, 2008 at 12:15 PM, Daniel Brown [EMAIL PROTECTED] wrote: On Mon, Mar 10, 2008 at 12:08 PM, Lamonte H [EMAIL PROTECTED] wrote: Is it necessary

Re: [PHP] Re: Why use session_register()?

2008-03-10 Thread Dave Goodchild
session_register is old school. RTFM. On Mon, Mar 10, 2008 at 4:26 PM, Al [EMAIL PROTECTED] wrote: Read the current php manual. Lamonte H wrote: Is it necessary to use session_register()? What exactly was the point of this function if you can set sessions using $_SESSION it self? --

[PHP] Re: Generating JavaScript menus on-the-fly

2008-03-10 Thread Roberto Mansfield
If you are building select menus on the fly using javascript, look at php's json_encode function. It will create a JSON representation of your php data structure. Makes passing data sets to javascript very easy. Just build your array of allowed options in php, plug the data into your javascript

Re: [PHP] SMTP

2008-03-10 Thread Alain Roger
Hi Ray, we tested it with telnet and it seems that it works... but my mail client does not receive it. :-( php mail function just tells me that email can not be delivered. here is the function: if (mail($to, $subject, $body)) { echo(pMessage successfully sent!/p); } else

Re: [PHP] Re: Generating JavaScript menus on-the-fly

2008-03-10 Thread Ken Kixmoeller
Thank you -- I don't know about those functions -- I'll check them out (for general knowledge, too)... Ken On Mar 10, 2008, at 12:01 PM, Roberto Mansfield wrote: If you are building select menus on the fly using javascript, look at php's json_encode function. It will create a JSON

Re: [PHP] Unexcepted $this

2008-03-10 Thread Ray Hauge
Philip Thompson wrote: On Mar 10, 2008, at 8:32 AM, Ray Hauge wrote: Murat BEŞER wrote: I can't under stood but PHP gaves me an error: UnExcepted $this for || $this-getFileExtension($file) == 'jpg' When I removed jpg extension check it's okay... PHP script runs well. What is the problem :)

[PHP] Question about user management...

2008-03-10 Thread Jason Pruim
Hi Everyone, Happy Monday to all of you! I am trying to think through a user management issue for a application I am working on. What I want to do, is be able to provide a multi user environment (All accessing the same page, but depending on company name they get different data) and be

Re: [PHP] Question about user management...

2008-03-10 Thread Daniel Brown
On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hi Everyone, Happy Monday to all of you! I am trying to think through a user management issue for a application I am working on. What I want to do, is be able to provide a multi user environment (All accessing the same

Re: [PHP] Links hierarchy maintenance

2008-03-10 Thread tedd
At 6:13 PM -0700 3/9/08, Adil Drissi wrote: Yes like that, but you can consider also that the vertical menu has different style for the link of the current page. Anyway it does not matter for this problem. Can you show us how your php function looks like? Or maybe you are just doing a test for

Re: [PHP] Question about user management...

2008-03-10 Thread TG
Sounds like a pretty typical setup. Depending on your layout, you may be able to use a templating type system for the pages as well. It's hard to tell if that's useful without more information. /tmpl/companyid/index.php Not sure if that's what you meant by using the company name or if you

Re: [PHP] cart in a session

2008-03-10 Thread Bill
Is it a good idea to put a cart in a session var since the cart will be an array ? Yes, and it's far more secure than putting the actual data into a cookie, since that can be changed on the client-side to alter prices and other data. Thanks -- PHP General Mailing List

Re: [PHP] SMTP

2008-03-10 Thread Alain Roger
Ok, thanks for info, i've downloaded the MailEnable SW for free and i was able to check that my PHP mail function really send correctly emails :-) thanks a lot, A. On Mon, Mar 10, 2008 at 3:33 PM, Daniel Brown [EMAIL PROTECTED] wrote: On Sun, Mar 9, 2008 at 4:38 PM, Alain Roger [EMAIL

[PHP] Session still open

2008-03-10 Thread Bill
Hi Ubuntu7.10 LAMP A PHP session destroys itself as soon as the client disconnects from the site. Why if I connect from another machine, log in, and disconnect without logging off, and return 5 mins later, my session is still alive ? Thanks -- PHP General Mailing List

Re: [PHP] Question about user management...

2008-03-10 Thread Jason Pruim
Hey TG, I was thinking about doing it as CompanyA CompanyB etc... etc... All stored in a database. And they can all go to the same main website and be able to get at everything they need. Thanks for looking! :) On Mar 10, 2008, at 3:48 PM, TG wrote: Sounds like a pretty typical setup.

Re: [PHP] Question about user management...

2008-03-10 Thread Jason Pruim
On Mar 10, 2008, at 3:14 PM, Daniel Brown wrote: On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hi Everyone, Happy Monday to all of you! I am trying to think through a user management issue for a application I am working on. What I want to do, is be able to provide

Re: [PHP] Question about user management...

2008-03-10 Thread tedd
At 3:14 PM -0400 3/10/08, Daniel Brown wrote: On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim [EMAIL PROTECTED] wrote: What I was thinking about doing was a combination of the company name (Which I set right now) and then a access level such as 50 for the Owner of the program, 40 for the

Re: [PHP] Session still open

2008-03-10 Thread Daniel Brown
On Mon, Mar 10, 2008 at 3:59 PM, Bill [EMAIL PROTECTED] wrote: Hi Ubuntu7.10 LAMP A PHP session destroys itself as soon as the client disconnects from the site. Why if I connect from another machine, log in, and disconnect without logging off, and return 5 mins later, my session is

Re: [PHP] Question about user management...

2008-03-10 Thread Jason Pruim
On Mar 10, 2008, at 4:07 PM, tedd wrote: At 3:14 PM -0400 3/10/08, Daniel Brown wrote: On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim [EMAIL PROTECTED] wrote: What I was thinking about doing was a combination of the company name (Which I set right now) and then a access level such as 50

Re: [PHP] Question about user management...

2008-03-10 Thread Daniel Brown
On Mon, Mar 10, 2008 at 4:07 PM, tedd [EMAIL PROTECTED] wrote: At 3:14 PM -0400 3/10/08, Daniel Brown wrote: The superuser (AKA root, administrator, God, whatever) has GID 0, just like on a *NIX system. This is because it's the highest level you can reach, and 0 is the lowest real

Re: [PHP] Session still open

2008-03-10 Thread Bill
Hi Daniel, Why if I connect from another machine, log in, and disconnect without logging off, and return 5 mins later, my session is still alive ? A session only expires in three cases: a.) An explicit session_destroy() is sent.* b.) The user-side cookie with the session

Re: [PHP] Question about user management...

2008-03-10 Thread tedd
At 4:13 PM -0400 3/10/08, Jason Pruim wrote: On Mar 10, 2008, at 4:07 PM, tedd wrote: define(ADMIN, md5(uniqid(rand(), true));); define(GENERAL_USER, md5(uniqid(rand(), true));); define(LEVEL_ONE_USER, md5(uniqid(rand(), true));); define(LEVEL_TWO_USER, md5(uniqid(rand(), true)););

Re: [PHP] Session still open

2008-03-10 Thread Daniel Brown
On Mon, Mar 10, 2008 at 4:32 PM, Bill [EMAIL PROTECTED] wrote: I didn't set any cookie so it must be the php session cookie. How can I check for the visitor's presence ? I can't set a timer or check for activity since the visitor can be studying an online document. I must rely on the

[PHP] /?feed=rss2

2008-03-10 Thread John Taylor-Johnston
It used to have a feed, by accident. Now someone munches up too much bandwidth. http://www.foo.com//?feed=rss2 How can I divert this to 127.0.0.1 or something to convince this one to leave my bandwidth alone? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: /?feed=rss2

2008-03-10 Thread John Taylor-Johnston
I do. CPanel too. How would I write that into an htaccess ? Shawn McKenzie wrote: John Taylor-Johnston wrote: If you have apache, I would use a rewrite rule to return not found. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] difference in time

2008-03-10 Thread Lamp Lists
hi to all! on one eZine site, I have to show when the article is posted but as difference from NOW. like posted 32 minutes ago, or posted 5 days ago. is there already sucha php/mysql function? thanks. -ll - Never miss a thing. Make

Re: [PHP] Session still open

2008-03-10 Thread Bill
Hi Daniel, http://www.nabble.com/Logging-session-timeout-in-DB-to15845123.html It can build a lot of stress on the server. What if I use connection_aborted() ? In the status line of the page I can write a 'connected' timer and use it to check the connection !? At most I'll have a 30 secs.

Re: [PHP] Session still open

2008-03-10 Thread Daniel Brown
On Mon, Mar 10, 2008 at 6:23 PM, Bill [EMAIL PROTECTED] wrote: At most I'll have a 30 secs. time lapse. (30 secs. is the default execution time for scripts) What do you think of that? That could work for very short sessions, sure. This was for a larger, longer, community-style script.

RE: [PHP] Re: Transferring files between computers using php

2008-03-10 Thread bruce
rahul... you can easily set up an nfs share on one of the systems, and have the other 2 boxes connect to the share wit w/r privs... this would allow a box to write to the share, with the other boxes being able read the files... if all the boxes are linux/fedora/rhel, and they're all connected

[PHP] CSV speed

2008-03-10 Thread Danny Brow
I have about 10 csv files I need to open to access data. It takes a lot of time to search each file for the values I need. Would it be best to just dump all the cvs files to an SQL db and then just grab what I need from there? I'm starting to think it would make a lot of sense. What do you guys

Re: [PHP] CSV speed

2008-03-10 Thread TG
If you can't store the values in a real DB, then that might be an option. You might consider using a temporary table if it's available in the database you're using, that way you don't have to worry about implicitly creating then destroying the table. The only problem is how temporary the

[PHP] strtotime( 'last Sunday' ) and republicans

2008-03-10 Thread Greg Donald
Hey Rob, Remember on 2007-09-18 at 22:45:37 when you suggested I do this: http://marc.info/?l=php-generalm=119015558426248w=2 Well.. today strtotime( 'last Sunday' ) screwed me and I'm writing to say that I nearly fell out of my chair laughing when I realized what the problem was, who caused

Re: [PHP] CSV speed

2008-03-10 Thread Wolf
Danny Brow wrote: I have about 10 csv files I need to open to access data. It takes a lot of time to search each file for the values I need. Would it be best to just dump all the cvs files to an SQL db and then just grab what I need from there? I'm starting to think it would make a lot of sense.

Re: [PHP] CSV speed

2008-03-10 Thread Danny Brow
On Mon, 2008-03-10 at 22:36 -0400, Wolf wrote: Danny Brow wrote: I have about 10 csv files I need to open to access data. It takes a lot of time to search each file for the values I need. Would it be best to just dump all the cvs files to an SQL db and then just grab what I need from

Re: [PHP] CSV speed

2008-03-10 Thread Larry Garfield
You may want to consider an SQLite database. Any PHP 5 install is likely to support it, and it should be very fast for reads. (Not so much for writes, but if you're dealing with something that can use CSV, it will probably work in SQLite, too.) On Monday 10 March 2008, TG wrote: If you

Re: [PHP] CSV speed

2008-03-10 Thread Greg Donald
On Mon, Mar 10, 2008 at 8:09 PM, Danny Brow [EMAIL PROTECTED] wrote: I have about 10 csv files I need to open to access data. It takes a lot of time to search each file for the values I need. Would it be best to just dump all the cvs files to an SQL db and then just grab what I need from

Re: [PHP] CSV speed

2008-03-10 Thread Wolf
Danny Brow wrote: On Mon, 2008-03-10 at 22:36 -0400, Wolf wrote: Danny Brow wrote: I have about 10 csv files I need to open to access data. It takes a lot of time to search each file for the values I need. Would it be best to just dump all the cvs files to an SQL db and then just grab what I

Re: [PHP] CSV speed

2008-03-10 Thread Wolf
Greg Donald wrote: On Mon, Mar 10, 2008 at 8:09 PM, Danny Brow [EMAIL PROTECTED] wrote: I have about 10 csv files I need to open to access data. It takes a lot of time to search each file for the values I need. Would it be best to just dump all the cvs files to an SQL db and then just grab

Re: [PHP] Question about user management...

2008-03-10 Thread Eric Butera
On Mon, Mar 10, 2008 at 4:07 PM, tedd [EMAIL PROTECTED] wrote: At 3:14 PM -0400 3/10/08, Daniel Brown wrote: On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim [EMAIL PROTECTED] wrote: What I was thinking about doing was a combination of the company name (Which I set right now) and then

Re: [PHP] Question about user management...

2008-03-10 Thread Eric Butera
On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hi Everyone, Happy Monday to all of you! I am trying to think through a user management issue for a application I am working on. What I want to do, is be able to provide a multi user environment (All accessing the same

Re: [PHP] strtotime( 'last Sunday' ) and republicans

2008-03-10 Thread Wolf
Greg Donald wrote: Hey Rob, Remember on 2007-09-18 at 22:45:37 when you suggested I do this: http://marc.info/?l=php-generalm=119015558426248w=2 Well.. today strtotime( 'last Sunday' ) screwed me and I'm writing to say that I nearly fell out of my chair laughing when I realized what the

Re: [PHP] Question about user management...

2008-03-10 Thread Mike
Wait, what? You are defining user role ids as MD5 hashes of UUIDs created from random numbers that change on every request? Am I missing something or is this completely insane advice? On Mar 10, 2008, at 1:07 PM, tedd wrote: At 3:14 PM -0400 3/10/08, Daniel Brown wrote: On Mon, Mar 10,