Re: [PHP] Question about apache-php concurrent process control

2005-07-21 Thread Richard Lynch
On Thu, July 21, 2005 8:40 pm, Liang ZHONG said: I now encounter a problem with flow control of my program with PHP. This is very crucial to the design of a pretty big project. This is what I want to do in the program: ?php do_A(); header(Location: .$result_of_do_A); Depending on the

Re: [PHP] Question about apache-php concurrent process control

2005-07-19 Thread Liang ZHONG
Thank you Rouvas, I never used the tools you mentioned. But I will definitely give them a try. I wrote a perl script using LWP as an http user agent. and the timing function you suggested. It works well. I am new to this forum, and new to PHP. It seems Rasmus is famous, and I should have

RE: [PHP] Question about apache-php concurrent process control

2005-07-19 Thread Shaw, Chris - Accenture
snipIt seems Rasmus is famous, and I should have shown my respect./snip history src = 'php_manual_en.chm' PHP succeeds an older product, named PHP/FI. PHP/FI was created by Rasmus Lerdorf in 1995, initially as a simple set of Perl scripts for tracking accesses to his online resume. He named this

Re: [PHP] Question about apache-php concurrent process control

2005-07-19 Thread Liang ZHONG
Hi André, It sounds interesting. But since I am pretty new to PHP, I have some questions, naive maybe, about what you wrote. #!/bin/sh\n/path/to/script/Send.php 12 \n What does the Send.php look like? I do not have idea how a shell interprets an php script and what the parameter 12 means

RE: [PHP] Question about apache-php concurrent process control

2005-07-19 Thread Liang ZHONG
Can somebody here help me to delete my message? People who read this must be laughing at me. :) snipIt seems Rasmus is famous, and I should have shown my respect./snip history src = 'php_manual_en.chm' PHP succeeds an older product, named PHP/FI. PHP/FI was created by Rasmus Lerdorf in

Re: [PHP] Question about apache-php concurrent process control

2005-07-17 Thread André Medeiros
I did something like that for a newsletter sending script. Basiclly, I had two scripts: a) AddEdit.php that would list the newsletter's items and allow it to send b) Send.php that was a script I ran on the background When pressed Send on AddEdit, it would do something like $tempName = tempnam(

Re: [PHP] Question about apache-php concurrent process control

2005-07-16 Thread rouvas
Hi Liang, trying to get conclusive results with browsers is futile. Use a command-line tool (like curl) to invoke the web pages and get the results. Or you can use PHP's own function to query the web server and do your own timing with microtime() function or another suitable for your purposes.

Re: [PHP] Question about apache-php concurrent process control

2005-07-16 Thread Rory Browne
On 7/16/05, rouvas [EMAIL PROTECTED] wrote: Hi Liang, trying to get conclusive results with browsers is futile. Use a command-line tool (like curl) to invoke the web pages and get the results. Or you can use Although personally I think that telnet-to-port-80 would be a better idea, in this

[PHP] Question about apache-php concurrent process control

2005-07-15 Thread Liang
I am a programmer and new to php. I wonder what process control can php interpreter do for multithreading . I notice that through http request, php interpreter can execute 2 php programs simataneously, but will only sequentially queued and execute if I try to execute one php code in the same

[PHP] Question about apache-php concurrent process control

2005-07-15 Thread Liang ZHONG
I am a programmer and new to php. I wonder what process control can php interpreter do for multithreading . I notice that through http request, php interpreter can execute 2 php programs simataneously, but will only sequentially queued and execute if I try to execute one php code in the same

Re: [PHP] Question about apache-php concurrent process control

2005-07-15 Thread Rasmus Lerdorf
Liang wrote: I am a programmer and new to php. I wonder what process control can php interpreter do for multithreading . I notice that through http request, php interpreter can execute 2 php programs simataneously, but will only sequentially queued and execute if I try to execute one php

Re: [PHP] Question about apache-php concurrent process control

2005-07-15 Thread Liang ZHONG
thing. Or 2 php interpreter processes process one php program sepreately without interfer with each other. Hope I have explained myself clearly. Thank you. From: Rasmus Lerdorf [EMAIL PROTECTED] To: Liang [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] Question about

Re: [PHP] Question about apache-php concurrent process control

2005-07-15 Thread Rasmus Lerdorf
Liang ZHONG wrote: As I know, apache-php works this way. When the web server gets an http request with file name extension .php, it will start the php interpreter to process the php file. Now I have a php program does something like this: when it is executing with one parameter p1, the

Re: [PHP] Question about apache-php concurrent process control

2005-07-15 Thread Liang ZHONG
Could you please explain it a little bit more? I did test this way. The code is the same for a.php and b.php ?php sleep(20); print Done. br /; ? I place request from 2 browser windows. First time, I placed with http://baseURL/a.php with both 2 browsers, starting times have 5

Re: [PHP] Question about apache-php concurrent process control

2005-07-15 Thread Rasmus Lerdorf
Liang ZHONG wrote: Could you please explain it a little bit more? I did test this way. The code is the same for a.php and b.php ?php sleep(20); print Done. br /; ? I place request from 2 browser windows. First time, I placed with http://baseURL/a.php with both 2

Re: [PHP] Question about apache-php concurrent process control

2005-07-15 Thread Liang ZHONG
Hi Rasmus, You are right. It was the problem with the browser. I used Mozilla Firefox to try, and do not know what consideration it just serialized the identical url http requests. I then turned to use 2 IE 6.0 windows, 2 tabs within Maxthon browser, one IE windows and one Firefox, to test.

[PHP] Question to eregi Syntax

2005-07-07 Thread janbro
Hi List, my research hasn't turned anything useful up. Probably 'cause I don't have enough info. I've been playing around with the ereg function. What I was wondering is what is the ^ for like in the below example? ereg('[^[:space:]a-zA-Z0-9_.-]{1,}', $name) thx janbro -- PHP General

RE: [PHP] Question to eregi Syntax

2005-07-07 Thread Shaw, Chris - Accenture
Do a search on the php website or the php offline manual for Pattern Syntax -Original Message- From: janbro [mailto:[EMAIL PROTECTED] Sent: 07 July 2005 15:30 To: php-general@lists.php.net Subject: [PHP] Question to eregi Syntax * This e-mail has

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-28 Thread Jasper Bryant-Greene
Kevin L'Huillier wrote: On 27/06/05, Dr. Brad Lustick [EMAIL PROTECTED] wrote: I'm a novice trying to understand the exact construction of code for doing an HTTP 301 permanent redirect for a server coded in PHP. Could someone please tell me how I would handle the following example? In your

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-28 Thread Jochem Maas
Jasper Bryant-Greene wrote: Kevin L'Huillier wrote: On 27/06/05, Dr. Brad Lustick [EMAIL PROTECTED] wrote: I'm a novice trying to understand the exact construction of code for doing an HTTP 301 permanent redirect for a server coded in PHP. Could someone please tell me how I would handle the

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-28 Thread Jasper Bryant-Greene
Jochem Maas wrote: header('HTTP/1.1 301 Moved Permanently'); also consider that using 'Status' may be better or possibly both to cover you bases, e.g.: ?php header(HTTP/1.1 301 Moved Permanently); header(Status: 301 Moved Permanently); ? Waste of time. Go read the HTTP

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-28 Thread Marek Kilimajer
Jasper Bryant-Greene wrote: Jochem Maas wrote: header('HTTP/1.1 301 Moved Permanently'); also consider that using 'Status' may be better or possibly both to cover you bases, e.g.: ?php header(HTTP/1.1 301 Moved Permanently); header(Status: 301 Moved Permanently); ? Waste of

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-28 Thread Jochem Maas
Jasper Bryant-Greene wrote: Jochem Maas wrote: header('HTTP/1.1 301 Moved Permanently'); also consider that using 'Status' may be better or possibly both to cover you bases, e.g.: ?php header(HTTP/1.1 301 Moved Permanently); header(Status: 301 Moved Permanently); ? Waste of

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-28 Thread Andy Pieters
Hi Actually you can get away with this: header(Location: $url,301); This will let php generate the proper headers Also, and I stress this point (again and again), the http specification clearly states that location headers need to have a *fully qualified url* not a site-specific one.

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-28 Thread Andy Pieters
On Wednesday 29 June 2005 00:31, Andy Pieters wrote: Hi Actually you can get away with this: header(Location: $url,301); Well it looks like we all make typos Header(Location: $url,true,301); is more like it This will let php generate the proper headers Also, and I stress this point

[PHP] Question about HTTP 301 permanent redirects

2005-06-27 Thread Dr. Brad Lustick
Hi, I'm a novice trying to understand the exact construction of code for doing an HTTP 301 permanent redirect for a server coded in PHP. Could someone please tell me how I would handle the following example? http://www.nimblepedic.com/services-bodytools.php?i=bodytools WANT TO DO A HTTP 301

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-27 Thread Kevin L'Huillier
On 27/06/05, Dr. Brad Lustick [EMAIL PROTECTED] wrote: I'm a novice trying to understand the exact construction of code for doing an HTTP 301 permanent redirect for a server coded in PHP. Could someone please tell me how I would handle the following example?

[PHP] Question to example from manual

2005-06-16 Thread janbro
Hi, I've been working on this example and copied it in my webroot, it doesn't give me an output. Does anybody know why? System WinXP Apache 2.0.50 php 5.0.3 thx janbro Example 7-6. Static variables with recursive functions ?php function Test() { static $count = 0; $count++; echo

Re: [PHP] Question to example from manual

2005-06-16 Thread Richard Lynch
On Thu, June 16, 2005 1:31 pm, janbro said: Hi, I've been working on this example and copied it in my webroot, it doesn't give me an output. Does anybody know why? System WinXP Apache 2.0.50 php 5.0.3 thx janbro Example 7-6. Static variables with recursive functions ?php function

[PHP] question about system function call

2005-06-16 Thread Tom Cruickshank
Hello, I'm trying to do the following in php. system(/usr/bin/smbutil -v view //[EMAIL PROTECTED]) to be able to view some shares folders on a server. Unfortunately, if I use this command in console, I get prompted for a password. Is there a way in php to wait for a password and enter it

Re: [PHP] question about system function call

2005-06-16 Thread Richard Lynch
On Thu, June 16, 2005 2:43 pm, Tom Cruickshank said: I'm trying to do the following in php. system(/usr/bin/smbutil -v view //[EMAIL PROTECTED]) to be able to view some shares folders on a server. Unfortunately, if I use this command in console, I get prompted for a password. Is

Re: [PHP] Question about acessing databases and formatting output

2005-05-10 Thread The Doctor
On Mon, May 09, 2005 at 10:41:22PM +0530, bala chandar wrote: On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Mon, May 09, 2005 at 08:19:47PM +0530, bala chandar wrote: Hi, On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Mon, May 09, 2005 at 08:29:34AM +0530, bala chandar

Re: [PHP] Question about acessing databases and formatting output

2005-05-09 Thread The Doctor
On Mon, May 09, 2005 at 08:29:34AM +0530, bala chandar wrote: On 5/9/05, bala chandar [EMAIL PROTECTED] wrote: Hi On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Sun, May 08, 2005 at 01:49:08PM -0600, The Doctor wrote: On Sun, May 08, 2005 at 08:56:25PM +0530, bala chandar wrote:

Re: [PHP] Question about acessing databases and formatting output

2005-05-09 Thread bala chandar
Hi, On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Mon, May 09, 2005 at 08:29:34AM +0530, bala chandar wrote: On 5/9/05, bala chandar [EMAIL PROTECTED] wrote: Hi On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Sun, May 08, 2005 at 01:49:08PM -0600, The Doctor wrote: On

Re: [PHP] Question about acessing databases and formatting output

2005-05-09 Thread The Doctor
On Mon, May 09, 2005 at 08:19:47PM +0530, bala chandar wrote: Hi, On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Mon, May 09, 2005 at 08:29:34AM +0530, bala chandar wrote: On 5/9/05, bala chandar [EMAIL PROTECTED] wrote: Hi On 5/9/05, The Doctor [EMAIL PROTECTED] wrote:

Re: [PHP] Question about acessing databases and formatting output

2005-05-09 Thread bala chandar
On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Mon, May 09, 2005 at 08:19:47PM +0530, bala chandar wrote: Hi, On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Mon, May 09, 2005 at 08:29:34AM +0530, bala chandar wrote: On 5/9/05, bala chandar [EMAIL PROTECTED] wrote: Hi

Re: [PHP] Question about acessing databases and formatting output

2005-05-08 Thread The Doctor
On Thu, May 05, 2005 at 05:49:38AM -0600, The Doctor wrote: On Thu, May 05, 2005 at 10:11:14AM +0530, bala chandar wrote: hi, On 5/5/05, The Doctor [EMAIL PROTECTED] wrote: This is probably easy, but how does one access a database, mysql or oracle or postgresql, and present the

Re: [PHP] Question about acessing databases and formatting output

2005-05-08 Thread bala chandar
On 5/8/05, The Doctor [EMAIL PROTECTED] wrote: On Thu, May 05, 2005 at 05:49:38AM -0600, The Doctor wrote: On Thu, May 05, 2005 at 10:11:14AM +0530, bala chandar wrote: hi, On 5/5/05, The Doctor [EMAIL PROTECTED] wrote: This is probably easy, but how does one access a database,

Re: [PHP] Question about acessing databases and formatting output

2005-05-08 Thread The Doctor
On Sun, May 08, 2005 at 08:56:25PM +0530, bala chandar wrote: On 5/8/05, The Doctor [EMAIL PROTECTED] wrote: On Thu, May 05, 2005 at 05:49:38AM -0600, The Doctor wrote: On Thu, May 05, 2005 at 10:11:14AM +0530, bala chandar wrote: hi, On 5/5/05, The Doctor [EMAIL PROTECTED]

Re: [PHP] Question about acessing databases and formatting output

2005-05-08 Thread The Doctor
On Sun, May 08, 2005 at 01:49:08PM -0600, The Doctor wrote: On Sun, May 08, 2005 at 08:56:25PM +0530, bala chandar wrote: On 5/8/05, The Doctor [EMAIL PROTECTED] wrote: On Thu, May 05, 2005 at 05:49:38AM -0600, The Doctor wrote: On Thu, May 05, 2005 at 10:11:14AM +0530, bala chandar

Re: [PHP] Question about acessing databases and formatting output

2005-05-08 Thread bala chandar
Hi On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Sun, May 08, 2005 at 01:49:08PM -0600, The Doctor wrote: On Sun, May 08, 2005 at 08:56:25PM +0530, bala chandar wrote: On 5/8/05, The Doctor [EMAIL PROTECTED] wrote: On Thu, May 05, 2005 at 05:49:38AM -0600, The Doctor wrote: On

Re: [PHP] Question about acessing databases and formatting output

2005-05-08 Thread bala chandar
On 5/9/05, bala chandar [EMAIL PROTECTED] wrote: Hi On 5/9/05, The Doctor [EMAIL PROTECTED] wrote: On Sun, May 08, 2005 at 01:49:08PM -0600, The Doctor wrote: On Sun, May 08, 2005 at 08:56:25PM +0530, bala chandar wrote: On 5/8/05, The Doctor [EMAIL PROTECTED] wrote: On Thu, May

Re: [PHP] Question about acessing databases and formatting output

2005-05-05 Thread The Doctor
On Thu, May 05, 2005 at 10:11:14AM +0530, bala chandar wrote: hi, On 5/5/05, The Doctor [EMAIL PROTECTED] wrote: This is probably easy, but how does one access a database, mysql or oracle or postgresql, and present the data in a tabular format? -- Member - Liberal International

[PHP] Question about acessing databases and formatting output

2005-05-04 Thread The Doctor
This is probably easy, but how does one access a database, mysql or oracle or postgresql, and present the data in a tabular format? -- Member - Liberal International This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED] God Queen and country! Beware Anti-Christ rising! UK as 5 May 2005

Re: [PHP] Question about acessing databases and formatting output

2005-05-04 Thread bala chandar
hi, On 5/5/05, The Doctor [EMAIL PROTECTED] wrote: This is probably easy, but how does one access a database, mysql or oracle or postgresql, and present the data in a tabular format? -- Member - Liberal International This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED] God Queen and

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [PHP] [suspicious - maybe spam] URL encoding in XSL - Yes, a PHP question

2005-04-23 Thread Christian Stocker
On 4/23/05, Brian Dunning [EMAIL PROTECTED] wrote: All the resources I've found on the web for URL encoding values within an XSL stylesheet are either .NET or Java, so I'm looking for some help with how to do this using PHP's special flavor of XML/XSL. Within the XSL doc, I've got:

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] URL encoding in XSL - Yes, a PHP question

2005-04-22 Thread Richard Lynch
On Fri, April 22, 2005 3:18 pm, Brian Dunning said: All the resources I've found on the web for URL encoding values within an XSL stylesheet are either .NET or Java, so I'm looking for some help with how to do this using PHP's special flavor of XML/XSL. Within the XSL doc, I've got: Didja

Re: [PHP] Re: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] URL encoding in XSL - Yes, a PHP question

2005-04-22 Thread Richard Lynch
On Fri, April 22, 2005 3:33 pm, Brian Dunning said: ?php $ItemLink = urlencode($ItemLink); ? Are you saying to embed that within the XSL? Will it process, and will the XSL variable be valid for PHP? No. I got NO IDEA how you would do this in XML. Sorry, maybe ask on an XML list. :-^ --

[PHP] [suspicious - maybe spam] URL encoding in XSL - Yes, a PHP question

2005-04-22 Thread Brian Dunning
All the resources I've found on the web for URL encoding values within an XSL stylesheet are either .NET or Java, so I'm looking for some help with how to do this using PHP's special flavor of XML/XSL. Within the XSL doc, I've got: xsl:variable name=ItemLink select=concat($MediaPlexURL, Link)/

[PHP] Re: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] URL encoding in XSL - Yes, a PHP question

2005-04-22 Thread Brian Dunning
?php $ItemLink = urlencode($ItemLink); ? Are you saying to embed that within the XSL? Will it process, and will the XSL variable be valid for PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Question regarding PDF creation

2005-04-18 Thread Mário Gamito
Hi, I'm using FPDF (http://www.fpdf.org/) to create a... PDF. I'm trying to use a variable inside an instruction, but i'm getting errors or malformed PDFs and i can't figure how to overcome them. This instruction $pdf-Cell(60,10,'Powered by FPDF.',0,1,'C'); inserts a line in the PDF, starting

RE: [PHP] Question regarding PDF creation

2005-04-18 Thread Chris W. Parker
Mário Gamito mailto:[EMAIL PROTECTED] on Monday, April 18, 2005 3:01 AM said: I'm using FPDF (http://www.fpdf.org/) to create a... PDF. First of all thanks for asking this question because I was in need of building PDFs and lo and behold FPDF works great so far! $pdf-Cell(60,10,'Powered

Re: [PHP] Question about fsockopen

2005-04-11 Thread Hans Juergen von Lengerke
Date: Sun, 10 Apr 2005 08:00:23 - (UTC) From: [EMAIL PROTECTED] I have several IP in one interface (eth0) in my server and I want make connection to another server (check email, etc) using different ip for every mail server. I was read the document, and there is no way how to make this

Re: [PHP] Question about fsockopen

2005-04-11 Thread Richard Lynch
On Sun, April 10, 2005 1:00 am, [EMAIL PROTECTED] said: I have several IP in one interface (eth0) in my server and I want make connection to another server (check email, etc) using different ip for every mail server. I was read the document, and there is no way how to make this happen. Any

[PHP] Question about fsockopen

2005-04-10 Thread php
Dear list, I have several IP in one interface (eth0) in my server and I want make connection to another server (check email, etc) using different ip for every mail server. I was read the document, and there is no way how to make this happen. Any idea? Thank you -- PHP General Mailing List

Re: [PHP] Question about fsockopen

2005-04-10 Thread Josip Dzolonga
[EMAIL PROTECTED] wrote: Dear list, I have several IP in one interface (eth0) in my server and I want make connection to another server (check email, etc) using different ip for every mail server. I was read the document, and there is no way how to make this happen. Any idea? Thank you Take a

Re: [PHP] Question about fsockopen

2005-04-10 Thread php
Dear lists, I have tested it but it's not what I want to do. I am looking for any method to make multi connection with many ip from my box to download email from different mailserver. Thank you David T [EMAIL PROTECTED] wrote: Dear list, I have several IP in one interface (eth0) in my

Re: [PHP] Question about fsockopen

2005-04-10 Thread Greg Donald
On Apr 10, 2005 9:12 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have tested it but it's not what I want to do. I am looking for any method to make multi connection with many ip from my box to download email from different mailserver. The method I'd use to fetch mail is fetchmail.

[PHP] Question about clients

2005-04-07 Thread karl james
Team, How do most of you get your clients, are their any other tricks besides word of mouth. I really want to become a freelance web designer, or work for a provider of clients. Also/or for a major coporation that. Does anybody have any suggestions on how I can start getting paid for what I

[PHP] Locking in PHP (Question for PHP Gurus)

2005-04-06 Thread Cabbar Duzayak
Hi All, I am using PHP on Apache/Linux with mod_php4. I need to implement a lazy cache for some resource which should be updated say every 1 hour in a way that the first person who arrives after an hour will be updating the cache. As you can imagine, I need to implement a write lock in this case,

Re: [PHP] Locking in PHP (Question for PHP Gurus)

2005-04-06 Thread Rasmus Lerdorf
Cabbar Duzayak wrote: Hi All, I am using PHP on Apache/Linux with mod_php4. I need to implement a lazy cache for some resource which should be updated say every 1 hour in a way that the first person who arrives after an hour will be updating the cache. As you can imagine, I need to implement a

Re: [PHP] Locking in PHP (Question for PHP Gurus)

2005-04-06 Thread Lars B. Jensen
I would use a cronjob to make the entry rather than a user, why let the poor guy wait for you to create the content You may have 2 requests both trying to create the new cache entry, but that is much cleaner than having to deal with locking. Do a tempnam() to get a temp file to write to and

Re: [PHP] Locking in PHP (Question for PHP Gurus)

2005-04-06 Thread Rasmus Lerdorf
Lars B. Jensen wrote: I would use a cronjob to make the entry rather than a user, why let the poor guy wait for you to create the content You may have 2 requests both trying to create the new cache entry, but that is much cleaner than having to deal with locking. Do a tempnam() to get a temp

[PHP] Re: Locking in PHP (Question for PHP Gurus)

2005-04-06 Thread Manuel Lemos
Hello, on 04/06/2005 10:56 PM Cabbar Duzayak said the following: I am using PHP on Apache/Linux with mod_php4. I need to implement a lazy cache for some resource which should be updated say every 1 hour in a way that the first person who arrives after an hour will be updating the cache. As you can

RE: [PHP] Question about shortening a string

2005-03-16 Thread Kim Madsen
-Original Message- From: Steve Slater [mailto:[EMAIL PROTECTED] Sent: Saturday, March 12, 2005 5:29 PM $name_array = explode( ,$name); $short_name = $name_array[0] . end($name_array); And a dozen other ways to do it I'm sure. I just finished a project with a mess of pattern matching

Re: [PHP] Question about shortening a string

2005-03-12 Thread Steve Slater
At 11:54 PM 3/11/2005, Stephen Johnson wrote: Just a quick and dirty solution - but couldn't you explode the name into an array and use the first and last array fields ? $name_array = explode( ,$name); $short_name = $name_array[0] . end($name_array); And a dozen other ways to do it I'm sure. I

[PHP] Question about shortening a string

2005-03-11 Thread Mário Gamito
Hi, In Portgal we have big names. My complete name, for instance, is Mário Augusto Machado dos Reis Gamito. Mário is the Christian name and Gamito - the last one - is always the last name of the father. I have a form where i want to let my users insert their full big name like mine, but i want

Re: [PHP] Question about shortening a string

2005-03-11 Thread Steve Slater
Mario, Many ways to do it, most using regex. This is not as clean as it can be but still shows the idea: ?php $name = Mario Augusto Machado dos Reis Gamito; preg_match (/^(\w+)(\W*)(\w+\W+)*(\w+)$/,$name,$matches); $short_name = $matches[1] $matches[4]; ? This example works for any number of

Re: [PHP] Question about shortening a string

2005-03-11 Thread Stephen Johnson
Just a quick and dirty solution - but couldn't you explode the name into an array and use the first and last array fields ? On Mar 11, 2005, at 11:39 PM, Steve Slater wrote: Mario, Many ways to do it, most using regex. This is not as clean as it can be but still shows the idea: ?php $name =

[PHP] Question re empty query

2005-03-09 Thread Jackson Linux
Hi, This: if (isset($_GET['r']) !empty($_GET['r']) ($r = intval($_GET['r'])) ){ $r = {$_GET['r']}; //Set the variable $r to mean the category number $fields = '*'; $sort = ORDER BY cv.sort; } else { $where = ''; $fields =

Re: [PHP] Question re empty query

2005-03-09 Thread Jochem Maas
Jackson Linux wrote: Hi, This: if (isset($_GET['r']) !empty($_GET['r']) ($r = intval($_GET['r'])) ){ $r = {$_GET['r']}; //Set the variable $r to mean the category number for starters WTF is the preceding statement for??? $r is already set if it exists by the expression in the if

[PHP] Question regarding simplexml predefined constants

2005-03-09 Thread Allan, David (ThomasTech)
In reading the documentation on simplexml predefined constants, I see a note that says these were added to PHP 5.1.0. Am I reading that [future] version correctly, and I can expect that these are to be released in a forthcoming stable release, and in fact do not yet exist in the version I am

Re: [PHP] Question: re: Session-only cookies and Firefox

2005-02-14 Thread Richard Lynch
RGL wrote: Question: Has anybody else noticed session-only cookies not disappearing when using Firefox? Is this a Firefox bug (should they be notified/ or I get latest Firefox) ? Using IE6 I can: setcookie('sesvar', 'this session only', 0, , www.mypersonaldomain.net); This can be read and

[PHP] Question: re: Session-only cookies and Firefox

2005-02-12 Thread RGL
Question: Has anybody else noticed session-only cookies not disappearing when using Firefox? Is this a Firefox bug (should they be notified/ or I get latest Firefox) ? Using IE6 I can: setcookie('sesvar', 'this session only', 0, , www.mypersonaldomain.net); This can be read and disappears after

[PHP] Question about php.ini

2005-02-07 Thread Stephen Wong
Hi, I hope we are all doing well today I'm very new to php. Here are some basic info about my server that I am running: Mac OS X 10.3.7 PHP 4.3.10 MySQL 4.0.18 Apache 1.3.33 What I want to do is host a forum on my web page. I can't seem to get it set up, and I notice that I do not have a

RE: [PHP] Question about php.ini

2005-02-07 Thread Jay Blanchard
[snip] 1.) rename the php.ini.default to plain php.ini and see if that resolves it. However, I'm not sure what kind of tests can I perform to see that it is working properly? [/snip] How about just making a copy of the file and testing it? Have you run phpinfo() yet? -- PHP General Mailing List

RE: [PHP] Question about php.ini

2005-02-07 Thread Jay Blanchard
[snip] Yup, I have tried making a copy of it. I'm just not exactly sure how to test it? I ran phpinfo() , and it runs even without a php.ini. [/snip] Change something in the configuation file that you know you can run a test on, like safe mode status, then restart Apache and conduct the test.

Re: [PHP] Question about php.ini

2005-02-07 Thread Richard Lynch
Stephen Wong wrote: I'm very new to php. Here are some basic info about my server that I am running: Mac OS X 10.3.7 PHP 4.3.10 MySQL 4.0.18 Apache 1.3.33 What I want to do is host a forum on my web page. I can't seem to get it set up, and I notice that I do not have a php.ini file in

RE: [PHP] Question about php.ini

2005-02-07 Thread Brandon Thompson
PROTECTED] Sent: Monday, February 07, 2005 12:53 PM To: Stephen Wong Cc: php-general@lists.php.net Subject: RE: [PHP] Question about php.ini [snip] Yup, I have tried making a copy of it. I'm just not exactly sure how to test it? I ran phpinfo() , and it runs even without a php.ini. [/snip

[PHP] Question about Safe Mode

2005-01-31 Thread Rick Root
I have a little home made CMS that writes files... on the server I've recently installed this CMS on, those files get written as apache:apache ... that file uses include to include other files that are not owned by apache, and this doesn't work. Warning: main(): SAFE MODE Restriction in effect.

RE: [PHP] Question about Safe Mode

2005-01-31 Thread Jay Blanchard
[snip] So... how do I work around this? Can I get php to write the files so they aren't owned by apache but rather thwn owner of the php script that creates them? [/snip] PHP scripts run by the HTTP server are run as the web server. The web server runs as 'Apache', so Apache needs permissions

Re: [PHP] Question about Safe Mode

2005-01-31 Thread Marek Kilimajer
Rick Root wrote: I have a little home made CMS that writes files... on the server I've recently installed this CMS on, those files get written as apache:apache ... that file uses include to include other files that are not owned by apache, and this doesn't work. Warning: main(): SAFE MODE

[PHP] question on getting URL

2005-01-30 Thread David Banning
I have a script called index.php on my main page and it actually is used to launch several webpages like so; http://mysite.com/index.php?id=16 When http://mysite.com runs it still uses index.php. but it doesn't show it in the address bar. All it shows is; http://mysite.com What I would like to

Re: [PHP] question on getting URL

2005-01-30 Thread Matthew Fonda
$file = basename(_FILE_); On Sun, 2005-01-30 at 01:26, David Banning wrote: I have a script called index.php on my main page and it actually is used to launch several webpages like so; http://mysite.com/index.php?id=16 When http://mysite.com runs it still uses index.php. but it doesn't

[PHP] question about a cron job

2005-01-17 Thread Al
I've got a question about the following cronjob. #At 3:01 our time, run backups 1 0 * * * /usr/local/bin/php /www/r/rester/htdocs/auto_backup/back_em_up.php /www/r/rester/htdocs/auto_backup/cron.log 21 #At 3:02 clean up sessions folder 2 0 * * * (find /www/r/rester/htdocs/sessions/ -name 'sess_*'

RE: [PHP] question about a cron job

2005-01-17 Thread Jay Blanchard
[snip] I've got a question about the following cronjob. #At 3:01 our time, run backups 1 0 * * * /usr/local/bin/php /www/r/rester/htdocs/auto_backup/back_em_up.php /www/r/rester/htdocs/auto_backup/cron.log 21 #At 3:02 clean up sessions folder 2 0 * * * (find /www/r/rester/htdocs/sessions/

Re: [PHP] question about a cron job

2005-01-17 Thread Al
Jay Blanchard wrote: [snip] I've got a question about the following cronjob. #At 3:01 our time, run backups 1 0 * * * /usr/local/bin/php /www/r/rester/htdocs/auto_backup/back_em_up.php /www/r/rester/htdocs/auto_backup/cron.log 21 #At 3:02 clean up sessions folder 2 0 * * * (find

Re: [PHP] question about a cron job

2005-01-17 Thread Erwin Kerk
Al wrote: I've got a question about the following cronjob. #At 3:01 our time, run backups 1 0 * * * /usr/local/bin/php /www/r/rester/htdocs/auto_backup/back_em_up.php /www/r/rester/htdocs/auto_backup/cron.log 21 #At 3:02 clean up sessions folder 2 0 * * * (find /www/r/rester/htdocs/sessions/

RE: [PHP] question about a cron job

2005-01-17 Thread Michael Sims
#this is only for testing a new cronjob, every minute * * * * * /usr/local/bin/php /www/r/rester/htdocs/phpList_cronjob/process_cronjob.php /www/r/rester/htdocs/phpList_cronjob/cron.log 21 The new one doesn't seem to want to run until after 3:01 or 3:02. Shouldn't the sever just run it

Re: [PHP] question about a cron job

2005-01-17 Thread Al
Erwin Kerk wrote: Al wrote: I've got a question about the following cronjob. #At 3:01 our time, run backups 1 0 * * * /usr/local/bin/php /www/r/rester/htdocs/auto_backup/back_em_up.php /www/r/rester/htdocs/auto_backup/cron.log 21 #At 3:02 clean up sessions folder 2 0 * * * (find

Re: [PHP] question about a cron job

2005-01-17 Thread Bret Hughes
On Mon, 2005-01-17 at 09:01, Erwin Kerk wrote: Al wrote: I've got a question about the following cronjob. #At 3:01 our time, run backups 1 0 * * * /usr/local/bin/php /www/r/rester/htdocs/auto_backup/back_em_up.php /www/r/rester/htdocs/auto_backup/cron.log 21 #At 3:02 clean up

RE: [PHP] question about a cron job

2005-01-17 Thread Michael Sims
Erwin Kerk wrote: The CRON daemon only refreshes it's job list after a job in the current list is completed. Therefore, the CRON daemon won't notice the every-minute job until 3.01 pm. I'm not sure I understand what you're saying above. Can you provide a pointer to documentation about this?

Re: [PHP] question about a cron job

2005-01-17 Thread Jason Wong
On Monday 17 January 2005 23:19, Al wrote: Erwin Kerk wrote: Al wrote: The CRON daemon only refreshes it's job list after a job in the current list is completed. Therefore, the CRON daemon won't notice the every-minute job until 3.01 pm. Not sure if I've misunderstood what Al is saying

Re: [PHP] question about a cron job

2005-01-17 Thread Jochem Maas
Michael Sims wrote: Erwin Kerk wrote: The CRON daemon only refreshes it's job list after a job in the current list is completed. Therefore, the CRON daemon won't notice the every-minute job until 3.01 pm. I'm not sure I understand what you're saying above. Can you provide a pointer to

RE: [PHP] question about a cron job

2005-01-17 Thread Michael Sims
Jochem Maas wrote: Michael Sims wrote: Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be

Re: [PHP] question about a cron job

2005-01-17 Thread Al
Michael Sims wrote: Erwin Kerk wrote: The CRON daemon only refreshes it's job list after a job in the current list is completed. Therefore, the CRON daemon won't notice the every-minute job until 3.01 pm. I'm not sure I understand what you're saying above. Can you provide a pointer to

Re: [PHP] question about a cron job

2005-01-17 Thread Jochem Maas
Michael Sims wrote: Jochem Maas wrote: Michael Sims wrote: Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus

[PHP] Question: arrays and form elements

2004-12-30 Thread Stuart Felenstein
Generally, when I set up a form where, for example, I'll be taking multiple selections from a list I would set the variable / element name as myvar[]. So I have the brackets [] after the variable name to make it an array. What I want to know is there a way to get around the use of this syntax

RE: [PHP] Question: arrays and form elements

2004-12-30 Thread Jay Blanchard
[snip] Generally, when I set up a form where, for example, I'll be taking multiple selections from a list I would set the variable / element name as myvar[]. So I have the brackets [] after the variable name to make it an array. What I want to know is there a way to get around the use of this

Re: [PHP] Question: arrays and form elements

2004-12-30 Thread Brent Baisley
Nope. Is there a problem you are having with using that syntax? If you are having trouble with referencing the fields with javascript, you can't use the regular syntax you are used to.: document.formname.fieldname[] That will give you an error because of the brackets. In javascript you'll need

<    4   5   6   7   8   9   10   11   12   13   >