[PHP] Re: safe_mode On -- What exactly does it **DO**?

2002-11-25 Thread Richard
It appears to do some stuff which is undocumented.
Specifically it quotes input to popen thus causing any redirection and other
comand line stuff to be passed to the program that is being invoked
as command parameters. Most of the stategies to simulate
bidirectional pipes break because of this.

Jr Bedford wrote:

> Okay, so I have the general idea that safe_mode On is a Good Thing [tm] and
> that using safe_mode_exec_dir with it is a Better Thing.
>
> Unfortunately I am having difficulty locating any documentation that
> describes exactly WHAT these to settings do.
>
> First:
> --
> Is safe_mode On only relevent in conjunction with safe_mode_exec_dir?  In
> other words, does safe_mode On merely restrict the use of system() calls?
> Or does safe_mode On do other things, along the lines of suExec -- such as
> making sure the .php file is owned by the user that owns the directory it
> lives in, that it has certain file permissions, etc. etc. etc.  Where can
> I find documentation on this?
>
> Second:
> ---
> What are the rules for safe_mode_exec_dir?  Can I create a directory
> called allowed-progs/ and then fill it with symLinks to various programs
> throughout the file system that I will allow my users to call?  Or will it
> consider a symLink a security violation and not follow it?  Can I list more
> than one directory?  Can I use wildcards such as /home/*/public_html/cgi ?
>
> Third: (This is a subset of question #2)
> -
> I have set: open_basedir /home/*/public_html
>
> What I REALLY want is more along the lines of /home/%u/public_html so that
> the only thing allowed is stuff in the public_html directory of the OWNER
> of the .php script being run.  I'd also like to do with with the
> safe_mode_exec_dir directory -- setting /home/%u/public_html/cgi
>
> Thanks.
>
> --JRB


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: safe_mode On -- What exactly does it **DO**?

2002-11-25 Thread Richard
It appears to do some stuff which is undocumented.
Specifically it quotes input to popen thus causing any redirection and other
comand line stuff to be passed to the program that is being invoked
as command parameters. Most of the stategies to simulate
bidirectional pipes break because of this.

Jr Bedford wrote:

> Okay, so I have the general idea that safe_mode On is a Good Thing [tm] and
> that using safe_mode_exec_dir with it is a Better Thing.
>
> Unfortunately I am having difficulty locating any documentation that
> describes exactly WHAT these to settings do.
>
> First:
> --
> Is safe_mode On only relevent in conjunction with safe_mode_exec_dir?  In
> other words, does safe_mode On merely restrict the use of system() calls?
> Or does safe_mode On do other things, along the lines of suExec -- such as
> making sure the .php file is owned by the user that owns the directory it
> lives in, that it has certain file permissions, etc. etc. etc.  Where can
> I find documentation on this?
>
> Second:
> ---
> What are the rules for safe_mode_exec_dir?  Can I create a directory
> called allowed-progs/ and then fill it with symLinks to various programs
> throughout the file system that I will allow my users to call?  Or will it
> consider a symLink a security violation and not follow it?  Can I list more
> than one directory?  Can I use wildcards such as /home/*/public_html/cgi ?
>
> Third: (This is a subset of question #2)
> -
> I have set: open_basedir /home/*/public_html
>
> What I REALLY want is more along the lines of /home/%u/public_html so that
> the only thing allowed is stuff in the public_html directory of the OWNER
> of the .php script being run.  I'd also like to do with with the
> safe_mode_exec_dir directory -- setting /home/%u/public_html/cgi
>
> Thanks.
>
> --JRB


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] -DEAPI

2004-01-11 Thread richard
I'm running a Suse 8.2 out of the box. Now I want to create a PHP program
with TCP sockets. The installed version of PHP is not supporting this
because it is still experimental.
After downloading and compiling the PHP source my first programs runs fine
from the command line. Next step is compiling PHP as an apache module. I
downloaded the apche source and compiled it. I didn't install it because
appache is running fine and I'm not sure if all modules in the new apche
will work.
When I compile the PHP source to libphp4.so it says "[warn] Loaded DSO
/usr/lib/apache/libphp4.so
uses plain Apache 1.3 API, this module might crash under EAPI! (please
recompile it with -DEAPI)"
So, before I called the configure script the CFLAGS is set to -DEAPI

export CFLAGS="-DEAPI"
'./configure' '--prefix=/usr/share' '--datadir=/usr/share/php'
'--bindir=/usr/bin' '--libdir=/usr/share' '--includedir=/usr/include'
'--with-_lib=lib' '--with-config-file-path=/etc'
'--with-exec-dir=/usr/lib/php/bin' '--disable-debug' '--enable-bcmath'
'--enable-calendar' '--enable-ctype' '--enable-discard-path' 
'--enable-exif'
'--enable-filepro' '--enable-force-cgi-redirect' '--enable-ftp'
'--enable-gd-imgstrttf' '--enable-gd-native-ttf'
'--enable-inline-optimization' '--enable-magic-quotes'
'--enable-mbstr-enc-trans' '--enable-mbstring' '--enable-mbregex'
'--enable-memory-limit' '--enable-safe-mode' '--enable-shmop'
'--enable-sigchild' '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-trans-sid' '--enable-versioning'
'--enable-wddx' '--enable-yp' '--with-bz2' '--with-ftp' '--with-gettext'
'--with-gmp' '--with-mcal=/usr' '--with-mcrypt' '--with-mysql=/usr'
'--with-snmp' '--with-t1lib' '--with-tiff-dir=/usr' '--with-ttf'
'--with-freetype-dir=yes' '--with-xpm-dir=/usr/X11R6' '--with-zlib=yes'
'--with-xslt-sablot' '--with-iconv' '--with-mm' '--with-apxs=/www/bin/apxs'
'--with-openssl' --enable-sockets 'i586-suse-linux'

When compiling it looks like

/bin/sh
/home/jonker/php-4.3.4/libtool --silent --preserve-dup-deps --mode=compile
gcc -DLINUX=22 -DUSE_HSREGEX -I/www/include -Isapi/apache/ -I/home/jonker/p
hp-4.3.4/sapi/apache/ -DPHP_ATOM_INC -I/home/jonker/php-4.3.4/include 
-I/hom
e/jonker/php-4.3.4/main -I/home/jonker/php-4.3.4 
-I/home/jonker/php-4.3.4/Ze
nd -I/home/jonker/php-4.3.4/ext/mbstring/mbregex 
-I/home/jonker/php-4.3.4/ex
t/mbstring/libmbfl -I/home/jonker/php-4.3.4/ext/mbstring/libmbfl/mbfl 
-I/usr
/include/mcal -I/usr/include/mysql -I/usr/include/ucd-snmp 
-I/home/jonker/ph
p-4.3.4/ext/xml/expat -I/home/jonker/php-4.3.4/TSRM -DEAPI -prefer-pic -c
/home/jonker/php-4.3.4/sapi/apache/mod_php4.c -o sapi/apache/mod_php4.lo

As you can see the -DEAPI is set.

But when I install the new libphp4.so the warning comes back. And worse,
apache crached when retrieving a php page.
Does someone know how to solve this ? Or has a working libphp4.so for me
with the above options ?
Many thanks in advance.

Richard Jonker

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] New to navigation functions...

2001-03-10 Thread Richard

Greetings.

I was wondering if there is any function like the JavaScript function:
location.href = "".or perhaps how I can execute a javascript
function from PHP. All related help is appriciated.

- Richard



-- 
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] New to navigation functions...

2001-03-10 Thread Richard

Thanks, I will check it out.

Anyhow, I was thinking of fixing an Update bug that I have in one of my
scripts. I use the same php file for reading and saving a file, the thing
is, if the user hits update or whatever, the entry or text will be entered
again, because the address is file.php?PARAM1=...&PARAM2=...Can you
help me with this one? What I want to do is to make sure that the location
is purely the website address and the php file name.

- Richard



""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message
98epti$n83$[EMAIL PROTECTED]">news:98epti$n83$[EMAIL PROTECTED]...
> ""Richard"" <[EMAIL PROTECTED]> wrote in message
> 98eo58$7fg$[EMAIL PROTECTED]">news:98eo58$7fg$[EMAIL PROTECTED]...
> > Greetings.
> >
> > I was wondering if there is any function like the JavaScript
function:
> > location.href = "".or perhaps how I can execute a javascript
> > function from PHP. All related help is appriciated.
> >
>
> You cannot execute JavaScript function, but you can use Java. There are
> articles about it on phpbuilder.com or else.
>
> Server side and Client side scripts are nothing to do with each other. You
> can specify parameters for client side script in server side script,
though.
>
> Regards,
> --
> Yasuo Ohgaki
> PHP and Related resources
> [PHP FAQ] http://www.php.net/FAQ.php
> [PHP Manual] http://www.php.net/manual/en/
> [PHP Links] http://www.php.net/links.php
> [RFCs] http://www.faqs.org/rfcs/
>
>
> > - Richard
> >
> >
> >
> > --
> > 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 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] submit button

2001-03-17 Thread Richard

You will have to use JavaScript.

Use the following:
 document.poster.action.disabled=true;   // Disable Submit & Preview
button

Or, if you aren't having it within a form, put the javascript in the end of
the page and write:

document.btnSend.disabled=true;

Note that the first code disables ALL "action" buttons...

- Richard


""george"" <[EMAIL PROTECTED]> wrote in message
99029b$78h$[EMAIL PROTECTED]">news:99029b$78h$[EMAIL PROTECTED]...
> IS there a way of making sure that a submit button cant be pressed twice.I
> am using a form to send an email and dont want two emails showing up.
>
> 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 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] Reading one line, and no more.

2001-03-19 Thread Richard

Greetings.

How can I read one specified row in a flat textfile? I am working in
arrays and so forth, therefore one row is enough. Thanks.

- Richard



-- 
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] ...And removing one line only?

2001-03-20 Thread Richard

Greetings.

This is a part of my "reading one line" message...

If one would need to remove one line in a flatfile, how would it be done? I
know there is no simple solution, and one is going to increment through the
chosen file.. But how is it done? My programming skills are quite OK, but I
am rather new to PHP and the for...loops doesnt work exactly the same way as
in C++, thus that I have forgotten the way to read line in one file and in
the same time iterate through another to write...

Remove one line?

Thanks,

- Richard



-- 
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] Create a Bulletin Board

2001-03-20 Thread Richard

Do you know anyone that doesn't use MySQL? I mean, that uses flatfiles?

- Richard


""Yoshi Melrose"" <[EMAIL PROTECTED]> wrote in message
032601c0b192$1eaed610$0214a8c0@enterprise">news:032601c0b192$1eaed610$0214a8c0@enterprise...
> Ahh... that's right, my bad. =)
>
> - Original Message -
> From: "James Atkinson" <[EMAIL PROTECTED]>
> To: "PHP General List" <[EMAIL PROTECTED]>
> Sent: Tuesday, March 20, 2001 4:59 PM
> Subject: RE: [PHP] Create a Bulletin Board
>
>
> > Anyone who wants a threaded discussion board won't be satisfied with
> phpBB.
> > It dosan't contain a threaded view and probably never will :)
> >
> > - James Atkinson
> > Lead Developer, phpBB
> >
> > > You could also check out phpBB:
> > >
> > > http://www.phpbb.com
> > > > > > Just keep track of a parent message number.  You should be able
> > > > > > to use that one field to trace any message back to a root
message.
> > > > > > And with that information, you should be able to build a
"thread".
> > > > > I concur on that.
> > > >
> > > > Good to see it's not just me. :p
> > > >
> > > > > However, I am more fond of the UBB/vBulletin style of
> > > > > threads, personally.
> > > >
> > > > UBB style threads?
> > > >
> > > > 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 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] Comparing two dates.. Which is the older one?

2001-03-20 Thread Richard

Greetings.

(yes.. I am active)

When a user loggs on, I pass the string $loggtime, that is written to a
file. Whenever a this user refreshes any of the pages, certain tasks are
performed, and a file's contents is checked, (which contents is a single
line of time). If the $loggtime is newer, nothing would happen, but if the
$loggtime is older than what is written in the file, something should
happen. Any ideas of how I can compare two dates?

- Richard


ps: to all who wonders, I am writing a really small community. Now, this
question is related whenever a new message is sent.. The message is written
to a file, and I check that file everytime a site is refreshed. The file is
arrayed with "|" as a separator. :Ds



-- 
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] Create a Bulletin Board

2001-03-20 Thread Richard

Oh...Well, learning something new every day. Seriously; I have never been
coding against a database.

- Richard

""James Atkinson"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I don't know of any PHP bulletin boards that use flat files. I database is
> far better for storing data like this anyway. Ever seen a UBB board with
> over 1,000,000 posts? Doing a simple search on it crashes the server...
>
> The next version of phpBB will have support for MySQL, Postgres, MSSQL,
ODBC
> and Oracle.
>
> - James
>
> > -Original Message-
> > From: Richard [mailto:[EMAIL PROTECTED]]
> > Sent: March 20, 2001 3:08 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Create a Bulletin Board
> >
> >
> > Do you know anyone that doesn't use MySQL? I mean, that uses flatfiles?
> >
> > - Richard
> >
> >
> > ""Yoshi Melrose"" <[EMAIL PROTECTED]> wrote in message
> > 032601c0b192$1eaed610$0214a8c0@enterprise">news:032601c0b192$1eaed610$0214a8c0@enterprise...
> > > Ahh... that's right, my bad. =)
> > >
> > > - Original Message -
> > > From: "James Atkinson" <[EMAIL PROTECTED]>
> > > To: "PHP General List" <[EMAIL PROTECTED]>
> > > Sent: Tuesday, March 20, 2001 4:59 PM
> > > Subject: RE: [PHP] Create a Bulletin Board
> > >
> > >
> > > > Anyone who wants a threaded discussion board won't be satisfied with
> > > phpBB.
> > > > It dosan't contain a threaded view and probably never will :)
> > > >
> > > > - James Atkinson
> > > > Lead Developer, phpBB
> > > >
> > > > > You could also check out phpBB:
> > > > >
> > > > > http://www.phpbb.com
> > > > > > > > Just keep track of a parent message number.  You
> > should be able
> > > > > > > > to use that one field to trace any message back to a root
> > message.
> > > > > > > > And with that information, you should be able to build a
> > "thread".
> > > > > > > I concur on that.
> > > > > >
> > > > > > Good to see it's not just me. :p
> > > > > >
> > > > > > > However, I am more fond of the UBB/vBulletin style of
> > > > > > > threads, personally.
> > > > > >
> > > > > > UBB style threads?
> > > > > >
> > > > > > 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 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 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] Comparing two dates.. Which is the older one?

2001-03-20 Thread Richard

I forgot to mention that the timestamp is:
$date_output = date("Y-m-d H:i A");

But that would work as fine correct?

- Richard


""Phillip Bow"" <[EMAIL PROTECTED]> wrote in message
998p9a$hqp$[EMAIL PROTECTED]">news:998p9a$hqp$[EMAIL PROTECTED]...
> Depending on what sort of timestamp you are getting you should be able to
> just do:
> if ($loggtime > $oldLoggtime) then...
>
> With just a straight unix timestamp(via mktime();) this would work fine.
> --
> phill
>
> ""Richard"" <[EMAIL PROTECTED]> wrote in message
> 998o75$aol$[EMAIL PROTECTED]">news:998o75$aol$[EMAIL PROTECTED]...
> > Greetings.
> >
> > (yes.. I am active)
> >
> > When a user loggs on, I pass the string $loggtime, that is written
to
> a
> > file. Whenever a this user refreshes any of the pages, certain tasks are
> > performed, and a file's contents is checked, (which contents is a single
> > line of time). If the $loggtime is newer, nothing would happen, but if
the
> > $loggtime is older than what is written in the file, something should
> > happen. Any ideas of how I can compare two dates?
> >
> > - Richard
> >
> >
> > ps: to all who wonders, I am writing a really small community. Now, this
> > question is related whenever a new message is sent.. The message is
> written
> > to a file, and I check that file everytime a site is refreshed. The file
> is
> > arrayed with "|" as a separator. :Ds
> >
> >
> >
> > --
> > 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 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] Comparing two dates.. Which is the older one?

2001-03-20 Thread Richard

Thanks..

So $date_output should only be used to print out current time, and
$timestamp is the one I should use to compare the dates?

- Richard

""Phillip Bow"" <[EMAIL PROTECTED]> wrote in message
998rej$16l$[EMAIL PROTECTED]">news:998rej$16l$[EMAIL PROTECTED]...
> If I were doing this for simplicity's sake I would alter this to be:
>  $timestamp = mktime();
>  $date_output = date("Y-m-d H:i A", $timestamp);
> Then store the $timestamp in the (pseudo)database.  Any operations I need
to
> compare times will be done on the $timestamp data rather than the
> $date_output data which contains a bunch of string data that would
otherwise
> have to be compensated for with more code.
> --
> phill
>
>
> --
> 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] Sorry :(

2001-04-14 Thread Richard

Hey, take it easy, I started like that too, I think we all did.

- Richard

""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
001301c0c51c$3cb49e40$0d1012d1@null">news:001301c0c51c$3cb49e40$0d1012d1@null...
I realized that'll that I don't do much to help this community. I rarely
reply to people's questions. Mainly because I have 56.6 and when I get mail
people answered already. I also ask alot of questions. Just saying thanks
for putting up with me.
Chris, The 17 yr Old Php Coder




-- 
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] Sorry :(

2001-04-15 Thread Richard

hahaha
""Plutarck"" <[EMAIL PROTECTED]> wrote in message
9bbq7u$9vr$[EMAIL PROTECTED]">news:9bbq7u$9vr$[EMAIL PROTECTED]...
> Remember: There are no stupid questions. Only stupid people.
>
>
> ...*couldn't resist*
>
> ;)
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> ""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
> 002b01c0c528$7ea85a60$0d1012d1@null">news:002b01c0c528$7ea85a60$0d1012d1@null...
> > Well thanks everyone, don't feel like I'm "leeching" from the community
> > anymore. Now when it comes to me and napster, thats another story
> > - Original Message -
> > From: "Brian Clark" <[EMAIL PROTECTED]>
> > To: "PHP is not a drug." <[EMAIL PROTECTED]>
> > Sent: Saturday, April 14, 2001 7:47 PM
> > Subject: Re: [PHP] Sorry :(
> >
> >
> > > Hi Chris,
> > >
> > > @ 3:51:02 PM on 4/14/2001, Chris Anderson wrote:
> > >
> > > > I realized that'll that I don't do much to help this community. I
> > > > rarely reply to people's questions. Mainly because I have 56.6 and
> > > > when I get mail people answered already. I also ask alot of
> > > > questions. Just saying thanks for putting up with me. Chris, The 17
> > > > yr Old Php Coder
> > >
> > > As far as I'm concerned, you don't have a thing to be sorry about.
> > >
> > > There isn't a thing wrong with asking questions here. In fact, if you
> > > have a good book and this list to get help from, you're far more
> > > likely to become successful with PHP.
> > >
> > > -Brian
> > > --
> > >  PGP is spoken here: 0xE4D0C7C8
> > >  Please, DO NOT carbon copy me on list replies.
> > >
> > >
> > >
> > > --
> > > 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 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] Sorry :(Just Testing)

2001-04-15 Thread Richard

There is PHP.TEST if you would like to test your posts


"Effendi Mahfud" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> > -Original Message-
> > From: Plutarck [SMTP:[EMAIL PROTECTED]]
> > Sent: Sunday, April 15, 2001 4:38 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Sorry :(
> >
> > Remember: There are no stupid questions. Only stupid people.
> >
> >
> > ...*couldn't resist*
> >
> > ;)
> >
> >
> > --
> > Plutarck
> > Should be working on something...
> > ...but forgot what it was.
> >
> >
> > ""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
> > 002b01c0c528$7ea85a60$0d1012d1@null">news:002b01c0c528$7ea85a60$0d1012d1@null...
> > > Well thanks everyone, don't feel like I'm "leeching" from the
community
> > > anymore. Now when it comes to me and napster, thats another story
> > > - Original Message -
> > > From: "Brian Clark" <[EMAIL PROTECTED]>
> > > To: "PHP is not a drug." <[EMAIL PROTECTED]>
> > > Sent: Saturday, April 14, 2001 7:47 PM
> > > Subject: Re: [PHP] Sorry :(
> > >
> > >
> > > > Hi Chris,
> > > >
> > > > @ 3:51:02 PM on 4/14/2001, Chris Anderson wrote:
> > > >
> > > > > I realized that'll that I don't do much to help this community. I
> > > > > rarely reply to people's questions. Mainly because I have 56.6 and
> > > > > when I get mail people answered already. I also ask alot of
> > > > > questions. Just saying thanks for putting up with me. Chris, The
17
> > > > > yr Old Php Coder
> > > >
> > > > As far as I'm concerned, you don't have a thing to be sorry about.
> > > >
> > > > There isn't a thing wrong with asking questions here. In fact, if
you
> > > > have a good book and this list to get help from, you're far more
> > > > likely to become successful with PHP.
> > > >
> > > > -Brian
> > > > --
> > > >  PGP is spoken here: 0xE4D0C7C8
> > > >  Please, DO NOT carbon copy me on list replies.
> > > >
> > > >
> > > >
> > > > --
> > > > 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 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 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] Mailbox and PHP

2001-04-15 Thread Richard

Greetings.

I have no problem writing an email client in PHP, which sends emails and
such things. One thing only, can I check someones POP3, such as mine,
through PHP? If so, what should be needed to complete it..? The server I am
using is running Linux FreeBSd (I think..) with the options for the user to
change quite alot..

- Richard



-- 
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] Mailbox and PHP

2001-04-15 Thread Richard

Thanks alot, seems to work allright.

- Richard

"Martin Skjöldebrand" <[EMAIL PROTECTED]> wrote in message
9bc8bf$5kb$[EMAIL PROTECTED]">news:9bc8bf$5kb$[EMAIL PROTECTED]...
> Richard wrote:
>
> > Greetings.
> >
> > I have no problem writing an email client in PHP, which sends emails
> > and
> > such things. One thing only, can I check someones POP3, such as mine,
> > through PHP? If so, what should be needed to complete it..? The server I
> > am using is running Linux FreeBSd (I think..) with the options for the
> > user to change quite alot..
>
>
> You can find a class lib in the e-mail section at the address below. Don't
> know how good it is, but I've done a (very) quick test and it does work.
>
> http://phpclasses.upperdesign.com/browse.html/package/2
>
> --
> 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] Site Sessions: Online/Offline - help?

2001-04-16 Thread Richard

Greetings.

Some of you are familiar with my latest project, a smaller community. I
have implemented almost everything I need, and I wish to thank those of you
who helped me with "which mail is new" and so forth. However, this problem
is quite worse I suppose, but I hope some of you has done something like
this before:

Sessions.

I wish to keep track of every visitor. Not a counter or anything, but more
of when a person signs in, the users nickname will be bound to this session
ID which will keep track of the person is online or offline. I have solved
it like so:

Whenever a person loggs in, I add it's name to a online.dat file. When
the user signs of, I remove the nickname thus the login time from the file.

PROBLEMS?? First one: User must click on "logout" to remove itself. Second:
It does not always remove itself.

Therefore, I ask: How can I create a new session for every visitor (so I
know how many are online at the time), bind this ID to its nickname (so one
row in a file would be: NICKNAME|SESSION_ID|DATE), and how can I make sure
that whenever the browser is closed or whatever, or after a certain time of
inactivity (3 minutes), the user is removed from the file.

All help is greatly appriciated and your name will be on the credits list
too.

- Richard



-- 
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] Blur some text please

2001-04-16 Thread Richard

Nah... It's up to the browser. 8-bit text cannot be given any effects using
PHP.

- Richard

"Brandon Orther" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> Does anyone know of an image library that plugs right into php that has a
> blur function so I can create a drop shadow effect for text?
>
> Thanks
> Brandon
>
>
> --
> 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 do i include ASP script into PHP...??!

2001-04-16 Thread Richard

ASP is a pathetic framwork.

""Phil Driscoll"" <[EMAIL PROTECTED]> wrote in message
005f01c0c6c2$ad8a2200$0c01a8c0@philsntserver">news:005f01c0c6c2$ad8a2200$0c01a8c0@philsntserver...
> There may be some perverse way of getting php and asp to parse the same
> page, but I;m sure you don't want to go there.
>
> If you have a legacy ASP script which you need to access, you can call it
> from within PHP using something like:
>
> $f=fopen('http://your.server/legacyscript.asp"), "r");
> if($f)
> {
>  /*read the data from the file handle and deal with it as you wish - you
> might want to process it somehow, or just output it as part of the current
> page*/
>  fclose($fp);
> }
>
> 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]
>



-- 
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] Site Sessions: Online/Offline - help?

2001-04-17 Thread Richard

Greetings.

Thanks for your help! That about people not using logout buttons is really
true! But what can one expect? However, how can I create a unique session
ID? I don't use Databases, at least not MYSQL.

- Richard

""Plutarck"" <[EMAIL PROTECTED]> wrote in message
9bhsa8$vq8$[EMAIL PROTECTED]">news:9bhsa8$vq8$[EMAIL PROTECTED]...
> Simplest way to do it IMHO.
>
> When a user logs in (starts their session) register their username into
the
> session (that session is "bound" to them now).
>
> On every page when a user does anything, update your database with the
> current time as a "last_activity" entry for that user.
>
> When showing who is currently logged in, get all the entries out and check
> their dates. If the last activity is older than a certain amount of
> acceptable time (how long it takes them to be considered "logged out".
note:
> people rarely use a logout button), then consider that user as not being
> logged in.
>
> Delete the entry so your "who's online" function doesn't hugely slow down
> the page, and you should be good to go.
>
>
> The only problem is that you have to do an update every time someone
visits
> a page, which increases your server load. But to avoid any noticable slow
> down you could just use a register_shutdown_function.
>
> I think that should handle your problem...
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> ""Richard"" <[EMAIL PROTECTED]> wrote in message
> 9bfv6n$pds$[EMAIL PROTECTED]">news:9bfv6n$pds$[EMAIL PROTECTED]...
> > Greetings.
> >
> > Some of you are familiar with my latest project, a smaller
community.
> I
> > have implemented almost everything I need, and I wish to thank those of
> you
> > who helped me with "which mail is new" and so forth. However, this
problem
> > is quite worse I suppose, but I hope some of you has done something like
> > this before:
> >
> > Sessions.
> >
> > I wish to keep track of every visitor. Not a counter or anything, but
more
> > of when a person signs in, the users nickname will be bound to this
> session
> > ID which will keep track of the person is online or offline. I have
solved
> > it like so:
> >
> > Whenever a person loggs in, I add it's name to a online.dat file.
When
> > the user signs of, I remove the nickname thus the login time from the
> file.
> >
> > PROBLEMS?? First one: User must click on "logout" to remove itself.
> Second:
> > It does not always remove itself.
> >
> > Therefore, I ask: How can I create a new session for every visitor (so I
> > know how many are online at the time), bind this ID to its nickname (so
> one
> > row in a file would be: NICKNAME|SESSION_ID|DATE), and how can I make
sure
> > that whenever the browser is closed or whatever, or after a certain time
> of
> > inactivity (3 minutes), the user is removed from the file.
> >
> > All help is greatly appriciated and your name will be on the credits
list
> > too.
> >
> > - Richard
> >
> >
> >
> > --
> > 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 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] Site Sessions: Online/Offline - help?

2001-04-18 Thread Richard


> mt_srand ((double) microtime() * 100);


Thanks alot, I will use the upper one... Perhaps decrease it abit ;)


> Note: one way to auto-logout someone is to use something like a on_unload
> javascript procedure, but don't bother. Not worth the hassle and it's
isn't
> fool-proof.

Nopp, tried that. It loggs out every time you change site, and I don't use
frames. I intend to use frames, so when the main frame is closed, that means
that the whole shit is closed. But now, I switch sites constantly, without
frames.

But still, with frames, our trick would work.

- Richard



-- 
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] Site Sessions: Online/Offline - help?

2001-04-19 Thread Richard

Greetings.

I am having some problems with the code itself! I have done like so,
that whenever peopel wishes to see the "onliners", I start a function called
DelOld(). This will not decrease server speed, nor create conflicts when
writing to temporary files and so forth.
Now, I tried to gather the following into an exploded array:

// the date output
$date_output = date("Y-m-d-H-i-A");

As you see, I've seperated all with a "-" so I can simply call [0], [1],
[2],... if I want something. Now, How can I compare if a user is away for
like 10 minutes, or 30 minutes? I have a function called
GetLoggDateofUser($Username) which will retreive the  $date_output, but with
colons and spaces, like so:
date("Y-m-d H:i A").

Do you or anyone else have any suggestions?

- Richard



-- 
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] Site Sessions: Online/Offline - help?

2001-04-20 Thread Richard

Greetings. (the thread was too far down to be read by anyone)

I am having some problems with the code itself! I have done like so,
that whenever peopel wishes to see the "onliners", I start a function called
DelOld(). This will not decrease server speed, nor create conflicts when
writing to temporary files and so forth.
Now, I tried to gather the following into an exploded array:

// the date output
$date_output = date("Y-m-d-H-i-A");

As you see, I've seperated all with a "-" so I can simply call [0], [1],
[2],... if I want something. Now, How can I compare if a user is away for
like 10 minutes, or 30 minutes? I have a function called
GetLoggDateofUser($Username) which will retreive the  $date_output, but with
colons and spaces, like so:
date("Y-m-d H:i A").

Do you or anyone else have any suggestions?

- Richard





-- 
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] RE: Site Sesions: Online/off...

2001-04-20 Thread Richard

Greetings. (the thread was too far down to be read by anyone)

I am having some problems with the code itself! I have done like so,
that whenever peopel wishes to see the "onliners", I start a function called
DelOld(). This will not decrease server speed, nor create conflicts when
writing to temporary files and so forth.
Now, I tried to gather the following into an exploded array:

// the date output
$date_output = date("Y-m-d-H-i-A");

As you see, I've seperated all with a "-" so I can simply call [0], [1],
[2],... if I want something. Now, How can I compare if a user is away for
like 10 minutes, or 30 minutes? I have a function called
GetLoggDateofUser($Username) which will retreive the  $date_output, but with
colons and spaces, like so:
date("Y-m-d H:i A").

Do you or anyone else have any suggestions?

- Richard





-- 
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] RE: Site Sesions: Online/off...

2001-04-21 Thread Richard

Hehehe.. Yeah.

Thanks alot, this will do perfectly good.

- Richard


""Plutarck"" <[EMAIL PROTECTED]> wrote in message
9bqhpe$f3d$[EMAIL PROTECTED]">news:9bqhpe$f3d$[EMAIL PROTECTED]...
> If you want to make it easy on yourself, convert it into a timestamp (unix
> preferably). Then all you have to do is:
>
> $dif = time() - $last_access_time;
>
> if ($dif > 3600)
> {
> echo "The user has been inactive for more than an hour.";
> }
>
> That's if you want to make it easy on yourself. If you're a masochist I
> suppose you could play around with mktime()  :)
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> ""Richard"" <[EMAIL PROTECTED]> wrote in message
> 9bpbf3$fc$[EMAIL PROTECTED]">news:9bpbf3$fc$[EMAIL PROTECTED]...
> > Greetings. (the thread was too far down to be read by anyone)
> >
> > I am having some problems with the code itself! I have done like so,
> > that whenever peopel wishes to see the "onliners", I start a function
> called
> > DelOld(). This will not decrease server speed, nor create conflicts when
> > writing to temporary files and so forth.
> > Now, I tried to gather the following into an exploded array:
> >
> > // the date output
> > $date_output = date("Y-m-d-H-i-A");
> >
> > As you see, I've seperated all with a "-" so I can simply call [0],
> [1],
> > [2],... if I want something. Now, How can I compare if a user is away
for
> > like 10 minutes, or 30 minutes? I have a function called
> > GetLoggDateofUser($Username) which will retreive the  $date_output, but
> with
> > colons and spaces, like so:
> > date("Y-m-d H:i A").
> >
> > Do you or anyone else have any suggestions?
> >
> > - Richard
> >
> >
> >
> >
> >
> > --
> > 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 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] Searching arrayed file... Suggestions?

2001-04-21 Thread Richard

Greetings.

I have made a try to write a search engine for a site I run. This search
iterates through all links which are made up like so:
"|BY|EMAIL|CATEGORY|FOLDER/BAND|LINKNAME|LINKURL|". Now, I use the code:

 if ($txtLinkname=="") return;

$logfile="entries.txt";
$file_line = file($logfile);
$total_lines = count($file_line);

// Start printing the header of the table. The rest is completed, nested
// course.. in the incrementation-loop.

echo"";
echo"";

for($i=($total_lines-1); 0 <= $i; $i--) { $line[] = $file_line[$i]; }

echo "Searching for links containing $txtLinkname...";
echo "";
echo "";
for ($i=0; $i < $total_lines; $i++){
$line_array = explode("|",$line[$i]);

$swhere=strtolower($line_array[5]);
$swhat=strtolower($txtLinkname);

$pos = strpos ($swhere, $swhat);
if ($pos<0) {
// not found

}else if (($pos>1) && (!empty($pos))) {
$found++;

echo"Name: $line_array[1]\n";
echo"Email: mailto:$line_array[2]\">$line_array[2]\n";
echo"Category: $line_array[3]\n";
echo"Band/Folder: $line_array[4]\n";
echo"Link Name: $line_array[5]\n";
echo"Link URL: $line_array[6]\n";
echo "";
}


 }
echo "";
if ($found==0) {
echo "No links found containing '$txtLinkname'!";
}else{
echo "Found: $found links containing $txtLinkname";
}

echo "";
echo "[ POST LINK | VIEW LINKS ]";
$found=0;
 echo "";
  ?>




And that is all the code I use. Where have I done wrong? You see, the
problem is that I found only some links, but not all. And if I have a link
called "Necrolust - Tribute to MayheM", it cannot find the "Necro" nor
"necRO". And as you can see, I HAVE used uppercase methods to find portions
and so forth. Any help is suggested!!

- Richard



-- 
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] Remove duplicates, as long as you have it.

2001-04-22 Thread Richard

Greetings.

I have this link file which has been active for quite a while, but the
problem is that when I used a "admin" program to manage the links
(admin.php) it kinda wrote the file multiple times, which means that it has
sorted the file and added multiple instances of the lines.

How I managed to create it? Well, by using the free linkadd/linkmanager
PHP script. Anyhow, what I need is how can I remove duplicates that are
sorted in arrays? Or does anyone of you has such a script or C++ program, so
you could sort the file for me or something?

Thanks
- Richard



-- 
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] Remove duplicates, as long as you have it.

2001-04-22 Thread Richard

That removes instances in an array, I am talking about a file. Each line
contains non-duplicate words, but the lines are mixed and duplicated,
perhaps trippled.

- Richard

""Taylor, Stewart"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Have you tried the array_unique function
> http://www.php.net/manual/en/function.array-unique.php
>
>
> -Stewart
>
> -Original Message-
> From: Richard [mailto:[EMAIL PROTECTED]]
> Sent: 22 April 2001 12:36
> To: [EMAIL PROTECTED]
> Subject: [PHP] Remove duplicates, as long as you have it.
>
>
> Greetings.
>
> I have this link file which has been active for quite a while, but the
> problem is that when I used a "admin" program to manage the links
> (admin.php) it kinda wrote the file multiple times, which means that it
has
> sorted the file and added multiple instances of the lines.
>
> How I managed to create it? Well, by using the free
linkadd/linkmanager
> PHP script. Anyhow, what I need is how can I remove duplicates that are
> sorted in arrays? Or does anyone of you has such a script or C++ program,
so
> you could sort the file for me or something?
>
> Thanks
> - Richard
>
>
>
> --
> 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 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] Autoupdate of page

2001-04-25 Thread Richard

You can set a JavaScript to refresh after an amount of time, or call this
function whenever the table is updated.


echo "jscode";// as soon
as you are done.


-Richard


""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
004101c0cba9$b330b840$211412d1@null">news:004101c0cba9$b330b840$211412d1@null...
> Hitting refresh would do it, you cant do anything client wise because the
> box is being filled by the server code
> - Original Message -
> From: "Martin Skjöldebrand" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 24, 2001 3:53 PM
> Subject: [PHP] Autoupdate of page
>
>
> > IS there a standard way of "auto-updateing" the contents of a page after
a
> > databas insert or edit? Do a SELECT updates the contents I can update
> > tables I've noticed. Contents in select boxes (as in
> >
> >  while ($row = mysql_fetch_row($secquery_res)) {
> > print "$row[0]";
> >   }
> > )
> >
> > is not automatically updated to match edits or inserts done on the same
> > page. You have to initialize the select box again. Or is there another
> way?
> >
> > M.
> >
> > --
> > 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 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] in_array() function not supported on my server... anything else?

2001-04-26 Thread Richard

Greetings..

This is how I currently check for instances of words and other:

 for ($i=0; $i < $total_lines; $i++){
$line_array = explode("|",$line[$i]);


$swhat=strtolower($txtLinkname);
$xos =
array(strtolower($line_array[1]),strtolower($line_array[2]),strtolower($line
_array[3]),strtolower($line_array[4]),strtolower($line_array[5]));

if (in_array($swhat,$xos,true)) {
$found++;


Problem is, that the server where I have my files don't support in_array. It
is claimed that the servers PHP server is on version 4.0, how can this be
when in_array is a function that came first with PHP4  (according to my
documents) ??

Is there something else I could use?

Thanks
- Richard



-- 
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] Generating thumbnails of JPEG/GIF images

2001-05-04 Thread Richard

Greetings.

Is there any quick way to generate thumbnails of existing pictures in a
directory? It would seem quite worthless to create 120x120 images of ones
that already exist, and upload duplicates.. Therefore, dynamic thumbnails
would be perfect. Any solutions?

PHP 4.0+ thanks.

- Richard



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

2001-05-09 Thread Richard

It appears like so.


"Joseph Bannon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > What version of PHP are you using? According to the manual:
> > "URL support was added in PHP 4.0.5"
>
>
>
> Oh, I have 4.0.4. I need to upgrade don't I?!?
>
> Thanks,
> J
>
> --
> 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] Global variables? (unset/set or what?)

2001-05-19 Thread Richard

Greetings.

I have about two include files which are included in every php page that
I have, and I wish to store global variables, such as passwords, usernames
and other details information.
After going through the PHP manual, all I could find was UNSET/SET
global variables, but I don't know if that is the one to use or not... they
looked like if they were to be doing something else.

Any help or ideas?

- Richard



-- 
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] Global variables? (unset/set or what?)

2001-05-19 Thread Richard

So i should start the header (or wherever in the header) with :

$GLOBALS["userPassword"] = "whatever";

function cp() {
global $userPassword;

// $userPassword is 'whatever' //
}


Did I get it or am I just too tired?

- Richard

"Michael Stearne" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try the define function.  That will define a constant that you will always
have
> access to (within functions, through various included files,etc.)  Or you
can
> write values to the $GLOBALS array of global variables.
>
> $GLOBALS["userPassword"]="u8943fd";
>
> Will define a variable that is accessible as $userPassword. outside of
> functions and within functions available after the global $userPassword;
> command is within the function.
>
> HTH,
> Michael
>
>
> Richard wrote:
>
> > Greetings.
> >
> > I have about two include files which are included in every php page
that
> > I have, and I wish to store global variables, such as passwords,
usernames
> > and other details information.
> > After going through the PHP manual, all I could find was UNSET/SET
> > global variables, but I don't know if that is the one to use or not...
they
> > looked like if they were to be doing something else.
> >
> > Any help or ideas?
> >
> > - Richard
> >
> > --
> > 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 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] Global variables? (unset/set or what?)

2001-05-19 Thread Richard

So this will do then:

$GLOBALS["userPassword"] = "whatever";

And when I need to use it, I use
echo userPassword;

and such alike?

What if I would like to change it? Can I simply use
'userPassword="whatever"';

?

Thanks,
Richard




-- 
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] Global varia........ **Sorry, I mean... **

2001-05-19 Thread Richard

Wrong examples written in my past post.

$GLOBALS["userPassword"] = "whatever";
global $userPassword;


and then write/read from it?

- Richard




-- 
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] Reports in web browser

2001-05-19 Thread Richard

You need to be more specific than that.

You cannot demand the browser to start printing, only thing is to write the
contents of the report to a webpage and then the visitor/user can print it
out if she/he likes.

It depends on how you have stored the reports.

- Richard

""Mihailo Dzigurski"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I have written some accounting application using PHP, and now I need to
> create some reports. Those reports need to be printed from web browser.
>
> What can I do?
>
> Thanks
> Mihailo.
>
>
> _
> Do You Yahoo!?
> Get your free @yahoo.com address at http://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 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 & HTML: newbie question

2002-01-16 Thread Richard


Hi there

I just signed up for an account at Spaceports so I can play with PHP ­ I
placed some PHP code in an HTML page and uploaded it to the server.

But when I checked it in my browser I got the error message: can¹t parse
line 1

Line 1 is simply the  tag!!

On one of their user forums someone suggested getting rid of the HTML tags
so I did and just left the PHP code on its own and this works fine ­ so how
can I use PHP with HTML?

I think it has something to do with the fact that  have to use their CGI
server to run PHP???

Cheers

Richard S



[PHP] Console, colors and stuff

2002-02-09 Thread Richard

Hey Boys,

I'm using PHP CGI version on Win32 to write some scripts. Not for a website
or anything, just some scripting at the console window. So now I want to
change the text color, clear the screen, and the other usual stuff. Just
like I can do with ncursus on the Linux version of PHP. Only, I can't find
something similar on Win32. It's pretty boring this way. Does anyone know
how to do it?

Richard



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[PHP] Re: Console, colors and stuff

2002-02-09 Thread Richard

I thought about it, but in Windows 2000 and NT, you can't use ansi.sys from
Win32 executables, only from Dos16 exe's.

Richard

"Alan McFarlane" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try 'echo'ing ansi control sequences?
>
> --
> Alan
>
> Richard <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hey Boys,
> >
> > I'm using PHP CGI version on Win32 to write some scripts. Not for a
> website
> > or anything, just some scripting at the console window. So now I want to
> > change the text color, clear the screen, and the other usual stuff. Just
> > like I can do with ncursus on the Linux version of PHP. Only, I can't
find
> > something similar on Win32. It's pretty boring this way. Does anyone
know
> > how to do it?
> >
> > Richard
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] regular expresion

2001-10-19 Thread Richard

Hi, I want to validate that a variable only contains numbers. I came up with
this code

$variable = "154545";  ->  must give me true.
$variable = "$%54545";  ->  must give me false
$variable = "$%54545";  ->  must give me false
$variable = "4545;#";  ->  must give me false
$variable = "004545";  ->  must give me false

CODE STARTS HERE

$variable = "5";
$variable = trim($variable);

if (ereg ("[a-zA-Z]", $variable)) {
   echo "NOT ONLY NUMBERS: $variable";
   $variable = "";
}

if (ereg ("[0-9]", $variable)) {
   $variable = $variable * 1;
   if ($variable == 0) {
  echo "IS NOT A NUMBER";
   } else {
  echo "JUST NUMBERS: $variable";
   }
}

Another thing that I thought about was this :

$variable= ereg_replace( "[^0-9]", "", $variable );

But is not what i am looking for...

I know there is a simpler way to do it. I just couldn't figure it out.

Thanks in advance
Ricardo



-- 
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] mail(), how can one specify ?

2001-03-22 Thread Richard

Greetings.

If I would like to use mail(...), how could I make the "from" tag
something else? I have not found any solution of specifying that!

- Richard



-- 
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] [PHP4] $fp = fopen( "news.txt", 'a' ); // 'a' = append! Wah!

2001-03-25 Thread Richard

You should find it on
http://www.php.net/manual/en/functions.fseek.php

Or something. There are examples that are quite clear.

- Richard

""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok, with this fseek..
>
> Could you give me an example of how to implement it?
>
>
>
>
> --
> 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] MySQL (about 1 database, many tables)

2001-04-05 Thread Richard

Greetings.

As "Frank K" wrote for some days ago, I was into the same thing, but I
need help with the following: I am creating a messaging central, which is
quite about the same as a web community if you like, or whatever. The thing
is, I need to save all the users, mailboxes and login dates... But I only
have one database, but infinite tables. Does anyone has any examples or
tips?   The following didn't go very well, but probably because I suck in
MySQL:

$query = "CREATE TABLE $tb_name ( UiD bigint(20) NOT NULL
auto_increment, uName text NOT NULL, uPwd text NOT NULL)";

What I was trying to do is to create one table which is called "users",
which contains :
uID (unique id, incremental!)   uOnline (boolean)uName and uPWD

And some other stuff, but as you can see, it did not go very well... Any
help is appriciated!


- Richard



-- 
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 (about 1 database, many tables)

2001-04-05 Thread Richard

Well, that was what I wrote in my post.. I don't get this MySQL that well,
and I didn't find that row very logical at all. But I got this email about
it, so I will read it and keep on reporting.


- Richard


"Lindsay Adams" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If that query did not work, then maybe the user that you are connecting to
> the database as does not have table create privileges?
>
> The syntax of the query is correct
> I am a little confused why you are using a text type for those columns
> And you can probably stand to use unsigned for UiD, since I doubt that you
> will be using negative values.
>
> Note that the value you pass for bigint() only represents the field width
> that mysql should display. It has nothing to do with the size of the
number
> it can store.
>
> On 4/5/01 4:33 PM, "Richard" <[EMAIL PROTECTED]> wrote:
>
> > Greetings.
> >
> >   As "Frank K" wrote for some days ago, I was into the same thing, but I
> > need help with the following: I am creating a messaging central, which
is
> > quite about the same as a web community if you like, or whatever. The
thing
> > is, I need to save all the users, mailboxes and login dates... But I
only
> > have one database, but infinite tables. Does anyone has any examples or
> > tips?   The following didn't go very well, but probably because I suck
in
> > MySQL:
> >
> >   $query = "CREATE TABLE $tb_name ( UiD bigint(20) NOT NULL
> > auto_increment, uName text NOT NULL, uPwd text NOT NULL)";
> >
> > What I was trying to do is to create one table which is called "users",
> > which contains :
> > uID (unique id, incremental!)   uOnline (boolean)uName and
uPWD
> >
> > And some other stuff, but as you can see, it did not go very well... Any
> > help is appriciated!
> >
> >
> > - Richard
> >
> >
>
>
> --
> 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] drop-down menu variables

2001-04-05 Thread Richard

You must set:

some text


if it's a SELECT list. Use  to set an initialized text.

Use .VALUE to check if it's empty or not... But beware, sometimes it forgets
the contents... If you would use the JavaScript "alert(text)" function...


- Richard
""Joao Monteiro"" <[EMAIL PROTECTED]> wrote in message
9aahf3$bph$[EMAIL PROTECTED]">news:9aahf3$bph$[EMAIL PROTECTED]...
> when i edit variables with a form the ones wich are simple text get
> corrected ok, but the ones chosen from drop-down menus only get added to
> existing variables...
> what am i doing wrong?
>
> Thanx
>
> Joao Monteiro
>
>
>
> --
> 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] fopen wierdness

2001-04-05 Thread Richard

No, you receive the handle to the file. You cannot rename the handle.


http://www.latest.txt";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
echo $contents;
fclose ($fd); ?>


Should do the trick.. or something.. Modify it or whatever.




- Richard



"Jerry" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> im trying to fopen a url with something like to following :
>
> fopen("something.com/something.txt", r);
>
> this returns a "0"
>
> now when i rename the doc to something.htm, ill get the contents?
>
>
> Jerry Bonner
> Systems Analyst / Web Development
> -
> email: [[EMAIL PROTECTED]]
> icq  : [34572902]
> phone: [507.344.1514]
> fax  : [507.385.6017]
> -
> Prairie Lakes Internet
>
>
> --
> 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] fwrite()

2001-04-06 Thread Richard

Check out

.htmlspecialchars(..)
.removeslashes()
.stripslashes()

- Richard


"Augusto Cesar Castoldi" <[EMAIL PROTECTED]> wrote in message
Pine.GSO.4.10.10104062012140.20277-10@venus">news:Pine.GSO.4.10.10104062012140.20277-10@venus...
> I have a textarea and I want to save the textarea text into a file. Then I
> put this in the html:
>
> 
>
> And this in action of php:
>
> $fd = fopen("Augusto.wri", "w" );
> fwrite($fd, $conteudo);
> fclose( $fd );
>
> But I'm having a big problem on this. Is the text has this caracter ("),
> the PHP add "\" before.
>
> So the number of (\) double every time that I want to update the file via
> textarea.
>
> How can I solve this problem?
>
> 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]




[PHP] Writing... But the permission is denied!

2001-04-12 Thread Richard

Greetings.

What can I do about file writing to a local folder, except for making
the entire folder WRITE/EXECUTE, and ALL for me.. Is there any way I can
program my scripts to be able to write or what is the problem? I have tryied
making the folder WRITE/EXECUTE, and I had READ also for all at first, but
then who wants folder browsing?

Thanks alot,
Richard



-- 
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] Writing... But the permission is denied!

2001-04-12 Thread Richard

Greetings.
(wrote an email too)

> If you can't give your webserver write permission in the content
directories

Does that have anything to do with .HTACCESS and files such as that?

- Richard





-- 
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] peter.johansson@era.ericsson.se PLEASE UNSUBSCRIBE!!!

2001-04-13 Thread Richard

I agree.
Why do the newsgroup forward some of the messages to this guy? Attack?

- Richard


""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
005701c0c42d$2b6e5f80$c61012d1@null">news:005701c0c42d$2b6e5f80$c61012d1@null...
I am so tired of receivng multiple error emails when I post




-- 
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] Weeeeee! ;)))

2004-07-24 Thread richard
I  don't bite, weah!
 
..btw, "10370" is  a  password  for archive

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Converting tables into forms

2009-10-29 Thread richard
Hi,

> What are aiming to do that something like PHPMyAdmin doesn't do?

Perhaps the forms are for users. And users being able to drop
databases isn't my idea of a good time. And setting up and maintaining
multiple database users is far too much work - I prefer not to provide
the interface in the first place.

-- 
Richard Heyes
HTML5 graphing: RGraph - www.rgraph.net (updated 25th October)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Lightweight web server for Windows?

2009-11-19 Thread richard
Hi,

> What do people on this list use as an ultra-lightweight web server (with
> PHP capability of course) on Windows? I have an old but still well
> functioning laptop that I have just given a second life by installing
> Windows Fundamentals (a stripped down version of XP). This works
> surprisingly well. So now I am looking for the necessary software, so I
> can do some local programming.

I would have recommended Omni HTTPd, but it seems it is no more.
Anyone know what happened to it? Regardless, I'd recommend buying a
server (cheap or otherwise) running your target environment, and use
that. If it's *nix, then you can use WinSCP to interface with it.

-- 
Richard Heyes
HTML5 graphing: RGraph - www.rgraph.net (updated 14th November)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] CSS and variables

2009-11-20 Thread richard
Hi,

> $newcolor = "color: red";
>
> '.$row[1].'
>
> But it doesn't work. No problem with th "spacer" class, works fine. I just
> can't get the syntax for pulling a CSS style from a PHP var.

You could do this:

{$row[1]}";
?>

-- 
Richard Heyes
HTML5 graphing: RGraph - www.rgraph.net (updated 14th November)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] MySQL Appeal from Monty

2009-12-13 Thread richard
Hi,

You might have already seen this, however if you haven't this may interest you:

http://monty-says.blogspot.com/2009/12/help-saving-mysql.html

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - www.rgraph.net (updated 12th December
- now with IE support!)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Happy New Year

2009-12-31 Thread Richard
Hi,

> exited works

Eh? Excited?

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - www.rgraph.net (updated 19th December
- now with IE support!)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] I am not receiving any e-mail from the list...

2010-01-11 Thread Richard
Hi,

> ...

I had this (I think) recently; mail simply stopped coming from the
list and I can't remember unsubscribing (though that's not saying
much...). I simply re-subscribed and all was dandy again.

--
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 9th January)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] I am not receiving any e-mail from the list...

2010-01-11 Thread Richard
Hi,

> ...

It's not a problem at all,  it just takes me a few months to realise... :-)

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 9th January)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] RSYNC - who knows more?

2010-01-17 Thread Richard
Hi,

> as sugestet i tried backup by using RSYNC.
> It is working fine.
>
> But i have some more Questions for this software.
>
> Is here some one that can help me with it?

You might get better results with the documentation:

http://samba.anu.edu.au/rsync/documentation.html

At a glance there are links to mailing lists too.

--
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 2nd January)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] RSYNC - who knows more?

2010-01-18 Thread Richard
Hi,

> yes i see the links to the mailing lists, but i can not access them.

Ask away then. Someone may be able to help you. I've used it a little
before in the past to synchronise dev and live boxes.

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 16th January)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cookies & sessions

2010-01-19 Thread Richard
Hi,

> However I have almost immediately found that while I appear to be able to 
> read cookies at
> any time, I cannot set them when I would like to. Is there any similar trick 
> which will
> work with cookies?

Keep in mind that cookies are set by sending an HTTP header as part of
the response, so until you do that they can't be sent back to you by
the client (and subsequently appear in $_COOKIE).

> (I assume that I can set several cookies using successive calls to 
> setcookie()?)

Sure. Not that I've done it.

> I was also somewhat surprised to find that a cookie is used to implement 
> sessions. Does
> this place any limitations on using both sessions and cookies in the same 
> program?

No (give them a different name though). You can also use sessions by
putting the session ID on the URL, but this, I believe, is called "a
ball ache".

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 16th January)
Follow me on Twitter: http://twitter.com/_rgraph
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: How to change a filename for download (e.g. jpeg, pdf etc.)

2010-01-25 Thread Richard
Hi,

> Can anyone point me to tutorials on how to change a filename for each
> download? My goal is to give the downloader a random name for a picture or a
> document, so he will never know what the original filename is.

Try adding a Content-Disposition header:



--
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 23rd January)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] imap4 search criteria

2010-01-29 Thread Richard
Hi,

> ...

You might have more joy with this on the php-dev list.

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 23rd January)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] flush() in conjunction with gzipped content

2010-01-31 Thread Richard
Hi,

This page: http://developer.yahoo.com/performance/rules.html#flush
recommends using a flush() call just after the  tag. However,
does this even have an effect when using ob_gzhandler() ?

Cheers.

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 31st January)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Richard
Hi,

> I have extended the standard exception class to send me an email
> whenever an exception occurs.

I did that once. Once being the operative word... :-) Ended up with
tens of thousands of emails one morning. At first I thought... "Wow,
maybe my popularity has grown somewhat". But it hadn't.

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 31st January)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Richard
Hi,

> But I bet you REALLY quickly fixed the problem!

I just took out the error handling. :-)

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 7th February)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Richard
Hi,

>> Real developers don't have errors in their code; they're undocumented 
>> features ;)

Or alternatively, if you freelance - "Forthcoming employment opportunities" :-)

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 7th February)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Richard
Hi,

> I have Forms that I submit for processing. I have seen examples of people 
> using either $_POST or $_REQUEST.
>
> When would I choose one over the other?

It's a wise choice to go with $_POST, unless your form is a GET form,
in which case use $_GET. $_REQUEST has the potential to open your
script(s) up to security issues.

> ...

Use quoted strings - either single or double quotes. Eg:

$myArray['myKey']
$myArray["myKey"]

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 20th February)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Richard
Hi,

> I am not sure what the security issues are you are referring to as the
> $_REQUEST superglobal contains both $_GET and $_POST values.  Could you
> expound on that?  Thanks.

Not really, do a search.

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 20th February)
Lots of PHP and Javascript code - http://www.phpguru.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] $_POST vs $_REQUEST

2010-02-23 Thread Richard
Hi,

Well people better than me (how is that possible?!) have said that
$_REQUEST has the potential to open your app up to security
vulnerabilities, and that it should be avoided because of that. Here's
a post from Stephan Esser about it on the PHP-Internals list:

http://www.mail-archive.com/intern...@lists.php.net/msg32832.html

Stephan heads up the Hardened-PHP project and when it comes to
security, I don't know of anyone better. So, if he advises not to use
_REQUEST, it's a good idea to follow that advice.

-- 
Richard Heyes

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Load simulation tests

2010-03-08 Thread Richard
Hi,

> I was wondering if there were any ways to simulate loads on a PHP script
> running on the server? Basically, I'd just like to take one of my sites
> through a dry-run so to speak and simulate x number of visitors.
> Ideally, I'd prefer something that didn't have to be installed on the
> remote server. Also, it would have to be something I could use from
> within Linux, as I only have Windows running as a VM, and I'm not sure
> it would work as intended if run though a VM.
>
> Have any of you used such tools, and if so, are there any you'd
> recommend?

There's always Apaches "ab". Though I've seen it mentioned that the
load isn't always realistic.

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 6th March)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] blog design issue...

2010-03-20 Thread Richard
Hi,

> I know you are all probably thinking "What does this have to do with PHP?"
> and in reality... It's probably stretching it a little bit... BUT I am in
> the process of writing a blog software (Yes I'm aware of all the open
> source, and paid stuff out there... I'm doing this to learn :)) I am looking
> at adding "categories" to my blog posts so I can organize my drivel into
> something that looks somewhat professional, or at the very least, organized
> so you can filter out all the crap...
>
> What I'm wondering about though, is would it be better from a database
> design stand point to do a database field for "categories" and then in there
> put "Personal", "Business", "Crap I found funny"  Basically 1 database field
> for all the categories I decide to use. OR should I go the other route and
> do 1 database field for each category?
>
> This is going to be a small blog to start, but I guess I should always be
> looking at performance, security, & maintainability right?
>
> I did read the post that tedd put up about looking at storing variables
> differently and am considering going that route... But just wanted to know
> what you all think :)
>
> Oh I'm also not expecting to have more then 4 or 5 categories at the
> most Unless I release the blog to the public and take wordpress down :P

You could use a SET field type. Internally MySQL uses numbers (a bit
mask IIRC) for them. Though you will be limited to 32 categories.

Eg:

Categories table:
ID Name

1  Personal
2  Business
4 Crap I found funny

Articles table:
ID Title  Category
===
1  My first blog entry  1
2  A joke from work6
3 A joke from home   5
4 A joke   4

The numbers are bitwise sums of the corresponding category IDs.
eg.4&2=6. I think. MySQL has some built in functions for dealing with
sets, like FIND_IN_SET() IIRC, which make life a lot easier.

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 13th March)
Lots of PHP and Javascript code - http://www.phpguru.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] blog design issue...

2010-03-20 Thread Richard
Hi,

> eg.4&2=6.

Oops, that should be 4|2 = 6.

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 13th March)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to know which PHP is used by Apache

2010-04-01 Thread Richard
Hi,

> In the situation if there are two PHP's installed on the Linux box.
> How to know which PHP is used by Apache?
>
> Another question is do Apache need PHP's binary to execute PHP Scripts? If
> yes what is the role of libphp5.so in Apache?
>
> Note: PHP is configured as module under Apache.

This may help:



-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 20th March)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Get Power Saving Settings of the Server

2010-04-19 Thread Richard
Hi,

> My PHP script is running as CLI. Can I get the Power Management
> Settings of the server ?
>
> I am using PHP 5.3.2 on Fedora 12 Machine (2.6.32.10-90.fc12.i686)

Your server management software may provide a way to get this
information either through the command line or through a network
interface. SNMP may also provide this information, and ISTR there's a
PHP SNMP module. Enjoy... :-)

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 10th April)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP stream_socket_client OpenSSL error (unknown ca)

2010-10-19 Thread Richard

 Hello,

I'm having some problems connecting to a server using the following php 
script :


stream_context_set_option($context, 'ssl', 'local_cert', 
'./cert.pem');

stream_context_set_option($context, 'ssl', 'allow_self_signed', TRUE);
stream_context_set_option($context, 'ssl', 'verify_peer', FALSE);

$ctn = stream_socket_client('ssl://distant.server.com:987', $errno, 
$errstr, 30, STREAM_CLIENT_CONNECT, $context);

if($ctn) {
print('Connected !');
}
?>

cert.pem is a self signed certificate that I generated a few days ago, 
it contains both RSA Key and Certificate and I have supplied the 
certificate to the distant server.


When I launch the script I get the following errors :

Warning: stream_socket_client(): SSL operation failed with code 1. 
OpenSSL Error messages:
error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca in 
/path/to/my/test.php on line 7


As it is a self signed certificate there is no CA so I added the two lines :

stream_context_set_option($context, 'ssl', 'allow_self_signed', TRUE);
stream_context_set_option($context, 'ssl', 'verify_peer', FALSE);

but that did not fix the problem.

This is my first script that connects through a socket using SSL, but I 
think that it doesn't even get out of the server because it doesn't like 
the certificate. Do you have any ideas about how I could get this 
working ? or maybe just point me in the right direction. If you need any 
more info please let me know.


Thank you,

Richard


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP stream_socket_client OpenSSL error (unknown ca)

2010-10-19 Thread Richard

 No I didn't have a passphrase on the local cert when I created it.

I noticed that I only sent it to you and then sent the same message to 
the list.


Thank you,

Richard

Le 19/10/10 20:28, Tommy Pham a écrit :

-Original Message-
From: Richard [mailto:php_l...@ghz.fr]
Sent: Tuesday, October 19, 2010 11:22 AM
To: Tommy Pham
Subject: Re: [PHP] PHP stream_socket_client OpenSSL error (unknown ca)

   I left the pasphrase blank, I've just tried with a blank passphrase but

it

doesn't help.


'./afnic.pem');

  stream_context_set_option($context, 'ssl', 'passphrase', '');
  stream_context_set_option($context, 'ssl', 'allow_self_signed',

TRUE);

  stream_context_set_option($context, 'ssl', 'verify_peer', FALSE);

  $connexion = stream_socket_client('ssl://epp.test.nic.fr:700',
$errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);
  if($connexion) {
  print('succes');
  }
?>


What I meant was that did you have a passphrase on your actual local cert
when you created it?

PS: Please cc the list also so others would know what's going and can help
troubleshoot and not reiterate what've been tried already.


Le 19/10/10 20:16, Tommy Pham wrote :

-Original Message-
From: Richard [mailto:php_l...@ghz.fr]
Sent: Tuesday, October 19, 2010 10:50 AM
To: php-general@lists.php.net
Subject: [PHP] PHP stream_socket_client OpenSSL error (unknown ca)

Hello,

I'm having some problems connecting to a server using the following php
script :


'./cert.pem');

   stream_context_set_option($context, 'ssl', 'allow_self_signed',

TRUE);

   stream_context_set_option($context, 'ssl', 'verify_peer', FALSE);

   $ctn = stream_socket_client('ssl://distant.server.com:987',

$errno,

$errstr,

30, STREAM_CLIENT_CONNECT, $context);
   if($ctn) {
   print('Connected !');
   }
?>

Just curious,

'passphrase  string

  Passphrase with which your local_cert file was encoded' quoted from

[1].

Regards,
Tommy

[1] http://us3.php.net/manual/en/context.ssl.php



cert.pem is a self signed certificate that I generated a few days ago,

it

contains both RSA Key and Certificate and I have supplied the

certificate

to

the distant server.

When I launch the script I get the following errors :

Warning: stream_socket_client(): SSL operation failed with code 1.
OpenSSL Error messages:
error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca in
/path/to/my/test.php on line 7

As it is a self signed certificate there is no CA so I added the two

lines

:

   stream_context_set_option($context, 'ssl', 'allow_self_signed',

TRUE);

   stream_context_set_option($context, 'ssl', 'verify_peer', FALSE);

but that did not fix the problem.

This is my first script that connects through a socket using SSL, but I

think

that it doesn't even get out of the server because it doesn't like the
certificate. Do you have any ideas about how I could get this working ?

or

maybe just point me in the right direction. If you need any more info

please

let me know.

Thank you,

Richard









--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP stream_socket_client OpenSSL error (unknown ca)

2010-10-20 Thread Richard

 Hello again,

Just to say that I have tested the script on php.net manual that 
generates a cert and then trys to connect (slightly modified the end of 
file [removing the while(true) section to just test the connection]) and 
I get exactly the same error.


Source : http://php.net/manual/en/function.stream-socket-server.php

Here is the full test script :

 "UK",
"stateOrProvinceName" => "Somerset",
"localityName" => "Glastonbury",
"organizationName" => "The Brain Room Limited",
"organizationalUnitName" => "PHP Documentation Team",
"commonName" => "Wez Furlong",
"emailAddress" => "w...@example.com"
);

// Generate certificate
$privkey = openssl_pkey_new();
$cert = openssl_csr_new($dn, $privkey);
$cert = openssl_csr_sign($cert, null, $privkey, 365);

// Generate PEM file
# Optionally change the passphrase from 'comet' to whatever you want, 
or leave it empty for no passphrase

$pem_passphrase = 'comet';
$pem = array();
openssl_x509_export($cert, $pem[0]);
openssl_pkey_export($privkey, $pem[1], $pem_passphrase);
$pem = implode($pem);

// Save PEM file
$pemfile = './server.pem';
file_put_contents($pemfile, $pem);

$context = stream_context_create();

// local_cert must be in PEM format
stream_context_set_option($context, 'ssl', 'local_cert', $pemfile);
// Pass Phrase (password) of private key
stream_context_set_option($context, 'ssl', 'passphrase', $pem_passphrase);

stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
stream_context_set_option($context, 'ssl', 'verify_peer', false);

// Create the server socket
$server = stream_socket_client('ssl://test.server.com:978', $errno, 
$errstr,30, STREAM_CLIENT_CONNECT, $context);


if($server)
{
print('ok');
}
?>


I still get the error :
Warning: stream_socket_client(): SSL operation failed with code 1. 
OpenSSL Error messages:
error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca in 
/home/richard/test.php on line 44
I think this proves that it's not my certificate at fault but maybe a 
problem with OpenSSL…


What do you think ?

Thank you,

Richard

Le 19/10/10 20:46, Richard a écrit :

No I didn't have a passphrase on the local cert when I created it.

I noticed that I only sent it to you and then sent the same message to 
the list.


Thank you,

Richard

Le 19/10/10 20:28, Tommy Pham a écrit :

-Original Message-
From: Richard [mailto:php_l...@ghz.fr]
Sent: Tuesday, October 19, 2010 11:22 AM
To: Tommy Pham
Subject: Re: [PHP] PHP stream_socket_client OpenSSL error (unknown ca)

I left the pasphrase blank, I've just tried with a blank passphrase but

it

doesn't help.


'./afnic.pem');

stream_context_set_option($context, 'ssl', 'passphrase', '');
stream_context_set_option($context, 'ssl', 'allow_self_signed',

TRUE);

stream_context_set_option($context, 'ssl', 'verify_peer', FALSE);

$connexion = stream_socket_client('ssl://epp.test.nic.fr:700',
$errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);
if($connexion) {
print('succes');
}
?>

What I meant was that did you have a passphrase on your actual local 
cert

when you created it?

PS: Please cc the list also so others would know what's going and can 
help

troubleshoot and not reiterate what've been tried already.


Le 19/10/10 20:16, Tommy Pham wrote :

-Original Message-
From: Richard [mailto:php_l...@ghz.fr]
Sent: Tuesday, October 19, 2010 10:50 AM
To: php-general@lists.php.net
Subject: [PHP] PHP stream_socket_client OpenSSL error (unknown ca)

Hello,

I'm having some problems connecting to a server using the 
following php

script :


'./cert.pem');

stream_context_set_option($context, 'ssl', 'allow_self_signed',

TRUE);

stream_context_set_option($context, 'ssl', 'verify_peer', FALSE);

$ctn = stream_socket_client('ssl://distant.server.com:987',

$errno,

$errstr,

30, STREAM_CLIENT_CONNECT, $context);
if($ctn) {
print('Connected !');
}
?>

Just curious,

'passphrase string

Passphrase with which your local_cert file was encoded' quoted from

[1].

Regards,
Tommy

[1] http://us3.php.net/manual/en/context.ssl.php


cert.pem is a self signed certificate that I generated a few days 
ago,

it

contains both RSA Key and Certificate and I have supplied the

certificate

to

the distant server.

When I launch the script I get the following errors :

Warning: stream_socket_client(): SSL operation failed with code 1.
OpenSSL Error messages:
error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca in
/path/to/my/test.php on line 7

As it is a self signed ce

Re: [PHP] QNX build

2008-01-18 Thread Richard

Jochem Maas wrote :

Richard schreef:

Hi,

After installing PHP on a Windows machine I see a very small 
PHP-executable and several extension dll's that can be loaded.


When I build PHP on a QNX machine I get one huge executable of 8.6 MB. Is 
it possible to build something similar to the Windows version?


yes, by specifying to ./configure that it should build shared extensions
or those extensions that allow it. so the relevant ./configure options
will look something like:

--enable-foo=shared,/path/to/libs

I tried that but it didn't work.


what's your configure line look like right now?

PS - I'd never heard of QNX - just looked it up - interested to know what 
your

doing with it and php.
I have an embedded system with an sqlite database. I want a web 
interface that shows database info and maybe system info.


PPS - Is a single large binary any worse than a smaller binary that loads
in a bunch of extensions (assuming the same extensions in each case), won't
the memory footprint be near enough the same for each?
It seems that my system has a problem with loading large binaries. It 
would be nice if I could decide in the ini file which extensions will 
be loaded (I am not sure which extensions I need).
I use the shttpd web server. This one does not support fast cgi. 
Loading a large cgi interpreter each time slows down my system.





Regards,

Richard



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] QNX build

2008-01-18 Thread Richard

Jochem Maas was thinking very hard :

Richard schreef:

Jochem Maas wrote :

Richard schreef:

Hi,

After installing PHP on a Windows machine I see a very small 
PHP-executable and several extension dll's that can be loaded.


When I build PHP on a QNX machine I get one huge executable of 8.6 MB. Is 
it possible to build something similar to the Windows version?


yes, by specifying to ./configure that it should build shared extensions
or those extensions that allow it. so the relevant ./configure options
will look something like:

--enable-foo=shared,/path/to/libs

I tried that but it didn't work.


didn't work in what way?


It is still one binary of 8.6 MB and no shared libs.





what's your configure line look like right now?

PS - I'd never heard of QNX - just looked it up - interested to know what 
your

doing with it and php.
I have an embedded system with an sqlite database. I want a web interface 
that shows database info and maybe system info.


cool :-)



PPS - Is a single large binary any worse than a smaller binary that loads
in a bunch of extensions (assuming the same extensions in each case), 
won't

the memory footprint be near enough the same for each?
It seems that my system has a problem with loading large binaries. It would 
be nice if I could decide in the ini file which extensions will be loaded 
(I am not sure which extensions I need).
I use the shttpd web server. This one does not support fast cgi. Loading a 
large cgi interpreter each time slows down my system.


ok - seems like you will only be needing a small subset of the available 
extensions.
have you tried using --disable-all and then only enabling the extensions you 
really

need, It may get the binary size down to a usable level.



When I use the option --disable-all the binary is about 5 MB. Which is 
much too large.
An option could be not to use php but perl. This binary is 1 MB. But I 
think the best option is a web server with fast cgi.







Regards,

Richard





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] QNX build

2008-02-06 Thread Richard

Jochem Maas used his keyboard to write :

Richard schreef:

Jochem Maas was thinking very hard :

Richard schreef:

Jochem Maas wrote :

Richard schreef:

Hi,

After installing PHP on a Windows machine I see a very small 
PHP-executable and several extension dll's that can be loaded.


When I build PHP on a QNX machine I get one huge executable of 8.6 MB. 
Is it possible to build something similar to the Windows version?


yes, by specifying to ./configure that it should build shared extensions
or those extensions that allow it. so the relevant ./configure options
will look something like:

--enable-foo=shared,/path/to/libs

I tried that but it didn't work.


didn't work in what way?


It is still one binary of 8.6 MB and no shared libs.





what's your configure line look like right now?

PS - I'd never heard of QNX - just looked it up - interested to know 
what your

doing with it and php.
I have an embedded system with an sqlite database. I want a web interface 
that shows database info and maybe system info.


cool :-)



PPS - Is a single large binary any worse than a smaller binary that 
loads
in a bunch of extensions (assuming the same extensions in each case), 
won't

the memory footprint be near enough the same for each?
It seems that my system has a problem with loading large binaries. It 
would be nice if I could decide in the ini file which extensions will be 
loaded (I am not sure which extensions I need).
I use the shttpd web server. This one does not support fast cgi. Loading 
a large cgi interpreter each time slows down my system.


ok - seems like you will only be needing a small subset of the available 
extensions.
have you tried using --disable-all and then only enabling the extensions 
you really

need, It may get the binary size down to a usable level.



When I use the option --disable-all the binary is about 5 MB. Which is much 
too large.
An option could be not to use php but perl. This binary is 1 MB. But I 
think the best option is a web server with fast cgi.


Removing the debugging symbols and enabling the extensions I need gives 
me a binary of 2.7 MB which is already better.




lighthttpd?


It took me a while to port lighttpd + libs but it is just what I am 
looking for.

Thanks a lot.










Regards,

Richard







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Progressive answers from a php query?

2008-02-06 Thread Richard
Hello, I don't know if this is possible with PHP alone but this is what 
I'm trying to do :


My script would check say for example 10 or 20 different http:// site 
addresses and collect some text from each page.


My problem is that it takes quite a long time to query so many sites, 
and the user would have to wait for un to 30 sec to 1 min before the 
page comes up ...


So there are two ways I can think of inorder to reduce the waiting time.

1) Perform asynchronous searches at the same time so all details are 
collected at the same time instead of waiting for the script to collect 
data from each one, one by one.


2) Somehow show data as it arrives instead of waiting for all the 
queries to be done.


Is it possible to do either of these two, or both of these two with only 
PHP? If so how would I do it?


or is it necessary to use javascript?


Thanks in advance,

Richard

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Multiple sessions open at same time, is it possible?

2008-03-02 Thread Richard

Hello,

I'm quite new to sessions, an am trying to program a script which needs 
two sessions ...


I have a members area which uses 1 session, and when you click on 
disconnect it closes the session and the user returns to the login page.


I also am programming a shopping cart so members can choose what they 
would like to download that also uses a session.


All worked fine untill I realised that because they both use the same 
session, when I disconnect from the members area it also obviously 
deletes all elements from the download cart.


I would there for need to have two seperate sessions one for the cart, 
and one for the members area. And sometimes I will need to have them 
both open.


Is this possible ? I've searched google but not found anything 
interesting, except session_name, but I still don't know how to open two 
sessions  or close one session but not the other, or open a variable in 
a specific session ...


Thanks in advance,

Richard

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple sessions open at same time, is it possible?

2008-03-02 Thread Richard

Stut a écrit :

On 2 Mar 2008, at 14:49, Richard wrote:
I'm quite new to sessions, an am trying to program a script which 
needs two sessions ...


I have a members area which uses 1 session, and when you click on 
disconnect it closes the session and the user returns to the login page.


I also am programming a shopping cart so members can choose what they 
would like to download that also uses a session.


All worked fine untill I realised that because they both use the same 
session, when I disconnect from the members area it also obviously 
deletes all elements from the download cart.


I would there for need to have two seperate sessions one for the 
cart, and one for the members area. And sometimes I will need to have 
them both open.


Is this possible ? I've searched google but not found anything 
interesting, except session_name, but I still don't know how to open 
two sessions  or close one session but not the other, or open a 
variable in a specific session ...


Just use one session. Put the data for each session into a separate 
array...


$_SESSION['members'] = array('lots', 'of', 'data');
$_SESSION['cart'] = array('lots', 'of', 'money-making', 'crap');

To "disconnect" the user from one or other simply unset that variable...

unset($_SESSION['members']);
unset($_SESSION['cart']);

KISS.

-Stut

Thankyou, instead of unsetting the whole session, I just unset de 
password, so the user has to login again and now it does not reset the 
cart anymore.


However, is there a way to limit the session stay alive time for just 
one variable ?


If for example, if a user has not done anything in his members area for 
more than 30 minutes I would like to be able to reset his password, but 
I do not want to reset the cart. Do I have to program this seperatly in 
PHP (IE set a session varibale $_SESSION['last_time'] = time(); and on 
each page loads :


if ( time() - $_SESSION[last_time] > 1800) {
$_SESSION['password'] = array();
else { 
   $_SESSION['last_time'] = time()

}
...

Or is there a better way to do this?

Thanks again :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple sessions open at same time, is it possible?

2008-03-02 Thread Richard

Stut a écrit :

On 2 Mar 2008, at 15:28, Richard wrote:

Stut a écrit :

On 2 Mar 2008, at 14:49, Richard wrote:
I would there for need to have two seperate sessions one for the 
cart, and one for the members area. And sometimes I will need to 
have them both open.


Is this possible ? I've searched google but not found anything 
interesting, except session_name, but I still don't know how to 
open two sessions  or close one session but not the other, or open 
a variable in a specific session ...


Just use one session. Put the data for each session into a separate 
array...


$_SESSION['members'] = array('lots', 'of', 'data');
$_SESSION['cart'] = array('lots', 'of', 'money-making', 'crap');

To "disconnect" the user from one or other simply unset that 
variable...


unset($_SESSION['members']);
unset($_SESSION['cart']);

KISS.
However, is there a way to limit the session stay alive time for just 
one variable ?


If for example, if a user has not done anything in his members area 
for more than 30 minutes I would like to be able to reset his 
password, but I do not want to reset the cart. Do I have to program 
this seperatly in PHP (IE set a session varibale 
$_SESSION['last_time'] = time(); and on each page loads :


if ( time() - $_SESSION[last_time] > 1800) {
   $_SESSION['password'] = array();
else {$_SESSION['last_time'] = time()
   }
...

Or is there a better way to do this?


There is no built-in mechanism for this so you need to implement your 
own as above. Personally I would store it as an expiry time rather 
than the current time, but whatever floats ya boat.


-Stut

Sorry, I only know how to use current time, just for my personal 
interest, how would you use expiry time ? I've looked around a bit and 
can't work out how you would do this without using the current time...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple sessions open at same time, is it possible? [ Solved, thankyou !]

2008-03-02 Thread Richard

Stut a écrit :

On 2 Mar 2008, at 15:59, Richard wrote:

Stut a écrit :

On 2 Mar 2008, at 15:28, Richard wrote:
However, is there a way to limit the session stay alive time for 
just one variable ?


If for example, if a user has not done anything in his members area 
for more than 30 minutes I would like to be able to reset his 
password, but I do not want to reset the cart. Do I have to program 
this seperatly in PHP (IE set a session varibale 
$_SESSION['last_time'] = time(); and on each page loads :


if ( time() - $_SESSION[last_time] > 1800) {
  $_SESSION['password'] = array();
else {$_SESSION['last_time'] = time()
  }
...

Or is there a better way to do this?


There is no built-in mechanism for this so you need to implement 
your own as above. Personally I would store it as an expiry time 
rather than the current time, but whatever floats ya boat.


Sorry, I only know how to use current time, just for my personal 
interest, how would you use expiry time ? I've looked around a bit 
and can't work out how you would do this without using the current 
time...



It's really not rocket science...

if ($_SESSION['expiry'] < time())
{
$_SESSION['password'] = array();
}
else
{
// Password expires in 30 minutes
$_SESSION['expiry'] = time() + 1800;
}

Just curious... why are you setting the password to an empty array? 
You'd probably be better off unset'ing it so you can use isset to 
check for it.


-Stut


Oh right ! :)
Yes you're right about the array,  I used it by mistake, as to reset a 
value in $_SESSION[cart] , ie : $_SESSION['cart']['item_number'] I had 
to do $_SESSION['cart']['item_number'] = array(); as unset would anly 
work for unsetting the whole cart and not just one item, but yes it 
would be best to use unset for $_SESSION['password'] !


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple sessions open at same time, is it possible? [ Solved, thankyou !]

2008-03-02 Thread Richard

Stut a écrit :

On 2 Mar 2008, at 16:32, Richard wrote:

Stut a écrit :
Just curious... why are you setting the password to an empty array? 
You'd probably be better off unset'ing it so you can use isset to 
check for it.



Oh right ! :)
Yes you're right about the array,  I used it by mistake, as to reset 
a value in $_SESSION[cart] , ie : $_SESSION['cart']['item_number'] I 
had to do $_SESSION['cart']['item_number'] = array(); as unset would 
anly work for unsetting the whole cart and not just one item, but yes 
it would be best to use unset for $_SESSION['password'] !


Eh? What's in $_SESSION['cart']['item_number']? You might want to 
consider one of the following depending on what's in that array 
element...


unset($_SESSION['cart']['item_number']);

unset($_SESSION['cart'][array_search($itemtoremove, $_SESSION['cart'])]);

unset($_SESSION['cart']['item_number'][array_search($itemtoremove, 
$_SESSION['cart']['item_number'])]);


At the very least it would be better to use null rather than array(), 
but actually removing the item from the array would be my recommendation.


-Stut

Sorry I went back to where I read that I should use =array(); and I miss 
read an instruction which was :  http://fr3.php.net/unset


|

|Quote from http://fr.php.net/session_unset

"Do NOT unset the whole $_SESSION with unset($_SESSION) as this will 
disable the registering of session variables through the $_SESSION 
superglobal."


So basically don't do:
unset($_SESSION)

Instead do:
$_SESSION = array();|



So no need for setting my session variables to array()...
|

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] sprintf problem...

2008-03-22 Thread Richard
Hello, I'm trying to write a invoice script but I have encountered a 
slight problem.
Each product needs to be listed without tax, and at the end of the file 
I need to show the VAT. In France VAT is 19.6%

So €10.03 without vat = €12.00 with vat.
So I do this :

$totalwithoutvat = 0;
$totalwithoutvat = 0;
$totalvat =0;
while ( $itemwithoutvat) = each( $px ) )
{
$totalwithoutvat += $itemwithoutvat;
$totalwithoutvat += sprintf("%0.2f", $itemwithoutvat * ( 1 + 19.6/100 ));
$totalvat += sprintf("%0.2f",$itemwithoutvat * 19.6/100);
}
print ("Total Vat =".sprintf("%0.2f",$totalvat)." - Total without vat = 
".sprintf("%0.2f",$totalwithoutvat)." - Total with vat = 
".sprintf("%0.2f",$totalwithvat));


But I'm not sure I am using sprintf correctly, maybe I should use a 
different function because :
When I have one item at 10.03, the result is : Total Vat = 1.97 - Total 
without vat = 10.03 Total with vat = 12.00
but if I have two items at 10.03 the result is : Total vat = 3.93 - 
Total without vat = 20.06 Total with vat = 23.99
but I need it to be : Total vat = 3.94 - Total without vat = 20.06 Total 
with vat = 24.00
So from what I can see, sprintf only seems to work for printing and the 
actual result is kept in memory, is this correct ? if so what function 
should I use instead?


Thanks in advance :)

Richard









--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sprintf problem... (with simplified code )

2008-03-22 Thread Richard

Here is a simplifie version of my code :



I get 12.00 and 23.99 ... what should I do to get 12.00 and 24.00 ?


Richard a écrit :
Hello, I'm trying to write a invoice script but I have encountered a 
slight problem.
Each product needs to be listed without tax, and at the end of the 
file I need to show the VAT. In France VAT is 19.6%

So €10.03 without vat = €12.00 with vat.
So I do this :

$totalwithoutvat = 0;
$totalwithoutvat = 0;
$totalvat =0;
while ( $itemwithoutvat) = each( $px ) )
{
$totalwithoutvat += $itemwithoutvat;
$totalwithoutvat += sprintf("%0.2f", $itemwithoutvat * ( 1 + 19.6/100 ));
$totalvat += sprintf("%0.2f",$itemwithoutvat * 19.6/100);
}
print ("Total Vat =".sprintf("%0.2f",$totalvat)." - Total without vat 
= ".sprintf("%0.2f",$totalwithoutvat)." - Total with vat = 
".sprintf("%0.2f",$totalwithvat));


But I'm not sure I am using sprintf correctly, maybe I should use a 
different function because :
When I have one item at 10.03, the result is : Total Vat = 1.97 - 
Total without vat = 10.03 Total with vat = 12.00
but if I have two items at 10.03 the result is : Total vat = 3.93 - 
Total without vat = 20.06 Total with vat = 23.99
but I need it to be : Total vat = 3.94 - Total without vat = 20.06 
Total with vat = 24.00
So from what I can see, sprintf only seems to work for printing and 
the actual result is kept in memory, is this correct ? if so what 
function should I use instead?


Thanks in advance :)

Richard



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sprintf problem... (with simplified code )

2008-03-23 Thread Richard
Sorry, this morning I have gone through everything again, and the 
simplified example was wrong, but corrected it gives the right answer, 
however although I'm sure I've done the same with the main script I can 
not get the correct answer.


I need to round each article seperatly so that the Vat inc prince 
remains the same.


So a 10.03 without vat always makes 12.00 with vat.

My test files works as it should :



Result : Total : 12 - Total 2 : 24

However the file I'm working on does not :(

The script I'm working on makes use of the fpdf php project which 
automaticaly creates PDF files.


Here is the extract of code :

while ( list($code_tva, $articleHT) = each( $px ) )
{
$tva = $tab_tva[$code_tva]; // is 19.6 %
$this->SetXY(15, $y); //sets the coordinates of cell to be created in 
PDF file for each item )
$this->Cell( 21.5,4, sprintf("%0.2f", $articleHT),'', '','C' ); // 
inserts the item
//=>>>>> $totalHT is TOTAL without VAT and 
$articleHT is a table which contains the price of each item without tax>>>

$totalHT += $articleHT; //adds all items without vat
//=>>>>> $totalTTC is TOTAL with VAT >>>
$totalTTC += sprintf("%0.2f", ($articleHT * ( 1 + $tva/100 ))); // adds 
the rounded (item * 1.196) (including vat)

//=>>>>> $totalTVA is TOTAL of VAT >>>
$tmp_tva = sprintf("%0.2f",$articleHT * $tva/100); //amount of VAT of 
current item

$a_tva[ $code_tva ] = $tmp_tva;
$totalTVA += $tmp_tva; //adds current item's vat to total vat
$this->SetXY(10, $y);
$this->Cell( 5,4, $code_tva, 0,0,"C"); //prints vat option
$this->SetXY(58, $y);
$this->Cell( 21.5,4, sprintf("%0.2f",$tmp_tva),'', '' ,'C'); //prints 
the current item's vat amount

$this->SetXY(79.5, $y);
$this->Cell( 21.5,4, sprintf("%0.2f",$tva) ,'', '', 'C'); //prints the 
vat percentage for item

$y+=4;
}
$this->SetXY(114,266.4);
$this->Cell(15,4, sprintf("%0.2f", $totalHT), '', '', 'R' ); //prints 
the total amount excluding vat

$this->SetXY(114,271.4);
$this->Cell(15,4, sprintf("%0.2f", $totalTVA), '', '', 'R' ); //prints 
total amount including vat


This is how I see it :
If I have two different items ($articleHT) at 10.03 this line ($tva = 
19.6 and $articleHT = 10.03) :

$totalTTC += sprintf("%0.2f", ($articleHT * ( 1 + $tva/100 )));
Should add 12.00 to $totalTTC However it seems to add 11.99588 to 
$totalTTC instead ...


In my test files it does exactly this, any idea why it would not do this 
in the real file ?


Thanks again :)


lists-php a écrit :

your issue is with rounding, and whether vat is applied (rounded)
per-item or on the invoice total.

your sprintf output is simply truncating and rounding on display. you
aren't storing the rounded (up) value.

increase the decimal positions to 4 or 6 and you'll see things better.

  Total = 11.995880 - Total 2 = 23.991760

the vat on 10.03 is 1.96588, which when you only display 2 positions
on display rounds up to 1.97. 


if you stored the rounded value ,on a per-item basis, you'd get what
you're after.

now, the question is whether vat is applied per item or on the
invoice total.

the difference becomes more obvious with say 3 items, at 10.03. on a
(rounded) per-item basis the vat total would be 5.91. on an invoice
total it would be 5.90 (rounded up from 5.89784).


  - Rick


 Original Message 
  

Date: Saturday, March 22, 2008 10:35:12 PM +0100
From: Richard <[EMAIL PROTECTED]>
To: PHP lists 
Cc: 
Subject: Re: [PHP] sprintf problem... (with simplified code )


Here is a simplifie version of my code :



I get 12.00 and 23.99 ... what should I do to get 12.00 and 24.00 ?


Richard a écrit :


Hello, I'm trying to write a invoice script but I have encountered
a  slight problem.
Each product needs to be listed without tax, and at the end of the 
file I need to show the VAT. In France VAT is 19.6%

So €10.03 without vat = €12.00 with vat.
So I do this :

$totalwithoutvat = 0;
$totalwithoutvat = 0;
$totalvat =0;
while ( $itemwithoutvat) = each( $px ) )
{
$totalwithoutvat += $itemwithoutvat;
$totalwithoutvat += sprintf("%0.2f", $itemwithoutvat * ( 1 +
19.6/100 )); $totalvat += sprintf("%0.2f",$itemwithoutvat *
19.6/100); }
print ("Total Vat =".sprintf("%0.2f",$totalvat)." - Total without
vat  = ".sprintf("%0.2f",$totalwithoutvat)." - Total with vat = 
".sprintf("%0.2f",$totalwithvat));


But I'm not sure I am using sprintf correctly, maybe I should use
a  different function because :
When I have one item at 10.03,

[PHP] Array from database table

2004-11-14 Thread Richard
How do I get the data from a mysql database into and array that looks
like this
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 ) 

The table has three fields but I only need the data from one field.

$query="SELECT amenityID FROM property_amenity where listingId =
'$listingId'";

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Pulling data from a table into a array

2004-11-14 Thread Richard
I am using mysql_fetch_row to pull data from a table to fill an array
But I am not getting the data into the array the way I whant it to be.

$query = "SELECT amenityID FROM property_amenity where listingId =
'$listingId'";
$results = mysql_query($query);
if ($results) {
while ($list=mysql_fetch_row($results)) {
$checked[]=$list;
}
}
print_r($checked);

This is what it is putting out

Array ( [0] => Array ( [0] => 1 ) [1] => Array ( [0] => 7 ) [2] => Array
( [0] => 9 ) [3] => Array ( [0] => 10 ) [4] => Array ( [0] => 12 ) [5]
=> Array ( [0] => 14 ) [6] => Array ( [0] => 24 ) [7] => Array ( [0] =>
25 ) [8] => Array ( [0] => 37 ) [9] => Array ( [0] => 38 ) ) 


This what I what the Array to look like

Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 12 [4] => 25 [5] => 37 )

What can I do to make it come out this way. 
The database table looks like this I only whant the data from the
amenityID in the order it finds it in the table

ID  listingID  amenityID
1   1 4
2   1 2
3   2 1
4   1 10

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Need help on client certificate validation using OpenSSL/PHP

2002-11-25 Thread Richard Rojas
Hi All,

 I'm a PHP newbie and Im really having difficulty with client-server
certificate validation using Openssl and PHP. If somehow you know of a
tutorial, a website or sample PHP codes that checks (expired, revoked) and
validates client certificates, it would be of great help.

I already tried using $_SERVER variable and I was able to extract
the infos on the certificate and simply compare the dates for expiration and
the other parts for validation but I know this is a bad idea. That it would
be a good practice to use PHPs openssl functions instead.

Here's my code:

";
echo "Issuer: " . $_SERVER['SSL_CLIENT_I_DN'];
echo "";
echo "Subject: " . $_SERVER['SSL_CLIENT_S_DN'];
echo "";
echo "Validity Start: " . $_SERVER['SSL_CLIENT_V_START'];
echo "";
echo "Validity End: " . $_SERVER['SSL_CLIENT_V_END'];

echo " SERVER ";
echo "Issuer: " . $_SERVER['SSL_SERVER_I_DN'];
echo "";
echo "Subject: " . $_SERVER['SSL_SERVER_S_DN'];
echo "";
echo "Validity Start: " . $_SERVER['SSL_SERVER_V_START'];
echo "";
echo "Validity End: " . $_SERVER['SSL_SERVER_V_END'];

--- then comparisons occur next ---

?>

Please help  me...

TIA,
Richard

PS. By the way, we converted our client certificates to PKCS#12 certificates



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] suEXEC and PHP

2002-11-26 Thread Richard Fox
Hi,

Apache 1.3.24, PHP 4.2.2

I am running a php script which executes something like

system("scp -r -S ssh host1:/home/dir host2:/home");

The scp command executes as the apache user, in my case 'nobody'. This does
not work, as the ssh authentication is not set up for user 'nobody' nor
should it be. Setting a different user, as in "scp -r -S ssh
myuser@host1:/home/dir myuser@host2:/home" deosn't work, ssh still tries to
authenticate 'nobody'.

First I tried running apache as a different user, 'apache', after setting up
the rsa keys etc (ssh stuff) for 'apache'. The authentication then works but
there are issues of the 'apache' user having read/write permissions on the
directories host1:/home/dir and host2:/home. I thought that giving the
'apache' user permission to read/write these directories wasn't a very good
idea.

Now I am trying to use the apache suEXEC feature to do this, so that my php
script can run as a different user (eg. myuser) who has all the right
permissions and ssh configured. However, so far I have been unsccessful and
suspect that suEXEC will not work with PHP. Does anyone out there have
experience with this? Any advice would be appreciated.

tia,

Rich


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] FTP and security

2002-11-26 Thread Richard Fox

My company, as a matter of policy, closes the ftp ports of the servers in the DMZ. 
However, I am not convinced that this is necessary, given the advent of very secure 
ftp servers. I would appreciate any comments on the security of an open ftp port. To 
relate this to php, I am ready to give up trying to make my 

system("scp ..");

code work, because I will have to give the apache user more permissions than I am 
comfortable with. So, I am thinking fo using php's ftp commands instead. I see nowhere 
in the documentation however, if the ftp_connect can be done via the ssh transport 
mechanism. Or, is this unnecessary, and can I use ftp (with plain text user and 
password passed to ftp_login()) on port 21 without worrying about getting hacked? 

muchas gracias

Rich



Re: [PHP] FTP and security

2002-11-26 Thread Richard Fox
> > To relate this to php, I am ready to give up
> > trying to make my
> >
> > system("scp ..");
> >
> > code work, because I will have to give the apache user more permissions
> > than I am comfortable with.
>
> What exactly are the problems you're encountering using scp?
>

I created an apache user, which I called apache, and  made sure this user
could connect to the remote servers and created rsa keys so no passwords
would be necessary (so my system($cmd) call would work). This is what
happens when I run scp:

bash-2.05a$ scp -pvr -S ssh apache@thor:/home/web/testsite/cgi-bin
apache@loki:/home/web/testsite
Executing: ssh -v -x -o'FallBackToRsh no' -o'ClearAllForwardings yes' -n -l
apache thor scp -v -r -p /home/web/testsite/cgi-bin
'apache@loki:/home/web/testsite'
OpenSSH_3.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090602f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Rhosts Authentication disabled, originating port will not be
trusted.
debug1: restore_uid
debug1: ssh_connect: getuid 48 geteuid 0 anon 1
debug1: Connecting to thor [127.0.0.1] port 22.
debug1: temporarily_use_uid: 48/48 (e=0)
debug1: restore_uid
debug1: temporarily_use_uid: 48/48 (e=0)
debug1: restore_uid
debug1: Connection established.
debug1: read PEM private key done: type DSA
debug1: read PEM private key done: type RSA
debug1: identity file /home/apache/.ssh/identity type -1
debug1: identity file /home/apache/.ssh/id_rsa type 1
debug1: identity file /home/apache/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.1p1
debug1: match: OpenSSH_3.1p1 pat OpenSSH*
Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.1p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: dh_gen_key: priv key bits set: 135/256
debug1: bits set: 1551/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'thor' is known and matches the RSA host key.
debug1: Found key in /home/apache/.ssh/known_hosts:1
debug1: bits set: 1576/3191
debug1: ssh_rsa_verify: signature correct
debug1: kex_derive_keys
debug1: newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: waiting for SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: service_accept: ssh-userauth
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: authentications that can continue:
publickey,password,keyboard-interactive
debug1: next auth method to try is publickey
debug1: try privkey: /home/apache/.ssh/identity
debug1: try pubkey: /home/apache/.ssh/id_rsa
debug1: input_userauth_pk_ok: pkalg ssh-rsa blen 149 lastkey 0x8086d50 hint
1
debug1: read PEM private key done: type RSA
debug1: ssh-userauth2 successful: method publickey
debug1: fd 4 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug1: send channel open 0
debug1: Entering interactive session.
debug1: ssh_session2_setup: id 0
debug1: Sending command: scp -v -r -p /home/web/testsite/cgi-bin
apache@loki:/home/web/testsite
debug1: channel request 0: exec
debug1: channel 0: open confirm rwindow 0 rmax 32768
debug1: channel 0: read<=0 rfd 4 len 0
debug1: channel 0: read failed
debug1: channel 0: close_read
debug1: channel 0: input open -> drain
debug1: channel 0: ibuf empty
debug1: channel 0: send eof
debug1: channel 0: input drain -> closed

There is more output, but as you can see the read of the src files failed
and an empty ibuf is sent. This command line call works if I am a normal
user for whom I have set up known_hosts and authorized_keys. But the above
is the result when I run scp as user 'apache'.


> So, I am thinking fo using php's ftp commands
> > instead. I see nowhere in the documentation however, if the ftp_connect
can
> > be done via the ssh transport mechanism. Or, is this unnecessary, and
can I
> > use ftp (with plain text user and password passed to ftp_login()) on
port
> > 21 without worrying about getting hacked?
>
> Well, if you're going to be using ftp-over-ssh, I don't see why you're not
> using scp directly instead.
>

I thought that if I create an ssh tunnel for ftp, I could use the php ftp
functions, they would actually be using ssh transparently.

Rich


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] how to use openssl_x509_read.

2002-11-27 Thread Richard Rojas
Hi,

   Does anybody know how to use this function?

openssl_x509_read(mixed x509certdata)

   Is x509certdata the certificate submitted by the browser to the server?

Richard


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




  1   2   3   4   5   6   7   8   9   10   >