php-general Digest 20 Oct 2006 06:50:39 -0000 Issue 4411

2006-10-20 Thread php-general-digest-help
php-general Digest 20 Oct 2006 06:50:39 - Issue 4411 Topics (messages 243360 through 243371): Re: User question for PHP 243360 by: Christian Heinrich 243361 by: Al 243362 by: Andy Hultgren 243369 by: Chris Weird stack trace in error_log from PDOException

[PHP] Setting try and catch to use my own error handler

2006-10-20 Thread Dave M G
PHP List, I have a system where the code parses the URL and creates objects based on the classes named in the link. In order to prevent a user typing in a URL that contains an object that doesn't exist, and getting an error, I'm trying to set up an error handler class, called ErrorHandler,

Re: [PHP] Setting try and catch to use my own error handler

2006-10-20 Thread Paul Scott
On Fri, 2006-10-20 at 15:50 +0900, Dave M G wrote: I have a system where the code parses the URL and creates objects based on the classes named in the link. In order to prevent a user typing in a URL that contains an object that doesn't exist, and getting an error, I'm trying to set up an

[PHP] array_walk, or array_map, or foreach?

2006-10-20 Thread Dave M G
PHP List, I took a snippet of code right off the php.net site to use trim on all the elements of an array. Theoretically, it should test if the element in an array is in turn another array, and break it down to the next level until it gets to a string it can use trim on. This is the code:

Re: [PHP] array_walk, or array_map, or foreach?

2006-10-20 Thread Robert Cummings
On Fri, 2006-10-20 at 16:04 +0900, Dave M G wrote: PHP List, I took a snippet of code right off the php.net site to use trim on all the elements of an array. Theoretically, it should test if the element in an array is in turn another array, and break it down to the next level until it

Re: [PHP] User question for PHP

2006-10-20 Thread Ivo F.A.C. Fokkema
On Fri, 20 Oct 2006 15:49:14 +1000, Chris wrote: Andy Hultgren wrote: To whoever was asking this (sorry didn't see the original email): Is it possible to have a PHP script execute as the user of the domain instead of the webserver? So when I upload files through a PHP script they are owned

[PHP] Re: array_walk, or array_map, or foreach?

2006-10-20 Thread Ivo F.A.C. Fokkema
On Fri, 20 Oct 2006 16:04:27 +0900, Dave M G wrote: PHP List, I took a snippet of code right off the php.net site to use trim on all the elements of an array. Theoretically, it should test if the element in an array is in turn another array, and break it down to the next level until it

[PHP] Ensuring all links go to index.php

2006-10-20 Thread Dave M G
PHP List, This problem is a little hard to describe. Please forgive me in advance if it's not clear. I have set up my .htaccess file to work with my PHP script to create friendly URLs. For example, the URL mysite.com/user/login will take the user to a page where a user logs in. It does

Re: [PHP] Problems with open_basedir

2006-10-20 Thread Patrik Jansson
Chris skrev: Patrik Jansson wrote: Hello, I'm having some difficulties with open_basedir. If I include the prefix /home/web25637/ in open_basedir shouldn't it include every directory within this? We're getting this error: Warning: file_exists() [function.file-exists]: open_basedir

RE: [PHP] Telemarketing Script/Tracking Application

2006-10-20 Thread Edward Kay
Is anyone aware of a PHP/MySQL app that would be used by telemarketing staff to track calls, do follow-ups, allow scripting, etc.? We could write something in house but we are pressed for time. I have been poking around the web this morning, but have not found much. TVMIA! SugarCRM? --

FW: [PHP] Ensuring all links go to index.php

2006-10-20 Thread Edward Kay
PHP List, This problem is a little hard to describe. Please forgive me in advance if it's not clear. I have set up my .htaccess file to work with my PHP script to create friendly URLs. For example, the URL mysite.com/user/login will take the user to a page where a user logs in.

Re: [PHP] Re: Problems with open_basedir

2006-10-20 Thread Patrik Jansson
Colin Guthrie wrote: Patrik Jansson wrote: I ran into problems with openbase_dir when using symlinks... They only really reared their ugly head when I upgraded to 5.1.6 before that they were OK (tho' if memory serves I had to add both the symlink location and the directory it pointed to.

[PHP] Check HTML style sheet?

2006-10-20 Thread Marc Roberts
Is it possible to use php to check that the .css file in the html of a web page is the correct one e.g. check if the file included in the html is new.css. I think I will have to write a regex but if anyone has any ideas (or already has a regex to do this), it would be much appreciated.

[PHP] Recieve information on a html site using php?

2006-10-20 Thread Marc Roberts
Is it possible to receive information on a html site, such as the language, date modified? If so how would I go about doing this? Thanks, Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Setting try and catch to use my own error handler

2006-10-20 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-20 15:50:32 +0900: set_error_handler(ErrorHandler::handleError()); Inside my ErrorHandler, I have this: public static function handleError($errno, $errstr, $errfile, $errline) { echo Hey dude! Error! . $errno . $errstr . $errfile . $errline ; } However, I

Re: [PHP] Recieve information on a html site using php?

2006-10-20 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-18 17:23:53 +0200: Is it possible to receive information on a html site, such as the language, date modified? If so how would I go about doing this? Your question is very vague, so I'm taking the liberty of interpretation. -

Re: [PHP] Ensuring all links go to index.php

2006-10-20 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-20 17:00:05 +0900: header(Location: /); header(/local/server/www/directory/); Do you know that both headers are invalid? -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE.

[PHP] Re: IMAP extension causing delays

2006-10-20 Thread Colin Guthrie
Edward Kay wrote: Thanks for your suggestions John. At the moment, I do need to run it as a CGI as I need different php.ini files for each virtual host. For what it's worth, when you use PHP as a module, you can change almost all settings in php ini on a per-virtual host basis using the Apache

[PHP] Re: Problems with open_basedir

2006-10-20 Thread Colin Guthrie
Patrik Jansson wrote: Anyway, are symlinks to blame here? I've added the real path into open_basedir, I also removed the // error but still I get the restriction message: So then I changed the absolute path in Joomla from /home/... to /usr/home/... and now I don't get the error anymore so

Re: [PHP] Re: Problems with open_basedir

2006-10-20 Thread Patrik Jansson
Colin Guthrie wrote: Well, I was never sure that it was a bug or not. I wasn't sure if it was my distro's packaging and any custom patches it applies and also where it was some x86_64 wierdness. Recently (last week) it was confirmed to me that it was not x86_64 at fault, but it was still my

[PHP] session - cookie issues

2006-10-20 Thread Dave Goodchild
Hi all, I am having issues with users not being able to post their details to my site. The system uses sessions, so when they hit the index page a test cookie is set thus: setcookie('djst', 'test'); and then I test whether that cookie is set on the next page. If not, I direct the users to an

Re: [PHP] session - cookie issues

2006-10-20 Thread Mukul Sabharwal
The way you're setting cookies (without a time parameter), it's set to expire at the end of the current session. Though it should work regardless, try setting an expire time: setcookie('djst', 'test', time()+3600); // expire in an hour On 10/20/06, Dave Goodchild [EMAIL PROTECTED] wrote: Hi

Re: [PHP] Re: Problems with open_basedir

2006-10-20 Thread Patrik Jansson
I noticed that this bug is already to be found in the bug database. This is exactly how I'm experiencing it: http://bugs.php.net/bug.php?id=37556 In that report they link the reader to http://bugs.php.net/bug.php?id=30188 which is also applicable. Although I can't understand the last answer:

Re: [PHP] Recieve information on a html site using php?

2006-10-20 Thread Marc Roberts
Thanks for the response, I think I have solved the problem using the code in the attached text document. Thanks for the help, Marc Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-10-18 17:23:53 +0200: Is it possible to receive information on a html site, such as the language, date

Re: [PHP] User question for PHP

2006-10-20 Thread chris smith
On 10/20/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote: On Fri, 20 Oct 2006 15:49:14 +1000, Chris wrote: Andy Hultgren wrote: To whoever was asking this (sorry didn't see the original email): Is it possible to have a PHP script execute as the user of the domain instead of the webserver?

[PHP] Fwd: Parsing and using URL variables

2006-10-20 Thread andrew newman
-- Forwarded message -- From: andrew newman [EMAIL PROTECTED] Date: Oct 20, 2006 2:30 PM Subject: Parsing and using URL variables To: php-general-digest@lists.php.net Hello I am very new to PHP and I am trying to parse the values of variables from a URL into a web page. to

Re: [PHP] Ensuring all links go to index.php

2006-10-20 Thread Lowell Allen
On Oct 20, 2006, at 4:00 AM, Dave M G wrote: PHP List, This problem is a little hard to describe. Please forgive me in advance if it's not clear. I have set up my .htaccess file to work with my PHP script to create friendly URLs. [snip] I thought it had something to do with setting

[PHP] Encode text

2006-10-20 Thread Ahmad Al-Twaijiry
Hi everyone I have a variable with UTF-8 text inside it and I want to convert this text to windows encode, is it possible in very easy way ? Thanks --- Ahmad http://www.v-tadawul.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Fwd: Parsing and using URL variables

2006-10-20 Thread Jochem Maas
looks like your having fun ... but before you go building using something that is going to cause you major security headaches go to this site and read, read, read: http://phpsec.org/ and remember NEVER TRUST USER INPUT (or data from *any* outside source); currently your example will

[PHP] handling multipart form-data

2006-10-20 Thread Anton Statutov
DOCUMENTATION php://input is not available with enctype=multipart/form-data. What I should do if I really need to get multipart data? I want to implement my own form-data parser with PHP5. Can I at least turn off the PHP's one to be able to use php://input with multipart? -- PHP General

Re: [PHP] User question for PHP

2006-10-20 Thread Ivo F.A.C. Fokkema
On Fri, 20 Oct 2006 23:24:14 +1000, chris smith wrote: On 10/20/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote: On Fri, 20 Oct 2006 15:49:14 +1000, Chris wrote: Andy Hultgren wrote: To whoever was asking this (sorry didn't see the original email): Is it possible to have a PHP script

[PHP] Paginating searchs = performance problem

2006-10-20 Thread Fourat Zouari
I have PHP/PostgreSQL application were i got a search page with some items to search, am building the search query on server side. I need to display a paginated search and for this i need to get the total count of lines matching the search before OFFSET/LIMITing my page, am i obliged to repeat

[PHP] Re: Encode text

2006-10-20 Thread Ivo F.A.C. Fokkema
On Fri, 20 Oct 2006 16:57:16 +0300, Ahmad Al-Twaijiry wrote: Hi everyone I have a variable with UTF-8 text inside it and I want to convert this text to windows encode, is it possible in very easy way ? Thanks --- Ahmad Hi Ahmad, utf8_decode() will decode your string to ISO-8859-1.

[PHP] Re: Paginating searchs = performance problem

2006-10-20 Thread Ivo F.A.C. Fokkema
On Fri, 20 Oct 2006 17:04:35 +0200, Fourat Zouari wrote: I have PHP/PostgreSQL application were i got a search page with some items to search, am building the search query on server side. I need to display a paginated search and for this i need to get the total count of lines matching the

Re: [PHP] Encode text

2006-10-20 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-20 16:57:16 +0300: I have a variable with UTF-8 text inside it and I want to convert this text to windows encode, is it possible in very easy way ? http://php.net/iconv -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You

Re: [PHP] Ensuring all links go to index.php

2006-10-20 Thread Google Kreme
On 20 Oct 2006, at 02:00 , Dave M G wrote: So... my question is, why is the /user portion of my URL being retained as a directory? You need RewriteEngine On and RewriteBase and RewriteCond and RewriteRule, it sounds like. Not really a php issue per se. -- I wrote this song two hours

Re: [PHP] Re: Paginating searchs = performance problem

2006-10-20 Thread Robert Cummings
On Fri, 2006-10-20 at 17:22 +0200, Ivo F.A.C. Fokkema wrote: On Fri, 20 Oct 2006 17:04:35 +0200, Fourat Zouari wrote: I have PHP/PostgreSQL application were i got a search page with some items to search, am building the search query on server side. I need to display a paginated search

Re: [PHP] Creating Tree Structure from associative array

2006-10-20 Thread Jürgen Wind
Robert Cummings wrote: On Thu, 2006-10-19 at 23:58 -0500, Larry Garfield wrote: That depends on what your data structure is, exactly, and what sort of tree structure you want on the other side. Please be more specific. On Thursday 19 October 2006 09:08, Angelo Zanetti wrote: Hi

Re: [PHP] Creating Tree Structure from associative array

2006-10-20 Thread Robert Cummings
On Fri, 2006-10-20 at 09:20 -0700, Jürgen Wind wrote: for web browser: // WooohoOO! // echo 'pre'; print_r( $tree ); True, but I do quick sample scripts from the command-line :D Cheers, Rob. -- .. | InterJinn

[PHP] connectivity weirdness

2006-10-20 Thread Richard Lynch
The canonical PHP example of web-scraping: ?php echo file_get_contents('http://php.net/');? fails on a machine I'm using. I'm laying out here all the things I've done and eliminated, and it got awfully long... Short Version: FC4 + LAMPP on 2 different private IP boxes at day job

Re: [PHP] connectivity weirdness

2006-10-20 Thread Jürgen Wind
?php echo file_get_contents('http://php.net/');? takes only 2 seconds here. w2k php5.14 FF1.5.0.7 -- View this message in context: http://www.nabble.com/connectivity-weirdness-tf2481786.html#a6920671 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List

Re: [PHP] connectivity weirdness

2006-10-20 Thread Jon Anderson
For what it's worth, for me telnet php.net 80 (then GET ...) takes ~25 seconds, most of which seems to be the reverse lookup. If I just telnet directly to php.net's IP directly and do the same, it's instant. Doing file_get_contents takes less than 1s numerically or not. jon (Replied directly

Re: [PHP] Recieve information on a html site using php?

2006-10-20 Thread Jürgen Wind
Marc Roberts wrote: Thanks for the response, I think I have solved the problem using the code in the attached text document. Thanks for the help, Marc Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-10-18 17:23:53 +0200: Is it possible to receive information on a html site,

[PHP] A problem with dates

2006-10-20 Thread Dave Goodchild
Hi all. I have an online events directory and am having some issues with date calculations. I have a table of dates (next year) and an events table - which have a many to many relationship and so use an intermediary mapping table called dates_events. All good - when the user enters a single,

Re: [PHP] session - cookie issues

2006-10-20 Thread Jürgen Wind
Dave Goodchild wrote: Hi all, I am having issues with users not being able to post their details to my site. The system uses sessions, so when they hit the index page a test cookie is set thus: setcookie('djst', 'test'); and then I test whether that cookie is set on the next page.

[PHP] Daylight saving time

2006-10-20 Thread Raphael Chasse
Hello, Regarding PHP5 bug #35296, http://bugs.php.net/bug.php?id=35296 I assume that it has been fixed in PHP5 for a while now (any version higher than PHP 5.0.5 ). Could someone tell me if PHP4 has been corrected as well ? in other word, what is the oldest version of PHP4 that contains

Re: [PHP] User question for PHP

2006-10-20 Thread chris smith
On 10/21/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote: On Fri, 20 Oct 2006 23:24:14 +1000, chris smith wrote: On 10/20/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote: On Fri, 20 Oct 2006 15:49:14 +1000, Chris wrote: Andy Hultgren wrote: To whoever was asking this (sorry didn't see the

Re: [PHP] Creating Tree Structure from associative array

2006-10-20 Thread Jochem Maas
Robert Cummings wrote: On Fri, 2006-10-20 at 09:20 -0700, Jürgen Wind wrote: for web browser: // WooohoOO! myself, I'm more partial to // YeeHaw! // echo 'pre'; print_r( $tree ); True, but I do quick sample scripts from the command-line :D Cheers, Rob. -- PHP

Re: [PHP] User question for PHP

2006-10-20 Thread Jochem Maas
chris smith wrote: On 10/21/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote: On Fri, 20 Oct 2006 23:24:14 +1000, chris smith wrote: On 10/20/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote: To my experience, apache (with PHP running as www-data or nobody or whatever) will not be

Re: [PHP] User question for PHP

2006-10-20 Thread chris smith
On 10/21/06, Jochem Maas [EMAIL PROTECTED] wrote: chris smith wrote: On 10/21/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote: On Fri, 20 Oct 2006 23:24:14 +1000, chris smith wrote: On 10/20/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote: To my experience, apache (with PHP running