php-general Digest 8 Aug 2006 09:21:53 -0000 Issue 4281

2006-08-08 Thread php-general-digest-help
php-general Digest 8 Aug 2006 09:21:53 - Issue 4281 Topics (messages 240282 through 240301): Re: Newbie Form Question 240282 by: Richard Lynch 240285 by: Andrew Kreps Re: client-server upload communication? 240283 by: Richard Lynch Re: Using preg_match to find

Re: [PHP] Mixing sprintf and mysql_real_escape_string

2006-08-08 Thread Larry Garfield
On Monday 07 August 2006 19:39, Peter Lauri wrote: [snip]My guess: magic_quotes_gpc is enabled where you're running the script. Therefore slashes are already present in the data from the form post.[/snip] Should I turn it off? Adding slashes and mysql_real_escape_string is not exactly the

[PHP] Regular expression to find from start of string to first space

2006-08-08 Thread Dave M G
PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing has marks, #, I *think* just encloses the

Re: [PHP] Regular expression to find from start of string to first space

2006-08-08 Thread David Tulloh
Dave M G wrote: PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing has marks, #, I

Re: [PHP] Is this really a pdf?

2006-08-08 Thread Sjef
Thanxs very much guys! I do realize that it is not foolproof, but better than nothing. In my situation mime_content_type doesn't work, so I will have to settle for the other method. Sjef -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regular expression to find from start of string to first space

2006-08-08 Thread Dave Goodchild
On 08/08/06, Dave M G [EMAIL PROTECTED] wrote: PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: . stands for

[PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread Ivo F.A.C. Fokkema
Hi guys, I'm really stuck with this error and since my backup scripts are no longer running automatically through cron, I really need to get this fixed soon :) Suddenly my backup scripts die with the error Could not startup.. Only through the cron, it runs fine through the console. I've tried

[PHP] Re: Regular expression to find from start of string to first space

2006-08-08 Thread Barry
Dave M G schrieb: PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing has marks, #, I *think*

[PHP] sending a variable variables to a function

2006-08-08 Thread Ross
I want to send variable variables to a function but I cannot seem to get the syntax correct. This is what I have so far... function my_function ($$moule_no) { // do something with $$module_no } my_function ($module1) my_function ($module2) my_function ($module3) -- PHP General Mailing

Re: [PHP] sending a variable variables to a function

2006-08-08 Thread Jochem Maas
Ross wrote: I want to send variable variables to a function but I cannot seem to get the syntax correct. This is what I have so far... function my_function ($$moule_no) { // do something with $$module_no } my_function ($module1) my_function ($module2) my_function

RE: [PHP] sending a variable variables to a function

2006-08-08 Thread Peter Lauri
The function needs to be declared without variable variable Du like this instead: function my_function($module) { // do something with $module } And then you call the function with the variable variable: my_function($$module_no); /Peter -Original Message- From: Ross

Re: [PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread John Nichel
Ivo F.A.C. Fokkema wrote: Hi guys, I'm really stuck with this error and since my backup scripts are no longer running automatically through cron, I really need to get this fixed soon :) Suddenly my backup scripts die with the error Could not startup.. Only through the cron, it runs fine

RE: [PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread Jef Sullivan
Here is the cron command that we use. I've modified the path to the file for security purposes. */5 * * 1-6 lynx -dump http://fully.qualified.path/cron_test.php -auth=usr:pwd Jef -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 08, 2006 7:11 AM

[PHP] break up variable and put each element in an array

2006-08-08 Thread Reinhart Viane
A. I have a page on which people can supply dates in a text area. Dates are entered like this: 3/01/2005 29/12/2005 2/01/2006 20/02/2006 28/12/2006 1/01/2007 15/02/2007 B. Now I need this Post element to be broken into pieces (per date) and each of those pieces should be put into a text so the

Re: [PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread Ivo F.A.C. Fokkema
On Tue, 08 Aug 2006 09:10:53 -0400, John Nichel wrote: Ivo F.A.C. Fokkema wrote: Suddenly my backup scripts die with the error Could not startup.. Only through the cron, it runs fine through the console. I've tried all kinds of tests with other PHP scripts, tried a different PC, asked my

Re: [PHP] break up variable and put each element in an array

2006-08-08 Thread Dave Goodchild
On 08/08/06, Reinhart Viane [EMAIL PROTECTED] wrote: A. I have a page on which people can supply dates in a text area. Dates are entered like this: 3/01/2005 29/12/2005 2/01/2006 20/02/2006 28/12/2006 1/01/2007 15/02/2007 B. Now I need this Post element to be broken into pieces (per date) and

[PHP] Incrementing a page link, refresh problem

2006-08-08 Thread Ross
I write a session to determine what module a user is on $_SESSION['module_no']==1; when they get to the end of the module I want to create a dynamic link to the next module $increment = $_SESSION['module_no']++; $link= ../module_$increment.php; The problem is every time the page is refreshed

Re: [PHP] break up variable and put each element in an array

2006-08-08 Thread Ivo F.A.C. Fokkema
On Tue, 08 Aug 2006 14:50:53 +0100, Dave Goodchild wrote: On 08/08/06, Reinhart Viane [EMAIL PROTECTED] wrote: A. I have a page on which people can supply dates in a text area. Dates are entered like this: 3/01/2005 29/12/2005 2/01/2006 20/02/2006 28/12/2006 1/01/2007 15/02/2007 B.

Re: [PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread Ray Hauge
On Tuesday 08 August 2006 08:47, Ivo F.A.C. Fokkema wrote: Does the user running the cron have permission to execute the php binary? Yes, the file's owner is me and it's my crontab. Also, I've made the file readable to all, just in case. All directories up the directory tree are

[PHP] Re: Incrementing a page link, refresh problem

2006-08-08 Thread Ivo F.A.C. Fokkema
On Tue, 08 Aug 2006 14:54:08 +0100, Ross wrote: I write a session to determine what module a user is on $_SESSION['module_no']==1; when they get to the end of the module I want to create a dynamic link to the next module $increment = $_SESSION['module_no']++; $link=

Re: [PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread Ivo F.A.C. Fokkema
On Tue, 08 Aug 2006 09:01:42 -0500, Ray Hauge wrote: On Tuesday 08 August 2006 08:47, Ivo F.A.C. Fokkema wrote: Does the user running the cron have permission to execute the php binary? Yes, the file's owner is me and it's my crontab. Also, I've made the file readable to all, just in case.

Re: [PHP] Re: Incrementing a page link, refresh problem

2006-08-08 Thread Jochem Maas
Ivo F.A.C. Fokkema wrote: On Tue, 08 Aug 2006 14:54:08 +0100, Ross wrote: I write a session to determine what module a user is on $_SESSION['module_no']==1; when they get to the end of the module I want to create a dynamic link to the next module $increment = $_SESSION['module_no']++;

RE: [PHP] break up variable and put each element in an array

2006-08-08 Thread Ivo F.A.C. Fokkema
On Tue, 2006-08-08 at 16:06 +0200, Reinhart Viane wrote: try this: $string = 3/01/2005 29/12/2005 2/01/2006 20/02/2006 28/12/2006 1/01/2007 15/02/2007; $array = explode(' ', $string); foreach ($array as $value) echo Date: $valuebr /; If the user separates the dates by an enter in

RE: [PHP] break up variable and put each element in an array

2006-08-08 Thread Reinhart Viane
try this: $string = 3/01/2005 29/12/2005 2/01/2006 20/02/2006 28/12/2006 1/01/2007 15/02/2007; $array = explode(' ', $string); foreach ($array as $value) echo Date: $valuebr /; If the user separates the dates by an enter in the textarea, you need to explode on \r\n. To be able to handle

RE: [PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread Ivo F.A.C. Fokkema
On Tue, 08 Aug 2006 07:28:43 -0600, Jef Sullivan wrote: Here is the cron command that we use. I've modified the path to the file for security purposes. */5 * * 1-6 lynx -dump http://fully.qualified.path/cron_test.php -auth=usr:pwd Jef Thanks for the reply. However, your example is not

RE: [PHP] break up variable and put each element in an array

2006-08-08 Thread Reinhart Viane
Thx all -Oorspronkelijk bericht- Van: Ivo F.A.C. Fokkema [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 8 augustus 2006 16:17 Aan: Reinhart Viane CC: php-general@lists.php.net Onderwerp: RE: [PHP] break up variable and put each element in an array On Tue, 2006-08-08 at 16:06 +0200,

Re: [PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread Ray Hauge
On Tuesday 08 August 2006 09:01, Ivo F.A.C. Fokkema wrote: On Tue, 08 Aug 2006 09:01:42 -0500, Ray Hauge wrote: On Tuesday 08 August 2006 08:47, Ivo F.A.C. Fokkema wrote: Does the user running the cron have permission to execute the php binary? Yes, the file's owner is me and it's my

RE: [PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread Arno Kuhl
Is there anything in your error log that says why it failed? (whatever error_log points to in php.ini, or maybe what ErrorLog points to in httpd.conf) Arno -Original Message- From: Ivo F.A.C. Fokkema [mailto:[EMAIL PROTECTED] Sent: 08 August 2006 01:42 To: php-general@lists.php.net

Re: [PHP] Cron running 'Hello world' script dies with Could not startup.

2006-08-08 Thread Ivo F.A.C. Fokkema
On Tue, 08 Aug 2006 10:01:41 -0500, Ray Hauge wrote: On Tuesday 08 August 2006 09:01, Ivo F.A.C. Fokkema wrote: On Tue, 08 Aug 2006 09:01:42 -0500, Ray Hauge wrote: On Tuesday 08 August 2006 08:47, Ivo F.A.C. Fokkema wrote: Does the user running the cron have permission to execute the php

[PHP] Re: Regular expression to find from start of string to first space

2006-08-08 Thread Adam Zey
Dave M G wrote: PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing has marks, #, I *think* just

[PHP] Greek Characters from MySQL to PHP to the Browser: ??????

2006-08-08 Thread John Wells
Hi Everybody, Despite all of my Googling and noodling, I can't seem to figure this out, and am hoping someone might be able to point me in the right direction. Scenario: - Running Apache 1.3 on OSX 10.4, PHP 5.1.4, MySQL 5.0.19 - Greek text is stored in a MySQL database, encoding set to UTF-8 -

[PHP] Re: Greek Characters from MySQL to PHP to the Browser: ??????

2006-08-08 Thread Colin Guthrie
John Wells wrote: Hi Everybody, Despite all of my Googling and noodling, I can't seem to figure this out, and am hoping someone might be able to point me in the right direction. Scenario: - Running Apache 1.3 on OSX 10.4, PHP 5.1.4, MySQL 5.0.19 - Greek text is stored in a MySQL database,

Re: [PHP] Re: Greek Characters from MySQL to PHP to the Browser: ??????

2006-08-08 Thread Michael B Allen
On Tue, 08 Aug 2006 18:00:29 +0100 Colin Guthrie [EMAIL PROTECTED] wrote: - If I copy and paste greek characters from the db table into a string in my PHP script, and output that, it works just FINE, without any htmlentities() or other functions. I'm at a loss. What am I doing wrong?

Re: [PHP] Greek Characters from MySQL to PHP to the Browser: ??????

2006-08-08 Thread Jochem Maas
John Wells wrote: Hi Everybody, Despite all of my Googling and noodling, I can't seem to figure this out, and am hoping someone might be able to point me in the right direction. Scenario: - Running Apache 1.3 on OSX 10.4, PHP 5.1.4, MySQL 5.0.19 - Greek text is stored in a MySQL

RE: [PHP] Is this really a pdf?

2006-08-08 Thread KermodeBear
If your server has the appropriate programs installed, there ARE some command line utilities that can take a PDF and convert it to another form; You can execute them with an exec call. Theoretically, if the PDF is corrupt they will print out some kind of error which you can capture. It could also

Re: [PHP] break up variable and put each element in an array

2006-08-08 Thread Richard Lynch
On Tue, August 8, 2006 8:02 am, Reinhart Viane wrote: A. I have a page on which people can supply dates in a text area. Dates are entered like this: 3/01/2005 29/12/2005 2/01/2006 20/02/2006 28/12/2006 1/01/2007 15/02/2007 B. Now I need this Post element to be broken into pieces

RE: [PHP] break up variable and put each element in an array

2006-08-08 Thread Richard Lynch
On Tue, August 8, 2006 9:06 am, Reinhart Viane wrote: try this: $string = 3/01/2005 29/12/2005 2/01/2006 20/02/2006 28/12/2006 1/01/2007 15/02/2007; $array = explode(' ', $string); foreach ($array as $value) echo Date: $valuebr /; If the user separates the dates by an enter in the

Re: [PHP] sending a variable variables to a function

2006-08-08 Thread Richard Lynch
On Tue, August 8, 2006 7:25 am, Ross wrote: I want to send variable variables to a function but I cannot seem to get the syntax correct. This is what I have so far... function my_function ($$moule_no) { For sure, you don't want $$ in the arglist. You probably want $module_varname, I

Re: [PHP] Greek Characters from MySQL to PHP to the Browser: ??????

2006-08-08 Thread Richard Lynch
On Tue, August 8, 2006 10:27 am, John Wells wrote: Despite all of my Googling and noodling, I can't seem to figure this out, and am hoping someone might be able to point me in the right direction. I would guess that the MySQL client linked into PHP isn't UTF-8, and it keeps asking the MySQL

[PHP] Multiple Includes vs. One Long Include (Functions)

2006-08-08 Thread Kevin Murphy
I was just wondering if there was any thought one way or another on the best practice for doing this. Lets say I have 10 functions that I want to reuse on my site. Not every page needs every function. So I move the function to an external page and then require it for the page. The

Re: [PHP] Multiple Includes vs. One Long Include (Functions)

2006-08-08 Thread Robert Cummings
On Tue, 2006-08-08 at 13:30 -0700, Kevin Murphy wrote: I was just wondering if there was any thought one way or another on the best practice for doing this. Lets say I have 10 functions that I want to reuse on my site. Not every page needs every function. So I move the function to an

RE: [PHP] Mixing sprintf and mysql_real_escape_string

2006-08-08 Thread Richard Lynch
Turn off Magic Quotes. They are doing an extra (bogus) escape before you ever get a chance at the data. On Mon, August 7, 2006 1:00 pm, Peter Lauri wrote: I should maybe add that the data actually comes from a form: mysql_query(sprintf(INSERT INTO table (value1, value2) VALUES (1, '%s'),

[PHP] Re: Multiple Includes vs. One Long Include (Functions)

2006-08-08 Thread Adam Zey
Kevin Murphy wrote: I was just wondering if there was any thought one way or another on the best practice for doing this. Lets say I have 10 functions that I want to reuse on my site. Not every page needs every function. So I move the function to an external page and then require it for the

RE: [PHP] break up variable and put each element in an array

2006-08-08 Thread Fokkema, I.F.A.C. \(HKG\)
try this: $string = 3/01/2005 29/12/2005 2/01/2006 20/02/2006 28/12/2006 1/01/2007 15/02/2007; $array = explode(' ', $string); foreach ($array as $value) echo Date: $valuebr /; If the user separates the dates by an enter in the textarea, you need to explode on \r\n. To be able to handle

Re: [PHP] Regular expression to find from start of string to first space

2006-08-08 Thread Richard Lynch
On Tue, August 8, 2006 4:21 am, Dave M G wrote: Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing

Re: [PHP] Strip non-alphanumerics from beginning and end?

2006-08-08 Thread Brian Dunning
Perfect, thanks very much. I think I'll probably die before I'm ever handy with regex. On Aug 4, 2006, at 7:57 PM, Robert Cummings wrote: On Fri, 2006-08-04 at 19:12 -0700, Brian Dunning wrote: Is there a command to strip all non-alphanumerics form the beginning and end of a string? Ex.:

Re: [PHP] Strip non-alphanumerics from beginning and end?

2006-08-08 Thread Adam Zey
In that case you may find Regex Coach (http://weitz.de/regex-coach/) handy. It essentially does the match in real-time as you watch, and shows you exactly what each part of the regex is matching. Essentially, you paste the text to search through in the bottom pane, and start typing the regex

Re: [PHP] question about how php handles post'd and get'd data

2006-08-08 Thread Ligaya Turmelle
jonathan wrote: i was having a conversation and was wondering where in the source code for php is the process for writing get'd and post'd data to their corresponding arrays? Also, is there a way to view the source code online? thanks, jonathan PHP's cvs is available online at

[PHP] select tag doesn't update post or get

2006-08-08 Thread Roel Dillen
I have a xhtml form with a select with options if I click submit the processing page is loaded and the result of the form is shown. The option given to the processing page however is always the same: the first in the list. It doesn't matter what I select in the drop down menu, the value of

Re: [PHP] Greek Characters from MySQL to PHP to the Browser: ??????

2006-08-08 Thread Ligaya Turmelle
John Wells wrote: Hi Everybody, Despite all of my Googling and noodling, I can't seem to figure this out, and am hoping someone might be able to point me in the right direction. Scenario: - Running Apache 1.3 on OSX 10.4, PHP 5.1.4, MySQL 5.0.19 - Greek text is stored in a MySQL database,

[PHP] Have a SQL Server COM question

2006-08-08 Thread Todd Cary
I am in the process of converting my clients PHP scripts that are using Interbase so they will work with SQL Server (their request; not mine). Is there a reference where I can get the COM Methods and Properties? Also, without loading the large AdoDb, is there a Prepare() method if I use the

Re: [PHP] select tag doesn't update post or get

2006-08-08 Thread Jochem Maas
Roel Dillen wrote: I have a xhtml form with a select with options if I click submit the processing page is loaded and the result of the form is shown. The option given to the processing page however is always the same: the first in the list. It doesn't matter what I select in the drop down

Re: [PHP] Re: PHP Frameworks - Opinion

2006-08-08 Thread Manuel Lemos
Hello, on 08/05/2006 11:47 PM Robert Cummings said the following: This is necessary to escape wildcards characters that should be taken literally in patterns. It is needed to implement the auto-complete feature using SQL conditions of type field LIKE 'typed-text%'. If typed-text contains % or

Re: [PHP] Re: PHP Frameworks - Opinion

2006-08-08 Thread Manuel Lemos
Hello, on 08/06/2006 09:52 PM Martin Alterisio said the following: Anyway, you may want to read this more in depth reflection of the state of the PHP framework world and recommendations on how to pick what suits best for you:

Re: [PHP] Using preg_match to find Japanese text

2006-08-08 Thread Dave M G
Richard, Madoka, Thank you for your insights into searching for Japanese characters. I've decided to stick with searching for words as determined by the placement of spaces within the source text. Thank you for your time and advice. -- Dave M G -- PHP General Mailing List

Re: [PHP] Regular expression to find from start of string to first space [SOLVED]

2006-08-08 Thread Dave M G
Richard, Adam, Barry, Dave, David, Thank you all for your helpful advice regarding expressions. I was able to combine all your advice, and made some additional discoveries along the way. The winning expression is: #^(.*)\s#iU First, I discovered that sometimes the source text had an