php-general Digest 2 Apr 2007 10:22:28 -0000 Issue 4711

2007-04-02 Thread php-general-digest-help
php-general Digest 2 Apr 2007 10:22:28 - Issue 4711 Topics (messages 251903 through 251910): Re: simple page not found 404 script - PHP 251903 by: Zoltán Németh Re: HTDIGEST FILE FORMAT 251904 by: Buesching, Logan J Re: finding the index name of an associative array

RE: [PHP] Ide help needed

2007-04-02 Thread Arno Kuhl
Nuspere's PHPEd. Highly recommended. I looked at all the alternatives, including Zend and Eclipse, and IMO PHPEd is superior. And faster performance is a real bonus. Arno -Original Message- From: Davi [mailto:[EMAIL PROTECTED] Sent: 02 April 2007 02:50 To: php-general@lists.php.net

[PHP] pg_last_error()

2007-04-02 Thread Miguel J. Jiménez
Hello, the question is simple... After I try to free a resultset in postgres using pg_free_result() it returns false ... Can I use pg_last_error() to get the cause of this last error? I have tried but it returns an empty string and I do not know if it is because I cannot use pg_last_error()

Re: [PHP] Security Best Practice: typecast?

2007-04-02 Thread Robin Vickery
On 01/04/07, Richard Lynch [EMAIL PROTECTED] wrote: So, after a recent thread on data filtering, I'm wondering... Is this good enough in ALL possible Unicode/charset situations: $foo_id = (int) $_POST['foo_id']; $query = insert into whatever(foo_id) values($foo_id); Or is it possible, even

[PHP] Example from www.php.net

2007-04-02 Thread Timothy Murphy
I was trying Example 2147, which reads: --- ?php $string = XML a xmlns:b foo name=one game=lonely1/foo /a XML; $xml = simplexml_load_string($string); foreach($xml-foo[0]-attributes() as $a = $b) { echo $a,'=',$b,\\n; } ? --- It says

[PHP] Problems with mail

2007-04-02 Thread Mário Gamito
Hi, I have this very straight forward code to send an e-mail: $subject_users_subscription_confirmation = Subscription confirmation; $message_users_subscription_confirmation = 'Please, click this link to confirm your subscritpion: http://www.telbit.pt/subscribe-confirm.php?email=' . $email .

Re: [PHP] Re: 0x9f54

2007-04-02 Thread Seak, Teng-Fong
Man-wai Chang wrote: MySQL? MSSQL? PgSQL? Tijnema It seems he wanted to insert a Chinese character with that hex value. Yes... I tried the insert with PHP, including the use of mysql_real_escape_string(), but MySQL still gave me a blank only. Well, this doesn't seem to

[PHP] Sending mail through another (SMTP authenticated) host

2007-04-02 Thread Mário Gamito
Hi, How can i use the mail function to send messages through another server that has authenticated SMTP ? Any help would be appreciated. Warm Regards -- :wq! Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Example from www.php.net

2007-04-02 Thread Timothy Murphy
Timothy Murphy wrote: I was trying Example 2147, which reads: --- ?php $string = XML a xmlns:b foo name=one game=lonely1/foo /a XML; $xml = simplexml_load_string($string); foreach($xml-foo[0]-attributes() as $a = $b) { echo $a,'=',$b,\\n; } ?

Re: [PHP] Date/time format?

2007-04-02 Thread Zoltán Németh
2007. 03. 30, péntek keltezéssel 14.00-kor Jason Pruim ezt írta: On Mar 29, 2007, at 4:52 PM, Zoltán Németh wrote: snip (I assume you want this calculation within one given day) you could read all rows into an array like $timeinfo = array(); $sql = SELECT minute, sequence FROM

Re: [PHP] Gnome and MIME types

2007-04-02 Thread Zoltán Németh
2007. 03. 30, péntek keltezéssel 13.51-kor Nathan Ziarek ezt írta: Got it. After putting .gnome2 folders every where I could think of, I accidentally put one in /var/www/ and it worked. I guess PHP considers the root of my web site to its home (which makes sense, but not what I was

[PHP] Re: Problems with mail

2007-04-02 Thread itoctopus
Weird, this code should work. Are you sure there is no hidden space somewhere in the email. Try just to hardcode the email (eg. mail('[EMAIL PROTECTED]', $subject_users_subscription_confirmation, $message_users_subscription_confirmation); and see what'll happen. -- itoctopus -

[PHP] scandir and ftp wrapper

2007-04-02 Thread j
Hi I have a question about scandir I have been trying to track down problems after upgrading from 5.1.6 to 5.2.1. I have been getting errors with a section of code that does something similar to the following $fileList=scandir(ftp://user:[EMAIL PROTECTED]/); I get the following error.

Re: [PHP] Problems with mail

2007-04-02 Thread cajbecu
Mário Gamito wrote: Hi, I have this very straight forward code to send an e-mail: $subject_users_subscription_confirmation = Subscription confirmation; $message_users_subscription_confirmation = 'Please, click this link to confirm your subscritpion:

[PHP] Best opensource XML parser for PHP ?

2007-04-02 Thread Don Don
Hi all whats the best open source (free) xml parser for php (4 ) ? I've come across a few but am looking the best as adjudged by the industry. Cheers - Food fight? Enjoy some healthy debate in the Yahoo! Answers Food Drink QA.

[PHP] Duplicate dates in array

2007-04-02 Thread Dave Goodchild
Hi all, I have an array containing a sequence of dates in the following format, for example: Mon 26 Nov 2007 Mon 24 Dec 2007 Mon 31 Dec 2007 Mon 28 Jan 2007 ...and I want to remove any the first element in cases where the Mondays fall in the same month, so in this case I want to be left with:

[PHP] How to detect charset encoding with PHP and command line?

2007-04-02 Thread William Lovaton
Hi there, I'd like to know a way to detect the file encoding from PHP and Linux command line too. In PHP I tried mb_detect_encoding() but it doesn't work reliable, first I have to specify a list of posible encodings and second it always returns the first encoding I put in the list no matter

Re: [PHP] Duplicate dates in array

2007-04-02 Thread Arpad Ray
Dave Goodchild wrote: Any ideas on the most efficient way to do it? I am working on using combinations of array_search, in_array and so on and want to avoid regular expressions if I can. Many thanks in advance for any suggestions! If you mean that you only want one date for each month (you'll

Re: [PHP] Duplicate dates in array

2007-04-02 Thread Dave Goodchild
Amazing, just what I needed - many thanks. Have been coding non-stop for 10 days and things are getting foggy. Grats for your informed and quick response and have a fantastic day!

Re: [PHP] Best opensource XML parser for PHP ?

2007-04-02 Thread Tijnema !
On 4/2/07, Don Don [EMAIL PROTECTED] wrote: Hi all whats the best open source (free) xml parser for php (4 ) ? I've come across a few but am looking the best as adjudged by the industry. Cheers There's already an XML parser build into PHP. I don't see any reasong using an external.

[PHP] php 5 upgrade and background script on unix

2007-04-02 Thread Frederic Belleudy
Hello there, I hope someone resolved the same issue. I upgraded my server to 5.2.1 I got some script that are running background script (generally we call this technic FORKING) Ive got a web interface that running (depending the action chosen) other scripts in the background. My issue is, it

[PHP] Forking doesn't work on php 5.2.1?

2007-04-02 Thread Frederic Belleudy
Hello there, I hope someone resolved the same issue. I upgraded my server to 5.2.1 I got some script that are running background script (generally we call this technic FORKING) Ive got a web interface that running (depending the action chosen) other scripts in the background. My issue is, it

Re: [PHP] php 5 upgrade and background script on unix

2007-04-02 Thread Jochem Maas
Frederic Belleudy wrote: Hello there, I hope someone resolved the same issue. I upgraded my server to 5.2.1 I got some script that are running background script (generally we call this technic FORKING) Ive got a web interface that running (depending the action chosen) other scripts in the

Re: [PHP] Forking doesn't work on php 5.2.1?

2007-04-02 Thread Jochem Maas
Frederic Belleudy wrote: Hello there, I hope someone resolved the same issue. I upgraded my server to 5.2.1 I got some script that are running background script (generally we call this technic FORKING) Ive got a web interface that running (depending the action chosen) other scripts in the

[PHP] imagecreate() question

2007-04-02 Thread tedd
Hi gang: A couple of image questions: In the php manual it says: imagecreate() returns an image identifier representing a blank image of specified size. We recommend the use of imagecreatetruecolor(). Q: Why the recommendation? imagecreate() returns a blank page whereas

Re: [PHP] Forking doesn't work on php 5.2.1? OT

2007-04-02 Thread Børge Holen
On Monday 02 April 2007 17:11, Jochem Maas wrote: Frederic Belleudy wrote: Hello there, I hope someone resolved the same issue. I upgraded my server to 5.2.1 I got some script that are running background script (generally we call this technic FORKING) Ive got a web interface that

Re: [PHP] imagecreate() question

2007-04-02 Thread Richard Davey
tedd wrote: In the php manual it says: imagecreate() returns an image identifier representing a blank image of specified size. We recommend the use of imagecreatetruecolor(). Q: Why the recommendation? Because the need to create 256 colour (or less) images grows less year by year. If you

Re: [PHP] php 5 upgrade and background script on unix

2007-04-02 Thread Frederic Belleudy
perfectly because if Im executing test_fork.php from the shell, the fork is working fine! __ NOD32 2162 (20070402) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- Frederic Belleudy Programmer PWIdeas ICQ #: 253-372-030

Re: [PHP] Forking doesn't work on php 5.2.1?

2007-04-02 Thread Frederic Belleudy
Well I think I've found the answer: the configure command is (in part): '--disable-cli' '--disable-pear' Ive got another server who is running fork script and '--enable-cli' is in the configure command. Well Ill let you know guys if it works after I've recompiled apache How comes it does

Re: [PHP] Forking doesn't work on php 5.2.1? OT

2007-04-02 Thread Jochem Maas
Børge Holen wrote: On Monday 02 April 2007 17:11, Jochem Maas wrote: Frederic Belleudy wrote: Hello there, I hope someone resolved the same issue. I upgraded my server to 5.2.1 I got some script that are running background script (generally we call this technic FORKING) Ive got a web

Re: [PHP] Forking doesn't work on php 5.2.1?

2007-04-02 Thread Jochem Maas
Frederic Belleudy wrote: Well I think I've found the answer: the configure command is (in part): '--disable-cli' '--disable-pear' Ive got another server who is running fork script and '--enable-cli' is in the configure command. then that is probably what the problem is - although I find

Re: [PHP] php 5 upgrade and background script on unix

2007-04-02 Thread Jochem Maas
Frederic Belleudy wrote: don't fork webserver processes, granted it doesn't fix the problem, but you really should be doing it anyway. I'm guessing that the pcntl extension is not compiled into the webserver php SAPI, it's a really big guess because you didn't supply the code you use to

Re: [PHP] Forking doesn't work on php 5.2.1?

2007-04-02 Thread Sebe
Jochem Maas wrote: Frederic Belleudy wrote: Well Ill let you know guys if it works after I've recompiled apache try recompiling php - recompiling apache won't have an effect as far as that compile option goes. it will if php is complied statically into apache, then you have to

Re: [PHP] Forking doesn't work on php 5.2.1? OT

2007-04-02 Thread Stut
Jochem Maas wrote: 'they' never tell anyone, but once in a while one of us drones gets lucky and figures out there is 'life beyond the list' ;-) You want me to do what with who now? -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php 5 upgrade and background script on unix

2007-04-02 Thread Frederic Belleudy
Jochem: won't it? what does it do? does it go into and endless loop and bring your machine to a halt by any chance? .. because by looking at it, as long as $in['bg'] is not set and not equal to true it's going to keep spawning sub-shells with cmdlines that call itself. Me: You haven't read my

Re: [PHP] Forking doesn't work on php 5.2.1?

2007-04-02 Thread Frederic Belleudy
Well my php.ini register_argc_argv = Off apache was configured with the option --disable-cli but cli is installed on my system and it works fine when i do execute the script from the shell so its a problem running php cli from my php apache module any other suggestions!?!??! Sebe wrote:

Re: [PHP] imagecreate() question

2007-04-02 Thread tedd
At 4:27 PM +0100 4/2/07, Richard Davey wrote: tedd wrote: In the php manual it says: imagecreate() returns an image identifier representing a blank image of specified size. We recommend the use of imagecreatetruecolor(). Q: Why the recommendation? Because the need to create 256 colour

Re: [PHP] php 5 upgrade and background script on unix

2007-04-02 Thread Frederic Belleudy
Jochem Maas wrote: Frederic Belleudy wrote: don't fork webserver processes, granted it doesn't fix the problem, but you really should be doing it anyway. I'm guessing that the pcntl extension is not compiled into the webserver php SAPI, it's a really big guess because you didn't supply the

Re: [PHP] imagecreate() question

2007-04-02 Thread Edward Vermillion
Did you try making it transparent first, before adding the circle? Only a question because I'm not sure if it will make a difference. I know I had problems trying to get the alpha blending to actually look decent in png's (ended up looking like a very poor gif with a non- antialiased mask)

Re: [PHP] Security Best Practice: typecast?

2007-04-02 Thread Chris Shiflett
Richard Lynch wrote: Should one be ultra-conservative and just do: $foo_sql = mysql_real_escape_string($connection); I don't consider this (escaping) to be particularly conservative; it's appropriate for any data you want to use in an SQL query that's being sent to MySQL. Filtering is

Re: [PHP] Security Best Practice: typecast?

2007-04-02 Thread Chris Shiflett
Tijnema wrote: use this instead: $foo_sql = mysql_real_escape_string($foo_sql,$connection); Don't escape an entire SQL query. Escaping helps us provide distinction between the query and the data, eliminating cases where data can interfere with the format of the query (SQL injection). If

[PHP] Security: Passing URLs between pages for redirect

2007-04-02 Thread Chris W. Parker
Hi. Currently I'm building a small application for internal office use but I'd like to get some feedback on a certain aspect of it. When someone tries to access a page they do not have access to they are redirected to the login page with the URL they tried to access in the querystring. This URL

RE: [PHP] Security: Passing URLs between pages for redirect

2007-04-02 Thread Jay Blanchard
[snip] Currently I'm building a small application for internal office use but I'd like to get some feedback on a certain aspect of it. When someone tries to access a page they do not have access to they are redirected to the login page with the URL they tried to access in the querystring. This

[PHP] Re: Sending mail through another (SMTP authenticated) host

2007-04-02 Thread Haydar TUNA
Hello, You can use phpmailer from http://phpmailer.sourceforge.net/ web adress:) . You can use examples like this: ?php require(class.phpmailer.php); $mail = new PHPMailer(); $mail-IsSMTP(); // send via SMTP $mail-Host = post.somehost.com; // SMTP servers $mail-SMTPAuth = true; //

[PHP] Cannot remove PHP Version 5.2.1-0.dotdeb.1

2007-04-02 Thread Miles Thompson
This probably belongs under php-install, but thought I would try here first, and it comes under the general header of Be careful what you wish for. On a new Ubuntu (Debian) server I installed this version of PHP because I wanted some 5.2 features. It's the hardened version, and not the one we

RE: [PHP] Audio CAPTCHA review request

2007-04-02 Thread Daevid Vincent
I think what you're doing is very interesting. I will point you at http://www.cepstral.com/ for a possible solution to your .mp3 usage. You could use Cepstral's swift tool to say the text dynamically. Another suggestion on your security: put in a random delay after unsuccessful attempts. This

Re: [PHP] Cannot remove PHP Version 5.2.1-0.dotdeb.1

2007-04-02 Thread Mario Guenterberg
On Mon, Apr 02, 2007 at 04:52:02PM -0300, Miles Thompson wrote: This probably belongs under php-install, but thought I would try here first, and it comes under the general header of Be careful what you wish for. On a new Ubuntu (Debian) server I installed this version of PHP because I wanted

RE: [PHP] Downloads for subsrcibers only

2007-04-02 Thread Daevid Vincent
Look at mod_auth_mysql. Then authenticate your pdf directory against that database of users. Otherwise anyone who knows the direct link to your PDF can download it, bypassing all your 'subscription' security. -Original Message- From: Mário Gamito [mailto:[EMAIL PROTECTED] Sent:

Re: [PHP] pg_last_error()

2007-04-02 Thread Chris
Miguel J. Jiménez wrote: Hello, the question is simple... After I try to free a resultset in postgres using pg_free_result() it returns false ... Can I use pg_last_error() to get the cause of this last error? I have tried but it returns an empty string and I do not know if it is because I

Re: [PHP] Problems with mail

2007-04-02 Thread Chris
Mário Gamito wrote: Hi, I have this very straight forward code to send an e-mail: $subject_users_subscription_confirmation = Subscription confirmation; $message_users_subscription_confirmation = 'Please, click this link to confirm your subscritpion:

Re: [PHP] Cannot remove PHP Version 5.2.1-0.dotdeb.1

2007-04-02 Thread Miles Thompson
Thanks Mario, I'll try that tomorrow morning. Much appreciated - Miles On 4/2/07, Mario Guenterberg [EMAIL PROTECTED] wrote: On Mon, Apr 02, 2007 at 04:52:02PM -0300, Miles Thompson wrote: This probably belongs under php-install, but thought I would try here first, and it comes under the

[PHP] secure database info in different environments

2007-04-02 Thread Bruce Cowin
Hi, I have a generic database class that I built to connect to our different databases. From other posts that I've read, I think the safe thing is for me to put this file outside the web root, ensure it has a .php extension, set the include path to include this folder and include it in any

Re: [PHP] Re: Example from www.php.net

2007-04-02 Thread Chris
Timothy Murphy wrote: Timothy Murphy wrote: I was trying Example 2147, which reads: --- ?php $string = XML a xmlns:b foo name=one game=lonely1/foo /a XML; $xml = simplexml_load_string($string); foreach($xml-foo[0]-attributes() as $a = $b) { echo $a,'=',$b,\\n;

Re: [PHP] Google-Yahoo venture and PHP

2007-04-02 Thread Chris
Matt Kay wrote: I really dont see what all the fuss is about. If MS is going to have us all running on thin clients, and Google/Yahoo want to beat them to the punch, is this really going to matter who we pay? The article on digg.com http://digg.com/tech_news/Google_Yahoo_Merger_Redefines_Access