php-general Digest 10 Jan 2001 11:42:10 -0000 Issue 446

Topics (messages 33587 through 33647):

AFTERBURNER - PHP CACHE
        33587 by: Marcin Orlowski

Baby's First Regex! (Repost - Please Help)
        33588 by: Murray Shields
        33589 by: Ignacio Vazquez-Abrams
        33590 by: Brian Clark
        33591 by: Toby Butzon
        33600 by: Murray Shields

replacing null characters
        33592 by: Chris

php script
        33593 by: Devin Atencio

HELP! PLEASE! Interfacing EMail to PHP
        33594 by: Dieter Kneffel

include problem using windows
        33595 by: Onaje Johnston

Re: looking for a PHP editor
        33596 by: Arcady Genkin
        33598 by: Arcady Genkin
        33599 by: Jeffrey A. Stuart
        33602 by: Josh G
        33606 by: Jeffrey A. Stuart

FP_QUERY:  Make problem php 4.0.4
        33597 by: Mark Olbert

snapshots
        33601 by: Dan Phoenix
        33603 by: Rasmus Lerdorf

Looking for a script
        33604 by: PeterOblivion.aol.com
        33605 by: Brian Clark

Passing a query result
        33607 by: Todd Cary
        33608 by: Toby Butzon
        33610 by: Todd Cary
        33611 by: Todd Cary
        33613 by: Toby Butzon
        33615 by: Todd Cary

Re: installing PHP4 on Apache on Win2000
        33609 by: Tshering Norbu

Re: more shopping cart crap
        33612 by: Tshering Norbu
        33614 by: Tshering Norbu

MySQL Newbie ? -Help!
        33616 by: Matt Stone
        33618 by: Jason Brooke
        33620 by: Matt Stone

Re: week of example code
        33617 by: Tiger Quimpo

PHP newbie question
        33619 by: Neil Zanella

mysql and php possibly causing problem
        33621 by: James Mclean

oops forgot to add
        33622 by: James Mclean

declaring variables in class definitions
        33623 by: sam1600.iname.com
        33635 by: Max A. Derkachev

Im having Trouble with File uploading,
        33624 by: MacBane

Browser cache and form with $PHP_SELF
        33625 by: Egan
        33626 by: Hrishi
        33627 by: Egan

Connect problem
        33628 by: Maximiliano Bubenick

Shopping Cart Schema - Sessions
        33629 by: Jason Beebe

Templating help
        33630 by: Cameron
        33642 by: Rasmus Lerdorf

Re: User Authentication Integration with NT
        33631 by: Phil Driscoll

Ping
        33632 by: Tshering Norbu
        33633 by: DaViper
        33636 by: Tshering Norbu
        33641 by: DaViper
        33647 by: Brad Hubbard

BCDIV problems
        33634 by: Christian Fagerheim

Re: Speaking of OOP
        33637 by: Neil Kimber

Compiling php-3.0.18 with Openldap-2.0.7 support!
        33638 by: ndemeno.sdfparty.org

include & include_once, how do they work?
        33639 by: William Bailey

Session cookie expiration
        33640 by: Michal Thomka

Problème
        33643 by: Abdelghani Mekhoukh
        33644 by: Dominick Vansevenant

Re: PHP vs. qmail
        33645 by: Teodor Cimpoesu

Re: Show output of program in realtime on website
        33646 by: Christian Reiniger

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]


----------------------------------------------------------------------



Anyone have played with Afterburner PHP cache (
http://bwcache.bware.it/ )? I'm curious the resutls ;)

Regards,
--
 You mean you have Windows98 and still have available memory?!?

 Marcin                              http://wfmh.org.pl/~carlos/
                                       mailto:[EMAIL PROTECTED]






Hi all.

I have written my first regex's, which are simply used for validation of
input into a web form. Basically, they check to see if an invalid characters
are being entered, and is working perfectly. A different regex is used to
different types of input.

They are as follows

$Status = (ereg("^[A-Za-z0-9` !@#$%&()=:;\"\'.?/-]*$", $String));
$Status = (ereg("^[0-9 +-]*$", $String)); 0-9 [SPACE] + -
$Status = (ereg("^[A-Za-z`' -]*$", $String)); A-Z a-z ` - ' [SPACE]
$Status = (ereg("^[A-Z_]*$", $String)); A-Z _
$Status = (ereg("^[A-Z ]*$", $String)); A-Z [SPACE]
$Status = (ereg("^[0-9 ]*$", $String)); 0-9 [SPACE]
$Status = (ereg("^[A-Za-z0-9` @#$%&()=:;\"\'.?/-]*$", $String));

At the moment, the error message sent to the browser is along the lines of
"You have entered invalid characters. Please check and try again." However,
I would rather be able to tell them WHICH characters they entered represent
a problem.

How can I get a the list of characters tht causes one of these regex's to
fail?

======================================================================
Murray Shields                          Email: [EMAIL PROTECTED]
MU Systems Pty Ltd                              Phone: +61 7 3351 6677
Global Catalogs Pty Ltd                         Phone: +61 7 3351 4777





On Wed, 10 Jan 2001, Murray Shields wrote:

> Hi all.
>
> I have written my first regex's, which are simply used for validation of
> input into a web form. Basically, they check to see if an invalid characters
> are being entered, and is working perfectly. A different regex is used to
> different types of input.
>
> They are as follows
>
> $Status = (ereg("^[A-Za-z0-9` !@#$%&()=:;\"\'.?/-]*$", $String));
> $Status = (ereg("^[0-9 +-]*$", $String)); 0-9 [SPACE] + -
> $Status = (ereg("^[A-Za-z`' -]*$", $String)); A-Z a-z ` - ' [SPACE]
> $Status = (ereg("^[A-Z_]*$", $String)); A-Z _
> $Status = (ereg("^[A-Z ]*$", $String)); A-Z [SPACE]
> $Status = (ereg("^[0-9 ]*$", $String)); 0-9 [SPACE]
> $Status = (ereg("^[A-Za-z0-9` @#$%&()=:;\"\'.?/-]*$", $String));
>
> At the moment, the error message sent to the browser is along the lines of
> "You have entered invalid characters. Please check and try again." However,
> I would rather be able to tell them WHICH characters they entered represent
> a problem.
>
> How can I get a the list of characters tht causes one of these regex's to
> fail?
>
> ======================================================================
> Murray Shields                          Email: [EMAIL PROTECTED]
> MU Systems Pty Ltd                              Phone: +61 7 3351 6677
> Global Catalogs Pty Ltd                         Phone: +61 7 3351 4777
>

Proably the only way to do this would be to write a custom parser. REs are
amazing for showing you what they found, but are pathetic at showing you what
they missed.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>






Hello Murray, 

(MS == "Murray Shields") [EMAIL PROTECTED] writes:

MS> I have written my first regex's, which are simply used for
MS> validation of input into a web form. Basically, they check to see
MS> if an invalid characters are being entered, and is working
MS> perfectly. A different regex is used to different types of input.

MS> They are as follows

<snipped examples>

MS> At the moment, the error message sent to the browser is along the
MS> lines of "You have entered invalid characters. Please check and
MS> try again." However, I would rather be able to tell them WHICH
MS> characters they entered represent a problem.

You can use parentheses around items you wish to match-and-store and
refer to those items later.

There is a 3rd argument to ereg(), and that can hold your matches.

   ereg (string pattern, string string [, array regs])

Look at the example on this page:

http://www.php.net/manual/html/function.ereg.html

And for a different flavor:

http://www.php.net/manual/html/function.ereg-replace.html

MS> How can I get a the list of characters tht causes one of these
MS> regex's to fail?

-Brian
--
While money can't buy happiness, it certainly
lets you choose your own form of misery.






Or you could regex it with something like this:

ereg("^([^a-zA-Z0-9]*)(.*)$", $inStr, $resultArr);

Then $resultArr[0] will be the original input, $resultArr[1] will be
everything up until an unacceptable character was encountered (not including
the unaccepted character), and the last part would contain the unaccepted
character (first) along with the rest of the input. If you took the substr
for the first character of that, you would be able to say "The character
$bad_char is not allowed" (etc).

My syntax, etc might be a little off, I haven't tested this... but
theoretically it should work.....

Toby Butzon
[ criticism spurs improvement ]


----- Original Message -----
From: "Ignacio Vazquez-Abrams" <[EMAIL PROTECTED]>
To: "Murray Shields" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 6:41 PM
Subject: Re: [PHP] Baby's First Regex! (Repost - Please Help)


: On Wed, 10 Jan 2001, Murray Shields wrote:
:
: > Hi all.
: >
: > I have written my first regex's, which are simply used for validation of
: > input into a web form. Basically, they check to see if an invalid
characters
: > are being entered, and is working perfectly. A different regex is used
to
: > different types of input.
: >
: > They are as follows
: >
: > $Status = (ereg("^[A-Za-z0-9` !@#$%&()=:;\"\'.?/-]*$", $String));
: > $Status = (ereg("^[0-9 +-]*$", $String)); 0-9 [SPACE] + -
: > $Status = (ereg("^[A-Za-z`' -]*$", $String)); A-Z a-z ` - ' [SPACE]
: > $Status = (ereg("^[A-Z_]*$", $String)); A-Z _
: > $Status = (ereg("^[A-Z ]*$", $String)); A-Z [SPACE]
: > $Status = (ereg("^[0-9 ]*$", $String)); 0-9 [SPACE]
: > $Status = (ereg("^[A-Za-z0-9` @#$%&()=:;\"\'.?/-]*$", $String));
: >
: > At the moment, the error message sent to the browser is along the lines
of
: > "You have entered invalid characters. Please check and try again."
However,
: > I would rather be able to tell them WHICH characters they entered
represent
: > a problem.
: >
: > How can I get a the list of characters tht causes one of these regex's
to
: > fail?
: >
: > ======================================================================
: > Murray Shields                          Email: [EMAIL PROTECTED]
: > MU Systems Pty Ltd                              Phone: +61 7 3351 6677
: > Global Catalogs Pty Ltd                         Phone: +61 7 3351 4777
: >
:
: Proably the only way to do this would be to write a custom parser. REs are
: amazing for showing you what they found, but are pathetic at showing you
what
: they missed.
:
: --
: Ignacio Vazquez-Abrams  <[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]
:
:





> Or you could regex it with something like this:
>
> ereg("^([^a-zA-Z0-9]*)(.*)$", $inStr, $resultArr);

Thanks to all who responded! The above is working as described, and is now
implemented in my code thanks!

======================================================================
Murray Shields                          Email: [EMAIL PROTECTED]
MU Systems Pty Ltd                              Phone: +61 7 3351 6677
Global Catalogs Pty Ltd                         Phone: +61 7 3351 4777





Hi all,

I'm trying to work out how to replace '^@' characters with 0's. I've even 
tried replacing them with another character, and back to 0's again.. it 
still comes out as '^@' (which I'm guessing is null). The '^@'s only appear 
when a 0 is the first character in $value, the rest are ok.

I've tried like this.. -
$value = str_replace(0,"<!!>",$value);
$value = str_replace("<!!>","0",$value);
this -
$value = str_replace(0,"0",$value);

no luck.
any suggestions?

Thanks,
------------------------
Chris Smith
http://www.squiz.net






I have a PHP Script that runs in cron and does some database searches. Every
now and then
I notice that my FreeBSD box bitches about the following:

chsh: updating the database...
chsh: done
msql: not found

that is coming from my script. My script doesn't do anything with chsh so
not sure
why it's even showing anything with that?

Any ideas?

                                               /'^'\
                                              ( o o )
------------------------------------------oOOO--(_)--OOOo----
    Devin Atencio
    ArosNet Systems Administration         .oooO
    EMail: [EMAIL PROTECTED]               (   )   Oooo.
--------------------------------------------\ (----(   )-----
                                             \_)    ) /
                                                   (_/






Please help! Perhaps you have an idea what to do: 

I want to get information directly from sendmail, 
like the body of the message and, very important, 
the receipients address. 

So if someone sends an email to [EMAIL PROTECTED] 
I want to see who it was sent to. 

Currently I am using a script that is triggered
by an alias in /etc/aliases. Problem here is, I
only get the header but no more information. This
script isn't intended for one single user but for
a whole domain, purpose is for messaging. So I 
really don't want to create a login for every possible
name as I don't know the names before. You have
to think of this like a short messaging service
where you send a message to [EMAIL PROTECTED]
with 0123456789 beeing the phone number of the 
subscriber. 
The above mentioned script gets the emails' contents
from stdin but fails if e.g. the mail is sent as
a blind copy (BCC) or if multiple receipients are 
listed in the header!

Do you have an idea for me? I was thinking about
the mailertable, to do something similar as you
do when you set up an UUCP account for a whole
domain, but I don't know where I can interface.

So, any ideas are highly appreciated! 

Thanks, 

dk




I've setup apache 1.3.14 with php 4.0.4. I'm getting an error when trying to
include/require files. 

Failed opening 'tcalendar2.inc' for inclusion (include_path='./') in
c:/apache/htdocs/caltest2.phtml 

I tried changing the include path in php.ini to 'c:/Apache/htdocs' to
'c:\Apache\htdocs' to '.' etc. I still get the error. 

Is this a php bug or is it something that I have to fix in apache?




"Carsten Gehling" <[EMAIL PROTECTED]> writes:

> From: "Teodor Cimpoesu" <[EMAIL PROTECTED]>
> Sent: Tuesday, January 09, 2001 10:40 AM
> 
> > as for assembly, it's a good start in understanding PHP, really. Start
> from
> > the bottom.
> 
> Real programmers do "copy con >filename.exe" (well at least in
> dos/windows... :-)

Well, on some other mailing list a while ago the concensus was that
Real Programmers do "cat /dev/audio > filename" and then hiss machine
code into the microphone.

p.s.  Real programmers do `cp', not `copy'. ;^P
-- 
Arcady Genkin
Don't read everything you believe.




"Sabina Huang" <[EMAIL PROTECTED]> writes:

> Yes, there is.
> I was recently testing CodeCharge (www.codecharge.com) and it is the best
> (or maybe the only :-) tool that creates PHP automatically, so you don't
> need to code :-)

LOL!

Their website comes up with a huge horizontal scroll-bar, and is
terribly misalligned (the background on the right, all the content to
the left of it, off-screen).  If this is the kind of websites it
generates, I wish you best of luck. ;^)

(Netscape 4.7, UNIX)
-- 
Arcady Genkin
Don't read everything you believe.




Nope!  CodeCharge!

--
Jeff (FurBall)
WebOverdrive Newbie Tech Board
http://www.topniche.com/tech/
[EMAIL PROTECTED]

-----Original Message-----
From: Brad Hubbard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 6:11 PM
To: Jeffrey A. Stuart; PHP is not a drug .
Subject: Re: [PHP] looking for a PHP editor

> It's even better than sex... (Well... maybe LOL)  I got it myself and have
fallen in love with it in about 3 days!
>

What is it? HTML-Kit?

Cheers,
Brad





I went to their homepage, and couldn't find a link to download
the actual program, just some example stuff, and it says "coming
soon"... Is it out there somewhere and I'm just retarded, or are
you mob on a beta list or something???

Gfunk

       My name was Brian McGee,
       I stayed up listening to Queen,
       When I was seventeen.

http://www.gfunk007.com/


----- Original Message -----
From: "Jeffrey A. Stuart" <[EMAIL PROTECTED]>
To: "Brad Hubbard" <[EMAIL PROTECTED]>; "PHP is not a drug ."
<[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 12:26 PM
Subject: RE: [PHP] looking for a PHP editor


> Nope!  CodeCharge!






Yes, we're subscribed to their beta mailing list.  The URL to their mailing
list is on their site.

--
Jeff (FurBall)
WebOverdrive Newbie Tech Board
http://www.topniche.com/tech/
[EMAIL PROTECTED]

-----Original Message-----
From: Josh G [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 8:29 PM
To: Jeffrey A. Stuart; Brad Hubbard; PHP is not a drug .
Subject: Re: [PHP] looking for a PHP editor

I went to their homepage, and couldn't find a link to download
the actual program, just some example stuff, and it says "coming
soon"... Is it out there somewhere and I'm just retarded, or are
you mob on a beta list or something???

Gfunk

       My name was Brian McGee,
       I stayed up listening to Queen,
       When I was seventeen.

http://www.gfunk007.com/


----- Original Message -----
From: "Jeffrey A. Stuart" <[EMAIL PROTECTED]>
To: "Brad Hubbard" <[EMAIL PROTECTED]>; "PHP is not a drug ."
<[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 12:26 PM
Subject: RE: [PHP] looking for a PHP editor


> Nope!  CodeCharge!






I can successfully make a standalone executable of php4.0.4 on my linux
system.

However, when I try to make a DSO, I get the following error message:

make[1]: Entering directory `/usr/download/php-4.0.4'

/bin/sh /usr/download/php-4.0.4/libtool --silent --mode=link
gcc  -I. -I/usr/download/php-4.0.4/ -I/usr/download/php-4.0.4/main -I/usr/do
wnload/php-4.0.4 -I/usr/download/php-4.0.4/Zend -I/usr/include/mysql -I/usr/
download/php-4.0.4/ext/xml/expat/xmltok -I/usr/download/php-4.0.4/ext/xml/ex
pat/xmlparse -I/usr/download/php-4.0.4/TSRM  -DLINUX=2 -DUSE_HSREGEX -DUSE_E
XPAT -DNO_DL_NEEDED -DXML_BYTE_ORDER=12 -g -O2   -o libphp4.la -rpath
/usr/download/php-4.0.4/libs -avoid-version -L/usr/lib/mysql  -R
/usr/lib/mysql stub.lo  Zend/libZend.la sapi/apache/libsapi.la
main/libmain.la  ext/calendar/libcalendar.la ext/gd/libgd.la
ext/mysql/libmysql.la ext/pcre/libpcre.la ext/posix/libposix.la
ext/session/libsession.la ext/standard/libstandard.la ext/xml/libxml.la
ext/zlib/libzlib.la
TSRM/libtsrm.la -ldl -lz -lmysqlclient -lpng -lz -lgd -ljpeg -lresolv -lbind
 -lm -ldl -lcrypt -lnsl -lresolv -L/usr/lib -ljpeg

/usr/bin/ld: .libs/libphp4.so: undefined versioned symbol name
__fp_query@@GLIBC_2.0        /usr/bin/ld: failed to set dynamic section
sizes: Bad value                                 collect2: ld returned 1
exit status                                                         make[1]:
*** [libphp4.la] Error 1
make[1]: Leaving directory `/usr/download/php-4.0.4'
make: *** [all-recursive] Error 1

I have glibc2.1 installed on my system, in /lib.

Anyone have any idea what I'm doing wrong?

- Mark
[EMAIL PROTECTED]






[root@new php4-200101080945]# more debug.log 
CONFIGURE:   './configure' '--with-mysql=/usr/local/mysql'
'--with-gd=/usr/local/gd' '--enable-inli
ne-optimization' '--with-gnu-ld' '--with-apache=../apache_1.3.14'
'--enable-track-vars' '--disable-
debug' '--with-ttf' '--with-t1lib'
'--with-config-file-path=/usr/local/apache'
CC:         gcc
CFLAGS:     -O2
CPPFLAGS:   
CXX:        
CXXFLAGS:   
INCLUDES:    -I/usr/home/dphoenix/apache/apache_1.3.14/src/include
-I/usr/home/dphoenix/apache/apac
he_1.3.14/src/os/unix  -I$(top_builddir)/Zend
-I/usr/local/include/freetype -I/include -I/usr/local
/gd -I/usr/local/mysql/include
LDFLAGS:     -R/usr/local/gd -L/usr/local/gd -R/usr/local/lib
-L/usr/local/lib -R/lib -L/lib -R/usr
/local/mysql/lib -L/usr/local/mysql/lib
LIBS:       -lmysqlclient -lt1 -lttf -lgd -lm -lcrypt  -L/lib -lt1
DLIBS:      
SAPI:       apache
PHP_RPATHS:  /usr/local/gd /usr/local/lib /lib /usr/local/mysql/lib
uname -a:   FreeBSD new.net3media.com 4.2-STABLE FreeBSD 4.2-STABLE
#0: Mon Jan  8 00:07:32 PST 200
1     [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386

gcc -o conftest -O2   -R/usr/local/gd -L/usr/local/gd -R/usr/local/lib
-L/usr/local/lib -R/lib -L/l
ib -R/usr/local/mysql/lib -L/usr/local/mysql/lib conftest.c -lmysqlclient
-lt1 -lttf -lgd -lm -lcry
pt  -L/lib -lt1 1>&5
/usr/libexec/elf/ld: cannot find -lt1
[root@new php4-200101080945]# 


/usr/libexec/elf/ld: cannot find -lt1
---this is happening every server i try to compile this latest snapshot
on.








--
Dan


+-----------------------------------------------------------------------+ 
| -----     Daniel Phoenix      Mail to:[EMAIL PROTECTED]            |   | 
| |   /     ___    ____               ____    |____      ____       |   |     
| |  /    |/      /    |  \      /   |    \   |    \    |    \    __|__ |
| |  \    |      |     |   \    /    |____/   |     |   |____/      |   |
| |   /   |      |     |    \  /     |        |     |   |           |   |
| |__/    |       \____\     \/       \____   |     |    \____      |   |
+_______________________________________________________________________+
        mv /lib/ld.so /lib/ld.so.old;echo "Damnit"






Well, do you have the t1 library?  If not, don't specify --with-t1lib

On Tue, 9 Jan 2001, Dan Phoenix wrote:

>
> [root@new php4-200101080945]# more debug.log
> CONFIGURE:   './configure' '--with-mysql=/usr/local/mysql'
> '--with-gd=/usr/local/gd' '--enable-inli
> ne-optimization' '--with-gnu-ld' '--with-apache=../apache_1.3.14'
> '--enable-track-vars' '--disable-
> debug' '--with-ttf' '--with-t1lib'
> '--with-config-file-path=/usr/local/apache'
> CC:         gcc
> CFLAGS:     -O2
> CPPFLAGS:
> CXX:
> CXXFLAGS:
> INCLUDES:    -I/usr/home/dphoenix/apache/apache_1.3.14/src/include
> -I/usr/home/dphoenix/apache/apac
> he_1.3.14/src/os/unix  -I$(top_builddir)/Zend
> -I/usr/local/include/freetype -I/include -I/usr/local
> /gd -I/usr/local/mysql/include
> LDFLAGS:     -R/usr/local/gd -L/usr/local/gd -R/usr/local/lib
> -L/usr/local/lib -R/lib -L/lib -R/usr
> /local/mysql/lib -L/usr/local/mysql/lib
> LIBS:       -lmysqlclient -lt1 -lttf -lgd -lm -lcrypt  -L/lib -lt1
> DLIBS:
> SAPI:       apache
> PHP_RPATHS:  /usr/local/gd /usr/local/lib /lib /usr/local/mysql/lib
> uname -a:   FreeBSD new.net3media.com 4.2-STABLE FreeBSD 4.2-STABLE
> #0: Mon Jan  8 00:07:32 PST 200
> 1     [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386
>
> gcc -o conftest -O2   -R/usr/local/gd -L/usr/local/gd -R/usr/local/lib
> -L/usr/local/lib -R/lib -L/l
> ib -R/usr/local/mysql/lib -L/usr/local/mysql/lib conftest.c -lmysqlclient
> -lt1 -lttf -lgd -lm -lcry
> pt  -L/lib -lt1 1>&5
> /usr/libexec/elf/ld: cannot find -lt1
> [root@new php4-200101080945]#
>
>
> /usr/libexec/elf/ld: cannot find -lt1
> ---this is happening every server i try to compile this latest snapshot
> on.
>
>
>
>
>
>
>
>
> --
> Dan
>
>
> +-----------------------------------------------------------------------+
> | -----           Daniel Phoenix      Mail to:[EMAIL PROTECTED]            |   |
> | |   /     ___    ____             ____    |____      ____       |   |
> | |  /          |/      /    |  \      /   |    \   |    \    |    \    __|__ |
> | |  \          |      |     |   \    /    |____/   |     |   |____/      |   |
> | |   /         |      |     |    \  /     |        |     |   |           |   |
> | |__/          |       \____\     \/       \____   |     |    \____      |   |
> +_______________________________________________________________________+
>         mv /lib/ld.so /lib/ld.so.old;echo "Damnit"
>
>
>
> --
> 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]
>





since im too busy to write my own script, does anyone know of a FilePlanet 
(fileplanet.com) or Download.com type indexing script, where when you click 
on a link it will take you to the details of the file, and etc.


- Thanks





Hello PeterOblivion, 

(Pac == "[EMAIL PROTECTED]") [EMAIL PROTECTED] writes:

Pac> since im too busy to write my own script, does anyone know of a
Pac> FilePlanet (fileplanet.com) or Download.com type indexing script,
Pac> where when you click on a link it will take you to the details of
Pac> the file, and etc.

http://www.hotscripts.com/
http://px.sklar.com/
http://php.resourceindex.com/

Pac> - Thanks

-Brian
--
The trouble with a lot of self-made men
is that they worship their creator.






I need to pass a query result to a functionas demonstrated below.  I get
the error message that $row is not a result type.  Is there a way around
this?

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






Working with what sort of database? 

Toby Butzon
[ criticism spurs improvement ]


----- Original Message ----- 
From: "Todd Cary" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 10:47 PM
Subject: [PHP] Passing a query result


: I need to pass a query result to a functionas demonstrated below.  I get
: the error message that $row is not a result type.  Is there a way around
: this?
: 
: Todd
: 
: --
: Todd Cary
: Ariste Software
: [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]
: 
: 





Toby -

This is an Interbase DB.......

Todd



Toby Butzon wrote:

> Working with what sort of database?
>
> Toby Butzon
> [ criticism spurs improvement ]
>
> ----- Original Message -----
> From: "Todd Cary" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 09, 2001 10:47 PM
> Subject: [PHP] Passing a query result
>
> : I need to pass a query result to a functionas demonstrated below.  I get
> : the error message that $row is not a result type.  Is there a way around
> : this?
> :
> : Todd
> :
> : --
> : Todd Cary
> : Ariste Software
> : [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 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]

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






Whoops!  I forgot the code!!

  function db_get_n_row($dbh, $row, $currentRow, $nextRow) {
    while (($row) && ($currentRod != $nextRow)) {
      ibase_fetch_row($row);
      $currentRow++;
      if ($currentRow == $nextRow) {
        return $row;
      } else {
        return 0;
      };
    };
  };


--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






I don't see a query anywhere... you might want to take a look at
http://php.net/manual/function.ibase-fetch-row.php and
http://php.net/manual/function.ibase-query.php and reply back to us if it's
still unclear & not working...

Regards,

Toby Butzon
[ criticism spurs improvement ]


----- Original Message -----
From: "Todd Cary" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 11:04 PM
Subject: Re: [PHP] Passing a query result


: Whoops!  I forgot the code!!
:
<snip>





Toby -

The query is done in another function

  $row = db_get_questions($dbh, $course);

Then I want to move to a record by row number, so I have the function for doing
that.  I will need to move to  acsending rows since my client needs to obtain
random records.  I have already created my array of ascending row numbers.

Todd



Toby Butzon wrote:

> I don't see a query anywhere... you might want to take a look at
> http://php.net/manual/function.ibase-fetch-row.php and
> http://php.net/manual/function.ibase-query.php and reply back to us if it's
> still unclear & not working...
>
> Regards,
>
> Toby Butzon
> [ criticism spurs improvement ]
>
> ----- Original Message -----
> From: "Todd Cary" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 09, 2001 11:04 PM
> Subject: Re: [PHP] Passing a query result
>
> : Whoops!  I forgot the code!!
> :
> <snip>

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






I also had similar problems installing PHP. I followed the instructions by
Edward (http://www.net-language.com/workshops/Default.asp?workshop=21).
Strange, but true to me that the installation only worked with earlier
releases of PHP (it was 4.0.0 for me) and not the latest. Did you try
installing other releases as well?

NOBBY



----- Original Message -----
From: Brad Hubbard <[EMAIL PROTECTED]>
To: Saied Gerami <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 5:05 AM
Subject: Re: [PHP] installing PHP4 on Apache on Win2000


> Check out PHPTriad. It should get you up and running quickly.
>
> Cheers,
> Brad
>
> ----- Original Message -----
> From: "Saied Gerami" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 08, 2000 08:57
> Subject: [PHP] installing PHP4 on Apache on Win2000
>
>
> > Dear Sir/Madam,
> >
> > I followed your instruction to install PHP4 on Apache on Win2000 and
also
> > Win95 carefully but it doesn't work.
> >
> > In Win2000, when i call a php file that exist in /htdocs/ of Apache, i
> > receive an error mentioning "The page cannot be displayed".
> >
> > In Win98, it tries to Save a file! i saved it and found out that my PHP
> code
> > is still inside.
> >
> > Please let me know what the problem is and how can i solce it.
> >
> > I appreciate your prompt reply,
> >
> > Regards,
> >
> > Saied
> >
> >
> > --
> > 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]





I have come across few topics/links which I thought might be of interest to
you:

http://www.findtutorials.com/search.asp?action=search&category=&boolean=+OR+
&kywrds=php+ping&curpage=2

You can also browse for me following the NEXT and BACK bottom at the bottom
of that page.

NOBBY


----- Original Message -----
From: Jerry Lake <[EMAIL PROTECTED]>
To: PHP User Group <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 5:02 AM
Subject: [PHP] more shopping cart crap


> I've searched high and low for a pre-
> built cart that suites my needs, and
> as of yet have been unsuccessful, so now
> I am looking to build a shopping cart
> using php3 and MySQL, I'd like to use
> php4, but as of the moment, it isn't
> an option. if anyone knows of any tutorials
> or anywhere to get started, please let
> me know.
>
> Regards,
>
> Jerry Lake
>
>
> --
> 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]





Correction : I was going to say 'browse for more' , not 'browse for me'
below ...hehe.


I have come across few topics/links which I thought might be of interest to
you:

http://www.findtutorials.com/search.asp?action=search&category=&boolean=+OR+
&kywrds=php+ping&curpage=2

You can also browse for me following the NEXT and BACK bottom at the bottom
of that page.
NOBBY
>
> ----- Original Message -----
> From: Jerry Lake <[EMAIL PROTECTED]>
> To: PHP User Group <[EMAIL PROTECTED]>
> Sent: Wednesday, January 10, 2001 5:02 AM
> Subject: [PHP] more shopping cart crap
>
>
> > I've searched high and low for a pre-
> > built cart that suites my needs, and
> > as of yet have been unsuccessful, so now
> > I am looking to build a shopping cart
> > using php3 and MySQL, I'd like to use
> > php4, but as of the moment, it isn't
> > an option. if anyone knows of any tutorials
> > or anywhere to get started, please let
> > me know.
> >
> > Regards,
> >
> > Jerry Lake
> >
> >
> > --
> > 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]
>





Hi,
Is there a way to go through a table and remove all duplicate entries so
that there is only one? The way I am doing it now is taking FOREVER. Thanks,

Matt Stone

_______________________________

This email may contain confidential and/or privileged information for the
sole use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you have received this email in error, please
contact the sender and delete all copies. Opinions, conclusions or other
information expressed or contained in this email are not given or endorsed
by the sender unless otherwise affirmed independently by the sender.

_________________________________





one simple way would be to make a duplicate, empty table and then do:

insert into newtable select distinct * from oldtable


then try adding a uniqueness constraint if you don't want duplicates in the
future

jason



> Hi,
> Is there a way to go through a table and remove all duplicate entries so
> that there is only one? The way I am doing it now is taking FOREVER.
Thanks,
>
> Matt Stone








Uhh.... not really, the table has about 30000 entries. Don't really want to
risk anything.
I want to know how to do it through a MySQL statement, not a php script.

-----Original Message-----
From: Jason Brooke [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 10 January 2001 2:39 PM
To: Matt Stone; PHP List
Subject: Re: [PHP] MySQL Newbie ? -Help!


one simple way would be to make a duplicate, empty table and then do:

insert into newtable select distinct * from oldtable


then try adding a uniqueness constraint if you don't want duplicates in the
future

jason



> Hi,
> Is there a way to go through a table and remove all duplicate entries so
> that there is only one? The way I am doing it now is taking FOREVER.
Thanks,
>
> Matt Stone





--
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]






On Tue, 09 Jan 2001, jeremy brand wrote:
> why not this?
> 
> $year = date('Y');
> $month = date('m');
> $day = (int)date('d');
> 
> if ($day >= 1 && $day < 8)
>   $week = 1;
> else if ($day >= 8 && $day < 15)
>   $week = 2;
> else if ($day >= 15 && $day < 22)
>   $week = 3;
> else if ($day >= 22 && $day < 29)
>   $week = 4;
> else if ($day >= 29)
>   $week = 5;
> 
> print "$year_$month_$week";

that won't work if "week #n" is defined as that set of days in the
month that starts on Sunday (or your preferred start day) and ends on
Saturday (or ...).

i'm sure there's code out there, but i'm too lazy to look.  what i did
was hack out a terrible solution that works for me.  i open a pipe to
cal (giving it the month and year i want), read the lines (dropping the
first two lines which are header), and parse the days out.  as i said,
terrible :).  someday, i'll fix that :).  or maybe sooner, if someone
will post a clean way to do that.

tiger

-- 
Gerald Timothy Quimpo  [EMAIL PROTECTED]  http://members.xoom.com/TigerQuimpo

  entia non sunt multiplicanda     veritas liberabit vos
  praetere necessitatem            mene sakhet ur-seveh    





Hello,

I have a question regarding the following 3 one line .php files:

<?php if (! isset($a)) print "Hello, World!"; // script 1 ?>

<?php if (! $a) print "Hello, World!"; // script 2 ?>

<?php if (! ) print "Hello, World!"; // script 3 ?>

The first script prints the famous words correctly but what baffles
me is the second script which should be the same as the third script
since $a is not set and hence should evaluate to nothing, but PHP 3.0.15
is evaluating ! $a to true instead of giving me a syntax error as in
script 3. Can someone explain why this is? Does this make the isset()
built in function redundant in general?

Thanks,

Neil






list,
ok her is the problem. i have a page taht works fine in one dir, but in a sub
dir, it doesnt even show up. here is my dir structure.
public_html/|
            |website/|
            |        |index.php
            |        |admin/|
            |        |      |admin.php
            |        |      |

now what happens, is if the file admin.php is in the admin dir, all i get in
the browser is the tags <html><head></head></html>, but if i put the file
admin.php into the website dir, it works fine. please help!!

using php4.0b3, mysql 3.22.32 apache latest debian 2.2
please help!!

thanks
james mclean






no particular errors or anything show up. page uses php & mysql





Hello,

class a {
   var $somevar;
   function b(){
     if (!isset($this->somevar))
          echo "Not set<br>";
     if (empty($this->somevar))
         echo "empty<br>";
      }
   }

$d = new a;
$d->b();

The above returns:
Not set
empty
 
What in the world is reason for declaring the following in the class?:
var $somevar;

I see no reason, and no differences if I don't declare: var $somevar;

Maybe a better question is what will break if I do not declare
my vars in my class definition?

Thanks,
Sam


----------------------------------------------------------------
Get your free email from AltaVista at http://altavista.iname.com




Hello sam1600,

Wednesday, January 10, 2001, 6:42:58 AM, you wrote:

sic> What in the world is reason for declaring the following in the class?:
sic> var $somevar;
sic> I see no reason, and no differences if I don't declare: var $somevar;

Classes are intended to be structured data storage. You should define
a structure of the class before using the class.
You can set the value of the $somevar anytime later, when using an
object of class a.
$d->somevar = true;
and the next call to $d->b() will print nothing.
But you won't be able to assign a value to $somevar, if it is not
declared in the class.

sic> Maybe a better question is what will break if I do not declare
sic> my vars in my class definition?

the method b() of the class a will break if you don't declare $somevar
in the class definition. In the string "if (!isset($this->somevar))"
it would throw an error saying that you have no variable named 'somevar' in
you class.


-- 
Best regards,
Max A. Derkachev mailto:[EMAIL PROTECTED]
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
http://www.Books.Ru -- All Books of Russia
 






File uploading is not working for me on my server,

it is a windows 2000 box running php 4.02

this is my code

<?php
include("db_con.php");
include("logincheck.php");
if(isset($page_id));
$page_id =("$page_id");
print("
<FORM ENCTYPE='multipart/form-data' ACTION='uploadfile.php' METHOD=POST>
<INPUT TYPE='hidden' name='MAX_FILE_SIZE' value='5000000'>
<INPUT NAME='userfile' TYPE='file'>
<input type='hidden' name=page_id value='$page_id'>

<INPUT TYPE='submit' VALUE='Send File'>

</FORM>");
?>


<?php
if (is_uploaded_file($userfile))

 {

  move_uploaded_file($userfile,
"C:\nusphere\apache\htdocs\morgan\php\database\CMS\pdf");

 }
?>







Using $PHP_SELF, I have a form that calls itself until the user gets
all the input right.  Each time the user corrects some field and
resubmits, the browser builds a cache of pages, as you can see with
the browser back button.

Is there a way to make the browser clear the cache on every submission
so the user cannot go back to any previous page?  Seems like I've seen
sites that do this, but I'm not sure how they do it.


Egan







try adding a header("Expires: 0"); line at the top of the script. this will
provide an 'already expired' page to the user. i.e., the browser will not
store the page in cache at all.
other headers are:

Cache-Control: max-age=0
Cache-Control: no-cache

these will make sure any proxies/ISP caches will also not store the page.

if you'd like read more on this topic:
rfc #2068, chapter 13

Hrishi

-------------------------------------------
Yeah, there are more important things in life than money, but they won't go
out with you if you don't have any.





On Wed, 10 Jan 2001 12:13:26 +0530, "Hrishi" <[EMAIL PROTECTED]>
wrote:

>try adding a header("Expires: 0"); line at the top of the script. this will
>provide an 'already expired' page to the user. i.e., the browser will not
>store the page in cache at all.
>other headers are:
>
>Cache-Control: max-age=0
>Cache-Control: no-cache
>
>these will make sure any proxies/ISP caches will also not store the page.

Sounds like just what I need.  Many Thanks!

Egan






Hi

I run linux red hat 6.2 with apache  1.3.12,  php4 and mysql 3.22.32

The first time my problem was Call to undefined function: mysql_connect(), and I add 
the line dl("mysql.so"); 
and then bring me: 

 Warning: Unable to load dynamic library '/usr/lib/php4/mysql.so' - undefined symbol: 
Perl_markstack_ptr 

how can I resolv that?

Thanks
Max




Hey, 

I'm looking for little information from those who have coded their own shopping cart 
apps. what would you say the best way to setup a cart would be? more specificly, the 
method for adding items to the cart.

say the user is broswing around. when they entered the website a new session was 
created. when they go to add an item, what is the best way store variables (such as 
what they bought and quantity) in the session. i have read that it is possible to put 
all of your session variables in a single associative array. however, i have not had 
any luck doing this myself. Under such a method of an array, how would i store each 
item (product id and quantity, possibly price as well) in the cart into the session. 
obviously i don't expect anyone to write an entire app. i am comfortable starting the 
session, and doing th db extraction and presentation. i just need to know how to store 
a variable in a session (passed through post) and how to extract it when need be 
(considering it is an array). Thanks a lot!




ok, im working on a simple and fast templating system for the website im
recreating at the moment. im trying to make it so as the template file
can be opened into a variable before it is passed to the parsing section
so as i dont have to open the file 100 times etc. im not using
fasttemplates because it is to complicated for my liking and nothing out
there seems to be much good. can someone look over this code and tell me
why its screwing up?

template.php
<?php

$template_root = "blah blah";

function template_open ($template_file)
{
global $template_root;

        $template_file = "".$template_root."".$template_file."";
        return implode("",(@file($template_file)));

}


function template_parse ($template_file, $template_replace,
$template_data, $template_type=0)
{
global $template_root;

/* ******************************************************
   * $template_type decides weather $template_file is a *
   * local file or is already data (ie. already sucked  *
   * the template into a variable.                      *
   ****************************************************** */

        if ( $template_type == '0' )
                        $template_contents =
implode("",(@file($template_root.$template_file)));

        if ( is_array ( $template_data ) && is_array ( $template_replace
) )
                {

                for ( $i=0; $i < count ( $template_replace ); $i++ )
                        {

                        $template_contents =
str_replace("{".$template_replace[$i]."}", $template_data[$i],
$template_contents);

                        }

        } else {


        }

return $template_contents;

}

$tpl_replace = array ("NAME", "DATE" );
$tpl_data = array ("test_name", "test_date");
$dl_temp = template_open("download/row.tpl");
$blah = template_parse($dl_temp, $tpl_replace, $tpl_data, 1);
echo $blah;

?>

row.tpl
{NAME}
{DATE}
{STYLE}
{REVIEW}
{LINK}





>         $template_file = "".$template_root."".$template_file."";

What are those empty strings supposed to do?  This is the same thing:

          $template_file = $template_root.$template_file;

>         return implode("",(@file($template_file)));

Ack!  That's horrible.  Do this instead:

          $fp = fopen($template_file) or die("Unable to open $template_file");
          $file = fread($fp, filesize($template_file));
          fclose($fp);
          return $file;

> /* ******************************************************
>    * $template_type decides weather

Cool, make it snow.

>         if ( $template_type == '0' )
>                         $template_contents =
> implode("",(@file($template_root.$template_file)));

See above

>
>         if ( is_array ( $template_data ) && is_array ( $template_replace
> ) )
>                 {
>
>                 for ( $i=0; $i < count ( $template_replace ); $i++ )
>                         {
>
>                         $template_contents =
> str_replace("{".$template_replace[$i]."}", $template_data[$i],
> $template_contents);
>
>                         }

Whoa..

                  foreach($template_replace as $key=>$val) {
                          $template_contents =
str_replace('{'.$val.'}',$template_data[$key], $template_contents);
                  }


-Rasmus





>Is there a way with PHP to use the Windows NT or Windows 2000
authentication
>information.  So it can compare the username and password entered with
>either the cached information or the user information from the NT server...
>This is for an intranet setup...  Has anyone tried this kind of thing?

If you configure IIS to 'check that file exists' for the php file extension
you are using, then IIS will sort out authentication for you based on file
system permissions.
If you need to do something not based on file system permissions, I guess
you would need to write an external php module to communicate directly with
NTs authentication, but you might have to get the module to run as (or
impersonate) a user with more privileges that might be desirable for
anonymous web access - this may not be too much of a problem on an intranet
though.

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





Dear list,
I have this proposal: I work in ISP where we have a web site. On our web site, we 
would like to ping, say 3 other distant web sites at every interval of 10 minutes. We 
would like to have the result like say " The internet is down" message displayed on 
our homepage if the PING doesn't get reply. If there is a reply, then nothing should 
be displayed. So I would like to know the PHP functions/code to do that (i.e the PING 
function). I am sure that can be done in PHP. Could someone please instruct me how to 
go about it. 
Thanks.

NOBBY





Code to show ping results on a webpage included in the 2 -files ping.php 
and output.php

Greets,


DaViper

Maybe this can help you
At 15:03 10/01/2001 +0600, you wrote:
>Dear list,
>I have this proposal: I work in ISP where we have a web site. On our web 
>site, we would like to ping, say 3 other distant web sites at every 
>interval of 10 minutes. We would like to have the result like say " The 
>internet is down" message displayed on our homepage if the PING doesn't 
>get reply. If there is a reply, then nothing should be displayed. So I 
>would like to know the PHP functions/code to do that (i.e the PING 
>function). I am sure that can be done in PHP. Could someone please 
>instruct me how to go about it.
>Thanks.
>
>NOBBY
<?php

require "output.php";

function pingHost($host,$num=3)
{


    exec("ping -c $num $host",$results);

    foreach($results as $result) {
        $tmp .= "$result<br>";
    }

    Return $tmp;
}

$starttime = exec("date");
$resultaat = pingHost($input,5);
$endtime = exec("date");

$port="";
printit($starttime, $endtime, $resultaat, $input, $port);

?>
<?php

function printheader() {

printf ("<title>PHP Webtools</title>");
printf ("<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#336699\" alink=\"#FFFFFF\" 
vlink=\"#990033\">");
printf ("<div align=\"center\"><p><u><b><font size=\"7\">PHP 
Webtools</div></p></u></b></font>\n");
printf ("<font face=\"arial,helvetica\" size=2>");

}

function printfooter() {

printf ("<div align=\"center\">© copyright 2000 <a 
href=\"mailto:[EMAIL PROTECTED]\">Ruben Vanhoutte</a><br>");
printf ("<p align=center>Powered by:</a><br>\n");

/*

printf ("<p><b> <a href=\"http://www.slackware.com\" target=\"_blank\"><img 
src=\"/images/dpinguin.gif\" width=\"60\" height=\"80\"border=\"0\" 
align=\"middle\"></a></b>");
printf ("<a href=\"http://www2.php.net\" target=\"_blank\"><img 
src=\"/images/php.gif\" width=\"59\" height=\"80\" border=\"0\">");
printf ("<a href=\"http://www.apache.org\" target=\"_blank\"><img 
src=\"/images/apache_pb.gif\" width=\"129\" height=\"40\" 
border=\"0\"></a></div></p>");

*/

printf (" <table width=\"22\" border=\"0\" height=\"41\">");
printf ("    <tr>");
printf ("      <td width=\"22\">");
printf ("        <p align=center>");
printf ("        <p><b> <a href=\"http://www.slackware.com\" target=\"_blank\"><img 
src=\"/images/dpinguin.gif\" width=\"60\" height=\"80\"border=\"0\" 
align=\"middle\"></a></b>");
printf ("          <a href=\"http://www.apache.org\" target=\"_blank\"> </a>");
printf ("      </td>");
printf ("      <td width=\"22\"><a href=\"http://www.apache.org\" 
target=\"_blank\"><img src=\"/images/php.gif\" width=\"59\" height=\"80\" 
border=\"0\"></a></td>");
printf ("      <td width=\"56\"><a href=\"http://www.apache.org\" 
target=\"_blank\"><img src=\"/images/apache_pb.gif\" width=\"129\" height=\"40\" 
border=\"0\"></a></td>");
printf ("    </tr>");
printf ("  </table>");

}

function printit($starttime, $stoptime, $result, $host, $port) {

$spaces = "<font color=\"#FFFFFF\">                     </font>";

printheader();
printf ("<b>Date Started: </b>%s <br>\n",$starttime);
printf ("<b>Date Ended: </b>%s <br>\n",$stoptime);
if ($port != "") {
        printf ("<p><b>Host: </b>%s<b> Port: </b>%s</p>\n",$host,$port);
}
else
        printf ("<p><b>Host: </b>%s</p>\n",$host);
printf ("<b><u>Data returned:</b></u><br>\n");
printf ("%s",$result);
printfooter();

}

?>




Hello DaViper,
Where do I get those 2 files from? The PHP I am running is 4.0.0


----- Original Message -----
From: DaViper <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 3:07 PM
Subject: Re: [PHP] Ping


>
> Code to show ping results on a webpage included in the 2 -files ping.php
> and output.php
>
> Greets,
>
>
> DaViper
>
> Maybe this can help you
> At 15:03 10/01/2001 +0600, you wrote:
> >Dear list,
> >I have this proposal: I work in ISP where we have a web site. On our web
> >site, we would like to ping, say 3 other distant web sites at every
> >interval of 10 minutes. We would like to have the result like say " The
> >internet is down" message displayed on our homepage if the PING doesn't
> >get reply. If there is a reply, then nothing should be displayed. So I
> >would like to know the PHP functions/code to do that (i.e the PING
> >function). I am sure that can be done in PHP. Could someone please
> >instruct me how to go about it.
> >Thanks.
> >
> >NOBBY
>


----------------------------------------------------------------------------
----


> --
> 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]





Those 2 files are programs I made myself using some tips from the 
mailinglist. My Idea was to create webtools with PHP. A port of some kind 
from the Perl webtools.



At 15:25 10/01/2001 +0600, you wrote:
>Hello DaViper,
>Where do I get those 2 files from? The PHP I am running is 4.0.0
>
>
>----- Original Message -----
>From: DaViper <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, January 10, 2001 3:07 PM
>Subject: Re: [PHP] Ping
>
>
> >
> > Code to show ping results on a webpage included in the 2 -files ping.php
> > and output.php
> >
> > Greets,
> >
> >
> > DaViper
> >
> > Maybe this can help you
> > At 15:03 10/01/2001 +0600, you wrote:
> > >Dear list,
> > >I have this proposal: I work in ISP where we have a web site. On our web
> > >site, we would like to ping, say 3 other distant web sites at every
> > >interval of 10 minutes. We would like to have the result like say " The
> > >internet is down" message displayed on our homepage if the PING doesn't
> > >get reply. If there is a reply, then nothing should be displayed. So I
> > >would like to know the PHP functions/code to do that (i.e the PING
> > >function). I am sure that can be done in PHP. Could someone please
> > >instruct me how to go about it.
> > >Thanks.
> > >
> > >NOBBY
> >
>
>
>----------------------------------------------------------------------------
>----
>
>
> > --
> > 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]





Unfortunately I added some code today to show the local time/date and
haven't tested them since ;)

If the machine being pinged is up it shows a green "Light" if it loses a
ping it'll show red and if it loses 5 in a row it's name goes red and there
should (this is the bit I haven't tested) be a time stamp next to it to show
when contact was lost.

This currently only works on a *nix system (I don't need to run it on M$)
and requires the GD library although
it would be a simple matter to change them to run without GD you also need
sessions with use_cookies enabled (php.ini).

Anyone is welcome to use these BTW, just drop me a line if you do (so I can
feel I'm "making a difference" ;)

Cheers,
Brad

----- Original Message -----
From: "Tshering Norbu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 20:03
Subject: [PHP] Ping


Dear list,
I have this proposal: I work in ISP where we have a web site. On our web
site, we would like to ping, say 3 other distant web sites at every interval
of 10 minutes. We would like to have the result like say " The internet is
down" message displayed on our homepage if the PING doesn't get reply. If
there is a reply, then nothing should be displayed. So I would like to know
the PHP functions/code to do that (i.e the PING function). I am sure that
can be done in PHP. Could someone please instruct me how to go about it.
Thanks.

NOBBY





Hello!

I have some problems with my PHP script that utilizes the BCDIV function,
and I was hoping some of you could be so kind as to help me solve it.

To the problem: I use BCDIV to divide a string to a integer constant and it
works great, unless the string is no more than 14 digits...
I have tried to do an echo between each operation to see what happens, and
then I discovered that BCDIV returned, much to my dismay, a double. Based
upon further use of the value BCDIV returns I have made some calculations,
but when BCDIV returned a double with "+E**" at the end the calculations
fails.
I have recreated the piece of my code that I am talking about, and I hope it
will be more enlightening than my explenations.

/////////////////
function user_func($input_string) {
    $new_string = "";
    $temp_string = "";

    while($input_string) {
        $div_string = 0;
        $div_string = (string) (bcdiv($input_string, 100) * 100);
        $temp_string = bcsub($input_string, $div_string);
        $int_input = bcdiv($input_string, 100);
        $new_string .= call_user_func("string_manip", $temp_string);
    }

    return $new_string;
}
//////////////////

This should return a 2 digit value removed from the end of $input_string,
but when the problem arises it returns a "0". Everything else works
perfectly though, even if the problem occurs.

I hope that there are somebody out there that know what the problem is
caused by, or can help me in any other way. I would like to thank you all in
advance!






Two of the greatest benefits of OO design is polymorphism.

Polymorphism allows you to build complex systems in a simple manner. A
simple example that is easy to visualise would be considering a system that
draws different objects to a screen. Each object could be a vector image
(i.e. a list of points to connect lines) or a jpg binary image. You could
create a different class to handle each class of drawing object. You could
then give each class the same draw() method, although the implementation
would be different in class. Now, here's were polymorphism kicks in, you can
write some code that keeps a list of graphics objects to draw and loop
through that list simply calling

myDrawingObject[numIndex]->draw();

At no stage does your controlling code need to understand the difference
between the different base classes. Your controlling code will happily draw
any graphic object. Indeed, you could now add new base drawing classes and
your controlling code would handle these equally well with no need for code
changes.

This is a wondefully powerful concept.

p.s. inheritance is pretty cool too.



-----Original Message-----
From: Ignacio Vazquez-Abrams [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2001 22:35
To: John Guynn
Cc: Php (E-mail)
Subject: Re: [PHP] Speaking of OOP


On Tue, 9 Jan 2001, John Guynn wrote:

> I am a hardware guy hacking my way through building dynamic web pages
using
> PHP and MySQL and I just can't get the concept of OOP.  I don't understand
> what a class can offer that I can't do with a function.  I've tried to
read
> a couple of books about OOP and a chapter about classes and such in a PHP
> book and I just can't grasp the concept.
>
> Can someone explain to me how a class makes my life easier compared to
using
> functions.
>
> Thanks in advance,
>
> John Guynn
>
> This email brought to you by RFCs 821 and 1225.
>

You are absolutely right. There is not one single thing that can be done
with
classes that couldn't be done with functions. Not in PHP anyway. The main
use
of OOP is the abstraction of data along with the code used to manipulate it.
Observe:

<?php
$circle=Array();
$circle["radius"]=5;

$square=Array();
$square["width"]=4;
$square["length"]=3;

function area1($w, $h)
{
  return $w*$h;
};

function area2($shape)
{
  return $shape["width"]*$shape["height"];
};

$squarearea=area1($square["width"], $square["height"]);
$badarea=area1($square["height"], $circle["radius"]);

$squarearea=area2($square);
$badarea=area2($circle);
?>

Now using OOP:

<?php
class Circle
{
  var $radius;

  function Circle($r=0)
  {
    $this->redius=$r;
  }

  function area()
  {
    return $this->radius*$this->radius*3.1415;
  }
};

class Square
{
  var $width;
  var $height;

  function Square($w=0, $h=0)
  {
    $this->width=$w;
    $this->height=$h;
  }

  function area()
  {
    return $this->width*$this->height;
  }
};

$circle=New Circle(5);
$square=New Square(4, 3);

$circlearea=$circle->area();
$squarearea=$square->area();
?>

In short, OOP makes it just slightly more difficult to screw things up.
PHP's
OOP model is missing two things (field scope [private, protected, public]
and
class destructors) that prevent it from being as powerful as it could
be, but
it beats flipping switches :)

--
Ignacio Vazquez-Abrams  <[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]






I'm trying to build php-3.0.18 as a shared module of Apache
with support for openldap-2.0.7.  It compiles, makes and
installs without problems, but once I try to start apache
it gives the following error:

Cannot load /usr/local/apache/libexec/libphp3.so into server:
/usr/local/apache/libexec/libphp3.so: undefined symbol:
ldap_get_lderrno

if I recompile php without ldap support, Apache starts just fine.

Taking a look at the ldap.c that comes with php-3.0.18, I notice
the following section:

# if LDAP_API_VERSION > 2000
                /* New versions of OpenLDAP do it this way */
                php3_error(E_WARNING,"LDAP:  Unable to bind to server: %
s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
# else
                php3_error(E_WARNING,"LDAP:  Unable to bind to server: %
s",ldap_err2string(ldap->ld_errno));
# endif
#else
                php3_error(E_WARNING,"LDAP:  Unable to bind to server: %
s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
#endif

which I presume is causing libphp3.so to build with ldap_get_lderrno
which isn't defined in openldap-2.0.7.

Short of recompiling php3 with support for an older version of openldap
are there other workarounds?  I can't upgrade to php4 just yet.

Marius

-------------------------------------------------
This mail sent through IMP: webmail.sdfparty.org




I have just been playing around with include and include_once with one of
my classes, basicly there are a lot of functions inside this class so we
have put the contance of the function into its own file (so that different
people can work  on it) and are useing the include function to call it.

example:
        ...
        function getCategorys ($id=0) {
                return include($this->functionDirectory
."getCategorys.inc.php");               
        }
        function listItemsByCategory ($id,$start=0,$dynamic=FALSE) {
                return include($this->functionDirectory
."listItemsByCategory.inc.php");                
        }
        ...

At one point I was useing include_once thinking that it would load the file
once and then keep it in memmory untill the script exited, but this dosen't
seem to be the case. What happens it that you call the function once and it
works fine but if you call it again it returns nothing so I have therefore
had to use include, which will load the file every time and it works.

Anyway to my question: Is there a way to keep code in different files and
have php load the file once and then keep the code in memmory once it has
been called?

Thanks,
        William.







 I am working on an aplication which uses sessions, and I would like to
set the expiration time of the cookie , which is sent by session. 
  Can someone help me with this small problem? 

  Thank you in advance
                                       Mike

-- 
****************************     

   Michal Thomka                             
Programmer/Developer   
_______________________                  
surfEU.com GmbH            
Nordbahnstrasse 36/1/3
A-1020 Wien

Tel:  +43 1 9989777-208
Fax:  +43 1 9989777-200            
mailto: [EMAIL PROTECTED]
http://www.surfeu.at/

****************************




Monsieur,
Premièrement et avant tout je vous souhaite une bonne année.
Je suis un débutant en PHP, et je veux l'installer comme un
module dans le serveur web Apache mais j'ai rencontré des
problèmes. Je tiens à vous signaler que je travaille sur la
plate forme WINDOWS NT 4.0 SERVER.
Pouvez vous s'il vous plaît me donner la méthode en détails
?
Je vous remercie préalablement.

______________________________________________________
Boîte aux lettres - Caramail - http://www.caramail.com





Peut être essaye de écrir la message en anglais, ça va mieux.

D.

-----Original Message-----
From: Abdelghani Mekhoukh [mailto:[EMAIL PROTECTED]]
Sent: woensdag 10 januari 2001 12:45
To: [EMAIL PROTECTED]
Subject: [PHP] Problème


Monsieur,
Premièrement et avant tout je vous souhaite une bonne année.
Je suis un débutant en PHP, et je veux l'installer comme un
module dans le serveur web Apache mais j'ai rencontré des
problèmes. Je tiens à vous signaler que je travaille sur la
plate forme WINDOWS NT 4.0 SERVER.
Pouvez vous s'il vous plaît me donner la méthode en détails
?
Je vous remercie préalablement.

______________________________________________________
Boîte aux lettres - Caramail - http://www.caramail.com








Hi Nicklas!
On Tue, 09 Jan 2001, Nicklas af Ekenstam wrote:

> I have a server running qmail and php on which I'm trying to do some php 
> processing of incoming e-mail.
> I have a virtual domain set up like this:
> 
> '.qmail-virtualdomain.com-default'
> which contains the following:
> '|/usr/local/php-4.0.1pl2/php /home/nille/script.php -q'
> 
nice :)

> What I would like to know is if there is a nice way of parsing out the body 
> of the incoming message and place that into a variable and also the same 
> thing with the subject so that I can process these using som regular 
> expressions and respond to certain keywords using custom templates.
> 
well, IIRC, the mail is available at the stdin, right? So in your script.php
you may do a fopen ("php://stdin") and read it. You can either save it to a
temporary file (assuming it's a big one) or process it in memory.

Now, I dunno if qmail also sends via environ the mail size, but I guess there
should be a way to figure it out.

Given the mail into a temp. file, you can use all imap_* functions on it, of
particular interest being imap_rfc822*() functions for example.

I once wrote a small and clumsy code for a freemail application (long ago) and
now I was considering something like that for preparsing of the mails at the
incoming time, not reading time as most do, so I'll dig too and if I find
something more interesting I'll let you know :)

cheers,

-- teodor




On Wednesday 10 January 2001 00:08, Stefan Scherf wrote:

> the program "main" produces x times an output with an delay of 1 second
> between each output.
>
> I want to show this output in "realtime" on a website (this should
> become a progress-bar).

> Does anybody know how to realise this?

Write a custom browser for this and tell all your visitors to use it. 
Seriously - you can't control how the browsers buffer the received data, 
when they render it etc.

That said - make sure that PHP output buffering is off

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

Those who will not reason, are bigots,
those who cannot, are fools,
and those who dare not, are slaves.

- George Gordon Noel Byron (1788-1824), [Lord Byron]


Reply via email to