php-general Digest 17 Mar 2002 05:16:56 -0000 Issue 1231

Topics (messages 88750 through 88803):

Re: server load
        88750 by: Andrey Hristov
        88753 by: caspar kennerdale
        88754 by: Andrey Hristov
        88755 by: caspar kennerdale
        88757 by: Andrey Hristov
        88760 by: Andrey Hristov

Re: where is http_cookie ?
        88751 by: Ray Hunter
        88769 by: Bas Jobsen

Re: PHP Document not found
        88752 by: Ray Hunter

Download do Manual
        88756 by: Márcio Santos

Re: Problem with sessions.
        88758 by: Tom Rogers
        88762 by: Edward van Bilderbeek - Bean IT

Re: Variable Variables and Mulitdimensional Arrays
        88759 by: Joe Webster

Re: Formatting input text?
        88761 by: Edward van Bilderbeek - Bean IT
        88763 by: Andre Dubuc
        88765 by: heinisch.creaction.de
        88767 by: Edward van Bilderbeek - Bean IT
        88772 by: Jason Wong

Update: [PHP] Weird?
        88764 by: jtjohnston
        88778 by: scott furt

PHPMyAdmin: [PHP] From: Newman, using " and ' or ` in My Sql
        88766 by: jtjohnston

Weird INCLUDE / mySQL problem
        88768 by: Dan Tappin

Re: Help Out A Newbie In Configuring PHP.INI
        88770 by: Dr. Shim

Re: Newman, PHP on non PHP servers?
        88771 by: Philip J. Newman
        88775 by: heinisch.creaction.de
        88777 by: Michael Geier
        88782 by: Philip J. Newman

Re: Targetted redirection?
        88773 by: anders nawroth

Success Using PEAR?
        88774 by: Bryan Henry
        88780 by: James Arthur

php.ini and fixing timeouts
        88776 by: DigitalKoala
        88786 by: heinisch.creaction.de

Re: Driving me nuts, need one second of your time
        88779 by: scott furt

Re: regular expression for (NOT 'word')
        88781 by: scott furt

problems with 4.1.2 build
        88783 by: Phil Glatz
        88784 by: Stephano Mariani

mktime on W2K?
        88785 by: Jeff Oien

retrieving remote web page
        88787 by: Andy Aldridge
        88791 by: Dave

Getting TOTAL DB Size of a MySQL Database
        88788 by: eric.coleman.zaireweb.com

OBJECT£ºWHAT'S THE RALATION BETWEEN A,B AND C?
        88789 by: bob

Sessions and enable-trans-sid
        88790 by: lists.mhess.qn.net

Again, and Again, and AGAIN!
        88792 by: Dr. Shim
        88793 by: Mike Gohlke
        88795 by: Dr. Shim
        88796 by: Jason Wong
        88797 by: Dr. Shim
        88798 by: Dr. Shim
        88799 by: Jason Wong
        88800 by: Dr. Shim
        88801 by: pong-TC
        88803 by: Jason Wong

No Sense: [PHP] Update: [PHP] Weird?
        88794 by: jtjohnston
        88802 by: David Robley

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Flex - the tools that parses the code skips everything between /* and */ and for this 
no token is given back. Of course if you don't
have 5kb comments Flex will be a little faster but possibly few %.

Regards,
Andrey

----- Original Message -----
From: "caspar kennerdale" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 7:13 PM
Subject: [PHP] server load


> Would a 10kb file which has 5kb of comments take longer to process in php
> than the same file wihout the comments which is 5kb?
>
> Or are the comments ignored as far as server load and speed to delivery are
> concerned?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
So you could have as much commented text without any detriment to the pages
performance?

great



-----Original Message-----
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: 16 March 2002 17:17
To: caspar kennerdale
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] server load


Flex - the tools that parses the code skips everything between /* and */ and
for this no token is given back. Of course if you don't
have 5kb comments Flex will be a little faster but possibly few %.

Regards,
Andrey

----- Original Message -----
From: "caspar kennerdale" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 7:13 PM
Subject: [PHP] server load


> Would a 10kb file which has 5kb of comments take longer to process in php
> than the same file wihout the comments which is 5kb?
>
> Or are the comments ignored as far as server load and speed to delivery
are
> concerned?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
However write short but meaningful comments. Keep in mind that the scripts has to be 
loaded in the memory from the disk. Although
after first request it is in some cache.


Andrey


----- Original Message -----
From: "caspar kennerdale" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 7:24 PM
Subject: RE: [PHP] server load


> So you could have as much commented text without any detriment to the pages
> performance?
>
> great
>
>
>
> -----Original Message-----
> From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> Sent: 16 March 2002 17:17
> To: caspar kennerdale
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] server load
>
>
> Flex - the tools that parses the code skips everything between /* and */ and
> for this no token is given back. Of course if you don't
> have 5kb comments Flex will be a little faster but possibly few %.
>
> Regards,
> Andrey
>
> ----- Original Message -----
> From: "caspar kennerdale" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Saturday, March 16, 2002 7:13 PM
> Subject: [PHP] server load
>
>
> > Would a 10kb file which has 5kb of comments take longer to process in php
> > than the same file wihout the comments which is 5kb?
> >
> > Or are the comments ignored as far as server load and speed to delivery
> are
> > concerned?
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I am thinking of using a documentation parser such as javadoc (called
phpdoc) which will create a separate html document on the functions and
feastures of the classes I am writing,as well as examples and tutorial info.

I am just considering whether or no I have two versions - a no comments
version which goes live and a commented version which I compile the html
fromand also distribute.

Does anyone here have experience with phpdoc?

-----Original Message-----
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: 16 March 2002 17:29
To: caspar kennerdale
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] server load


However write short but meaningful comments. Keep in mind that the scripts
has to be loaded in the memory from the disk. Although
after first request it is in some cache.


Andrey


----- Original Message -----
From: "caspar kennerdale" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 7:24 PM
Subject: RE: [PHP] server load


> So you could have as much commented text without any detriment to the
pages
> performance?
>
> great
>
>
>
> -----Original Message-----
> From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> Sent: 16 March 2002 17:17
> To: caspar kennerdale
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] server load
>
>
> Flex - the tools that parses the code skips everything between /* and */
and
> for this no token is given back. Of course if you don't
> have 5kb comments Flex will be a little faster but possibly few %.
>
> Regards,
> Andrey
>
> ----- Original Message -----
> From: "caspar kennerdale" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Saturday, March 16, 2002 7:13 PM
> Subject: [PHP] server load
>
>
> > Would a 10kb file which has 5kb of comments take longer to process in
php
> > than the same file wihout the comments which is 5kb?
> >
> > Or are the comments ignored as far as server load and speed to delivery
> are
> > concerned?
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I have :)))

Andrey

----- Original Message ----- 
From: "caspar kennerdale" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 7:40 PM
Subject: RE: [PHP] server load


> I am thinking of using a documentation parser such as javadoc (called
> phpdoc) which will create a separate html document on the functions and
> feastures of the classes I am writing,as well as examples and tutorial info.
> 
> I am just considering whether or no I have two versions - a no comments
> version which goes live and a commented version which I compile the html
> fromand also distribute.
> 
> Does anyone here have experience with phpdoc?
> 
> -----Original Message-----
> From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> Sent: 16 March 2002 17:29
> To: caspar kennerdale
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] server load
> 
> 
> However write short but meaningful comments. Keep in mind that the scripts
> has to be loaded in the memory from the disk. Although
> after first request it is in some cache.
> 
> 
> Andrey
> 
> 
> ----- Original Message -----
> From: "caspar kennerdale" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, March 16, 2002 7:24 PM
> Subject: RE: [PHP] server load
> 
> 
> > So you could have as much commented text without any detriment to the
> pages
> > performance?
> >
> > great
> >
> >
> >
> > -----Original Message-----
> > From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> > Sent: 16 March 2002 17:17
> > To: caspar kennerdale
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] server load
> >
> >
> > Flex - the tools that parses the code skips everything between /* and */
> and
> > for this no token is given back. Of course if you don't
> > have 5kb comments Flex will be a little faster but possibly few %.
> >
> > Regards,
> > Andrey
> >
> > ----- Original Message -----
> > From: "caspar kennerdale" <[EMAIL PROTECTED]>
> > To: "PHP General" <[EMAIL PROTECTED]>
> > Sent: Saturday, March 16, 2002 7:13 PM
> > Subject: [PHP] server load
> >
> >
> > > Would a 10kb file which has 5kb of comments take longer to process in
> php
> > > than the same file wihout the comments which is 5kb?
> > >
> > > Or are the comments ignored as far as server load and speed to delivery
> > are
> > > concerned?
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
I've just tested on the productional test server a sample php consisting from 62kb 
comment. Benchmarked with ab
1-st bench - ten connections
Server Port:            80

Document Path:          /test.php
Document Length:        0 bytes

Concurrency Level:      10
Time taken for tests:   0.552 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      17992 bytes
HTML transferred:       0 bytes
Requests per second:    181.16
Transfer rate:          32.59 kb/s received

2-nd bench:
Server Port:            80

Document Path:          /test.php
Document Length:        0 bytes

Concurrency Level:      10
Time taken for tests:   100.601 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      1730173 bytes
HTML transferred:       0 bytes
Requests per second:    99.40
Transfer rate:          17.20 kb/s received

3rd bench:  - one connection
Server Port:            80

Document Path:         /test.php
Document Length:        0 bytes

Concurrency Level:      1
Time taken for tests:   280.047 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      1730000 bytes
HTML transferred:       0 bytes
Requests per second:    35.71
Transfer rate:          6.18 kb/s received

Connnection Times (ms)
              min   avg   max
Connect:        0     3  3000
Processing:     9    24   209
Total:          9    27  3209

Keep in mind that I've started ab from another machine on the same 100Mbit network.

Regards,
Andrey

----- Original Message ----- 
From: "caspar kennerdale" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 7:40 PM
Subject: RE: [PHP] server load


> I am thinking of using a documentation parser such as javadoc (called
> phpdoc) which will create a separate html document on the functions and
> feastures of the classes I am writing,as well as examples and tutorial info.
> 
> I am just considering whether or no I have two versions - a no comments
> version which goes live and a commented version which I compile the html
> fromand also distribute.
> 
> Does anyone here have experience with phpdoc?
> 
> -----Original Message-----
> From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> Sent: 16 March 2002 17:29
> To: caspar kennerdale
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] server load
> 
> 
> However write short but meaningful comments. Keep in mind that the scripts
> has to be loaded in the memory from the disk. Although
> after first request it is in some cache.
> 
> 
> Andrey
> 
> 
> ----- Original Message -----
> From: "caspar kennerdale" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, March 16, 2002 7:24 PM
> Subject: RE: [PHP] server load
> 
> 
> > So you could have as much commented text without any detriment to the
> pages
> > performance?
> >
> > great
> >
> >
> >
> > -----Original Message-----
> > From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> > Sent: 16 March 2002 17:17
> > To: caspar kennerdale
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] server load
> >
> >
> > Flex - the tools that parses the code skips everything between /* and */
> and
> > for this no token is given back. Of course if you don't
> > have 5kb comments Flex will be a little faster but possibly few %.
> >
> > Regards,
> > Andrey
> >
> > ----- Original Message -----
> > From: "caspar kennerdale" <[EMAIL PROTECTED]>
> > To: "PHP General" <[EMAIL PROTECTED]>
> > Sent: Saturday, March 16, 2002 7:13 PM
> > Subject: [PHP] server load
> >
> >
> > > Would a 10kb file which has 5kb of comments take longer to process in
> php
> > > than the same file wihout the comments which is 5kb?
> > >
> > > Or are the comments ignored as far as server load and speed to delivery
> > are
> > > concerned?
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
Try using the predefined variable $_COOKIE instead and see if that works for
you...


"Bas Jobsen" <[EMAIL PROTECTED]> wrote in message
02031617361309.10531@bjobsen">news:02031617361309.10531@bjobsen...
> Hello,
>
> I have installed php 4.1.2. as a cgi module.
> But http_cookie isn't set. I don' know whats wrong.
> You can find the output of phpinfo() at
> http://www.tgp2stats.com/test.php
>
> Tnx,
>
> Bas Jobsen


--- End Message ---
--- Begin Message ---
Hi,

Well okay. But now i'm using this code:

test.php (http://www.tgp2stats.com/test.php):
--
<?
$test="bas";
session_start();
session_register("test");
header("Location: test2.php");
?>
--
test2.php (http://www.tgp2stats.com/test2.php):
--
<?
session_start();
session_register("test");
echo "test: ".$test;
phpinfo();
?>
--

For netscape(linux) $test print "bas", but is empty when using Konquerer, 
Opera or even IE (on a win98 system).

This code will work for all this browsers with php4.1.2 as module.
Has this something to do with CGI vs module? Or is there a configuration 
mistake?

Bas







Op zaterdag 16 maart 2002 18:02, schreef Jackson Miller:
> HTTP COOKIE will only be set
> if you have a cookie from that
> domain on your computer.  Try
> setting a cookie with
> setcookie() before your
> phpinfo() line on your
> test.php page.
>
> Hope this helps.
>
>
> -Jackson
>
> -----Original Message-----
> From: Bas Jobsen
> [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 16, 2002
> 11:36 AM
> To: PHP General
> Subject: [PHP] where is
> http_cookie ?
>
>
> Hello,
>
> I have installed php 4.1.2. as
> a cgi module.
> But http_cookie isn't set. I
> don' know whats wrong.
> You can find the output of
> phpinfo() at
> http://www.tgp2stats.com/test.
> php
>
> Tnx,
>
> Bas Jobsen
>
> --
> PHP General Mailing List
> (http://www.php.net/)
> To unsubscribe, visit:
> http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You should try moving to the current version of php and then try it...

Ray Hunter


"Jan Weidhaase" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
>
> If I try to open a non-existing PHP document by my Apache server I got an
> internal server error massage. All other documents that were not found
bring
> me to a error 404 document.
> 4 days ago I updated from PHP3 to PHP4.0.3pl1 and with the former version
i
> got a error massage like: "no php file input spicified on line 0" or
> something like that.
>
> Does anybody no about this problem? Thank you
> Jan
>
>


--- End Message ---
--- Begin Message ---
Olá pessoal!
Gostaria que alguém me enviasse o manual de php em portugues 
descompactado, pois tenho tido problemas em descompacta-lo, mesmo em 
pdf.
Com os melhores cumprimentos:

+------------------------------------+
| Marcio Santos                      |
| Estudante de Ensino de Informatica |
| Universidade da Madeira            |
| GSM: +351 96 653 10 72             |
+------------------------------------+


__________
http://www.IOL.pt
Todo o mundo passa por aqui!


--- End Message ---
--- Begin Message ---
Hi
When you create the new session give it a different name.
Tom

At 01:49 AM 17/03/2002, Carlos Costa Portela wrote:
>         Hello all:
>
>         I am playing with sessions and I have a problem with the
>session_destroy() function. If I do a session_register() after calling it,
>the session recover the previous values (values that I supposed forgot by
>the session).
>
>         At
>http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
>http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
>have the web page and the code, respectively.
>
>         The problem is that the "counter" variable maintains the value
>even after click "logout".
>
>         If you go to the web page, press:
>
>login -> counter=0
>other link -> counter=1
>other link -> counter=2
>other link -> counter=3
>logout
>other link -> counter=4
>
>         I suppose that the problem is that I call
>session_register("counter"). How must I solve this problem?
>
>         Best regards and thanks in advance,
>                 Carlos.
>
>         [ all about php+web : http://www.improveyourweb.com ]
>
>  _______Carlos Costa Portela_________________________________________________
>| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
>|_____Tódalas persoas maiores foron nenos antes, pero poucas se lembran______|
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
maybe you better use:

session_unregister("counter");

Greets,
Edward


----- Original Message -----
From: "Carlos Costa Portela" <[EMAIL PROTECTED]>
To: "php-general mailing list" <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 4:49 PM
Subject: [PHP] Problem with sessions.


> Hello all:
>
> I am playing with sessions and I have a problem with the
> session_destroy() function. If I do a session_register() after calling it,
> the session recover the previous values (values that I supposed forgot by
> the session).
>
> At
> http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
> http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
> have the web page and the code, respectively.
>
> The problem is that the "counter" variable maintains the value
> even after click "logout".
>
> If you go to the web page, press:
>
> login -> counter=0
> other link -> counter=1
> other link -> counter=2
> other link -> counter=3
> logout
> other link -> counter=4
>
> I suppose that the problem is that I call
> session_register("counter"). How must I solve this problem?
>
> Best regards and thanks in advance,
> Carlos.
>
> [ all about php+web : http://www.improveyourweb.com ]
>
>  _______Carlos Costa
Portela_________________________________________________
> | e-mail:  [EMAIL PROTECTED] | home page:
http://casa.ccp.servidores.net |
> |_____Tódalas persoas maiores foron nenos antes, pero poucas se
lembran______|
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
You seem to have three different ideas/questions... let me attempt to answer
them:

> Hi. I want to be able to access a key in a multidimensional array at some
> depth "n" without knowing before runtime what the keys are.

let's take a multidimensional array $x
$x = array(
    "somevar",
    array(
        "otherval",
        "evenmore"
    )
);

echo $x[0]; should print 'somevar'
echo $x[1]; should print 'Array'
echo $x[1][0]; should print 'otherval'
echo $x[1][1]; should print 'evenmore'

>
> I thought this might be possible using variable variables. Here's some
> sample code using variable variables and multidimensional arrays:
> $y = 'a';
> $z = 'b';
> $t = 'c';
> $x = array("a"=>array("b"=>array("c"=>TRUE)));
>

> // I want to be able to concatenate the array indexes into one variable
> variable. This would be done in a loop at runtime.
if you want to concat all the key's of an array with a loop you could do:

reset($x); //just to make sure we are at the first key
while(list($key,$val) = each($x)){
    $my_keys .= $key
}
echo $my_keys;

should result in: (using $x from my code above)

1 (I think it might even come out as 01 -- but probally 1 since it will be
treated as a int maybe =) )

>
> Any help would greatly be appreciated,
>
> Charlie
>
>

Hope that helps, still not sure what your question was or if i answered it
;)

-Joe


--- End Message ---
--- Begin Message ---
Just use javascript... (be careful, what works with IE, doesn't
automatically work with Netscape)...

Greets,

Edward

----- Original Message -----
From: "Andre Dubuc" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 4:44 PM
Subject: [PHP] Formatting input text?


> I wonder whether this is possible?
>
> I would like to format a text input so that the first letter of the input
(as
> the user is typing it in) would automatically be converted to Uppercase
> (capitals). Furthermore, if it is possible, I would like to pre-format the
> date "input type=text" so that only numbers or dashes could be entered. I
> really enjoyted this capablity in Paradox PAL language.
>
> Does anything exist that would allow me to do this in PHP?
>
> An example:
>
> Code
> <td><b>Surname</b></td>
> <td><input type=text name=rap></td>
>
> Screen (and into database)
> Surname: black   >> would be converted as they type to >> Surname: Black
>
> Any suggestions or advice would be greatly appreciated.
> Tia,
> Andre
>
>
> --
> Please pray the Holy Rosary to end the holocaust of abortion.
> Remember in your prayers the suffering souls in Purgatory.
>
> May God bless you abundantly in His love!
>
> For a free Cenacle Scriptural Rosary Booklet --
http://www.webhart.net/csrb/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
Hi Edward,

If I wanted to avoid Javascript, could I still accomplish this in PHP?

Regards, Andre


On Saturday 16 March 2002 13:33, you wrote:
> Just use javascript... (be careful, what works with IE, doesn't
> automatically work with Netscape)...
>
> Greets,
>
> Edward
>
> ----- Original Message -----
> From: "Andre Dubuc" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, March 16, 2002 4:44 PM
> Subject: [PHP] Formatting input text?
>
> > I wonder whether this is possible?
> >
> > I would like to format a text input so that the first letter of the input
>
> (as
>
> > the user is typing it in) would automatically be converted to Uppercase
> > (capitals). Furthermore, if it is possible, I would like to pre-format
> > the date "input type=text" so that only numbers or dashes could be
> > entered. I really enjoyted this capablity in Paradox PAL language.
> >
> > Does anything exist that would allow me to do this in PHP?
> >
> > An example:
> >
> > Code
> > <td><b>Surname</b></td>
> > <td><input type=text name=rap></td>
> >
> > Screen (and into database)
> > Surname: black   >> would be converted as they type to >> Surname: Black
> >
> > Any suggestions or advice would be greatly appreciated.
> > Tia,
> > Andre
> >
> >
> > --
> > Please pray the Holy Rosary to end the holocaust of abortion.
> > Remember in your prayers the suffering souls in Purgatory.
> >
> > May God bless you abundantly in His love!
> >
> > For a free Cenacle Scriptural Rosary Booklet --
>
> http://www.webhart.net/csrb/
>
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.

May God bless you abundantly in His love!

For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/
--- End Message ---
--- Begin Message ---
At 16.03.2002  10:44, you wrote:
>
>I wonder whether this is possible?
>
>I would like to format a text input so that the first letter of the input (as
>the user is typing it in) would automatically be converted to Uppercase
>(capitals). Furthermore, if it is possible, I would like to pre-format the
>date "input type=text" so that only numbers or dashes could be entered. I
>really enjoyted this capablity in Paradox PAL language.
>
>Does anything exist that would allow me to do this in PHP?
>
>An example:
>
>Code
><td><b>Surname</b></td>
><td><input type=text name=rap></td>
>
>Screen (and into database)
>Surname: black   >> would be converted as they type to >> Surname: Black
>
>Any suggestions or advice would be greatly appreciated.
Suggestion:
a.)try this in JavaScript on the client side, you have to check if the 
valid chars/numbers are entered
otherwise the page will be not send.
b.) check the form, whem the page arrives on the server, and if the vals 
are not correct, send
the page back to be corrected by the user.
HTH Oliver

--- End Message ---
--- Begin Message ---
As Oliver says, it is possible in PHP, but then you have to do it, AFTER the
form is submitted... Just do some regular expressions on your data before
displaying / storing it...

Edward


----- Original Message -----
From: "Andre Dubuc" <[EMAIL PROTECTED]>
To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 7:49 PM
Subject: Re: [PHP] Formatting input text?


> Hi Edward,
>
> If I wanted to avoid Javascript, could I still accomplish this in PHP?
>
> Regards, Andre
>
>
> On Saturday 16 March 2002 13:33, you wrote:
> > Just use javascript... (be careful, what works with IE, doesn't
> > automatically work with Netscape)...
> >
> > Greets,
> >
> > Edward
> >
> > ----- Original Message -----
> > From: "Andre Dubuc" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Saturday, March 16, 2002 4:44 PM
> > Subject: [PHP] Formatting input text?
> >
> > > I wonder whether this is possible?
> > >
> > > I would like to format a text input so that the first letter of the
input
> >
> > (as
> >
> > > the user is typing it in) would automatically be converted to
Uppercase
> > > (capitals). Furthermore, if it is possible, I would like to pre-format
> > > the date "input type=text" so that only numbers or dashes could be
> > > entered. I really enjoyted this capablity in Paradox PAL language.
> > >
> > > Does anything exist that would allow me to do this in PHP?
> > >
> > > An example:
> > >
> > > Code
> > > <td><b>Surname</b></td>
> > > <td><input type=text name=rap></td>
> > >
> > > Screen (and into database)
> > > Surname: black   >> would be converted as they type to >> Surname:
Black
> > >
> > > Any suggestions or advice would be greatly appreciated.
> > > Tia,
> > > Andre
> > >
> > >
> > > --
> > > Please pray the Holy Rosary to end the holocaust of abortion.
> > > Remember in your prayers the suffering souls in Purgatory.
> > >
> > > May God bless you abundantly in His love!
> > >
> > > For a free Cenacle Scriptural Rosary Booklet --
> >
> > http://www.webhart.net/csrb/
> >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> Please pray the Holy Rosary to end the holocaust of abortion.
> Remember in your prayers the suffering souls in Purgatory.
>
> May God bless you abundantly in His love!
>
> For a free Cenacle Scriptural Rosary Booklet --
http://www.webhart.net/csrb/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
On Saturday 16 March 2002 23:44, Andre Dubuc wrote:
> I wonder whether this is possible?
>
> I would like to format a text input so that the first letter of the input
> (as the user is typing it in) would automatically be converted to Uppercase
> (capitals). Furthermore, if it is possible, I would like to pre-format the
> date "input type=text" so that only numbers or dashes could be entered. I
> really enjoyted this capablity in Paradox PAL language.
>
> Does anything exist that would allow me to do this in PHP?
>
> An example:
>
> Code
> <td><b>Surname</b></td>
> <td><input type=text name=rap></td>
>
> Screen (and into database)
> Surname: black   >> would be converted as they type to >> Surname: Black
>
> Any suggestions or advice would be greatly appreciated.

Wrong place! PHP is a server-side language. What you need requires 
client-side -- Javascript or Java.



-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
People who go to conferences are the ones who shouldn't.
*/
--- End Message ---
--- Begin Message ---
I have created date :)
$date = date ("MD");
That's not it. It seems to fail at one level or another, I think, becuase the
function calls itself - and probably gets lost somehow.
John

> ... i think you might have to create the
> $date directory before writing a file to it.
> writing to /tmp/dir/file.txt will fail if
> the directory "dir" doesn't exist.

<?php

#######################################
$date = date ("MD");
#######################################
###  Don't forget trailing slash  #####
#######################################
$from_path = "c:\\program files\\easyphp\\ccl_www\\";
$to_path = "c:\\ccl_www\\".$date."ccl_www\\";
#######################################

if(!is_dir($from_path))
{
echo "failed";
exit;
}else{
rec_copy($from_path, $to_path);
echo "files copies from $from_path and backed up to $to_path";
}

#########################################################################
function rec_copy ($from_path, $to_path) {
if(!is_dir($to_path))
mkdir($to_path, 0777);

$this_path = getcwd();
 if (is_dir($from_path))
 {
    chdir($from_path);
    $handle=opendir('.');

    while (($file = readdir($handle))!==false)
    {
 if (($file != ".") && ($file != "..")) {
  if (is_dir($file))
  {
  rec_copy ($from_path.$file."/",  $to_path.$file."/");
       chdir($from_path);
  }else{
#  echo "error if (is_dir($file))<br>";
  }
  if (is_file($file))
  {
  copy($from_path.$file, $to_path.$file);
  }else{
#  echo "error copy($from_path.$file, $to_path.$file)<br>";
  }
 }#end (($file != ".")
    }#end while (($file

    closedir($handle);
 }# end if (is_dir
 else{
# echo "if (is_dir($from_path))<br>";
 }
}# end function

?>

--- End Message ---
--- Begin Message ---
I meant, have you created a physical directory
named $date?

That's your problem.  There's no directory
named $date on your computer, and you're
trying to write files into a non-existent
directory.

jtjohnston wrote:
> I have created date :)
> $date = date ("MD");
> That's not it. It seems to fail at one level or another, I think, becuase the
> function calls itself - and probably gets lost somehow.
> John
> 
> 
>>... i think you might have to create the
>>$date directory before writing a file to it.
>>writing to /tmp/dir/file.txt will fail if
>>the directory "dir" doesn't exist.
>>
> 
> <?php
> 
> #######################################
> $date = date ("MD");
> #######################################
> ###  Don't forget trailing slash  #####
> #######################################
> $from_path = "c:\\program files\\easyphp\\ccl_www\\";
> $to_path = "c:\\ccl_www\\".$date."ccl_www\\";
> #######################################
> 
> if(!is_dir($from_path))
> {
> echo "failed";
> exit;
> }else{
> rec_copy($from_path, $to_path);
> echo "files copies from $from_path and backed up to $to_path";
> }
> 
> #########################################################################
> function rec_copy ($from_path, $to_path) {
> if(!is_dir($to_path))
> mkdir($to_path, 0777);
> 
> $this_path = getcwd();
>  if (is_dir($from_path))
>  {
>     chdir($from_path);
>     $handle=opendir('.');
> 
>     while (($file = readdir($handle))!==false)
>     {
>  if (($file != ".") && ($file != "..")) {
>   if (is_dir($file))
>   {
>   rec_copy ($from_path.$file."/",  $to_path.$file."/");
>        chdir($from_path);
>   }else{
> #  echo "error if (is_dir($file))<br>";
>   }
>   if (is_file($file))
>   {
>   copy($from_path.$file, $to_path.$file);
>   }else{
> #  echo "error copy($from_path.$file, $to_path.$file)<br>";
>   }
>  }#end (($file != ".")
>     }#end while (($file
> 
>     closedir($handle);
>  }# end if (is_dir
>  else{
> # echo "if (is_dir($from_path))<br>";
>  }
> }# end function
> 
> ?>
> 
> 



--- End Message ---
--- Begin Message ---
> The standard quote (') should be used to delimit string literals in MYSQL
> statements. Use it to surround strings you're inserting into or comparing
> against VARCHARs, CHARs, TEXTs, etc.

>  $sql = "UPDATE mytable SET name='Best Table Of All' WHERE id=3";

That is ok if you call MySQL in your .php. But in PHPMyAdmin, it seems preferable to 
use `.

--- End Message ---
--- Begin Message ---
I have a simple INCLUDE file that creates a default dynamic tab style table
of contact for the top of each of my pages.

I wanted a solution where I could control the content by simply changing an
integer in mySQL indicating weather a tab was visible or not. It works but I
now have a strange problem.

Each entry in the DB has unique id but I recently added a 'order' value. For
example: Home = 10, Buy = 20, Sell = 30, Contact = 40. Well I added Manage =
35 so that I could sort my results and control the order with our re-writing
code.

The problem is that when I use the include the sort order gets lost. In all
cases I have the ORDER BY toc_order which are my 10,20,30,35 values in each
row.

Can anyone shed some light on this issue?

Here is a link for an example:

http://test.oilfiielddepot.com/test

Please CC me as I am on digest mode.

Thanks,

Dan Tappin ([EMAIL PROTECTED])

--- End Message ---
--- Begin Message ---
Well, I was stupid posting this question anyway. Don't worry about my
problem. I have it fixed. =)

Again, I will be more careful not to repeat posts (or post things I can find
the answer for somewhere else).

-------Original Message-------

Well, aroung 14 Feb I ended up saying this to an address that might or
might not be yours :-):



--- End Message ---
--- Begin Message ---
Ok say I have a top ten list of something in a MySql db on server lisa.philipnz.com 
which runs php scripts.  Is it possable to call, using a javascript information from 
say

http://www.geocities.com/philip_newman/ this list, will the PHP exacute on 
lisa.philipnz.com when the script is requested from another server page.

Philip J. Newman
PhilipNZ :: Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]
ICQ# 20482482
+64 25 6144012
--- End Message ---
--- Begin Message ---
At 17.03.2002  08:02, you wrote:
>
>Ok say I have a top ten list of something in a MySql db on server 
>lisa.philipnz.com which runs php scripts.  Is it possable to call, using a 
>javascript information from say
>
>http://www.geocities.com/philip_newman/ this list, will the PHP exacute on 
>lisa.philipnz.com when the script is requested from another server page.
why don´t you just

<html>
<frameset...>
><frame src=http://www.geocities.com/philip_newman/ 
>your_script_page.php3?your_parameters
</frameset>
frameset could be just the whole page.
But there could be a better way

HTH Oliver



--- End Message ---
--- Begin Message ---
create a page on the PHP server that returns the results as an html page...
than use an include or frameset to put the results into the geocities page...

if it wasn't a geocities site, you could use an SSI include or PHP include.
-- 
Michael Geier
CDM Sports, Inc. - Systems Administrator
    email: [EMAIL PROTECTED]

Quoting "Philip J. Newman" <[EMAIL PROTECTED]>:

> Ok say I have a top ten list of something in a MySql db on server
> lisa.philipnz.com which runs php scripts.  Is it possable to call, using a
> javascript information from say
> 
> http://www.geocities.com/philip_newman/ this list, will the PHP exacute on
> lisa.philipnz.com when the script is requested from another server page.
> 
> Philip J. Newman
> PhilipNZ :: Design Solutions
> http://www.philipnz.com/
> [EMAIL PROTECTED]
> ICQ# 20482482
> +64 25 6144012
> 


-------------------------------------------------
This mail sent through CDM Sports Webmail.
--- End Message ---
--- Begin Message ---
I'm thinking of more around the site of haveing something that can be
included in peoples homepages like a top ten list that changes, but they
don't have to change it ... thats why I was thinking about javascript.

<script language="JavaScript"
src="http://lisa.philipnz.com/javatopten.php";></script>

and javatopten.php returns document.write(' Blar Blar');

----- Original Message -----
From: "Michael Geier" <[EMAIL PROTECTED]>
To: "Philip J. Newman" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, March 17, 2002 9:06 AM
Subject: Re: [PHP] From: Newman, PHP on non PHP servers?


> create a page on the PHP server that returns the results as an html
page...
> than use an include or frameset to put the results into the geocities
page...
>
> if it wasn't a geocities site, you could use an SSI include or PHP
include.
> --
> Michael Geier
> CDM Sports, Inc. - Systems Administrator
>     email: [EMAIL PROTECTED]
>
> Quoting "Philip J. Newman" <[EMAIL PROTECTED]>:
>
> > Ok say I have a top ten list of something in a MySql db on server
> > lisa.philipnz.com which runs php scripts.  Is it possable to call, using
a
> > javascript information from say
> >
> > http://www.geocities.com/philip_newman/ this list, will the PHP exacute
on
> > lisa.philipnz.com when the script is requested from another server page.
> >
> > Philip J. Newman
> > PhilipNZ :: Design Solutions
> > http://www.philipnz.com/
> > [EMAIL PROTECTED]
> > ICQ# 20482482
> > +64 25 6144012
> >
>
>
> -------------------------------------------------
> This mail sent through CDM Sports Webmail.
>
>



--- End Message ---
--- Begin Message ---
I use this code to break out of frames:

if (top.frames.length!=0)
    top.location=self.document.location;

Put this code in the <head> section between <script> tags.
If the document isn't on top, it soon will be.
(This solution slows the loading of the page a bit, the browser will
have to go thru the page once more, I think.)

Anders

----- Ursprungligt meddelande ----- 
Från: "Brinkman, Theodore" <[EMAIL PROTECTED]>
Till: "PHP List" <[EMAIL PROTECTED]>
Skickat: den 15 mars 2002 17:27
Ämne: RE: [PHP] Targetted redirection?


> OK, If I understand correctly, the following scenario would work?
> 
> Given: My site is being brought up inside somebody else's (say
> about.com)frameset.  [We'll call this page about.html]
> Given: I want my main page (index.html) to break out of the frames in the
> about.html page.  
> 
> Solution: My main page (index.html) should send header('Window-target:
> _Top');
> 
> So, if I use frames, and I want to keep my frameset page out of someone
> else's frame, I should send that header for my frameset page?
> 
> Is this correct?
> 
> - Theo
> 
> 
> -----Original Message-----
> From: Analysis & Solutions [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 15, 2002 10:27 AM
> To: PHP List
> Subject: Re: [PHP] Targetted redirection?
> 
> 
> Hi Folks:
> 
> Okay, here's what I'm talking about...  A sample system.  Four files.
> 
> index.php     main page holding the frameset.  frameset has two
>               frames.  one on left.  one on right.
> left.php      navigation menu that goes in the left hand frame
> right.php     content in right hand frame.  this page is the default
>               one that comes up in the initial frameset.
> right2.php    another page for the right hand frame
> 
> 
> ***************** index.php ******************
> 
> <?php
> #   This has no effect.
> #   header('Window-target: _top');
> ?>
> 
> <html>
> <head><title>index page</title></head>
> <frameset COLS="120,*">
> <FRAME SRC="left.php" name="menu" scrolling="no">
> <frame src="right.php" name="content">
> </frameset>
> </html>
> 
> 
> ***************** left.php ******************
> 
> <?php
> #   Turning this on will jump this page out of the frames.
> #   header('Window-target: _top');
> ?>
> 
> <html><head><title>the menu</title></head><body>
> <a href="right.php" target="content">right</a>
> <br /><a href="right2.php" target="content">right 2</a>
> </body></html>
> 
> 
> ***************** right.php ******************
> 
> <?php
> #   Turning this on will jump this page out of the frames.
> #   header('Window-target: _top');
> ?>
> 
> <HTML><HEAD><TITLE>Right</TITLE></HEAD><BODY>
> Hi there. This is the main content page in the right frame.
> </BODY></HTML>
> 
> 
> ***************** right2.php ******************
> 
> <?php
> #  This has no effect.
> #  header('Window-target: _top');
> ?>
> 
> <HTML><HEAD><TITLE>Right 2</TITLE></HEAD><BODY>
> Hi there. This is the secondary content page in the right frame.
> </BODY></HTML>
> 
> 
> 
> Now, put all those files on your machine.  Hit index.php and you'll see 
> everything normally.  Then, uncomment the header function in left.php or 
> right.php and you'll see that page jump out of the frames.  But, turn 
> the header on in index.php or index2.php and you'll still be in the 
> frames.
> 
> Enjoy,
> 
> --Dan
> 
> -- 
>                 PHP scripts that make your job easier
>               http://www.analysisandsolutions.com/code/
>          SQL Solution  |  Layout Solution  |  Form Solution
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
anyone had success using PEAR?

I have read the documentation and been trying to use the PEAR
files that came with PHP 4.1.2 , PEAR cvs and PHP4/PEAR cvs 
with no success.  

I wish there was some updated documentation, and more explanation 
on which files to use for stable development.  Every answer I 
get from people developing PEAR is vague and contradictory.

~ b r y a n
--- End Message ---
--- Begin Message ---
On Saturday 16 Mar 2002 20:32, Bryan Henry wrote:
> anyone had success using PEAR?
>
> I have read the documentation and been trying to use the PEAR
> files that came with PHP 4.1.2 , PEAR cvs and PHP4/PEAR cvs
> with no success.
>
> I wish there was some updated documentation, and more explanation
> on which files to use for stable development.  Every answer I
> get from people developing PEAR is vague and contradictory.
>
>

What part of PEAR?

I use the DB,DB-pager and RSS functions from PEAR. They seem to work well.

--jaa
--- End Message ---
--- Begin Message ---
hi folks,

I'm running a php script from a console - it includes quite a lot of heavy
database queries - and takes a while to run.  Problem is that the the script
keeps on timing out and I get

Fatal error:  Maximum execution time of 30 seconds exceeded ...

I've set the MAX EXECUTION time in php.ini to 30000 - but php doesn't seem
to be reading it..

Any ideas?

thanks!


--- End Message ---
--- Begin Message ---
At 16.03.2002  20:59, you wrote:
>hi folks,
>
>I'm running a php script from a console - it includes quite a lot of heavy
>database queries - and takes a while to run.  Problem is that the the script
>keeps on timing out and I get
>
>Fatal error:  Maximum execution time of 30 seconds exceeded ...
>
>I've set the MAX EXECUTION time in php.ini to 30000 - but php doesn't seem
>to be reading it..
>
>Any ideas?

         set_time_limit (int seconds);

from the manual:
When called, set_time_limit() restarts the timeout counter from zero. In 
other words, if the timeout is the default 30 seconds, and 25 seconds into 
script execution a call such as set_time_limit(20) is made, the script will 
run for a total of 45 seconds before timing out.

Note that set_time_limit() has no effect when PHP is running in safe mode. 
There is no workaround other than turning off safe mode or changing the 
time limit in the configuration file.
HTH Oliver

--- End Message ---
--- Begin Message ---
It's not absurd at all.

What is absurd is that you're coding without
checking for any error conditions :-)

As a rule of thumb, if a function returns a
success flag, check it.  it'll immediately
cut out about 90% of all "weird" errors.

cosmin laslau wrote:
> <?
> $query = "SELECT * from mytable";
> $result = mysql_db_query("db", $query);
> 
> while ($myarray = mysql_fetch_array($result))
> {
> $title = $myarray[title];
> echo "$title<br>";
> }
> ?>
> 
> Can someone PLEASE tell me why the coding above gives the following error:
> 
> 
> Warning: Supplied argument is not a valid MySQL result resource in 
> /var/web/somesite.com/html/index.php on line 5
> 
> 
> It's absurd. It's driving me nuts. I'm about to introduce my computer to 
> the pavement 40 feet below.
> 
> Thanks in advance for whoever sees what I am sure is a glaring and 
> obvious flaw in the coding. I've been looking at it for an hours and 
> just can't get anything from where I'm standing, maybe a different 
> perpective will help.
> 
> 
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
> 
> 



--- End Message ---
--- Begin Message ---
Try this... it should only print out "Some webpage data"

$text = "
<script something>script data.</script>
Some webpage data
<script something>another script data </script>
";

print preg_replace('/<script (.*?)></script>(.*?)<\/script>/',
   '', $text);


Ando Saabas wrote:
> Ok let me explain my problem further some. I need the regular expression to
> purify the html page from script tags:
> I used: $file = eregi_replace("(<script(.*)>.*</script>)", " ", $file);
> Now this works fine, until theres a webpage like:
> 
> <script something>script data.</script>
> Some webpage data
> <script something>another script data </script>
> 
> so the regexp above replaces everything between first <script > and last
> </script> ie the webpage data also.
> So i thought to change the regexp to something like this:  $file =
> eregi_replace("(<script(.*)>NOT(script)</script>)", " ", $file);
> where NOT(script) would match everything that contains word script
> 
> 
> 
> 
> Rick Emery wrote:
> 
> 
>>the best you can do is:
>>
>><?php
>>$a = "this has php  in the string";
>>if( ! ereg("php", $a ) )
>>{ print "a: not in string"; }
>>$a = "this has in the string";
>>if( ! ereg("php", $a ) )
>>{ print "b: not in string"; }
>>?>
>>
>>-----Original Message-----
>>From: Ando Saabas [mailto:[EMAIL PROTECTED]]
>>Sent: Thursday, March 14, 2002 9:33 AM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] regular expression for (NOT 'word')
>>
>>how would i build a regular expression in php that would match
>>everything but the given word. For example, match the string only if
>>there isnt a word 'php' in the string.
>>I understand i can list characters i dont want to see in the string:
>>[^php].
>>but this means there cant be any p or h in the string. And ^(php) checks
>>if the string starts with 'php'.
>>How should i do it?
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> 



--- End Message ---
--- Begin Message ---
I'm trying to build PHP 4.1.2 with an existing static Apache 1.3.23 
installation, and am having some resolution problems I haven't seen before.

This is on a dusty old Free BSD 2.2.2 system, but I was able to build 4.1.1 
with no problems with the same configuration.  It uses gcc version 2.7.2.1 
--- yes, I know I should upgrade the OS, but since it was able to make 
4.1.1 ok a few weeks ago, I'm guessing that isn't the problem.  I'm 
compiling in postgres and gd support, but have the same problem with them out.


I followed the steps (minimal apache, php, fuill apache), running configure 
each time and doing a make clean.

During the PHP make I see:
gcc -I. -I/usr/local/src/php-4.1.2/sapi/apache -I/usr/local/src/php-4.1.2/main
-I/usr/local/src/php-4.1.2 -I/usr/local/src/apache_1.3.23/src/include
-I/usr/local/src/apache_1.3.23/src/os/unix -I/usr/local/src/php-4.1.2/Zend
-I/usr/local/src/php-4.1.2/ext/xml/expat 
-I/usr/local/src/apache_1.3.23/src/include
-I/usr/local/src/apache_1.3.23/src/os/unix -I/usr/local/src/php-4.1.2/TSRM
-g -O2  -c mod_php4.c && touch mod_php4.lo
In file included from /usr/local/src/apache_1.3.23/src/include/httpd.h:72,
                  from mod_php4.c:32:
/usr/local/src/apache_1.3.23/src/include/ap_config.h:1386: warning: 
`XtOffsetOf' redefined
/usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location of 
the previous definition

I was able to fix this by editing main/php.h and removing the extra spaces, 
so the definition was the same as in the other files.

I tried an Apache build, but it gave me:
===> src/modules/php4
gcc -c  -I../../os/unix -I../../include   -funsigned-char
-I/usr/local/src/php-4.1.2 -I/usr/local/src/php-4.1.2/main 
-I/usr/local/src/php-4.1.2/main
-I/usr/local/src/php-4.1.2/Zend -I/usr/local/src/php-4.1.2/Zend
-I/usr/local/src/php-4.1.2/TSRM -I/usr/local/src/php-4.1.2/TSRM 
-I/usr/local/src/php-4.1.2
-DUSE_EXPAT -I../../lib/expat-lite `../../apaci` -fpic -DSHARED_MODULE
mod_php4.c && mv mod_php4.o mod_php4.so-o
In file included from ../../include/httpd.h:72,
                  from mod_php4.c:32:
../../include/ap_config.h:1386: warning: `XtOffsetOf' redefined
/usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location of 
the previous definition
rm -f libphp4.so
gcc -shared -o libphp4.so mod_php4.so-o 
libmodphp4.a  -L/usr/local/src/gd-1.8.4/ 
-L/usr/local/postgres/lib  -L/usr/local/src/gd-1.8.4/ 
-L/usr/local/postgres/lib -Lmodules/php4 -L../modules/php4 
-L../../modules/php4 -lmodphp4   -lpq -lgd -lcrypt -lbind 
-lm  -lcrypt   -lcrypt
ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cd9 for 
"_zend_unblock_interruptions"
ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1ccd for 
"_alloc_globals"
ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cc0 for 
"_alloc_globals"

followed by hundreds of similar errors...

thanks


--- End Message ---
--- Begin Message ---
Upgrade binutils?

Stephano Mariani

> -----Original Message-----
> From: Phil Glatz [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, 16 March 2002 10:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] problems with 4.1.2 build
> 
> I'm trying to build PHP 4.1.2 with an existing static Apache 1.3.23
> installation, and am having some resolution problems I haven't seen
> before.
> 
> This is on a dusty old Free BSD 2.2.2 system, but I was able to build
> 4.1.1
> with no problems with the same configuration.  It uses gcc version
2.7.2.1
> --- yes, I know I should upgrade the OS, but since it was able to make
> 4.1.1 ok a few weeks ago, I'm guessing that isn't the problem.  I'm
> compiling in postgres and gd support, but have the same problem with
them
> out.
> 
> 
> I followed the steps (minimal apache, php, fuill apache), running
> configure
> each time and doing a make clean.
> 
> During the PHP make I see:
> gcc -I. -I/usr/local/src/php-4.1.2/sapi/apache -I/usr/local/src/php-
> 4.1.2/main
> -I/usr/local/src/php-4.1.2 -I/usr/local/src/apache_1.3.23/src/include
> -I/usr/local/src/apache_1.3.23/src/os/unix
-I/usr/local/src/php-4.1.2/Zend
> -I/usr/local/src/php-4.1.2/ext/xml/expat
> -I/usr/local/src/apache_1.3.23/src/include
> -I/usr/local/src/apache_1.3.23/src/os/unix
-I/usr/local/src/php-4.1.2/TSRM
> -g -O2  -c mod_php4.c && touch mod_php4.lo
> In file included from
/usr/local/src/apache_1.3.23/src/include/httpd.h:72,
>                   from mod_php4.c:32:
> /usr/local/src/apache_1.3.23/src/include/ap_config.h:1386: warning:
> `XtOffsetOf' redefined
> /usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location
of
> the previous definition
> 
> I was able to fix this by editing main/php.h and removing the extra
> spaces,
> so the definition was the same as in the other files.
> 
> I tried an Apache build, but it gave me:
> ===> src/modules/php4
> gcc -c  -I../../os/unix -I../../include   -funsigned-char
> -I/usr/local/src/php-4.1.2 -I/usr/local/src/php-4.1.2/main
> -I/usr/local/src/php-4.1.2/main
> -I/usr/local/src/php-4.1.2/Zend -I/usr/local/src/php-4.1.2/Zend
> -I/usr/local/src/php-4.1.2/TSRM -I/usr/local/src/php-4.1.2/TSRM
> -I/usr/local/src/php-4.1.2
> -DUSE_EXPAT -I../../lib/expat-lite `../../apaci` -fpic -DSHARED_MODULE
> mod_php4.c && mv mod_php4.o mod_php4.so-o
> In file included from ../../include/httpd.h:72,
>                   from mod_php4.c:32:
> ../../include/ap_config.h:1386: warning: `XtOffsetOf' redefined
> /usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location
of
> the previous definition
> rm -f libphp4.so
> gcc -shared -o libphp4.so mod_php4.so-o
> libmodphp4.a  -L/usr/local/src/gd-1.8.4/
> -L/usr/local/postgres/lib  -L/usr/local/src/gd-1.8.4/
> -L/usr/local/postgres/lib -Lmodules/php4 -L../modules/php4
> -L../../modules/php4 -lmodphp4   -lpq -lgd -lcrypt -lbind
> -lm  -lcrypt   -lcrypt
> ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cd9 for
> "_zend_unblock_interruptions"
> ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1ccd for
> "_alloc_globals"
> ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cc0 for
> "_alloc_globals"
> 
> followed by hundreds of similar errors...
> 
> thanks
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
I use this on a Unix server to get yesterday's date if it's a
Saturday:

if ($day == '6') {
$today1 = date("Y:m:d", mktime(0,0,0,$month,$day-1,$year));
}

But on my Windows 2000 machine it thinks it's 1999:12:05.
How can I do this on Windows? Thanks.
Jeff Oien
--- End Message ---
--- Begin Message ---
Hi,

I'm wanting to retrieve a remote page and extract information from it to
insert into my own page. I know that this can be done with fopen, however
the page I am wishing to retrieve is generated with a POSTed form.

Is there any way that I can retrieve a page that has been created by the
filling in of a form (using the POST method)?

Thanks for any help...

-Andy


--- End Message ---
--- Begin Message ---
have a look at CURL

Dave

>-----Original Message-----
>From: Andy Aldridge [mailto:[EMAIL PROTECTED]]
>Sent: Saturday, March 16, 2002 7:46 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] retrieving remote web page
>
>
>Hi,
>
>I'm wanting to retrieve a remote page and extract information from it to
>insert into my own page. I know that this can be done with fopen, however
>the page I am wishing to retrieve is generated with a POSTed form.
>
>Is there any way that I can retrieve a page that has been created by the
>filling in of a form (using the POST method)?
>
>Thanks for any help...
>
>-Andy
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Anyone have a small snippet I could use to get the total size of any certin
MySQL database..

Just want to disply it in my browser using a little php script, have any
ideas?

Thanks,
Eric

--- End Message ---
--- Begin Message ---
<?php
class A
{
    function A($i)
    {
        $this->value = $i;
        // try to figure out why we do not need a reference here
        $this->b = new B($this);
    }

    function createRef()
    {
        $this->c = new B($this);
    }

    function echoValue()
    {
        echo "<br>","class ",get_class($this),': ',$this->value;
    }
}


class B
{
    function B(&$a)
    {
        $this->a = &$a;
    }

    function echoValue()
    {
        echo "<br>","class ",get_class($this),': ',$this->a->value;
    }
}

// try to undestand why using a simple copy here would yield
// in an undesired result in the *-marked line
$a =new A(10);
$a->createRef();

$a->echoValue();
$a->b->echoValue();
$a->c->echoValue();

$a->value = 11;

$a->echoValue();
$a->b->echoValue(); // *
$a->c->echoValue();

?>
--- End Message ---
--- Begin Message ---
I have compiled php with the enable-trans-sid (for the site I am using I 
can NOT use cookies)

when I start a session or store something in _SESSION['varname']  varname 
can not be accessed on other pages....

nor is there a file in the /tmp file

nor does my URI change with a session id


Any Ideas,

Michael

--- End Message ---
--- Begin Message ---
I've tried repediately to have a PHP script validate a form when the form is
submitted. I'm quite new to PHP, and I'd really appreciate the help anybody
could give me. I've been stuck on this problem far to long.

I have a form (here's the code):

<form method="post" action="<?php $PHP_SELF; ?>">
  Username:
  <input type="text" name="username" maxlength="255" value="<?
$HTTP_POST_VARS['username']; ?>">
  <br>
  Password:
  <input type="text" name="password" maxlength="8" value="<?
$HTTP_POST_VARS['password']; ?>">
  <br>
  <input type="submit" name="login" value="Log In"
onclick="document.refresh()">
  <br>
  <br>
</form>

And right underneath the form code, I have my PHP script:

<?php
 if (isset($login)) {
  insert();
 }

 function insert() {
  $db = odbc_connect('mydatabase', 'myusername', 'mypassword');

  if(!$db) {
   echo "An error has occured. Please <a
href=\"mailto:[EMAIL PROTECTED]\";>e-mail</a> the text below to
me.<br><br>~~~~~~~<br>$PHP_ERROR<br>$db<br>~~~~~~~";
  }

  $SQLQuery = "SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
AND fldPassword = '$password'";
  $cursor = odbc_exec($db, $SQLQuery);

  if (!$cursor) {
   echo "An error has occured. Please <a
href=\"mailto:[EMAIL PROTECTED]\";>e-mail</a> the text below to
me.<br><br>~~~~~~~~<br>" . odbc_errormsg($db) . "<br>~~~~~~~";
  }
 }
   ?>

What I'm trying to achieve here is that when the user fills out the form,
presses the "Log In" button, the script underneath validates and inserts the
data into a database.  Now, I click on the "Log In" button, nothing happens.

Could anybody please help me with this? I would really, really appreciat any
help.


--- End Message ---
--- Begin Message ---
Dr. Shim wrote:

>I've tried repediately to have a PHP script validate a form when the form is
>submitted. I'm quite new to PHP, and I'd really appreciate the help anybody
>could give me. I've been stuck on this problem far to long.
>
>I have a form (here's the code):
>
><form method="post" action="<?php $PHP_SELF; ?>">
>  Username:
>  <input type="text" name="username" maxlength="255" value="<?
>$HTTP_POST_VARS['username']; ?>">
>
The shortcut is <?php =$blah?>, not <?php $blah?>

>  <br>
>  Password:
>  <input type="text" name="password" maxlength="8" value="<?
>$HTTP_POST_VARS['password']; ?>">
>  <br>
>  <input type="submit" name="login" value="Log In"
>onclick="document.refresh()">
>
document.submit() should do it, refresh() will just reload the page.

>  <br>
>  <br>
></form>
>
>And right underneath the form code, I have my PHP script:
>
><?php
> if (isset($login)) {
>  insert();
> }
>
> function insert() {
>  $db = odbc_connect('mydatabase', 'myusername', 'mypassword');
>
>  if(!$db) {
>   echo "An error has occured. Please <a
>href=\"mailto:[EMAIL PROTECTED]\";>e-mail</a> the text below to
>me.<br><br>~~~~~~~<br>$PHP_ERROR<br>$db<br>~~~~~~~";
>  }
>
>  $SQLQuery = "SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
>AND fldPassword = '$password'";
>  $cursor = odbc_exec($db, $SQLQuery);
>
>  if (!$cursor) {
>   echo "An error has occured. Please <a
>href=\"mailto:[EMAIL PROTECTED]\";>e-mail</a> the text below to
>me.<br><br>~~~~~~~~<br>" . odbc_errormsg($db) . "<br>~~~~~~~";
>  }
> }
>   ?>
>
>What I'm trying to achieve here is that when the user fills out the form,
>presses the "Log In" button, the script underneath validates and inserts the
>data into a database.  Now, I click on the "Log In" button, nothing happens.
>
>Could anybody please help me with this? I would really, really appreciat any
>help.
>
>
>




--- End Message ---
--- Begin Message ---
I've changed

<form method="post" action="<?php $PHP_SELF; ?>">

To

<form method="post" action="<?php =$PHP_SELF; ?>">

And I get a parse error. Could you possibly help me correct this? (I'm a
newbie, so have pity on me. =)


--- End Message ---
--- Begin Message ---
On Sunday 17 March 2002 11:46, Dr. Shim wrote:
> I've changed
>
> <form method="post" action="<?php $PHP_SELF; ?>">
>
> To
>
> <form method="post" action="<?php =$PHP_SELF; ?>">
>
>
> And I get a parse error. Could you possibly help me correct this? (I'm a
> newbie, so have pity on me. =)


Use:

  <form method="post" action="<?php echo $PHP_SELF; ?>">


Also, please use a descriptive subject heading next time!


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Paul's Law:
        You can't fall off the floor.
*/
--- End Message ---
--- Begin Message ---
Sorry about the subject heading.

I've put in

<form method="post" action="<?php echo $PHP_SELF; ?>">

But still when I click on the "Log In" button, thing happens.


--- End Message ---
--- Begin Message ---
Oh, by the way, the "if...then" claus runs successfully, but the function
never is called. Am I wrong?



--- End Message ---
--- Begin Message ---
On Sunday 17 March 2002 12:04, Dr. Shim wrote:
> Sorry about the subject heading.
>
> I've put in
>
> <form method="post" action="<?php echo $PHP_SELF; ?>">
>
> But still when I click on the "Log In" button, thing happens.

Please post the rest of your code and also which version of PHP you're using.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Your lover will never wish to leave you.
*/
--- End Message ---
--- Begin Message ---
I'm using PHP 4.1.1 (for Windows). Here is *all* of my code.

<html>
<head>
<title>Administrative Log-In Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
Please enter your username and password below in the fields below.
<form method="post" action="<?php echo $PHP_SELF; ?>">
  Username:
  <input type="text" name="username" maxlength="255" value="<?php echo
$HTTP_POST_VARS['username']; ?>">
  <br>
  Password:
  <input type="text" name="password" maxlength="8" value="<? echo
$HTTP_POST_VARS['password']; ?>">
  <br>
  <input type="submit" name="login" value="Log In">
  <br>
  <br>
</form>
  <?php
 if (isset($login)) {
  insert();
  echo $login;
 }

 function insert() {
  $db = odbc_connect('IdentDatabase', 'root', '');

  if(!$db) {
   echo "An error has occured. Please <a
href=\"mailto:[EMAIL PROTECTED]\";>e-mail</a> the text below to
me.<br><br>~~~~~~~<br>$PHP_ERROR<br>$db<br>~~~~~~~";
  }

  $SQLQuery = "SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
AND fldPassword = '$password'";
  $cursor = odbc_exec($db, $SQLQuery);

  if (!$cursor) {
   echo "An error has occured. Please <a
href=\"mailto:[EMAIL PROTECTED]\";>e-mail</a> the text below to
me.<br><br>~~~~~~~~<br>" . odbc_errormsg($db) . "<br>~~~~~~~";
  }
 }
   ?>
</body>
</html>



"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
On Sunday 17 March 2002 12:04, Dr. Shim wrote:
> Sorry about the subject heading.
>
> I've put in
>
> <form method="post" action="<?php echo $PHP_SELF; ?>">
>
> But still when I click on the "Log In" button, thing happens.

Please post the rest of your code and also which version of PHP you're
using.


--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Your lover will never wish to leave you.
*/


--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] writes:
>I'm using PHP 4.1.1 (for Windows). Here is *all* of my code.
>
><html>
><head>
><title>Administrative Log-In Page</title>
><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
></head>
>
><body bgcolor="#FFFFFF">
>Please enter your username and password below in the fields below.
><form method="post" action="<?php echo $PHP_SELF; ?>">
>  Username:
>  <input type="text" name="username" maxlength="255" value="<?php echo
>$HTTP_POST_VARS['username']; ?>">
>  <br>
>  Password:
>  <input type="text" name="password" maxlength="8" value="<? echo
>$HTTP_POST_VARS['password']; ?>">
>  <br>
>  <input type="submit" name="login" value="Log In">
>  <br>
>  <br>
></form>

Hello Jason

If I were you, I would not use $HTTP_POST_VARS.. YOur form element like
this <input type="text" name="password" maxlength="8"> is good enough.  I
don't think you need this value="<? echo
>$HTTP_POST_VARS['password']; ?>".   Also, make sure that echo $PHP_SELF
is output the form name or just put the form name directly.  Anything else
is fine.  Your isset condition should be provoked once clicked,  and call
the insert function.  It is very simple from my opinion.  I use PHP on IIS
also.

Hope, this would help.
Pong

>  <?php
> if (isset($login)) {
>  insert();
>  echo $login;
> }
>
> function insert() {
>  $db = odbc_connect('IdentDatabase', 'root', '');
>
>  if(!$db) {
>   echo "An error has occured. Please <a
>href=\"mailto:[EMAIL PROTECTED]\";>e-mail</a> the text below to
>me.<br><br>~~~~~~~<br>$PHP_ERROR<br>$db<br>~~~~~~~";
>  }
>
>  $SQLQuery = "SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
>AND fldPassword = '$password'";
>  $cursor = odbc_exec($db, $SQLQuery);
>
>  if (!$cursor) {
>   echo "An error has occured. Please <a
>href=\"mailto:[EMAIL PROTECTED]\";>e-mail</a> the text below to
>me.<br><br>~~~~~~~~<br>" . odbc_errormsg($db) . "<br>~~~~~~~";
>  }
> }
>   ?>
></body>
></html>
>


--- End Message ---
--- Begin Message ---
On Sunday 17 March 2002 12:12, Dr. Shim wrote:

> I'm using PHP 4.1.1 (for Windows). Here is *all* of my code.
>
> <html>
> <head>
> <title>Administrative Log-In Page</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
>
> <body bgcolor="#FFFFFF">
> Please enter your username and password below in the fields below.
> <form method="post" action="<?php echo $PHP_SELF; ?>">
>   Username:
>   <input type="text" name="username" maxlength="255" value="<?php echo
> $HTTP_POST_VARS['username']; ?>">

You're using 4.1.1, $HTTP_POST_VARS{} has been replaced by $_POST[] (see 
changelog/history/php.ini for details).

>   <br>
>   Password:
>   <input type="text" name="password" maxlength="8" value="<? echo
> $HTTP_POST_VARS['password']; ?>">
>   <br>
>   <input type="submit" name="login" value="Log In">
>   <br>
>   <br>
> </form>
>   <?php
>  if (isset($login)) {
>   insert();
>   echo $login;
>  }
>
>  function insert() {
>   $db = odbc_connect('IdentDatabase', 'root', '');
>
>   if(!$db) {
>    echo "An error has occured. Please <a
> href=\"mailto:[EMAIL PROTECTED]\";>e-mail</a> the text below to
> me.<br><br>~~~~~~~<br>$PHP_ERROR<br>$db<br>~~~~~~~";
>   }
>
>   $SQLQuery = "SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
> AND fldPassword = '$password'";

If register_globals is not ON, then $username & $password will not have been 
defined. You have to reference them as $_POST['username']. But as you're 
referencing an array from inside a double-quoted string then just 
$_POST[username] will do:

  $SQLQuery = "SELECT fldID FROM tblUsers 
                WHERE fldUsername = '$_POST[$username]'
                  AND fldPassword = '$_POST[$password]'";


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
You'd like to do it instantaneously, but that's too slow.
*/
--- End Message ---
--- Begin Message ---
No!? $date is a string?!

$date = date ("MD");

How does that make a difference?

$to_path = "c:\\ccl_www\\".$date."\\ccl_www\\";

You want me to change it to:

$to_path = "c:\\ccl_www\\$date\\ccl_www\\";

Does anyone follow why?

>Scott Furt wrote:

> I meant, have you created a physical directory
> named $date?
> That's your problem.  There's no directory named $date on your computer, and
> you're
> trying to write files into a non-existent directory.
>
> jtjohnston wrote:
> > I have created date :)
> > $date = date ("MD");
> > That's not it. It seems to fail at one level or another, I think, becuase the
> > function calls itself - and probably gets lost somehow.
> > John
> >
> >
> >>... i think you might have to create the
> >>$date directory before writing a file to it.
> >>writing to /tmp/dir/file.txt will fail if
> >>the directory "dir" doesn't exist.
> >>
> >
> > <?php
> >
> > #######################################
> > $date = date ("MD");
> > #######################################
> > ###  Don't forget trailing slash  #####
> > #######################################
> > $from_path = "c:\\program files\\easyphp\\ccl_www\\";
> > $to_path = "c:\\ccl_www\\".$date."ccl_www\\";
> > #######################################
> >
> > if(!is_dir($from_path))
> > {
> > echo "failed";
> > exit;
> > }else{
> > rec_copy($from_path, $to_path);
> > echo "files copies from $from_path and backed up to $to_path";
> > }
> >
> > #########################################################################
> > function rec_copy ($from_path, $to_path) {
> > if(!is_dir($to_path))
> > mkdir($to_path, 0777);
> >
> > $this_path = getcwd();
> >  if (is_dir($from_path))
> >  {
> >     chdir($from_path);
> >     $handle=opendir('.');
> >
> >     while (($file = readdir($handle))!==false)
> >     {
> >  if (($file != ".") && ($file != "..")) {
> >   if (is_dir($file))
> >   {
> >   rec_copy ($from_path.$file."/",  $to_path.$file."/");
> >        chdir($from_path);
> >   }else{
> > #  echo "error if (is_dir($file))<br>";
> >   }
> >   if (is_file($file))
> >   {
> >   copy($from_path.$file, $to_path.$file);
> >   }else{
> > #  echo "error copy($from_path.$file, $to_path.$file)<br>";
> >   }
> >  }#end (($file != ".")
> >     }#end while (($file
> >
> >     closedir($handle);
> >  }# end if (is_dir
> >  else{
> > # echo "if (is_dir($from_path))<br>";
> >  }
> > }# end function
> >
> > ?>
> >
> >

--
John Taylor-Johnston
-----------------------------------------------------------------------------
  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   -     Université de Sherbrooke:
          http://compcanlit.ca/
          819-569-2064


--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> No!? $date is a string?!
> 
> $date = date ("MD");
> 
> How does that make a difference?
> 
> $to_path = "c:\\ccl_www\\".$date."\\ccl_www\\";
> 
> You want me to change it to:
> 
> $to_path = "c:\\ccl_www\\$date\\ccl_www\\";
> 
> Does anyone follow why?
> 
> >Scott Furt wrote:
> 
> > I meant, have you created a physical directory
> > named $date?
> > That's your problem.  There's no directory named $date on your computer, and
> > you're
> > trying to write files into a non-existent directory.
> >
> > jtjohnston wrote:
> > > I have created date :)
> > > $date = date ("MD");
> > > That's not it. It seems to fail at one level or another, I think, becuase the
> > > function calls itself - and probably gets lost somehow.
> > > John
> > >
> > >
> > >>... i think you might have to create the
> > >>$date directory before writing a file to it.
> > >>writing to /tmp/dir/file.txt will fail if
> > >>the directory "dir" doesn't exist.
> > >>

I think what is being suggested is that you may not have a directory 
named whatever "c:\\ccl_www\\".$date."\\ccl_www\\" expands to; frinstance 
if $date were 0203 you would need to have an existing directory 
"c:\\ccl_www\\0203\\ccl_www\\"

Of course, I could be misunderstanding...

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---

Reply via email to