[PHP] PHP LDAP SSL

2001-03-06 Thread Matthieu Le Corre

I try to have the php ldap functions working with SSL ,
but when the code is executed the apache child die !!!
is there anyone with that working 

regards
-- 
__

Matthieu LE CORRE
   SERVICE INFORMATIQUE
 Ecole Polytechnique de l'Universit de Nantes 
(EPUN)
Site de la Chantrerie
 Rue Christian Pauc
BP 50609
   44306 Nantes Cedex 3
02 40 68 32 23
__

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] :: usability

2001-03-06 Thread Milan Mlynarcik

Is "::" used only when referencing on parent class or it has some other funcionality 
??? Whaere can I find more documentattion on this topic ???
-
Milan Mlynarcik
Web Programmer
Charmed Technology Slovakia
Nam. sv. Egidia 16/37
058 01 Poprad, Slovakia
E-mail: [EMAIL PROTECTED]
Office: 00421 92 7881 874
Mobile: 00421 905 964 535
Web page: http://www.charmed.com/
-



[PHP] Not Allowing REload or REfresh with this script?

2001-03-06 Thread Dhaval Desai

Hi!


Well I need help with something. I have a form which
has a ction to a file called actio.php
Now When I hit the submit button. It goes to the file
and it performs a certain action as seen below:

action.php: is as follows:

?php

if(isset($userfile))
{
echo "$userfile is set";
global $userfile;
unset ($userfile);
}
else
{
echo "Sorry buddy , Userfile is not set";
}


?


My main intentyion is to unset the variable so that
When the page is REFRESHED or RELOADED. It should
execute the else code block.


I am trying to implement it on one of my websites
where users can not refresh a particular a page.


Thank You
Dhaval Desai




__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql_connect() with timeout

2001-03-06 Thread php3

Addressed to: [EMAIL PROTECTED]
  [EMAIL PROTECTED]

** Reply to note from [EMAIL PROTECTED] Tue, 6 Mar 2001 01:29:52 -0500

 Frankly, I don't know how people would otherwise handle connections
 to MySQL since the attempts could, potentially, block forever.


I guess because the entire system is so reliable for most people.  I've
been doing dynamic sites for over a year now, and I've never had a
problem.  The only downtime MySQL has is when I shut it down for a few
minutes once a week to back up the database files.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP LDAP SSL

2001-03-06 Thread Stig Venaas

On Tue, Mar 06, 2001 at 09:27:55AM +0100, Matthieu Le Corre wrote:
 I try to have the php ldap functions working with SSL ,
 but when the code is executed the apache child die !!!
 is there anyone with that working 

Works fine for me. I know one other person with the same problem as you.
He also tried with ldapsearch from OpenLDAP 2.0.7 and it crashed, so it
seems to be an OpenLDAP problem. Perhaps you should try that as well,
just use ldapsearch as usual, but use -H "ldaps://host" rather than
-hhost. It then does the same as PHP does, and the result seems to be
the same.

In his case, the bug seems to be SASL related. I'm not using SASL and
it works. So I advise you to try to compile 2.0.7 without SASL libraries,
and try ldapsearch then. I don't know what platform you have, but ldd
might show you which libraries your current ldapsearch uses. See also
the thread "can't connect to secure LDAP server" on the openldap-software
list.

If it crashes, it would be good if you reported the bug at
http://www.OpenLDAP.org/its/. Please try to give as much debug info
as possible. gdb might help you. In case you don't know how to use
gdb, here's some info.

First execute "gdb ldapsearch". You should use the unstripped
ldapsearch (openldap-2.0.7/clients/tools/ldapsearch in the source tree).
Then on the gdb prompt "(gdb)" type
"set args -H ldaps://nwserver.mydomain.com ..." (same arguments as
on the command line), and then type run. You should then get some
info about where it crashes. When it crashes, type the gdb command
"bt". The output will help people know where it crashed. That should
be in your bug report.

I've assumed a few things here. If your not using OpenLDAP or
ldapsearch doesn't crash, the problem is something else.

Stig

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Newbie: Can't find function error.

2001-03-06 Thread php3

Addressed to: Darren Ward [EMAIL PROTECTED]
  [EMAIL PROTECTED]

** Reply to note from Darren Ward [EMAIL PROTECTED] Tue, 6 Mar 2001 18:17:11 
+1100

 Hi Guys,

 Newbie to the list and the world of PHP.

 I'm having a LOT of trouble getting PHP to work.

 The PHP and Apache installs have gone well as evidenced by:

 # ./httpd -l
 Compiled-in modules:
   http_core.c
   mod_env.c
   mod_log_config.c
   mod_mime.c
   mod_negotiation.c
   mod_status.c
   mod_info.c
   mod_include.c
   mod_autoindex.c
   mod_dir.c
   mod_cgi.c
   mod_asis.c
   mod_imap.c
   mod_actions.c
   mod_userdir.c
   mod_alias.c
   mod_access.c
   mod_auth.c
   mod_so.c
   mod_setenvif.c
   mod_ssl.c
   mod_php4.c
   mod_perl.c

 And httpd.conf has the handlers for php3 and php but whenever I browse to a
 test php3 file it says:

  Fatal error: Call to undefined function: php_info() in test.php3 on line 1

 The file looks like:

 ?php php_info() ?



Try:

?php phpinfo() ?




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Newbie: Can't find function error.

2001-03-06 Thread Darren Ward

Thanks to all who replied, that works fine although only as extenmsion php
and not php3 but I'll sort that out.

A second follow up question is where I should place the ini file to change
environment variables?

What I've read doesn't work :(

Darren

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 06, 2001 7:57 PM
To: Darren Ward; [EMAIL PROTECTED]
Subject: Re: [PHP] Newbie: Can't find function error.


Addressed to: Darren Ward [EMAIL PROTECTED]
  [EMAIL PROTECTED]

** Reply to note from Darren Ward [EMAIL PROTECTED] Tue, 6 Mar
2001 18:17:11 +1100 
   
 Hi Guys,
   
 Newbie to the list and the world of PHP.
   
 I'm having a LOT of trouble getting PHP to work.
   
 The PHP and Apache installs have gone well as evidenced by:
   
 # ./httpd -l
 Compiled-in modules:
   http_core.c
   mod_env.c
   mod_log_config.c
   mod_mime.c
   mod_negotiation.c
   mod_status.c
   mod_info.c
   mod_include.c
   mod_autoindex.c
   mod_dir.c
   mod_cgi.c
   mod_asis.c
   mod_imap.c
   mod_actions.c
   mod_userdir.c
   mod_alias.c
   mod_access.c
   mod_auth.c
   mod_so.c
   mod_setenvif.c
   mod_ssl.c
   mod_php4.c
   mod_perl.c
   
 And httpd.conf has the handlers for php3 and php but whenever I browse to
a
 test php3 file it says:
   
  Fatal error: Call to undefined function: php_info() in test.php3 on line
1
   
 The file looks like:
   
 ?php php_info() ?



Try:

?php phpinfo() ?




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] removing characters

2001-03-06 Thread php3

Addressed to: Rick St Jean [EMAIL PROTECTED]
  [EMAIL PROTECTED]

** Reply to note from Rick St Jean [EMAIL PROTECTED] Tue, 06 Mar 2001 
01:47:05 -0500


A good way to do what you are asking is a combination of the last two
suggestions...


if( count( $Area )) {#  Don't do anything if there are no entries
   reset( $Area );

   #  Handle the first one, with no 'or'
   list( , $Value ) = each( $Area );
   $String = "(Area='$Value')";

   #  Handle the rest with a leading 'or'
   while( list( , $Value ) = each( $Area )) {
  $String .= " or (Area='$Value')";
  }
   }




 I have just started with php a few days ago but in the book that I am
 reading it
 uses a foreach loop that is specifically for arrays.


 foreach($Area as $key=$value)
 {
   your concatination string here
 }

 Rick

 At 04:45 PM 3/6/01 +1030, you wrote:
 On Tue,  6 Mar 2001 15:50, [EMAIL PROTECTED] wrote:
   A problem of inexperience...
  
   I am trying to store an array in mysql. I obtain the array like so--
  
   $partcount = count($Area);
reset($Area);
for ($i = 0; $i  $partcount; $i++){
  $key = key($Area);
  $val = $Area[$key];
   $string1 .= $val . "\') or (Area=\'";
  next($Area);
}
  
   This results, with a bit of coaxing, in an array like this one --
  
   +-+
  
   | Area|
  
   +-+
  
   | (Area='1') or (Area='2') or (Area='3') or (Area='') |
  
   +-+
  
   Everything is falling into place, *except*  these last thirteen
   characters --
  
or (Area='')
  
   And that's what I'd like to eradicate.
  
   Tips, suggestions, especially outright code greatly appreciate.
  
   Thanks,
   Robert
   p.s.-- I have ordered the Friedl book on Regular Expressions. Hoping it
   will enlighten me for the future
 
 My suggestion would be to not create the empty reference in the firast
 place :-)
 
 Before starting your loop (but after checking there is something to work
 with) use the first element of the arra to create the (Area='1') then you
 can loop through the rest of the array, starting with $i = 1 and create
 
or (Area='$val')


Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP LDAP SSL

2001-03-06 Thread Matthieu Le Corre

Hum the ldapsearch work fine !!!
with the command : ldapsearch -x -H "ldaps://x..xx:636"
I have got a possitive response from server !
and I don't use SASL ...
really don't know why is don't work with php !!!

my box : RH7 KDE2
Apache 1.3.17
php 4.04 pl1
mod_ssl-2.8.0-1.3.17
openssl-devel-0.9.6-1
openssl-0.9.6-1
openldap-devel-2.0.7-11
openldap-2.0.7-2
openldap-clients-2.0.7-12

Le Mardi  6 Mars 2001 09:53, vous avez crit :
 On Tue, Mar 06, 2001 at 09:27:55AM +0100, Matthieu Le Corre wrote:
  I try to have the php ldap functions working with SSL ,
  but when the code is executed the apache child die !!!
  is there anyone with that working

 Works fine for me. I know one other person with the same problem as you.
 He also tried with ldapsearch from OpenLDAP 2.0.7 and it crashed, so it
 seems to be an OpenLDAP problem. Perhaps you should try that as well,
 just use ldapsearch as usual, but use -H "ldaps://host" rather than
 -hhost. It then does the same as PHP does, and the result seems to be
 the same.


-- 
__

Matthieu LE CORRE
   SERVICE INFORMATIQUE
 Ecole Polytechnique de l'Universit de Nantes 
(EPUN)
Site de la Chantrerie
 Rue Christian Pauc
BP 50609
   44306 Nantes Cedex 3
02 40 68 32 23
__

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 6 Mar 2001 09:50:23 -0000 Issue 550

2001-03-06 Thread php-general-digest-help


php-general Digest 6 Mar 2001 09:50:23 - Issue 550

Topics (messages 42677 through 42729):

Get text between a href="" /a
42677 by: Keith Mayo
42679 by: Henrik Hansen

speeding a site with lots of includes
42678 by: Eduardo Dominguez
42698 by: Chris Lee

Re: mail problem
42680 by: Peter Houchin

PHP and MySQL dynamic query?
42681 by: Blueriver Networking Services

function -- global variables
42682 by: Augusto Cesar Castoldi
42685 by: Hardy Merrill

Sites Using PHP - For a presentation
42683 by: Brad Landis

To the PHP developpers / DOMXML (Update and delete??)
42684 by: Dominique Paquin

php, mysql and htaccess
42686 by: george

Re: comparing values
42687 by: David Robley

mail any idea's?
42688 by: Peter Houchin
42689 by: Peter Houchin

Translation using FastTemplates
42690 by: ADnoctum

mysql_connect() with timeout
42691 by: php.winux.com
42724 by: php3.developersdesk.com

PHP Conference In San Diego?
42692 by: Jonathan Sharp

config question
42693 by: PeterOblivion.aol.com
42694 by: Kelly Corkill
42695 by: David Robley
42697 by: Philip Olson
42704 by: php3.developersdesk.com

Re: what does $$ mean?
42696 by: Stephan Ahonen

compile error
42699 by: Doug Kite

Quick Regex Question
42700 by: Jeff Oien
42701 by: CC Zona

is_uploaded_file false if file too big
42702 by: Tyson Lloyd Thwaites
42710 by: Rick St Jean

Re: HREFs that can't be
42703 by: php3.developersdesk.com

removing characters
42705 by: rpruitt.mid-tn.com
42707 by: David Robley
42709 by: Rick St Jean
42728 by: php3.developersdesk.com

Session not destroying properly
42706 by: Mike Yuen
42718 by: Yasuo Ohgaki
42720 by: trogers

Shopping Baskets
42708 by: Sean Weissensee

Calling Perl from PHP --  Help  --
42711 by: Matt Friedman

OT Perl help
42712 by: Matt Friedman

Almost working Regex
42713 by: Murray Shields
42714 by: Rick St Jean
42715 by: Yasuo Ohgaki
42717 by: Murray Shields

Newbie: Can't find function error.
42716 by: Darren Ward
42719 by: Pavel Jartsev
42726 by: php3.developersdesk.com
42727 by: Darren Ward

PHP LDAP  SSL
42721 by: Matthieu Le Corre
42725 by: Stig Venaas
42729 by: Matthieu Le Corre

:: usability
42722 by: Milan Mlynarcik

Not Allowing REload or REfresh with this script?
42723 by: Dhaval Desai

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]


--



I need some help with a program, I need to get every
instance of text between a href =”” GET TEXT HERE
/a and save the results in a variable. Does anyone
have some example code of how to do it along with how
to put the results into just one variable? 


__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




 I need some help with a program, I need to get every
 instance of text between a href ="" GET TEXT HERE
 /a and save the results in a variable. Does anyone
 have some example code of how to do it along with how
 to put the results into just one variable? 

Try with:

$string = "a href =\"\"GET TEXT HERE/a";
$string = strip_tags($string);

--
Henrik Hansen





An app I am currently developing has grown a lot. It currently
handles aproximately 12 includes, more or less 13 thousand lines
of code.

By doing some benchmarks, i realized that the bottleneck is the include()
payload.

How can I optimize a program like this one ?
thanks in advance






I found 0.002 for the first include, and 0.0001 second for a refresh not to bad.

PIII-500 512mb ram
PHP-4.0.4pl1

no zend-optimizer, no zend-cache

the refresh is less because linux caches the file in it internal buffer. I wouldnt 
consider 0.002sec that bad of a hit. you could have 50hit/sec with 10 includes each on 
ALL difernet files. you could have 1000hit/sec on the same files.


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]



""Eduardo Dominguez"" [EMAIL PROTECTED] wrote in message 
981385$21k$[EMAIL PROTECTED]">news:981385$21k$[EMAIL PROTECTED]...
An app I am currently developing has grown a lot. It currently
handles aproximately 12 includes, more or less 13 thousand lines
of code.

By doing some benchmarks, i realized that the bottleneck is the include()
payload.

How can I optimize a program like this one ?
thanks in advance



-- 
PHP General Mailing List 

Re: [PHP] PHP LDAP SSL

2001-03-06 Thread Stig Venaas

On Tue, Mar 06, 2001 at 10:54:24AM +0100, Matthieu Le Corre wrote:
 Hum the ldapsearch work fine !!!
 with the command : ldapsearch -x -H "ldaps://x..xx:636"
 I have got a possitive response from server !
 and I don't use SASL ...

I got some info from the other guy. He also used RH7 which includes
SASL libraries, and he had crashes in both PHP and ldapsearch. Could
you see if your ldapsearch crashes if you don't use -x parameter? -x
tells it not to use SASL while there are no similar option from PHP.
The other guy solved it by compiling OpenLDAP 2.0.7 himself without
SASL support and using that with PHP.

Stig

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mysql_connect or mysql_pconnect or DEATH ???

2001-03-06 Thread Marian Vasile

I have a chat software working on www.jumatateata.ro

The problem is that all the time I get mysql sessions opened and I don't
understand.
I used mysql_connect (at the beggining of every script) and mysql_close in
the end.
The ISP told me that still remain mysql sessions opened.

Then I used mysql_pconnect and again, too many sessions opened.

What makes everything hard is that I don't have telnet acces so this is my
next question:
How I can see mysql sessions opened just using a php script ? Can I ?
(I'm asking this because I was thinking that I can write a php script to
show me the sessions.=)

Do you have any idea about this ?
I'm really interested to find out...
Thanx a lot...

Marian Vasile
IT Manager
Schnecker van Wyk  Pearson
www.investments.ro


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP LDAP SSL

2001-03-06 Thread Matthieu Le Corre

i don't use SASL
so when i use ldapsearch without -x 
I get "ldap_sasl_interactive_bind_s: Unknown authentication method"
but it doesnt crash !
when i use php ldap functions with ssl 
php doesn't crash but juste an Apache child crash !
so you think that if i compile openldap without SASL i will work ?
i 'm really not sure because it's not that it doesn't work it's just crash ;(

thank for all

regards

Le Mardi  6 Mars 2001 11:08, vous avez crit :
 On Tue, Mar 06, 2001 at 10:54:24AM +0100, Matthieu Le Corre wrote:
  Hum the ldapsearch work fine !!!
  with the command : ldapsearch -x -H "ldaps://x..xx:636"
  I have got a possitive response from server !
  and I don't use SASL ...

 I got some info from the other guy. He also used RH7 which includes
 SASL libraries, and he had crashes in both PHP and ldapsearch. Could
 you see if your ldapsearch crashes if you don't use -x parameter? -x
 tells it not to use SASL while there are no similar option from PHP.
 The other guy solved it by compiling OpenLDAP 2.0.7 himself without
 SASL support and using that with PHP.

 Stig

-- 
__

Matthieu LE CORRE
   SERVICE INFORMATIQUE
 Ecole Polytechnique de l'Universit de Nantes 
(EPUN)
Site de la Chantrerie
 Rue Christian Pauc
BP 50609
   44306 Nantes Cedex 3
02 40 68 32 23
__

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP LDAP SSL

2001-03-06 Thread Stig Venaas

On Tue, Mar 06, 2001 at 11:22:55AM +0100, Matthieu Le Corre wrote:
 i don't use SASL
 so when i use ldapsearch without -x 
 I get "ldap_sasl_interactive_bind_s: Unknown authentication method"
 but it doesnt crash !

Okay, the other guy had a crash there. For me it works without -x and
I don't use SASL either.

 when i use php ldap functions with ssl 
 php doesn't crash but juste an Apache child crash !
 so you think that if i compile openldap without SASL i will work ?
 i 'm really not sure because it's not that it doesn't work it's just crash ;(

The Apache child probably crashes because of segfault or something in the
LDAP code, but there could be other reasons. In theory you should get the
same behavior with ldapsearch as from PHP.

I'm not sure of anything, but what I would have done to debug it, is to
use gdb either on the Apache process or on a stand-alone PHP. I prefer
debugging with a stand-alon binary myself. Then run PHP with your script
and see what happens. If you get a seg-fault or other crash, you can try
to use gdb as I explained with ldapsearch to see where PHP crashes.
Compiling PHP stand-alone is easy, do configure with just --with-ldap.
You don't have to install it either, just run the resulting php binary.
If it says something abous sasl where it crashes, I would try to compile
OpenLDAP without SASL and then link PHP with the resulting libraries.

If you try gdb on the PHP binary and get some message not related to sasl,
or have problems using gdb, let me know.

Stig

-- 
Duct tape is like the force.  It has a light side, and a dark side, and
it holds the universe together ...
-- Carl Zwanzig

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] bug tracking software

2001-03-06 Thread Peter Van Dijck

I've looked into bug tracking software at hotscripts: mantis
http://mantisbt.sourceforge.net/mantis/main_page.php3
is promising but has too many bugs itself still (I fixed three in the past 
20 minutes of playing with it, it's still in beta, but I can't afford the 
estimated x days of debugging it right now).
I need something stable to start working with straight away. And preferably 
something easy to use.
Which one should I use?
Peter
~~
http://liga1.com: building multiple language/culture websites


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP LDAP SSL

2001-03-06 Thread Matthieu Le Corre

Le Mardi  6 Mars 2001 11:35, vous avez crit :

 I'm not sure of anything, but what I would have done to debug it, is to
 use gdb either on the Apache process or on a stand-alone PHP. I prefer
 debugging with a stand-alon binary myself. Then run PHP with your script
 and see what happens. If you get a seg-fault or other crash, you can try
 to use gdb as I explained with ldapsearch to see where PHP crashes.
 Compiling PHP stand-alone is easy, do configure with just --with-ldap.
 You don't have to install it either, just run the resulting php binary.
 If it says something abous sasl where it crashes, I would try to compile
 OpenLDAP without SASL and then link PHP with the resulting libraries.

 If you try gdb on the PHP binary and get some message not related to sasl,
 or have problems using gdb, let me know.

hum you are right 
I've compiled PHP stand-alone
and running the script
and I get 
--
Program received signal SIGSEGV, Segmentation fault.
0x4003ba7b in ldap_int_sasl_external () from /usr/lib/libldap.so.2
(gdb) next
Single stepping until exit from function ldap_int_sasl_external,
which has no line number information.
 
Program terminated with signal SIGSEGV, Segmentation fault.
---

in fact it's ldaplib.so.2 that crash !! 
what a mess ...
in fact it's the sasl function that crash 

i'll try to compil ldap without it !
it mays take a while ...

thak for all 
regards 


-- 
__

Matthieu LE CORRE
   SERVICE INFORMATIQUE
 Ecole Polytechnique de l'Universit de Nantes 
(EPUN)
Site de la Chantrerie
 Rue Christian Pauc
BP 50609
   44306 Nantes Cedex 3
02 40 68 32 23
__

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /main php_ini.c

2001-03-06 Thread Stanislav Malyshev

stasTue Mar  6 03:38:56 2001 EDT

  Modified files:  
/php4/main  php_ini.c 
  Log:
  Don't insert empty path if PHPRC is empty
  
  
Index: php4/main/php_ini.c
diff -u php4/main/php_ini.c:1.53 php4/main/php_ini.c:1.54
--- php4/main/php_ini.c:1.53Sun Feb 25 22:07:31 2001
+++ php4/main/php_ini.c Tue Mar  6 03:38:55 2001
@@ -241,7 +241,11 @@
 #endif
php_ini_search_path = (char *) 
emalloc(sizeof(".")+strlen(env_location)+strlen(default_location)+2+1);
free_ini_search_path = 1;
-   sprintf(php_ini_search_path, ".%c%s%c%s", ZEND_PATHS_SEPARATOR, 
env_location, ZEND_PATHS_SEPARATOR, default_location);
+   if(env_location  env_location[0]) {
+   sprintf(php_ini_search_path, ".%c%s%c%s", 
+ZEND_PATHS_SEPARATOR, env_location, ZEND_PATHS_SEPARATOR, default_location);
+   } else {
+   sprintf(php_ini_search_path, ".%c%s", ZEND_PATHS_SEPARATOR, 
+default_location);
+   }
if (free_default_location) {
efree(default_location);
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP LDAP SSL

2001-03-06 Thread Stig Venaas

There's been some discussion on the OpenLDAP lists as well, and there
seems to be a fix around. See
http://www.openldap.org/its/index.cgi/Software%20Bugs?id=889

Stig

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] blank spaces???

2001-03-06 Thread Miguel Loureiro

Hello all,
is there any solution when working with variables that have blank spaces, because when 
read the variavel to a select, it only appears the first word (e.g. having: "aaa bbb 
ccc", it only appears "aaa").
T.Y.All
Best Regards
Miguel  Loureiro [EMAIL PROTECTED] 



[PHP] HELP!!! Upload files!!!!

2001-03-06 Thread Bruno Freire

Look the message:

Warning: Rename failed (Invalid cross-device link) in
/usr/local/etc/httpd/htdocs/intranet/upload.php on line 26

What i'm doing wrong???

My code:


html
head
script
function nomearq()
{
   teste.nome.value=teste.arquivo.value;
}
/script
body bgcolor="#E6"
?php
 if ($arquivo!="")
 {
$arq="";
$i=strlen($nome);
while (substr($nome,$i,1)!="\\")
{
   $arq2=$arq;
   $arq=substr($nome,$i,1);
   $arq.=$arq2;
   $i--;
}
chmod($arquivo, 0777 );
 
rename($arquivo,"/usr/local/etc/httpd/htdocs/intranet/uploads/comercial/cota
cao/$arq");(line 26)
$cont++;
 }
 else
 {
$cont=0;
 }
echo "N de arquivos enviados: $contbr";
?

FORM  ENCTYPE="multipart/form-data" ACTION="upload.php?caminho=?php echo
$caminho;?" METHOD=POST name="teste"
INPUT TYPE="hidden" value="20971520"
Nome do Arquivo INPUT NAME="arquivo" TYPE="file"
INPUT TYPE="submit" VALUE="Enviar" onclick="nomearq()"
INPUT TYPE="hidden" value="" name="nome"
/FORM
/body
/html



[PHP] dymanic forms

2001-03-06 Thread george

I am trying to build a form which can be geberated dynamically
by the user selecting the number of fields up to a max of 10.

just now i am using
if ($fields ==1){

echo "input type=text name=test";
}
 elseif ($fields ==2){

echo "input type=text name=test";
echo "input type=text name=test";
}

 elseif ($fields ==3){
echo "input type=text name=testbr";
echo "input type=text name=testbr";
echo "input type=text name=testbr";
}

there must be  a better way to do this

TIA

george



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] dymanic forms

2001-03-06 Thread Lucas Persona

Hi George!

george wrote:
 I am trying to build a form which can be geberated dynamically
 by the user selecting the number of fields up to a max of 10.
 just now i am using
 if ($fields ==1){
 echo "input type=text name=test";
 }
  elseif ($fields ==2){
 echo "input type=text name=test";
 echo "input type=text name=test";

You could use a 'for' structure to do that...like:
for ($i=0; $i  $fields; $i++)
{
  echo "input type=text name=test[" . $i . "]";
}

  The 'echo' line is different from yours so u can get each text value
after the POST action.

See you,
-- 
Lucas Persona

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] no-resubmit on reload/refresh

2001-03-06 Thread Bruin, Bolke de


I have a form which is submitted by a POST action.

After submitting, the same page (updated though) returns
with the form. (It's a messageboard)

Now when someone refreshes/reloads the page they get the
question if they want to resubmit the form.
I don't want that. You get double posts this way.

I know it is possible to check the input for any duplicates,
but for example this guestbook http://pub.alxnet.com/guestbook?id=120611

(hope the id works) does it differently and your browser does
NOT if you wnat to resubmit, it just doesn't do it.

Anyone knows how this works (HTTP header maybe?)

cheerz
Bolke



RE: [PHP] no-resubmit on reload/refresh

2001-03-06 Thread Jon Haworth

Javascript? (I know it's generally horrible, but it's good for this sort of
thing)

Stick this in your head.../head:

  script language="JavaScript" type="text/javascript"!--Begin
  var submitcount=0;
  function jsCheck() {
  if (submitcount == 0) {
 submitcount++;
 return true;
  } else {
 alert("This request has already been submitted, please wait
while it is processed.");
 return false;
  }
  }
  //End--/script

And call it from your form like this:

form name="myform" action="whatever" method="post" onSubmit="return
jsCheck()"

Voila.

HTH
Jon



-Original Message-
From: Bruin, Bolke de [mailto:[EMAIL PROTECTED]]
Sent: 06 March 2001 12:53
To: [EMAIL PROTECTED]
Subject: [PHP] no-resubmit on reload/refresh



I have a form which is submitted by a POST action.

After submitting, the same page (updated though) returns
with the form. (It's a messageboard)

Now when someone refreshes/reloads the page they get the
question if they want to resubmit the form.
I don't want that. You get double posts this way.

I know it is possible to check the input for any duplicates,
but for example this guestbook http://pub.alxnet.com/guestbook?id=120611

(hope the id works) does it differently and your browser does
NOT if you wnat to resubmit, it just doesn't do it.

Anyone knows how this works (HTTP header maybe?)

cheerz
Bolke


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or
confidentiality'

**

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ?param=value#anchorname

2001-03-06 Thread Matthias Krehl

I found this one. Perhaps it's interesting for someone. Maybe it's even a
bug. Or maybe i ignored some specifications. However:

This query:

foo-script.php?param=value#anchorname

will lead to 'value#anchorname' for $HTTP_GET_VARS['param']

Better is this one:

foo-script.php?param=value#anchorname

which will lead to 'value' for $HTTP_GET_VARS['param']

bye Matthias


Matthias Krehl
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Get text between a href= /a

2001-03-06 Thread Christian Reiniger

On Monday 05 March 2001 23:09, you wrote:
 I need some help with a program, I need to get every
 instance of text between a href =”” GET TEXT HERE
 /a and save the results in a variable. Does anyone
 have some example code of how to do it along with how
 to put the results into just one variable?

Hmm, try
preg_match_all ('/a\s+href[^]+([^]+)\/a/', $Subject, $Matches);

$Matches [0] [1],
$Matches [1] [1],
$Matches [2] [1]
etc

will contain the text afterwards.


-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Pretty cool, the kind of power information technology puts in our hands
these days.

- Securityfocus on probing 3600 hosts for known problems in 3 weeks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




AW: [PHP] ?param=value#anchorname

2001-03-06 Thread Matthias Krehl

ok, what i wanted to do was:

1. submit a variable ('param') to the following page

and independently

2. on the following page jump to an anchor ('anchorname')

of course, if you want to submit the variable: 'value#anchorname' to the
following page the first approach ist the one and only

bye Matthias


Matthias Krehl
[EMAIL PROTECTED]


 -Ursprngliche Nachricht-
 Von: Jon Haworth [mailto:[EMAIL PROTECTED]]
 Gesendet: Dienstag, 6. Mrz 2001 14:17
 An: 'Matthias Krehl'
 Betreff: RE: [PHP] ?param=value#anchorname


 But if you're trying to pass an anchor as part of a hyperlink which is
 itself the contents of a variable, you DEFINITELY want to use the first,
 right?

 I can't see when you'd need the second. What are you using it for? (What
 happens to "#anchorname"?)

 Cheers
 Jon

 -Original Message-
 From: Matthias Krehl [mailto:[EMAIL PROTECTED]]
 Sent: 06 March 2001 13:14
 To: [EMAIL PROTECTED]
 Subject: [PHP] ?param=value#anchorname


 I found this one. Perhaps it's interesting for someone. Maybe it's even a
 bug. Or maybe i ignored some specifications. However:

 This query:

 foo-script.php?param=value#anchorname

 will lead to 'value#anchorname' for $HTTP_GET_VARS['param']

 Better is this one:

 foo-script.php?param=value#anchorname

 which will lead to 'value' for $HTTP_GET_VARS['param']

 bye Matthias


 Matthias Krehl
 [EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



 **
 'The information included in this Email is of a confidential
 nature and is
 intended only for the addressee. If you are not the intended addressee,
 any disclosure, copying or distribution by you is prohibited and may be
 unlawful. Disclosure to any party other than the addressee, whether
 inadvertent or otherwise is not intended to waive privilege or
 confidentiality'

 **


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] speeding a site with lots of includes

2001-03-06 Thread Christian Reiniger

On Monday 05 March 2001 23:20, you wrote:
 An app I am currently developing has grown a lot. It currently
 handles aproximately 12 includes, more or less 13 thousand lines
 of code.

 By doing some benchmarks, i realized that the bottleneck is the
 include() payload.

Are you sure it's the include() ? Or is it the parsing time for the 13k 
LOC (much more likely)?

 How can I optimize a program like this one ?

Have a look at zend optimizer or apc cache 
(apc.communityconnect.(com|org|net))

Another way would be to clean up your code (if you haven't already done 
this). Often this can drastically cut down on code size (a cleanup I did 
recently roughly halved code size) while improving clarity and 
maintainability

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Pretty cool, the kind of power information technology puts in our hands
these days.

- Securityfocus on probing 3600 hosts for known problems in 3 weeks


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] no-resubmit on reload/refresh

2001-03-06 Thread Bruin, Bolke de

That's not really what I want

http://pub.alxnet.com/guestbook?id=200

(this one works)

does it without. 

On my page I am using a child window to reload the parent window
, so your solution can't be used unfortunately.

Bolke

-Oorspronkelijk bericht-
Van: Jon Haworth [mailto:[EMAIL PROTECTED]]
Verzonden: Tuesday, March 06, 2001 2:01 PM
Aan: Bruin, Bolke de; [EMAIL PROTECTED]
Onderwerp: RE: [PHP] no-resubmit on reload/refresh


Javascript? (I know it's generally horrible, but it's good for this sort of
thing)

Stick this in your head.../head:

  script language="JavaScript" type="text/javascript"!--Begin
  var submitcount=0;
  function jsCheck() {
  if (submitcount == 0) {
 submitcount++;
 return true;
  } else {
 alert("This request has already been submitted, please wait
while it is processed.");
 return false;
  }
  }
  //End--/script

And call it from your form like this:

form name="myform" action="whatever" method="post" onSubmit="return
jsCheck()"

Voila.

HTH
Jon



-Original Message-
From: Bruin, Bolke de [mailto:[EMAIL PROTECTED]]
Sent: 06 March 2001 12:53
To: [EMAIL PROTECTED]
Subject: [PHP] no-resubmit on reload/refresh



I have a form which is submitted by a POST action.

After submitting, the same page (updated though) returns
with the form. (It's a messageboard)

Now when someone refreshes/reloads the page they get the
question if they want to resubmit the form.
I don't want that. You get double posts this way.

I know it is possible to check the input for any duplicates,
but for example this guestbook http://pub.alxnet.com/guestbook?id=120611

(hope the id works) does it differently and your browser does
NOT if you wnat to resubmit, it just doesn't do it.

Anyone knows how this works (HTTP header maybe?)

cheerz
Bolke


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or
confidentiality'

**

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] dymanic forms

2001-03-06 Thread george

 Thanks,

   works a treat

george



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sites Using PHP - For a presentation

2001-03-06 Thread Christian Reiniger

On Monday 05 March 2001 23:44, you wrote:

 I am looking for some big name sites using PHP.
 I will be doing a presentation next month and would like to show a list
 of sites that are using PHP.

Well, sourceforge.net is pretty big (and complex).

http://www.securityspace.com/s_survey/data/index.html
might also provide some info, and with 
http://uptime.netcraft.com/up/graph you can look at some popular sites 
yourself

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Pretty cool, the kind of power information technology puts in our hands
these days.

- Securityfocus on probing 3600 hosts for known problems in 3 weeks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] no-resubmit on reload/refresh

2001-03-06 Thread Jørg V . Bryne

Well, I've had the same problems with an "Send SMS" routine and it caused
the message to get sent twice or more if the user refreshed.

I fixed this by adding the following logic:

If there are post-data, put this into a session variable (an array of
key=val) and reload the page.
if there are no post-data put the session-variable array into the current
scope again using a foreach loop, and then delete the session variable, so
data won't be processed again.  Works like a charm, and doesn't include
javascript. Don't know if it's excactly right for you, so you might have to
modify it a bit.

(From memory only, might be typo's:)

snip
?
session_start();
session_register( pre_posted );

if (count( $HTTP_POST_VARS)=1) {
 foreach( $HTTP_POST_VARS as $k=$v ) {
  $pre_posted[$k] = $v;
 }
 header( "Location: $PHP_SELF" );
 exit;
} elseif ( is_array( $pre_posted )) {
 foreach( $pre_posted as $k=$v ) {
$$k = $v;
 }
 unset( $pre_posted );
}

echo "bYou posted: $Test/bbrWant to refresh?";
?

form method=post
input name='Test' value='test' size=20
input type=submit
/form

/snip
- Original Message -
From: "Bruin, Bolke de" [EMAIL PROTECTED]
To: "'Jon Haworth'" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, March 06, 2001 2:29 PM
Subject: RE: [PHP] no-resubmit on reload/refresh


 That's not really what I want

 http://pub.alxnet.com/guestbook?id=200

 (this one works)

 does it without.

 On my page I am using a child window to reload the parent window
 , so your solution can't be used unfortunately.

 Bolke

 -Oorspronkelijk bericht-
 Van: Jon Haworth [mailto:[EMAIL PROTECTED]]
 Verzonden: Tuesday, March 06, 2001 2:01 PM
 Aan: Bruin, Bolke de; [EMAIL PROTECTED]
 Onderwerp: RE: [PHP] no-resubmit on reload/refresh


 Javascript? (I know it's generally horrible, but it's good for this sort
of
 thing)

 Stick this in your head.../head:

   script language="JavaScript" type="text/javascript"!--Begin
   var submitcount=0;
   function jsCheck() {
   if (submitcount == 0) {
  submitcount++;
  return true;
   } else {
  alert("This request has already been submitted, please wait
 while it is processed.");
  return false;
   }
   }
   //End--/script

 And call it from your form like this:

 form name="myform" action="whatever" method="post" onSubmit="return
 jsCheck()"

 Voila.

 HTH
 Jon



 -Original Message-
 From: Bruin, Bolke de [mailto:[EMAIL PROTECTED]]
 Sent: 06 March 2001 12:53
 To: [EMAIL PROTECTED]
 Subject: [PHP] no-resubmit on reload/refresh



 I have a form which is submitted by a POST action.

 After submitting, the same page (updated though) returns
 with the form. (It's a messageboard)

 Now when someone refreshes/reloads the page they get the
 question if they want to resubmit the form.
 I don't want that. You get double posts this way.

 I know it is possible to check the input for any duplicates,
 but for example this guestbook http://pub.alxnet.com/guestbook?id=120611

 (hope the id works) does it differently and your browser does
 NOT if you wnat to resubmit, it just doesn't do it.

 Anyone knows how this works (HTTP header maybe?)

 cheerz
 Bolke


 **
 'The information included in this Email is of a confidential nature and is
 intended only for the addressee. If you are not the intended addressee,
 any disclosure, copying or distribution by you is prohibited and may be
 unlawful. Disclosure to any party other than the addressee, whether
 inadvertent or otherwise is not intended to waive privilege or
 confidentiality'

 **

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /pear/Cache/Container file.php

2001-03-06 Thread Christian Stocker

chregu  Tue Mar  6 05:25:45 2001 EDT

  Modified files:  
/php4/pear/Cache/Container  file.php 
  Log:
  deleteDir deletes now the created "group"-Directories as well.
  Hope it works on windows as well...
  
  
Index: php4/pear/Cache/Container/file.php
diff -u php4/pear/Cache/Container/file.php:1.4 php4/pear/Cache/Container/file.php:1.5
--- php4/pear/Cache/Container/file.php:1.4  Sat Mar  3 11:02:54 2001
+++ php4/pear/Cache/Container/file.php  Tue Mar  6 05:25:43 2001
@@ -16,7 +16,7 @@
 // |  Sebastian Bergmann [EMAIL PROTECTED]   |
 // +--+
 //
-// $Id: file.php,v 1.4 2001/03/03 19:02:54 uw Exp $
+// $Id: file.php,v 1.5 2001/03/06 13:25:43 chregu Exp $
 
 require_once 'Cache/Container.php';
 
@@ -24,7 +24,7 @@
 * Stores cache contents in a file.
 *
 * @author   Ulf Wendel  [EMAIL PROTECTED]
-* @version  $Id: file.php,v 1.4 2001/03/03 19:02:54 uw Exp $
+* @version  $Id: file.php,v 1.5 2001/03/06 13:25:43 chregu Exp $
 */
 class Cache_Container_file extends Cache_Container {
 
@@ -53,35 +53,35 @@
 * @var  string
 */
 var $filename_prefix = "";
-
+
 /**
 * Creates the cache directory if neccessary
 * 
 * @paramarray   Config options: ["cache_dir" = ..., "filename_prefix" = ...]
 */
 function Cache_Container_file($options = "") {
-
+
 if (is_array($options))
 $this-setOptions($options, array("cache_dir", "filename_prefix"));
-
+
 clearstatcache();
 
 if (!file_exists($this-cache_dir) || !is_dir($this-cache_dir))
 mkdir($this-cache_dir, 0755);
-
+
 } // end func contructor
 
 
 function fetch($id, $group) {
-
+
 $file = $this-getFilename($id, $group);
-if (!file_exists($file)) 
+if (!file_exists($file))
 return array(NULL, NULL, NULL);
-   
+
 // retrive the content
 if (!($fh = @fopen($file, "rb")))
 return new CacheError("Can't access cache file '$file'. Check access 
rights and path.", __FILE__, __LINE__);
-
+
 // file format:
 // 1st line: expiration date
 // 2nd line: user data
@@ -102,13 +102,13 @@
 * otherwise it will break the filestructure.
 */
 function save($id, $cachedata, $expires, $group, $userdata) {
-
+
 $this-flushPreload($id, $group);
-
+
 $file = $this-getFilename($id, $group);
 if (!($fh = @fopen($file, "wb")))
 return new CacheError("Can't access '$file' to store cache data. Check 
access rights and path.", __FILE__, __LINE__);
-
+
 // file format:
 // 1st line: expiration date
 // 2nd line: user data
@@ -123,28 +123,28 @@
 // I'm not sure if we need this
 touch($file);
 
-return true;
+return true;
 } // end func save
 
 function delete($id, $group) {
-
+
 $this-flushPreload($id, $group);
-
+
 $file = $this-getFilename($id, $group);
 if (file_exists($file)) {
-   
+
 $ok = unlink($file);
 clearstatcache();
 
 return $ok;
 }
-
-return false;
+
+return false;
 } // end func delete
 
 
 function flush($group) {
-
+
 $this-flushPreload();
 $dir = ($group) ? $this-cache_dir . $group . "/" : $this-cache_dir;
 
@@ -153,8 +153,8 @@
 
 return $num_removed;
 } // end func flush
-
 
+
 function idExists($id, $group) {
 
 return file_exists($this-getFilename($id, $group));
@@ -176,24 +176,24 @@
 *   recursive function call!
 */
 function garbageCollection($dir = "") {
-
-$this-flushPreload();  
+
+$this-flushPreload();
 
 if (!$dir)
 $dir = $this-cache_dir;
 
 if (!($dh = opendir($dir)))
 return new CacheError("Can't access cache directory '$dir'. Check 
permissions and path.", __FILE__, __LINE__);
-
+
 while ($file = readdir($dh)) {
 if ("." == $file || ".." == $file)
 continue;
-
+
 $file = $dir . $file;
 if (is_dir($file))
 $this-garbageCollection($file . "/");
-
-// skip trouble makers but inform the user
+
+// skip trouble makers but inform the user
 if (!($fh = @fopen($file, "rb"))) {
 new CacheError("Can't access cache file '$file', skipping it. Check 
permissions and path.", __FILE__, __LINE__);
 continue;
@@ -205,8 +205,8 @@
 

[PHP] here's a tricky one (well for me)

2001-03-06 Thread george

 I am trying to let a user build a form, so
on the first page they decide on the number of fields , when they submit
that number it names them field1 2 3 etc,now I then want them to name the
fields but the problem is because the number of fields varies how do I pass
all the variables onto the next page if one time it could be 2 next time it
could be 10

TIA

George



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP mySQL primer?

2001-03-06 Thread John Vanderbeck

Hello all,

I'm lookign at having to do a user registration setup, and I would imagine
the best way to do that would be a databse.  The server has mySQL setup on
it, but I have no experience with it.

Can anyone point me to some good basic primers?  Soemthing that just creates
a db that holds user names and passwords?

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] here's a tricky one (well for me)

2001-03-06 Thread Boget, Chris

  I am trying to let a user build a form, so on the first page they 
 decide on the number of fields , when they submit that number 
 it names them field1 2 3 etc,now I then want them to name the
 fields but the problem is because the number of fields varies how 
 do I pass all the variables onto the next page if one time it could 
 be 2 next time it could be 10

On the first page, the field name that specifies the number of fields
is "number_of_fields".
On the second page that takes that value and works with it, you can
do something like this:

for( $i = 1; $i = $number_of_fields; $i++ ) {
  $fieldName = "field$i";
  echo "input type=text name=\"$fieldName\"
value=\"${$fieldName}\"br\n";

}echo "input type=hidden name=\"number_of_fields\"
value=\"$number_of_fields\"\n";

When processing your form to get the values, do essentially the same
thing:

for( $i = 1; $i = $number_of_fields; $i++ ) {
  $fieldName = "field$i";
  echo "The value entered for field $i is ${$fieldName}br\n";

}

Through all your forms, just work with "$number_of_fields".

Chris



Re: [PHP] bug tracking software

2001-03-06 Thread Rick St Jean

Many people recommend bugzilla from netscape.

Rick

At 10:49 AM 3/6/01 +, Peter Van Dijck wrote:
I've looked into bug tracking software at hotscripts: mantis
http://mantisbt.sourceforge.net/mantis/main_page.php3
is promising but has too many bugs itself still (I fixed three in the past 
20 minutes of playing with it, it's still in beta, but I can't afford the 
estimated x days of debugging it right now).
I need something stable to start working with straight away. And 
preferably something easy to use.
Which one should I use?
Peter
~~
http://liga1.com: building multiple language/culture websites


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Rounding to strange results

2001-03-06 Thread Martin E. Koss

Hi,
I use a product database for 2 sites, one of which adds sales tax and rounds
to the nearest .10 and on the other site there is no tax and also no
rounding.

I am unable to figure out why a price of 1000.00 is being displayed as 1.00
and any price over 1000 does the same thing. 100.00 works fine, as does all
other prices, this is the same with and without rounding.

Anything I should look for to solve this problem?

Martin.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] dymanic forms

2001-03-06 Thread Rick St Jean

Use a for loop with

?
 for ($i=1; $i = $fields ;$i++)
{
 print("input type=text name=test");
}

?

Or you can use a while loop with a counter... same thing.


At 12:17 PM 3/6/01 +, you wrote:
I am trying to build a form which can be geberated dynamically
by the user selecting the number of fields up to a max of 10.

just now i am using
if ($fields ==1){

echo "input type=text name=test";
}
  elseif ($fields ==2){

echo "input type=text name=test";
echo "input type=text name=test";
}

  elseif ($fields ==3){
echo "input type=text name=testbr";
echo "input type=text name=testbr";
echo "input type=text name=testbr";
}

there must be  a better way to do this

TIA

george



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /sapi/apache mod_php4.c

2001-03-06 Thread Zeev Suraski

zeevTue Mar  6 07:00:08 2001 EDT

  Modified files:  
/php4/sapi/apache   mod_php4.c 
  Log:
  Avoid writing to error_log in case of aborted connections.
  
  
Index: php4/sapi/apache/mod_php4.c
diff -u php4/sapi/apache/mod_php4.c:1.89 php4/sapi/apache/mod_php4.c:1.90
--- php4/sapi/apache/mod_php4.c:1.89Sun Feb 25 22:07:35 2001
+++ php4/sapi/apache/mod_php4.c Tue Mar  6 07:00:08 2001
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: mod_php4.c,v 1.89 2001/02/26 06:07:35 andi Exp $ */
+/* $Id: mod_php4.c,v 1.90 2001/03/06 15:00:08 zeev Exp $ */
 
 #define NO_REGEX_EXTRA_H
 #ifdef WIN32
@@ -124,10 +124,8 @@

if (SG(server_context)) {
ret = rwrite(str, str_length, (request_rec *) SG(server_context));
-   } else {
-   ret = fwrite(str, 1, str_length, stderr);
}
-   if(ret != str_length) {
+   if (ret != str_length) {
php_handle_aborted_connection();
}
return ret;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] blank spaces???

2001-03-06 Thread Chris Lee

code snipits allways help :) but a guess would be that your not putting the var in ''

echo "
select name='somename'
option value='$value'$value
/select
";

please email if this is not the problem.

-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]


""Miguel Loureiro"" [EMAIL PROTECTED] wrote in message 
001d01c0a637$51eaac40$[EMAIL PROTECTED]">news:001d01c0a637$51eaac40$[EMAIL PROTECTED]...
Hello all,
is there any solution when working with variables that have blank spaces, because when 
read the variavel to a select, it only appears the first word (e.g. having: "aaa bbb 
ccc", it only appears "aaa").
T.Y.All
Best Regards
Miguel  Loureiro [EMAIL PROTECTED] 




Re: [PHP] Not Allowing REload or REfresh with this script?

2001-03-06 Thread Chris Lee

try this, your code example has some design flaws.

?php

 include_once('session.egn');

 if (isset($HTTP_POST_VARS['submit']))
  if ( isset($HTTP_SESSION_VARS['done']) AND $HTTP_SESSION_VARS['done'] == $PHP_SELF)
  {
   echo "a br\n";
   echo "You can only press submit once br\n";
   exit();
  } else
  {
   echo "b br\n";
   $done = $PHP_SELF;
   session_register('done');
  }

 // do some code

 echo "
 form method='post' action='$PHP_SELF'
 input type='hidden' name='submit' value ='1'

 input type='submit'
 /form
 ";

?

im not exactly sure on what

if (issset($userfile))
{
global $userfile;
unset($userfile);
} else
{
// do some code
}

this is supposed todo, what is the global there for? what does it do? please explain.


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]


"Dhaval Desai" [EMAIL PROTECTED] wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi!


Well I need help with something. I have a form which
has a ction to a file called actio.php
Now When I hit the submit button. It goes to the file
and it performs a certain action as seen below:

action.php: is as follows:

?php

if(isset($userfile))
{
echo "$userfile is set";
global $userfile;
unset ($userfile);
}
else
{
echo "Sorry buddy , Userfile is not set";
}


?


My main intentyion is to unset the variable so that
When the page is REFRESHED or RELOADED. It should
execute the else code block.


I am trying to implement it on one of my websites
where users can not refresh a particular a page.


Thank You
Dhaval Desai




__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Rounding to strange results

2001-03-06 Thread Johnson, Kirk

Is there a comma in one thousand, e.g., 1,000.00? round() will truncate
everything to the right of a comma.

Kirk

-Original Message-
From: Martin E. Koss [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 06, 2001 7:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Rounding to strange results


Hi,
I use a product database for 2 sites, one of which adds sales tax and rounds
to the nearest .10 and on the other site there is no tax and also no
rounding.

I am unable to figure out why a price of 1000.00 is being displayed as 1.00
and any price over 1000 does the same thing. 100.00 works fine, as does all
other prices, this is the same with and without rounding.

Anything I should look for to solve this problem?

Martin.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /sapi/isapi php4isapi.c

2001-03-06 Thread Ben Mansell

joostersTue Mar  6 07:09:15 2001 EDT

  Modified files:  
/php4/sapi/isapiphp4isapi.c 
  Log:
  Thread hashtable was being initialized with a size of 1! Changed to 128 as
  a more sensible number.
  # Also could change the 'expected resources' parameter from 1, but I
  # haven't tested that bit yet
  --
  
  
Index: php4/sapi/isapi/php4isapi.c
diff -u php4/sapi/isapi/php4isapi.c:1.68 php4/sapi/isapi/php4isapi.c:1.69
--- php4/sapi/isapi/php4isapi.c:1.68Tue Feb 27 05:29:21 2001
+++ php4/sapi/isapi/php4isapi.c Tue Mar  6 07:09:15 2001
@@ -770,7 +770,11 @@
 {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
-   tsrm_startup(1, 1, TSRM_ERROR_LEVEL_CORE, "C:\\TSRM.log");
+#ifdef WITH_ZEUS
+   tsrm_startup(128, 1, TSRM_ERROR_LEVEL_CORE, "TSRM.log");
+#else
+   tsrm_startup(128, 1, TSRM_ERROR_LEVEL_CORE, "C:\\TSRM.log");
+#endif
sapi_startup(isapi_sapi_module);
if (isapi_sapi_module.startup) {
isapi_sapi_module.startup(sapi_module);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Rounding to strange results

2001-03-06 Thread Rick St Jean

You can write  a function that get the %(mod) of 1000 then subtracts it 
from the number.

Rick

At 08:43 AM 3/6/01 -0700, Johnson, Kirk wrote:
Is there a comma in one thousand, e.g., 1,000.00? round() will truncate
everything to the right of a comma.

Kirk

-Original Message-
From: Martin E. Koss [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 06, 2001 7:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Rounding to strange results


Hi,
I use a product database for 2 sites, one of which adds sales tax and rounds
to the nearest .10 and on the other site there is no tax and also no
rounding.

I am unable to figure out why a price of 1000.00 is being displayed as 1.00
and any price over 1000 does the same thing. 100.00 works fine, as does all
other prices, this is the same with and without rounding.

Anything I should look for to solve this problem?

Martin.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How to tell if client has cookies turned off?

2001-03-06 Thread kevin1

How can I tell reliably if someone has cookies turned off?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /sapi/apache mod_php4.c

2001-03-06 Thread Zeev Suraski

zeevTue Mar  6 07:10:53 2001 EDT

  Modified files:  
/php4/sapi/apache   mod_php4.c 
  Log:
  Avoid using ret uninitialized
  
  
Index: php4/sapi/apache/mod_php4.c
diff -u php4/sapi/apache/mod_php4.c:1.90 php4/sapi/apache/mod_php4.c:1.91
--- php4/sapi/apache/mod_php4.c:1.90Tue Mar  6 07:00:08 2001
+++ php4/sapi/apache/mod_php4.c Tue Mar  6 07:10:53 2001
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: mod_php4.c,v 1.90 2001/03/06 15:00:08 zeev Exp $ */
+/* $Id: mod_php4.c,v 1.91 2001/03/06 15:10:53 zeev Exp $ */
 
 #define NO_REGEX_EXTRA_H
 #ifdef WIN32
@@ -119,7 +119,7 @@
 
 static int sapi_apache_ub_write(const char *str, uint str_length)
 {
-   int ret;
+   int ret=0;
SLS_FETCH();

if (SG(server_context)) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP LDAP SSL

2001-03-06 Thread Matthieu Le Corre

COOLL it work
oki guys 
to work : apply the patch openldap source 
recompil  openldap
don't forget to copy librairie from /usr/local/lib to /usr/lib ! 
recompil  php
recompil apache 

and it works !!!

it's beeen hard but it works !!!

thank for all

Le Mardi  6 Mars 2001 12:51, vous avez crit :
 There's been some discussion on the OpenLDAP lists as well, and there
 seems to be a fix around. See
 http://www.openldap.org/its/index.cgi/Software%20Bugs?id=889

 Stig

-- 
__

Matthieu LE CORRE
   SERVICE INFORMATIQUE
 Ecole Polytechnique de l'Universit de Nantes 
(EPUN)
Site de la Chantrerie
 Rue Christian Pauc
BP 50609
   44306 Nantes Cedex 3
02 40 68 32 23
__

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /pear Cache.php /pear/Cache Container.php Graphics.php Output.php /pear/Cache/Container db.php file.php phplib.php

2001-03-06 Thread Sebastian Bergmann

sbergmann   Tue Mar  6 07:27:30 2001 EDT

  Modified files:  
/php4/pear  Cache.php 
/php4/pear/CacheContainer.php Graphics.php Output.php 
/php4/pear/Cache/Container  db.php file.php phplib.php 
  Log:
  Whitespace only.
  

Index: php4/pear/Cache.php
diff -u php4/pear/Cache.php:1.4 php4/pear/Cache.php:1.5
--- php4/pear/Cache.php:1.4 Sun Mar  4 06:26:58 2001
+++ php4/pear/Cache.php Tue Mar  6 07:27:30 2001
@@ -16,7 +16,7 @@
 // |  Sebastian Bergmann [EMAIL PROTECTED]   |
 // +--+
 //
-// $Id: Cache.php,v 1.4 2001/03/04 14:26:58 mj Exp $
+// $Id: Cache.php,v 1.5 2001/03/06 15:27:30 sbergmann Exp $
 
 /**
 * Cache is a base class for cache implementations.
@@ -24,7 +24,7 @@
 * TODO: Simple usage example goes here.
 *
 * @author   Ulf Wendel [EMAIL PROTECTED]
-* @version  $Id: Cache.php,v 1.4 2001/03/04 14:26:58 mj Exp $
+* @version  $Id: Cache.php,v 1.5 2001/03/06 15:27:30 sbergmann Exp $
 * @package  Cache
 * @access   public 
 */
@@ -63,7 +63,7 @@
 * @access   public
 */
 var $gc_probability = 1;
-
+
 /**
 * Storage container object.
 * 
@@ -91,7 +91,7 @@
 $this-garbageCollection();
 
 }
-
+
 /**
 * Returns the requested dataset it if exists and is not expired
 *  
@@ -110,7 +110,6 @@
 return NULL;
 } // end func get
 
-
 /**
 * Stores the given data in the cache.
 * 
@@ -127,8 +126,7 @@
 
 return $this-container-save($id, $data, $expires, $group, "");
 } // end func save
-
-
+
 /**
 * Stores a dataset without additional userdefined data.
 * 
@@ -149,7 +147,6 @@
 return $this-container-save($id, $cachedata, $expires, $group, $userdata);
 } // end func extSave
 
-
 /**
 * Loads the given ID from the cache.
 * 
@@ -164,8 +161,7 @@
 
 return $this-container-load($id, $group);
 } // end func load
-
-
+
 /**
 * Returns the userdata field of a cached data set.
 *
@@ -181,8 +177,7 @@
 
 return $this-container-getUserdata($id, $group);
 } // end func getUserdata
-
-
+
 /**
 * Removes the specified dataset from the cache.
 * 
@@ -197,8 +192,7 @@
 
 return $this-container-delete($id, $group);
 } // end func delete
-
-
+
 /**
 * Flushes the cache - removes all data from it
 * 
@@ -211,8 +205,7 @@
 
 return $this-container-flush($group);
 } // end func flush
-
-
+
 /**
 * Checks if a dataset exists.
 * 
@@ -229,8 +222,7 @@
 
 return $this-container-isCached($id, $group);
 } // end func isCached
-
-
+
 /**
 * Checks if a dataset is expired
 * 
@@ -251,7 +243,7 @@
 
 return $this-container-isExpired($id, $group, $max_age);
 } // end func isExpired
-
+
 /**
 * Generates a "unique" ID for the given value
 * 
@@ -286,9 +278,6 @@
 $this-container-garbageCollection();
 $last_run = time();
 }
-
 } // end func garbageCollection
-
-
 } // end class cache 
 ?
Index: php4/pear/Cache/Container.php
diff -u php4/pear/Cache/Container.php:1.5 php4/pear/Cache/Container.php:1.6
--- php4/pear/Cache/Container.php:1.5   Tue Mar  6 03:32:10 2001
+++ php4/pear/Cache/Container.php   Tue Mar  6 07:27:30 2001
@@ -1,5 +1,4 @@
 ?php
-
 // +--+
 // | PHP version 4.0  |
 // +--+
@@ -17,7 +16,7 @@
 // |  Sebastian Bergmann [EMAIL PROTECTED]   |
 // +--+
 //
-// $Id: Container.php,v 1.5 2001/03/06 11:32:10 chregu Exp $
+// $Id: Container.php,v 1.6 2001/03/06 15:27:30 sbergmann Exp $
 
 /**
 * Common base class of all cache storage container.
@@ -37,7 +36,7 @@
 * not recommended!
 * 
 * @author   Ulf Wendel [EMAIL PROTECTED]
-* @version  $Id: Container.php,v 1.5 2001/03/06 11:32:10 chregu Exp $
+* @version  $Id: Container.php,v 1.6 2001/03/06 15:27:30 sbergmann Exp $
 * @package  Cache
 * @access   public
 * @abstract
@@ -52,63 +51,56 @@
 * @var  boolean
 */
 var $preload = true;
-
+
 /**
 * ID of a preloaded dataset
 *
 * @var  string
 */
 var $id = "";
-
-
+
 /**
 * Cache group of a preloaded dataset
 *
 * @var  string
 */
 var $group = "";
-
-
+
 /**
 * Expiration timestamp of a preloaded dataset.
 * 
 * @var  integer 0 means never, endless
 */
 var $expires = 0;
-
-
+
 /**
 * Value of a preloaded dataset.
 * 
 * @var  string
 */
 

Re: [PHP] PHP mySQL primer?

2001-03-06 Thread Adrian Murphy

first i'd set up phpmyadmin.
http://www.phpwizard.net/projects/phpMyAdmin/
it' great and really easy to use for you mysqldb.
once you've done that.there's a useful tutorial on webmonkey for what u
need.
http://hotwired.lycos.com/webmonkey/00/05/index2a.html?tw=programming

g'luck

- Original Message -
From: John Vanderbeck [EMAIL PROTECTED]
To: PHP User Group [EMAIL PROTECTED]
Sent: Tuesday, March 06, 2001 2:10 PM
Subject: [PHP] PHP  mySQL primer?


 Hello all,

 I'm lookign at having to do a user registration setup, and I would imagine
 the best way to do that would be a databse.  The server has mySQL setup on
 it, but I have no experience with it.

 Can anyone point me to some good basic primers?  Soemthing that just
creates
 a db that holds user names and passwords?

 - John Vanderbeck
 - Admin, GameDesign


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] using php generate html file?

2001-03-06 Thread Fai

Does any body know how to use php to generate html file? That is when a user
input for a webpage title, webpage background color or image in a php page,
and then we can generate a html file which contains the properties of user's
input such as background color.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Auto Prepend/Append

2001-03-06 Thread Boget, Chris

Based on what I read, I believe the answer to this question
is "No", but am hoping for confirmation because someone
might have been able to find a way to make this work.

Is it possible to use the auto prepend/append directives to
prepend/append particular files only to files with a particular
extension?

Say I have:

prepend.php
append.php

and I want these files to only be prepended/appended to ".HTML"
files and no other file type.

Is this possible?

Again, I think the answer is "no", but would like to see if anyone
might have done something like this...

Chris



[PHP-CVS] cvs: php4 /ext/standard output.c php_output.h

2001-03-06 Thread Zeev Suraski

zeevTue Mar  6 07:54:49 2001 EDT

  Modified files:  
/php4/ext/standard  output.c php_output.h 
  Log:
  Initial work on internal output handlers - should be much quicker
  
  
Index: php4/ext/standard/output.c
diff -u php4/ext/standard/output.c:1.43 php4/ext/standard/output.c:1.44
--- php4/ext/standard/output.c:1.43 Sun Mar  4 07:46:13 2001
+++ php4/ext/standard/output.c  Tue Mar  6 07:54:49 2001
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.43 2001/03/04 15:46:13 zeev Exp $ */
+/* $Id: output.c,v 1.44 2001/03/06 15:54:49 zeev Exp $ */
 
 #include "php.h"
 #include "ext/standard/head.h"
@@ -123,14 +123,29 @@
int final_buffer_length=0;
zval *alternate_buffer=NULL;
char *to_be_destroyed_buffer;
+   char *internal_output_handler_buffer;
+   int status;
SLS_FETCH();
OLS_FETCH();
 
if (OG(nesting_level)==0) {
return;
}
+   status = 0;
+   if (!OG(active_ob_buffer).status  PHP_OUTPUT_HANDLER_START) {
+   /* our first call */
+   status |= PHP_OUTPUT_HANDLER_START;
+   }
+   if (just_flush) {
+   status |= PHP_OUTPUT_HANDLER_CONT;
+   } else {
+   status |= PHP_OUTPUT_HANDLER_END;
+   }
 
-   if (OG(active_ob_buffer).output_handler) {
+   if (OG(active_ob_buffer).internal_output_handler) {
+   internal_output_handler_buffer = 
+OG(active_ob_buffer).internal_output_handler_buffer;
+   
+OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, 
+OG(active_ob_buffer).text_length, internal_output_handler_buffer, status);
+   } else if (OG(active_ob_buffer).output_handler) {
zval **params[2];
zval *orig_buffer;
zval *z_status;
@@ -144,16 +159,7 @@
 
ALLOC_INIT_ZVAL(z_status);
Z_TYPE_P(z_status) = IS_LONG;
-   Z_LVAL_P(z_status) = 0;
-   if (!OG(active_ob_buffer).status  PHP_OUTPUT_HANDLER_START) {
-   /* our first call */
-   Z_LVAL_P(z_status) |= PHP_OUTPUT_HANDLER_START;
-   }
-   if (just_flush) {
-   Z_LVAL_P(z_status) |= PHP_OUTPUT_HANDLER_CONT;
-   } else {
-   Z_LVAL_P(z_status) |= PHP_OUTPUT_HANDLER_END;
-   }
+   Z_LVAL_P(z_status) = status;
 
params[0] = orig_buffer;
params[1] = z_status;
@@ -218,6 +224,10 @@
OG(active_ob_buffer).status |= PHP_OUTPUT_HANDLER_START;
OG(php_body_write) = php_b_body_write;
}
+   if (OG(active_ob_buffer).internal_output_handler
+(internal_output_handler_buffer != 
+OG(active_ob_buffer).internal_output_handler_buffer)) {
+   efree(internal_output_handler_buffer);
+   }
 }
 
 
@@ -249,6 +259,20 @@
 }
 
 
+PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t 
+internal_output_handler, uint buffer_size)
+{
+   OLS_FETCH();
+
+   if (OG(nesting_level)==0) {
+   return;
+   }
+
+   OG(active_ob_buffer).internal_output_handler = internal_output_handler;
+   OG(active_ob_buffer).internal_output_handler_buffer = (char *) 
+emalloc(buffer_size);
+   OG(active_ob_buffer).internal_output_handler_buffer_size = buffer_size;
+}
+
+
 /*
  * Output buffering - implementation
  */
@@ -285,6 +309,7 @@
OG(active_ob_buffer).output_handler = output_handler;
OG(active_ob_buffer).chunk_size = chunk_size;
OG(active_ob_buffer).status = 0;
+   OG(active_ob_buffer).internal_output_handler = NULL;
 }
 
 
Index: php4/ext/standard/php_output.h
diff -u php4/ext/standard/php_output.h:1.20 php4/ext/standard/php_output.h:1.21
--- php4/ext/standard/php_output.h:1.20 Sat Mar  3 17:45:19 2001
+++ php4/ext/standard/php_output.h  Tue Mar  6 07:54:49 2001
@@ -16,13 +16,15 @@
+--+
 */
 
-/* $Id: php_output.h,v 1.20 2001/03/04 01:45:19 zeev Exp $ */
+/* $Id: php_output.h,v 1.21 2001/03/06 15:54:49 zeev Exp $ */
 
 #ifndef PHP_OUTPUT_H
 #define PHP_OUTPUT_H
 
 #include "php.h"
 
+typedef void (*php_output_handler_func_t)(char *output, uint output_len, char 
+**handled_output, int status);
+
 PHPAPI void php_output_startup(void);
 void php_output_register_constants(void);
 PHPAPI int  php_body_write(const char *str, uint str_length);
@@ -36,6 +38,7 @@
 PHPAPI void php_end_implicit_flush(void);
 PHPAPI char *php_get_output_start_filename(void);
 PHPAPI int php_get_output_start_lineno(void);
+PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t 
+internal_output_handler, uint buffer_size);
 
 PHP_FUNCTION(ob_start);
 PHP_FUNCTION(ob_end_flush);
@@ -51,9 +54,12 @@
uint size;
uint 

RE: [PHP] Netscape problems with PHP

2001-03-06 Thread Johnson, Kirk

Robert, can you (or anyone else) describe further the problem with Netscape
and $PHP_SELF? This sounds a little worrisome to me!

TIA

Kirk

-Original Message-
From: Robert Fischler, Ph.D. ABD [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 5:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Netscape problems with PHP


I've been running into problems when testing PHP scripts on Netscape (when
MSIE works fine).

First problem (SOLVED) was that Netscape does something funny with the
$PHP_SELF environmental variable, so I've learned to circumvent the problem
by just hard-coding the page name instead of relying on the $PHP_SELF trick.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Netscape problems with PHP

2001-03-06 Thread Billy Harvey

$PHP_SELF is set by the web server - not the browser.  Problems in
Netscape are almost always caused by incomplete syntax in the HTML
code you've output.  Netscape is more strict about this than IE.

Billy

  Robert, can you (or anyone else) describe further the problem with Netscape
  and $PHP_SELF? This sounds a little worrisome to me!
  
  TIA
  
  Kirk

  From: Robert Fischler, Ph.D. ABD [mailto:[EMAIL PROTECTED]]
  
  I've been running into problems when testing PHP scripts on Netscape (when
  MSIE works fine).
  
  First problem (SOLVED) was that Netscape does something funny with the
  $PHP_SELF environmental variable, so I've learned to circumvent the problem
  by just hard-coding the page name instead of relying on the $PHP_SELF trick.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] using php generate html file?

2001-03-06 Thread Miles Thompson

Go to www.thickbook.com where Julie Meloni has a tutorial on form with 
custom error messages, or something similar. Anyway, it uses a form, 
buttons, input fields, and generation of custom error messages and 
re-display of the form.

All the principles you need are there.

Miles Thompson

At 12:13 AM 3/7/01 +0800, Fai wrote:
Does any body know how to use php to generate html file? That is when a user
input for a webpage title, webpage background color or image in a php page,
and then we can generate a html file which contains the properties of user's
input such as background color.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to tell if client has cookies turned off?

2001-03-06 Thread Chris Adams

On 6 Mar 2001 07:53:46 -0800, kevin1 [EMAIL PROTECTED] wrote:
How can I tell reliably if someone has cookies turned off?

Set a cookie on your site (perhaps the homepage?) and use code like this:

if (!empty($UserHasCookies)) {
echo 'Whew - you do have cookies';
}

The idea is to set your code to assume that cookie support is disabled unless
it finds a cookie saying otherwise. That way it'll fail safely if someone
either doesn't have a cookie or their browser discards the cookie halfway
through. This may seem silly, but some people get *really* paranoid about
cookies. Combined with the increasingly good cookie management in modern
browsers and just about anything is possible - this is in fact the major
shortcoming to code like the above - it's possible for someone to accept one
cookie and deny another, so just being able to set a cookie once does not mean
that you will be able to set another.

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/standard output.c php_output.h

2001-03-06 Thread Zeev Suraski

zeevTue Mar  6 08:25:14 2001 EDT

  Modified files:  
/php4/ext/standard  output.c php_output.h 
  Log:
  Fix internal output buffering
  
  
Index: php4/ext/standard/output.c
diff -u php4/ext/standard/output.c:1.44 php4/ext/standard/output.c:1.45
--- php4/ext/standard/output.c:1.44 Tue Mar  6 07:54:49 2001
+++ php4/ext/standard/output.c  Tue Mar  6 08:25:14 2001
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.44 2001/03/06 15:54:49 zeev Exp $ */
+/* $Id: output.c,v 1.45 2001/03/06 16:25:14 zeev Exp $ */
 
 #include "php.h"
 #include "ext/standard/head.h"
@@ -195,6 +195,10 @@
to_be_destroyed_buffer = OG(active_ob_buffer).buffer;
 
if (!just_flush) {
+   if (OG(active_ob_buffer).internal_output_handler
+(internal_output_handler_buffer != 
+OG(active_ob_buffer).internal_output_handler_buffer)) {
+   efree(internal_output_handler_buffer);
+   }
if (OG(nesting_level)1) { /* restore previous buffer */
php_ob_buffer *ob_buffer_p;
 
@@ -223,10 +227,6 @@
OG(active_ob_buffer).text_length = 0;
OG(active_ob_buffer).status |= PHP_OUTPUT_HANDLER_START;
OG(php_body_write) = php_b_body_write;
-   }
-   if (OG(active_ob_buffer).internal_output_handler
-(internal_output_handler_buffer != 
OG(active_ob_buffer).internal_output_handler_buffer)) {
-   efree(internal_output_handler_buffer);
}
 }
 
Index: php4/ext/standard/php_output.h
diff -u php4/ext/standard/php_output.h:1.21 php4/ext/standard/php_output.h:1.22
--- php4/ext/standard/php_output.h:1.21 Tue Mar  6 07:54:49 2001
+++ php4/ext/standard/php_output.h  Tue Mar  6 08:25:14 2001
@@ -16,14 +16,14 @@
+--+
 */
 
-/* $Id: php_output.h,v 1.21 2001/03/06 15:54:49 zeev Exp $ */
+/* $Id: php_output.h,v 1.22 2001/03/06 16:25:14 zeev Exp $ */
 
 #ifndef PHP_OUTPUT_H
 #define PHP_OUTPUT_H
 
 #include "php.h"
 
-typedef void (*php_output_handler_func_t)(char *output, uint output_len, char 
**handled_output, int status);
+typedef void (*php_output_handler_func_t)(char *output, uint output_len, char 
+**handled_output, int mode);
 
 PHPAPI void php_output_startup(void);
 void php_output_register_constants(void);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Auto Prepend/Append

2001-03-06 Thread Chris Adams

On 6 Mar 2001 08:13:00 -0800, Boget, Chris [EMAIL PROTECTED] wrote:
Is it possible to use the auto prepend/append directives to
prepend/append particular files only to files with a particular
extension?

I don't believe you can do this directly with PHP but you probably can with
Apache: 
Files *.html
php_value prepend_file "foo.php"
/Files


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Set ODBC Timeout Value

2001-03-06 Thread Karl J. Stubsjoen

Is there a way to set the timeout value for an ODBC connection, lets say for
script trying to query a table which is locked?  Right now, the default
timeout value is well over1 minute, and I don't think I can change it
anywhere else (meaning:  I don't the the Network Administrator is going to
change it).

Thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] time and date function

2001-03-06 Thread Augusto Cesar Castoldi


Can I do any "subtraction" with times and/or dates on php or mysql?

I have two times (HH:MM:SS). And I want to know if there is a diference of
5 min  between the times.

Is there any function that do this? Or I have to program this?

regards,

Augusto Cesar Castoldi


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] here's a tricky one (well for me)

2001-03-06 Thread george


Thanks Chris

george



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] time and date function

2001-03-06 Thread Nick Davies


Just convert the time to unixtime and - 5*60 (5 mins).

On Tue, 6 Mar 2001, Augusto Cesar Castoldi wrote:

 
 Can I do any "subtraction" with times and/or dates on php or mysql?
 
 I have two times (HH:MM:SS). And I want to know if there is a diference of
 5 min  between the times.
 
 Is there any function that do this? Or I have to program this?
 
 regards,
 
 Augusto Cesar Castoldi
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to tell if client has cookies turned off?

2001-03-06 Thread Rick St Jean

Something else to consider is that if someone is kinda smart they can place 
the
variable into the url.  So, if it is important you may want to put a 
checksum or token in there.

Rick

At 08:52 AM 3/6/01 -0800, you wrote:
On 6 Mar 2001 07:53:46 -0800, kevin1 [EMAIL PROTECTED] wrote:
 How can I tell reliably if someone has cookies turned off?

Set a cookie on your site (perhaps the homepage?) and use code like this:

 if (!empty($UserHasCookies)) {
 echo 'Whew - you do have cookies';
 }

The idea is to set your code to assume that cookie support is disabled unless
it finds a cookie saying otherwise. That way it'll fail safely if someone
either doesn't have a cookie or their browser discards the cookie halfway
through. This may seem silly, but some people get *really* paranoid about
cookies. Combined with the increasingly good cookie management in modern
browsers and just about anything is possible - this is in fact the major
shortcoming to code like the above - it's possible for someone to accept one
cookie and deny another, so just being able to set a cookie once does not mean
that you will be able to set another.

Chris

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] GD Image failure on WindowsNT - Unable to Open temporary File

2001-03-06 Thread John E. Haag

Hi All,

First, a general thanks for the helpfulness of everyone in the PHP 
community over the years.

Question:
I am using PHP under Windows for the first time, and I'm getting an 
error message when trying to create images (any kind) using GD. 
The error is:
imagepng: unable to open temporary file in 
bc:\inetpub\wwwroot\jhaag\outreach\image_test.php/b on line 
b11/b

Any ideas? Is this a configuration thing?

Thanks.

   -John Haag

O N E  P O W E R F U L  C L I C K
   All4one Search Machine http://www.all4one.com
All4one Submission Machine http://www.all4one.com/all4submit
  (614) 575-9897


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Set ODBC Timeout Value

2001-03-06 Thread Andrew Hill

Karl,

ODBC drivers typically have a timeout configuration.  Decreasing that may
solve your problem.

Best regards,
Andrew
---
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology
http://www.openlinksw.com


On 3/6/01 12:00 PM, "Karl J. Stubsjoen" [EMAIL PROTECTED] wrote:

 Is there a way to set the timeout value for an ODBC connection, lets say for
 script trying to query a table which is locked?  Right now, the default
 timeout value is well over1 minute, and I don't think I can change it
 anywhere else (meaning:  I don't the the Network Administrator is going to
 change it).
 
 Thanks
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] recursive problem

2001-03-06 Thread Doug Brewer

Hello,

I've got a script that recurses to build a path name (it's more
complex than that). The script uses static variables to do this.

Based on certain conditions, the script might cause a redirect. I find
that when the script redirects, the value of the static variable is
not reset, and I get a doubled path.

So instead of:

$path == path/to/first/script

I get

$path == path/to/first/script/path/to/second/script

I tried resetting $path based upon the whether or not a flag variable
like $is_redirect is in existence, but all other variables seemed to
be reset when the browser redirects...which is what you'd expect,
except these static variables seem to keep their value.

any ideas?

TIA,

Doug Brewer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] time()

2001-03-06 Thread Philip Olson

Hi Augusto,

This is a quick hack (nobody freak out please!) that will hopefully
explain this question and your other recent thread.  Without further ado, 
play with this :

?php

$seconds = array ('day'= 60*60*24,
  'week'   = 60*60*24*7,
  'month'  = 60*60*24*30,
  'year'   = 60*60*24*365,
  'decade' = 60*60*24*365*10);

testTime($seconds);

function testTime($times,$format='l dS of F Y h:i:s A')
{
echo 'Current time() : '. time();

echo 'h3Future Times/h3ul';
foreach ($times as $type = $value) {

echo 'li'. $type . ' : ' . date($format,time()+$value);
}
echo '/ul';

echo 'h3Past Times/h3ul';
foreach ($times as $type = $value) {

echo 'li'. $type . ' : ' . date($format,time()-$value);
}
echo '/ul';
} 

?

If it doesn't make sense, just say so.  But essentially, timestamps are
very cool and important!  Time() returns such a beast.  It returns the
number of seconds since this date, we call it the EPOCH (*bows*)  :

January 1 1970 00:00:00 GMT

Read about it here :

http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=epoch


Regards,

Philip Olson
http://www.cornado.com/

On Tue, 6 Mar 2001, Augusto Cesar Castoldi wrote:

 I'm trying to do a session with MySQL.
 
 how works the funtion time? I didn't undertood the manual.
 
 that number is a date, time, seconds?? What is it?
 
 regards,
 
 Augusto
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to tell if client has cookies turned off?

2001-03-06 Thread Rick St Jean

you can check the HTTP_COOKIE_VARS array after setting a cookie to see
if anything is placed in there.

Rick

At 08:52 AM 3/6/01 -0800, Chris Adams wrote:
On 6 Mar 2001 07:53:46 -0800, kevin1 [EMAIL PROTECTED] wrote:
 How can I tell reliably if someone has cookies turned off?

Set a cookie on your site (perhaps the homepage?) and use code like this:

 if (!empty($UserHasCookies)) {
 echo 'Whew - you do have cookies';
 }

The idea is to set your code to assume that cookie support is disabled unless
it finds a cookie saying otherwise. That way it'll fail safely if someone
either doesn't have a cookie or their browser discards the cookie halfway
through. This may seem silly, but some people get *really* paranoid about
cookies. Combined with the increasingly good cookie management in modern
browsers and just about anything is possible - this is in fact the major
shortcoming to code like the above - it's possible for someone to accept one
cookie and deny another, so just being able to set a cookie once does not mean
that you will be able to set another.

Chris

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/standard output.c php_output.h

2001-03-06 Thread Zeev Suraski

zeevTue Mar  6 08:28:51 2001 EDT

  Modified files:  
/php4/ext/standard  output.c php_output.h 
  Log:
  More internal output buffering fixes
  
  
Index: php4/ext/standard/output.c
diff -u php4/ext/standard/output.c:1.45 php4/ext/standard/output.c:1.46
--- php4/ext/standard/output.c:1.45 Tue Mar  6 08:25:14 2001
+++ php4/ext/standard/output.c  Tue Mar  6 08:28:51 2001
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.45 2001/03/06 16:25:14 zeev Exp $ */
+/* $Id: output.c,v 1.46 2001/03/06 16:28:51 zeev Exp $ */
 
 #include "php.h"
 #include "ext/standard/head.h"
@@ -123,7 +123,6 @@
int final_buffer_length=0;
zval *alternate_buffer=NULL;
char *to_be_destroyed_buffer;
-   char *internal_output_handler_buffer;
int status;
SLS_FETCH();
OLS_FETCH();
@@ -143,8 +142,9 @@
}
 
if (OG(active_ob_buffer).internal_output_handler) {
-   internal_output_handler_buffer = 
OG(active_ob_buffer).internal_output_handler_buffer;
-   
OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, 
OG(active_ob_buffer).text_length, internal_output_handler_buffer, status);
+   final_buffer = OG(active_ob_buffer).internal_output_handler_buffer;
+   final_buffer_length = 
+OG(active_ob_buffer).internal_output_handler_buffer_size;
+   
+OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, 
+OG(active_ob_buffer).text_length, final_buffer, final_buffer_length, status);
} else if (OG(active_ob_buffer).output_handler) {
zval **params[2];
zval *orig_buffer;
@@ -196,8 +196,8 @@
 
if (!just_flush) {
if (OG(active_ob_buffer).internal_output_handler
-(internal_output_handler_buffer != 
OG(active_ob_buffer).internal_output_handler_buffer)) {
-   efree(internal_output_handler_buffer);
+(final_buffer != 
+OG(active_ob_buffer).internal_output_handler_buffer)) {
+   efree(final_buffer);
}
if (OG(nesting_level)1) { /* restore previous buffer */
php_ob_buffer *ob_buffer_p;
Index: php4/ext/standard/php_output.h
diff -u php4/ext/standard/php_output.h:1.22 php4/ext/standard/php_output.h:1.23
--- php4/ext/standard/php_output.h:1.22 Tue Mar  6 08:25:14 2001
+++ php4/ext/standard/php_output.h  Tue Mar  6 08:28:51 2001
@@ -16,14 +16,14 @@
+--+
 */
 
-/* $Id: php_output.h,v 1.22 2001/03/06 16:25:14 zeev Exp $ */
+/* $Id: php_output.h,v 1.23 2001/03/06 16:28:51 zeev Exp $ */
 
 #ifndef PHP_OUTPUT_H
 #define PHP_OUTPUT_H
 
 #include "php.h"
 
-typedef void (*php_output_handler_func_t)(char *output, uint output_len, char 
**handled_output, int mode);
+typedef void (*php_output_handler_func_t)(char *output, uint output_len, char 
+**handled_output, uint *handled_output_len, int mode);
 
 PHPAPI void php_output_startup(void);
 void php_output_register_constants(void);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 / configure.in /build build2.mk

2001-03-06 Thread Sascha Schumann

sas Tue Mar  6 08:51:53 2001 EDT

  Modified files:  
/php4   configure.in 
/php4/build build2.mk 
  Log:
  Replace AM_PROG_LEX with a separated call to AC_PROG_LEX and AC_DECL_YYTEXT.
  The latter is only called, if lex was found, so that PHP configures now
  on setups without (f)lex.
  
  
Index: php4/configure.in
diff -u php4/configure.in:1.219 php4/configure.in:1.220
--- php4/configure.in:1.219 Mon Feb 26 10:14:27 2001
+++ php4/configure.in   Tue Mar  6 08:51:53 2001
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.219 2001/02/26 18:14:27 andi Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.220 2001/03/06 16:51:53 sas Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -116,7 +116,10 @@
 AC_PROG_CC_C_O
 AC_PROG_LN_S
 
-AM_PROG_LEX
+AC_PROG_LEX
+if test -n "$LEX"; then
+  AC_DECL_YYTEXT
+fi
 
 dnl ## Make flex scanners use const if they can, even if __STDC__ is not
 dnl ## true, for compilers like Sun's that only set __STDC__ true in
Index: php4/build/build2.mk
diff -u php4/build/build2.mk:1.17 php4/build/build2.mk:1.18
--- php4/build/build2.mk:1.17   Wed Feb  7 16:49:24 2001
+++ php4/build/build2.mkTue Mar  6 08:51:53 2001
@@ -14,7 +14,7 @@
 #  | Authors: Sascha Schumann [EMAIL PROTECTED]|
 #  +--+
 #
-# $Id: build2.mk,v 1.17 2001/02/08 00:49:24 sas Exp $ 
+# $Id: build2.mk,v 1.18 2001/03/06 16:51:53 sas Exp $ 
 #
 
 include generated_lists
@@ -54,14 +54,13 @@
fi; \
done
@test -f want_dependencies || flag=-i; \
-   automake -a $$flag $(AMFLAGS) $(makefile_files) \
-   || true 2
+   automake -a $$flag $(AMFLAGS) $(makefile_files) 21 | $(SUPPRESS_WARNINGS)
@for i in $(LT_TARGETS); do mv $$i.bak $$i; done
 
 aclocal.m4: configure.in acinclude.m4 dynlib.m4
aclocal
 
-SUPPRESS_WARNINGS = (egrep -v '(warning: AC_TRY_RUN called without default to allow 
cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX)'||true)
+SUPPRESS_WARNINGS = (egrep -v '(warning: AC_TRY_RUN called without default to allow 
+cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|.*AM_PROG_LEX.*)'||true)

 $(config_h_in): configure acconfig.h
 # explicitly remove target since autoheader does not seem to work 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Calling Perl from PHP -- Help --

2001-03-06 Thread Julian Wood


I think you're looking for passthru (or perhaps system or exec). If your php
is like this:

?php passthru ("/tmp/hello.pl yay") ?

and hello.pl is like this:

#!/usr/bin/perl
print 'Args:'.join(' ', @ARGV);

Your web page will read:

Args:yay

You'll probably need to change the method of input (to use @ARGV instead of
) on your Porter stemmer program to make it work properly.

J

-- 
Julian Wood

Multimedia Developer
University of Calgary


on 3/5/01 11:53 PM, Matt Friedman at [EMAIL PROTECTED] wrote:

 I'm stumped. I've searched all over and can't figure this one out.
 
 I have a perl script that waits for input on the command line. You type in a
 string and it returns a string.
 
 I'd like to be able to this via php, since I can't rewrite the script in php,
 since it's a little over my head.
 
 So, how do I open the perl script in php, send it some input and read the
 output?
 
 Thanks,
 Matt.
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/midgard sitegroup.c

2001-03-06 Thread Jon Parise

On Tue, Mar 06, 2001 at 08:12:52AM -, Emiliano Heyns wrote:

 emile Tue Mar  6 00:12:52 2001 EDT
 
   Modified files:  
 /php4/ext/midgard sitegroup.c 
   Log:
   Bug #123

I assume this fixed _Midgard_ bug #123, not _PHP_ bug #123.  Could you
please distinguish between them in the future?  While it is obvious
which bug you mean now, it might be confusing for people looking back
in the commit logs.

-- 
Jon Parise ([EMAIL PROTECTED])  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] strtotime question

2001-03-06 Thread Jason Murray

Hi there,

$ob-date is '2000/03/06'.

$d = ereg_replace('([0-9]*)-([0-9]*)-([0-9]*)',
  '\2/\3/\1', $ob-date);

$d is now '03/06/2000'.

$foo = getdate(strtotime($d)+86400);

Here I have to add an entire day to the value of strtotime($d) to get
the expected results for below.

echo "P" . $foo["weekday"] . ", " . $d . "blockquote\n";

Without adding a day to strtotime() $foo["weekday"] is 'Monday'.

Is there some kind of timezone stuff I am not accounting for? or is it
something else?

Thanks,
Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] removing and item out of a string

2001-03-06 Thread Rick St Jean

I really suck with Regular expression but what if you did a replacement on
1, and replaced it with 1
2, and replaced it with 2
3, and replaced it with 3

Kind of a cheap workaround.
??

Rick

At 01:07 PM 3/6/01 -0500, Brian C. Doyle wrote:
Hello all,

I need to remove a comma from inside of 2 quotes ie "1,234.56" I need to 
change that to "1234.56"
Unfortunatly I can not do reg_replace(",","","1,234.56");
This is inside a csv file.



Brian C. Doyle
Coach Team Force
Earthlink Technical Support
[EMAIL PROTECTED]

##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Background processing / forking

2001-03-06 Thread Natasha

hey,

i wanted to know if there's a fork function in php,
cause i don't see it in the manual.

I basically wanna call a C program from PHP.

Now the problem is that the C program will be running
for longs periods like maybe half or even an hour. So
i would basically want to just execute the program and
return control to the script immediately so that the c
program continues it's work.

it's easy with forking. but i dont see it in php.

thx.

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/midgard mgd_internal.h midgard.c

2001-03-06 Thread David Guerizec

davidg  Tue Mar  6 09:56:17 2001 EDT

  Modified files:  
/php4/ext/midgard   mgd_internal.h midgard.c 
  Log:
  added ability to break tree walking
  
  
Index: php4/ext/midgard/mgd_internal.h
diff -u php4/ext/midgard/mgd_internal.h:1.8 php4/ext/midgard/mgd_internal.h:1.9
--- php4/ext/midgard/mgd_internal.h:1.8 Tue Feb 27 17:00:31 2001
+++ php4/ext/midgard/mgd_internal.h Tue Mar  6 09:56:17 2001
@@ -1,4 +1,4 @@
-/* $Id: mgd_internal.h,v 1.8 2001/02/28 01:00:31 davidg Exp $
+/* $Id: mgd_internal.h,v 1.9 2001/03/06 17:56:17 davidg Exp $
 Copyright (C) 1999 Jukka Zitting [EMAIL PROTECTED]
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA [EMAIL PROTECTED]
@@ -112,7 +112,7 @@
PHP_UPDATE_REPLIGARD(#roottable, (*root)-value.lval); \
 }
 
-void midgard_user_call_func(midgard *mgd, int id, int level, void * xparam);
+int midgard_user_call_func(midgard *mgd, int id, int level, void * xparam);
 
 #define MGD_WALK_FUNCTION(table) \
MGD_WALK_FUNCTION_EX(table, 
table, up)
@@ -162,13 +162,14 @@
 \
xp[0] = (*xparam); \
xp[1] = (*midgard_user_call_func_name); \
-   mgd_walk_table_tree(mgd_handle(), #table, #upfield, (*id)-value.lval, \
+   RETVAL_LONG( \
+   mgd_walk_table_tree(mgd_handle(), #table, #upfield, (*id)-value.lval, 
+\
   
(*level)-value.lval, \
   order ? 
(*order)-value.lval : 1, \
   (void *)xp, 
\
   
midgard_user_call_func, \
-  sort ? 
(*sort)-value.str.val : NULL); \
-   RETURN_TRUE; \
+  sort ? 
+(*sort)-value.str.val : NULL) \
+   ); \
 } \
 \
 /* }}} */
Index: php4/ext/midgard/midgard.c
diff -u php4/ext/midgard/midgard.c:1.20 php4/ext/midgard/midgard.c:1.21
--- php4/ext/midgard/midgard.c:1.20 Tue Feb 27 17:00:32 2001
+++ php4/ext/midgard/midgard.c  Tue Mar  6 09:56:17 2001
@@ -1,4 +1,4 @@
-/* $Id: midgard.c,v 1.20 2001/02/28 01:00:32 davidg Exp $
+/* $Id: midgard.c,v 1.21 2001/03/06 17:56:17 davidg Exp $
 Copyright (C) 1999 Jukka Zitting [EMAIL PROTECTED]
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA [EMAIL PROTECTED]
@@ -745,16 +745,17 @@
}
 }
 
-void midgard_user_call_func(midgard *mgd, int id, int level, void *xparam)
+int midgard_user_call_func(midgard *mgd, int id, int level, void *xparam)
 {
zval *args[3];
zval ** xp = (zval **)xparam;
zval *return_value;
+   int retval;
 
if(!PZVAL_IS_REF(xp[0])) {
/* DG: Do we force the user to pass it by reference ? */
php_error(E_WARNING,"You must pass the fourth parameter by 
reference.");
-   return;
+   return 0;
}
ALLOC_ZVAL(return_value);   ZVAL_NULL(return_value);
ALLOC_ZVAL(args[0]);ZVAL_LONG(args[0], id);
@@ -768,11 +769,17 @@
  (xp[1])-value.str.val);
zval_dtor(return_value);
zval_dtor(args[0]); zval_dtor(args[1]);
-   return;
+   return 0;
}
-
+   if(return_value-type == IS_NULL)
+   retval = 1;
+   else {
+   convert_to_long_ex(return_value);
+   retval = return_value-value.lval;
+   }
zval_dtor(return_value);
zval_dtor(args[0]); zval_dtor(args[1]);
+   return retval;
 }
 
 #if YOU_WANT_TO_TEST
@@ -826,15 +833,17 @@
 
xp[0] = (*xparam);
xp[1] = (*midgard_user_call_func_name);
-   mgd_walk_table_tree(mgd_handle(), mgd_table_name[(*tableid)-value.lval],
+   RETVAL_LONG(
+   mgd_walk_table_tree(mgd_handle(),
+   mgd_table_name[(*tableid)-value.lval],

(*upfield)-value.str.val,

(*id)-value.lval,

(*level)-value.lval,
order ? 
(*order)-value.lval : 1,
(void *)xp,

midgard_user_call_func,
-   sort ? 
(*sort)-value.str.val : NULL);
-   RETURN_TRUE;
+   sort ? 
+(*sort)-value.str.val : NULL)
+

RE: [PHP] Auto Prepend/Append

2001-03-06 Thread Boget, Chris

 Try putting
 Files "*.html"
   php_value auto_prepend_file "foo.php"
 /Files
 in your httpd.conf file.  Once you put this in the conf file 
 for Apache, restart Apache and see if the changes take place.  
 That should do what you want it to.

Unfortunately, no.
Here is what we have in our httpd.conf file:

VirtualHost mydomain.com:80
Port 80
Files "*.html"
php_value auto_prepend_file "prepend.php"
/Files
DocumentRoot /this/is/the/path/to/mydomain.com
ServerName mydomain.com
/VirtualHost

We are running several different virtual hosts, but want this
change applicable to this one only.

Thanks for everyone's help thus far. Hopefully we can get this
up and running.

Chris



RE: [PHP] removing and item out of a string

2001-03-06 Thread Doug Brewer

what about

preg_replace("(\d),(\d)", "$1$2",$your_string);

to replace every occurence of a comma surrounded by digits?

This works with 4.04, prior to that the "replace" string would by
"\\1\\2".

Doug

| -Original Message-
| From: Brian C. Doyle [mailto:[EMAIL PROTECTED]]
| Sent: Tuesday, March 06, 2001 12:08 PM
| To: [EMAIL PROTECTED]
| Subject: [PHP] removing and item out of a string
|
|
| Hello all,
|
| I need to remove a comma from inside of 2 quotes ie
| "1,234.56" I need to
| change that to "1234.56"
| Unfortunatly I can not do reg_replace(",","","1,234.56");
| This is inside a csv file.
|
|
|
| Brian C. Doyle
| Coach Team Force
| Earthlink Technical Support
| [EMAIL PROTECTED]
|


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Redirect using PHP to a new browser window.

2001-03-06 Thread John Huggins

List,

I current use something like this to send some one who clicks on my links to
the actual web page.


  $row = @mysql_fetch_array($result);

  $url = $row["url"];
  $ID  = $row["ID"];

  header("Location: $url");
  header("");


And then the hitcounter for that particular ID is incremented, thus the
reason for this whole script.

This works great.  However, I would like the option to open up the target in
a new window like when you specify "target="somewindowname" in the a
href... tag.

How can I accomplish the same thing with the header or ... sigh ... can I
not do this.


John


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Background processing / forking

2001-03-06 Thread Mukul Sabharwal

Hi Natasha,

Well the probably easiest shitty way to do it is:

exec("theprogram 1 /some/file 21 ");

would exec()ute theprogram and will put it's output in
/some/file and stderr's output also in the /some/file,
and  at last signifies the backgroundness of the
program.

however as you mentioned C, the better way could fork
it in C, and since i don't wanna get offtopic i won't
mention it here.

-:)

HTH


--- Natasha [EMAIL PROTECTED] wrote:  hey,
 
 i wanted to know if there's a fork function in php,
 cause i don't see it in the manual.
 
 I basically wanna call a C program from PHP.
 
 Now the problem is that the C program will be
 running
 for longs periods like maybe half or even an hour.
 So
 i would basically want to just execute the program
 and
 return control to the script immediately so that the
 c
 program continues it's work.
 
 it's easy with forking. but i dont see it in php.
 
 thx.
 
 __
 Do You Yahoo!?
 Get email at your own domain with Yahoo! Mail. 
 http://personal.mail.yahoo.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


=
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available @ http://mukul.free.fr

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Background processing / forking

2001-03-06 Thread Anders Johannsen

 Now the problem is that the C program will be running
 for longs periods like maybe half or even an hour. So
 i would basically want to just execute the program and
 return control to the script immediately so that the c
 program continues it's work.

 it's easy with forking. but i dont see it in php.

It's quite easy with PHP as well, even though we do not have forking.

Either use exec("nohup c-program") to detach the program, and return control
back to the script, or execute it via a shutdown function. That way, the
program gets executed after the script has finished.

PEAR offers an abstraction for executing system commands. Look for CMD.php

/A



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/standard output.c

2001-03-06 Thread Zeev Suraski

zeevTue Mar  6 10:29:00 2001 EDT

  Modified files:  
/php4/ext/standard  output.c 
  Log:
  Fixes to internal output buffering
  
  
Index: php4/ext/standard/output.c
diff -u php4/ext/standard/output.c:1.46 php4/ext/standard/output.c:1.47
--- php4/ext/standard/output.c:1.46 Tue Mar  6 08:28:51 2001
+++ php4/ext/standard/output.c  Tue Mar  6 10:29:00 2001
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.46 2001/03/06 16:28:51 zeev Exp $ */
+/* $Id: output.c,v 1.47 2001/03/06 18:29:00 zeev Exp $ */
 
 #include "php.h"
 #include "ext/standard/head.h"
@@ -122,7 +122,7 @@
char *final_buffer=NULL;
int final_buffer_length=0;
zval *alternate_buffer=NULL;
-   char *to_be_destroyed_buffer;
+   char *to_be_destroyed_buffer, *to_be_destroyed_output_buffer;
int status;
SLS_FETCH();
OLS_FETCH();
@@ -193,12 +193,9 @@
}
 
to_be_destroyed_buffer = OG(active_ob_buffer).buffer;
+   to_be_destroyed_output_buffer = 
+OG(active_ob_buffer).internal_output_handler_buffer;
 
if (!just_flush) {
-   if (OG(active_ob_buffer).internal_output_handler
-(final_buffer != 
OG(active_ob_buffer).internal_output_handler_buffer)) {
-   efree(final_buffer);
-   }
if (OG(nesting_level)1) { /* restore previous buffer */
php_ob_buffer *ob_buffer_p;
 
@@ -222,11 +219,18 @@
if (!just_flush) {
efree(to_be_destroyed_buffer);
 
+   if (to_be_destroyed_output_buffer) {
+   efree(to_be_destroyed_output_buffer);
+   }
OG(nesting_level)--;
} else {
OG(active_ob_buffer).text_length = 0;
OG(active_ob_buffer).status |= PHP_OUTPUT_HANDLER_START;
OG(php_body_write) = php_b_body_write;
+   if (OG(active_ob_buffer).internal_output_handler
+final_buffer != 
+OG(active_ob_buffer).internal_output_handler_buffer) {
+   efree(final_buffer);
+   }
}
 }
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/standard output.c

2001-03-06 Thread Zeev Suraski

zeevTue Mar  6 11:38:33 2001 EDT

  Modified files:  
/php4/ext/standard  output.c 
  Log:
  Fix freeing of buffers
  
  
Index: php4/ext/standard/output.c
diff -u php4/ext/standard/output.c:1.47 php4/ext/standard/output.c:1.48
--- php4/ext/standard/output.c:1.47 Tue Mar  6 10:29:00 2001
+++ php4/ext/standard/output.c  Tue Mar  6 11:38:33 2001
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.47 2001/03/06 18:29:00 zeev Exp $ */
+/* $Id: output.c,v 1.48 2001/03/06 19:38:33 zeev Exp $ */
 
 #include "php.h"
 #include "ext/standard/head.h"
@@ -122,7 +122,8 @@
char *final_buffer=NULL;
int final_buffer_length=0;
zval *alternate_buffer=NULL;
-   char *to_be_destroyed_buffer, *to_be_destroyed_output_buffer;
+   char *to_be_destroyed_buffer;
+   char *to_be_destroyed_handled_output[2] = { 0, 0 };
int status;
SLS_FETCH();
OLS_FETCH();
@@ -193,9 +194,15 @@
}
 
to_be_destroyed_buffer = OG(active_ob_buffer).buffer;
-   to_be_destroyed_output_buffer = 
OG(active_ob_buffer).internal_output_handler_buffer;
+   if (OG(active_ob_buffer).internal_output_handler
+(final_buffer != 
+OG(active_ob_buffer).internal_output_handler_buffer)) {
+   to_be_destroyed_handled_output[0] = final_buffer;
+   }
 
if (!just_flush) {
+   if (OG(active_ob_buffer).internal_output_handler) {
+   to_be_destroyed_handled_output[1] = 
+OG(active_ob_buffer).internal_output_handler_buffer;
+   }
if (OG(nesting_level)1) { /* restore previous buffer */
php_ob_buffer *ob_buffer_p;
 
@@ -219,18 +226,17 @@
if (!just_flush) {
efree(to_be_destroyed_buffer);
 
-   if (to_be_destroyed_output_buffer) {
-   efree(to_be_destroyed_output_buffer);
-   }
OG(nesting_level)--;
} else {
OG(active_ob_buffer).text_length = 0;
OG(active_ob_buffer).status |= PHP_OUTPUT_HANDLER_START;
OG(php_body_write) = php_b_body_write;
-   if (OG(active_ob_buffer).internal_output_handler
-final_buffer != 
OG(active_ob_buffer).internal_output_handler_buffer) {
-   efree(final_buffer);
-   }
+   }
+   if (to_be_destroyed_handled_output[0]) {
+   efree(to_be_destroyed_handled_output[0]);
+   }
+   if (to_be_destroyed_handled_output[1]) {
+   efree(to_be_destroyed_handled_output[1]);
}
 }
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] imap functions

2001-03-06 Thread Chris Lee

anyone have any code snippits or urls you could share on the imap functions? Ive got 
it to list all pop/imap/nttp folders on a server with a username/password, I can view 
pop/imap msgs, no attachemtns yet, and can not list nntp headers for some reason. the 
whole imap deal looks great but doesnt seem stable either, some imap functions if 
there are no folders or headers causes apache to seg fault.


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]




Re: [PHP] background processing / forking

2001-03-06 Thread Mukul Sabharwal

Disclaimer:
   The following post contains C code for *nix!
   Viewer discretion recommended!

Hi,

I'm back, I couldn't resist you mentioning C, so as
you did, big fault, the code that follows is probably
much better than exec, as an stderr terminal will
still be attached, but anyway:

exec("yourprogramname");

this /should/ work, if it don't then the before exec i
mentioned would work!

#include sys/types.h
#include sys/time.h
#include stdlib.h
#include stdio.h
#include string.h
#include signal.h
#include unistd.h

void get_into_background(void)
{
pid_tpid;

// all the familiar kitchenware!

pid = fork();
if(pid != 0)
  exit(0);

setsid(); // sets out process and group id as
part of the session
  // but only if the process ain't a leader, hehe

close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);

// the program shouldn't acquire a terminal

signal(SIGHUP, SIG_IGN); // incase we get
HUP'd, ignore!

pid = fork();
if(pid != 0)
  exit(0);

chdir("/towhere");
umask(0);
}
 
void the_actual_exec(void)
{
charbuffer[1024];
char*args[3];

args[0] = "ls";
args[1] = "-F";
args[2] = 0;

execv("/bin/ls", args); // 0 terminated array
perror("execv"); // as exec dont return nutting
 // going past exec is an ERROR
}


int main(int argc, char **argv)
{
get_into_background();
the_actual_exec();
return 0;
}

=
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available @ http://mukul.free.fr

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Newbie question about how to detect mime/type

2001-03-06 Thread MRossland

Hi all, I was wondering how I could detect if a file is an image (jpg or gif
or png) file? I’m running this on an NT box, but I don’t want to rely on the
file extension.

Is there a way?

Thanks for any help,
--Mark



[PHP] object-method() chaining

2001-03-06 Thread The Doctor What

I'm currently working on the DB project from h*ll.   Why? Because
a lot of the tables of the normalized DB are mapped into objects and
PHP's object support questionable at best.

I've worked around the lack of multiple inheritance, and some of the
other problems.  But the inability to do something as simple as:
object-MethodThatReturnsAnotherObject()-method() is very
troublesome

I cannot express how error prone it is to have to create tons of
temporary variables.

I can already hear people saying stuff like: "Why don't you use the
attribute (or variable) directly?"

Because in most cases MethodThatReturnsAnotherObject() does work
before it hands me the object, and it's important to my project.

If someone has a good example of an object framework around a
normalized database, I'd love to see it.  Otherwise, can someone
tell me where in the flipping PHP4 code is this limitation coded?

Dislaimer: I'm irrate.  This problem has been grating against me for
4 weeks straight now.

Ciao!

-- 
Like punning, programming is a play on words.

The Doctor What: Not that 'who' guy  http://docwhat.gerf.org/
[EMAIL PROTECTED]   KF6VNC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] [A bit OT but not] Anchors and Query strings

2001-03-06 Thread Boget, Chris

I need to set up a link that has both.  However, IE/NS isn't
liking this:

www.mydomain.com/thispage.php#joe?thisvar=thatvalue

I need to pass "thisvar" into thispage.php and use it to determine
information to display.  I also need to pass the anchor name "joe"
so the page jumps down to that anchor.
What am I doing wrong?

Also, I need to parse the above to get information for something
else.  Is there any easier way to get "joe" out of the above than
a regex?

Chris



[PHP] Please Help!!!! - Really BASIC stuff!

2001-03-06 Thread Martin Hughes

Hi,

Could someone please help me? If I have links on my page:

a href="side.php?page=audio"Link 1 Here/a
a href="side.php?page=visual"Link 2 Here/a

And then side.php is the following:

html
  /head
  Blah
  /head
  body
FILE CONTENTS GO HERE
  /body
/html


Where the files to be included are: audio.txt and visual.txt respectively,
what php code should I put in my side.php? (the extention of the files does
not have to be .txt)

This seems to be a basic thing EVERY website done with php achieves -
HOW

(I am NOT familiar with php!! - English please :0))

Many Thanks :0),

Martin
==
Musical Director
University of York Gilbert  Sullivan Society
177 Hull Road, York YO10 3JY
01904 427 537 / 07951 015 220
[EMAIL PROTECTED]
http://www.mixermanic.co.uk
==


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Please Help!!!! - Really BASIC stuff!

2001-03-06 Thread Jason Murray

Use include(). Like

?
switch ($page) {
case "audio" : include("audio.txt"); break;
case "visual" : include("visual.txt"); break;
}

Greetings,
Jason

-- 
Jason Murray
Developer
http://www.jwebmedia.com/
1 877 525 jWEB

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] [A bit OT but not] Anchors and Query strings

2001-03-06 Thread Phil Driscoll

The # goes at the end of the URL after the query string stuff. Once there,
it should be easy to strip off the joe by looking for the last # in the
string (not that there will be more than 1!).

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Please Help!!!! - Really BASIC stuff!

2001-03-06 Thread Philip Olson


Hi Martin,

It's important to know that "Stuff" in the Url like this are just
variables.  For example :

  foo.php?fruit=applesdog=snoopyothers=huhmore=yep

Now with foo.php we can do this (a few exceptions) :

  echo "$dog would like to each some $fruit";

And in your case, you have $page so let's compare your $page variable
and include files accordingly.  We'll be using an if statement which can
be read about here :

  http://www.php.net/manual/en/control-structures.php

This will do the job :

  ?php

  if ($page == 'visual') {

echo 'h3Visual Stuff is Good!/h3';
include 'visual.txt';

  } elseif ($page == 'audio') {

   echo 'h3Welcome to Musical Section!/h3';
   include 'audio.inc';

  } else {

   echo 'h3Welcome to my site!/h3';
   include 'default.php';
  
  }
  ?

Yes there are other ways but this is the simplest and you should (and
will!) learn to use if/elseif/else which will be useful in the future.

Regards,

Philip Olson
http://www.cornado.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Redirect using PHP to a new browser window.

2001-03-06 Thread Nick Norton

If the only thing you plan on doing after incrementing your counter is going
to the new page, why not put the target="_blank" in the a tag that points
to your script.  Then you'll do your counter script and redirect when you're
already in a new window.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Please Help!!!! - Really BASIC stuff!

2001-03-06 Thread Phil Driscoll

There are loads of different ways to spit out a text file.

The easiest is readfile($Filename) which does exactly what you want,
providing that the file already contains sanitised html (eg br instead of
newlines etc.

If not, you could use fread to get the file contents into a variable and
then process them as you wish (eg with nl2br etc).

No doubt, you will be told another hundred ways to do it as well :)

Cheers

PS Interesting postal address - I frequent the Beeswing pub on Hull Rd every
Thursday evening with members of the old car club I'm in!

--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Please Help!!!! - Really BASIC stuff!

2001-03-06 Thread Rick St Jean

This will allow you to have more control over what pages get edited...

but you can use something a little easier like...
?
$filename= $page . ".php"
include ("$filename");
?


At 09:02 PM 3/6/01 +, you wrote:

Hi Martin,

It's important to know that "Stuff" in the Url like this are just
variables.  For example :

   foo.php?fruit=applesdog=snoopyothers=huhmore=yep

Now with foo.php we can do this (a few exceptions) :

   echo "$dog would like to each some $fruit";

And in your case, you have $page so let's compare your $page variable
and include files accordingly.  We'll be using an if statement which can
be read about here :

   http://www.php.net/manual/en/control-structures.php

This will do the job :

   ?php

   if ($page == 'visual') {

 echo 'h3Visual Stuff is Good!/h3';
 include 'visual.txt';

   } elseif ($page == 'audio') {

echo 'h3Welcome to Musical Section!/h3';
include 'audio.inc';

   } else {

echo 'h3Welcome to my site!/h3';
include 'default.php';

   }
   ?

Yes there are other ways but this is the simplest and you should (and
will!) learn to use if/elseif/else which will be useful in the future.

Regards,

Philip Olson
http://www.cornado.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mailing list.

2001-03-06 Thread Rick St Jean

Does this mailing list run off PHP?  Does anyone find it a pain to have to 
cut and paste the url of the
list into the to bar again and again?  I am using Eudora, and I am just 
wondering if it is me.  What
mail server are they using? qmail or sendmail?


Rick
##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Creating bw png images

2001-03-06 Thread Alexandre Hautequest

Hi all.

To not use anymore gif, i switch my gd lib to 1.8, but i need to generate 2
colors png graphics, but i just got 16-bit images. Is there any
place/function/variable i can set to achieve this?

TIA.

--
Alexandre Hautequest
hquest at fesppr.br
Fundao de Estudos Sociais do Paran - http://www.fesppr.br/
Centro de Administrao de Redes - CAR

"Ningum  melhor do que todos ns juntos."
Equipe Zeus Competies

-
Esta mensagem foi enviada pelo WebMail da FESP.
Conhea a FESP: http://www.fesppr.br/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Please Help!!!! - Really BASIC stuff!

2001-03-06 Thread Martin Hughes

My God!!

You're all stars!!! (This is the **fastest** mailing list I've ever joined)


If I have *loads* of links (not just audio  visual) is there a way to
create a file to include them all?

Basically - what I've got is a frameset with side  main frames (side is for
nav, main is for... well, main stuff!) and all my links are in a .js file:

===
var navAudio="side.php?page=audio"
var mainAudio="main.php?page=audio"
function openAudio(){
  parent.main.location=mainAudio
  parent.parent.side.location=navAudio
  }
===

and the link a href="javascript:openAudio()"LINK/a

..but with audio, visual, act 1, act 2, orchestra, cast, and loads of other
"pages". Do I put:

?
switch ($page) {
case "audio" : include("side_audio.txt"); break;
case "visual" : include("side_visual.txt"); break;
case "cast" : include("side_cast.txt"); break;
case "orchestra" : include("side_orchestra.txt"); break;
}
?

etc. in every page? Or is there a way of doing the whole link thing and
changing several frames with one link in php (just by the .php?page=foo
action)

I hope this makes sense!!!

Thanks LOADS,

Martin :0)

==
Musical Director
University of York Gilbert  Sullivan Society
177 Hull Road, York YO10 3JY
01904 427 537 / 07951 015 220
[EMAIL PROTECTED]
http://www.mixermanic.co.uk
==


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/zlib php_zlib.h zlib.c

2001-03-06 Thread Zeev Suraski

zeevTue Mar  6 12:43:55 2001 EDT

  Modified files:  
/php4/ext/zlib  zlib.c php_zlib.h 
  Log:
  Implement internal output compression0:wq
  
  

Index: php4/ext/zlib/zlib.c
diff -u php4/ext/zlib/zlib.c:1.74 php4/ext/zlib/zlib.c:1.75
--- php4/ext/zlib/zlib.c:1.74   Sun Mar  4 07:12:38 2001
+++ php4/ext/zlib/zlib.cTue Mar  6 12:43:54 2001
@@ -16,11 +16,12 @@
|  Stefan Röhrich [EMAIL PROTECTED]|
+--+
  */
-/* $Id: zlib.c,v 1.74 2001/03/04 15:12:38 zeev Exp $ */
+/* $Id: zlib.c,v 1.75 2001/03/06 20:43:54 zeev Exp $ */
 #define IS_EXT_MODULE
 
 #include "php.h"
 #include "SAPI.h"
+#include "php_ini.h"
 
 #include stdlib.h
 #include errno.h
@@ -106,6 +107,12 @@
{NULL, NULL, NULL}
 };
 
+
+PHP_INI_BEGIN()
+STD_PHP_INI_BOOLEAN("zlib.output_compression",   "0",PHP_INI_ALL, 
+OnUpdateInt,output_compression,   php_zlib_globals, zlib_globals)
+PHP_INI_END()
+
+
 zend_module_entry php_zlib_module_entry = {
"zlib",
php_zlib_functions,
@@ -155,6 +162,8 @@
REGISTER_LONG_CONSTANT("FORCE_GZIP", CODING_GZIP, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FORCE_DEFLATE", CODING_DEFLATE, CONST_CS | 
CONST_PERSISTENT);
 
+   REGISTER_INI_ENTRIES();
+
return SUCCESS;
 }
 
@@ -163,6 +172,15 @@
ZLIBLS_FETCH();
 
ZLIBG(ob_gzhandler_status) = 0;
+   switch (ZLIBG(output_compression)) {
+   case 0:
+   break;
+   case 1:
+   php_enable_output_compression(4096);
+   break;
+   default:
+   php_enable_output_compression(ZLIBG(output_compression));
+   }
return SUCCESS;
 }
 
@@ -177,6 +195,8 @@
 }
 #endif

+   UNREGISTER_INI_ENTRIES();
+
return SUCCESS;
 }
 
@@ -939,7 +959,7 @@
 
 
 
-static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buf_used, 
zend_bool do_start, zend_bool do_end ZLIBLS_DC)
+static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buffer_len, 
+zend_bool do_start, zend_bool do_end ZLIBLS_DC)
 {
Bytef *buffer;
uInt prev_outlen, outlen;
@@ -948,16 +968,23 @@
int end_offset = (do_end?8:0);
 
outlen = sizeof(char) * (str_length * 1.001 + 12);
-   buffer = (Bytef *) emalloc(outlen+start_offset+end_offset);
+   if ((outlen+start_offset+end_offset)  *p_buffer_len) {
+   buffer = (Bytef *) emalloc(outlen+start_offset+end_offset);
+   } else {
+   buffer = *p_buffer;
+   }

ZLIBG(stream).next_out = buffer+start_offset;
ZLIBG(stream).avail_out = outlen;
 
+
err = deflate(ZLIBG(stream), Z_SYNC_FLUSH);
while (err == Z_OK  !ZLIBG(stream).avail_out) {
prev_outlen = outlen;
outlen *= 3;
-   buffer = realloc(buffer, outlen+start_offset+end_offset);
+   if ((outlen+start_offset+end_offset)  *p_buffer_len) {
+   buffer = realloc(buffer, outlen+start_offset+end_offset);
+   }

ZLIBG(stream).next_out = buffer+start_offset + prev_outlen;
ZLIBG(stream).avail_out = prev_outlen * 2;
@@ -969,19 +996,17 @@
err = deflate(ZLIBG(stream), Z_FINISH);
}
 
+
*p_buffer = buffer;
-   *p_buf_used = outlen - ZLIBG(stream).avail_out;
+   *p_buffer_len = outlen - ZLIBG(stream).avail_out;
+
return err;
 }
 
 
 int php_deflate_string(const char *str, uint str_length, char **newstr, uint 
*new_length, int coding, zend_bool do_start, zend_bool do_end)
 {
-   Bytef *buffer;
-   uInt buf_used;
int err;
-   Bytef header_buffer[11];
-   Bytef trailer_buffer[9];
ZLIBLS_FETCH();
 
ZLIBG(compression_coding) = coding;
@@ -1000,10 +1025,6 @@
return FAILURE;
}

-   /* Write a very simple .gz header: */
-   sprintf(header_buffer, "%c%c%c%c%c%c%c%c%c%c", 
gz_magic[0],
-   gz_magic[1], Z_DEFLATED, 0 
/*flags*/,
-   0,0,0,0 /*time*/, 0 
/*xflags*/, OS_CODE);
ZLIBG(crc) = crc32(0L, Z_NULL, 0);
break;
case CODING_DEFLATE:
@@ -1023,34 +1044,33 @@
ZLIBG(crc) = crc32(ZLIBG(crc), (const Bytef *) str, str_length);
}
 
-   err = php_do_deflate(str_length, buffer, buf_used, do_start, do_end 
ZLIBLS_CC);
+   err = php_do_deflate(str_length, (Bytef **) newstr, new_length, do_start, 
+do_end ZLIBLS_CC);
/* TODO: error handling (err may be 

  1   2   >