OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 18 Nov 2003 00:03:59 -0000 Issue 2421

php-general-digest-helplists.php.net
Date: Mon Nov 17 2003 - 18:03:59 CST


php-general Digest 18 Nov 2003 00:03:59 -0000 Issue 2421

Topics (messages 169920 through 170031):

Re: setting a global var so that all pages can see var
        169920 by: PAUL FERRIE
        169924 by: PAUL FERRIE
        169927 by: Pavel Jartsev
        169951 by: Curt Zirzow

Re: GD question
        169921 by: DvDmanDT

Re: Include an encoder into PHP distribution?
        169922 by: John W. Holmes
        169933 by: Manuel Lemos
        169939 by: Jay Blanchard
        169940 by: Michael
        169945 by: Curt Zirzow
        169978 by: David T-G
        169980 by: Michael

Re: thanks for the summary (was "Re: [PHP] Can't fetch ...")
        169923 by: Kim Steinhaug

Re: php-xml
        169925 by: Becoming Digital
        169950 by: Curt Zirzow
        170027 by: pnp

Re: Feature or Bug: Omission of closing PHP tag...
        169926 by: Becoming Digital

Re: setting a global var so that all pages can see var still :(
        169928 by: PAUL FERRIE

Is PHP License GPL?
        169929 by: Chris
        169932 by: David Otton

Unexpected result in floor function
        169930 by: ruben
        169934 by: Randal Neirynck
        169936 by: Marek Kilimajer

Re: PHP fopen function
        169931 by: Jay Blanchard

Single Session for different websites
        169935 by: Manisha Sathe
        169979 by: Burhan Khalid

fopen and preg_match
        169937 by: Sami Kyösti
        169953 by: Chris Hayes
        169968 by: Jason Wong
        169989 by: Sami Kyösti

WinXP+Apache2+php4+php5=almost true
        169938 by: Øystein Håland
        169944 by: Øystein Håland

easy and simple way to read xml into array
        169941 by: Victor Spång Arthursson
        169954 by: Chris Hayes

Re: Having fits with input to array
        169942 by: Susan Ator
        169956 by: John W. Holmes
        169966 by: Susan Ator

Re: SSH and php
        169943 by: Ryan A
        169946 by: Duncan Hill
        169948 by: Mike Migurski
        169961 by: David T-G

Re: Can't fetch HTTP POST data in PHP?
        169947 by: Curt Zirzow
        169949 by: Curt Zirzow

Re: msession - giving me a hard time
        169952 by: Guillaume Dupuis
        169959 by: John W. Holmes
        169974 by: Guillaume Dupuis

Microsoft .NET arguement
        169955 by: Mike R
        169957 by: Jay Blanchard
        169958 by: Dan Joseph
        169960 by: Jay Blanchard
        169963 by: Mike R
        169965 by: Dan Joseph
        169967 by: chris.neale.somerfield.co.uk
        169970 by: Jason Wong
        169971 by: Mike R
        169972 by: Dan Joseph
        169983 by: Brian V Bonini
        169988 by: Wouter van Vliet
        170015 by: John Nichel
        170030 by: Eugene Lee

confusing ouput!
        169962 by: ike strong
        169964 by: Jay Blanchard

convert string to number
        169969 by: Diana Castillo
        169973 by: Jay Blanchard
        169976 by: John W. Holmes
        169977 by: Jay Blanchard

Re: MMCache segmentation faults
        169975 by: Uros Gruber

Re: Get value between 2 strings
        169981 by: Al

Looking for Spam free php form
        169982 by: David Buchmueller
        169984 by: Chris Boget
        169985 by: Philip Olson
        169986 by: David T-G
        169987 by: Steve Murphy
        170029 by: Justin French

Re: strtotime bad logic or strtotime bug?
        169990 by: Gnik

Compensating for time zones in PHP
        169991 by: Dave G

passing second function through a function
        169992 by: Ian Truelsen
        169993 by: John W. Holmes
        169994 by: David Otton
        169995 by: John W. Holmes
        170013 by: DvDmanDT

passing PHP variables to Javascript ...
        169996 by: Kenn Murrah
        169997 by: John W. Holmes

To Loop or Not to Loop?
        169998 by: Jay Fitzgerald
        169999 by: Matt Matijevich
        170000 by: Chris W. Parker

mcrypt libraries?
        170001 by: Jas

explode()
        170002 by: Adam Williams
        170003 by: Jay Blanchard

From form to an array
        170004 by: Jeff McKeon
        170006 by: Jay Blanchard
        170009 by: DvDmanDT
        170010 by: Jeff McKeon
        170012 by: Jeff McKeon
        170016 by: Jay Blanchard
        170020 by: Jeff McKeon

PHP, HTML, CSS and a lot of problems
        170005 by: Björn Berg
        170008 by: David T-G
        170011 by: Björn Berg

Help with Solaris/iPlanet 4.1 Setup
        170007 by: Evans, Tim

escaping ' when inside a " "
        170014 by: Adam Williams
        170017 by: David T-G
        170018 by: Marek Kilimajer
        170019 by: Jay Blanchard
        170021 by: Adam Williams

Communicating with remote server
        170022 by: Matt Palermo
        170023 by: Jeff McKeon
        170024 by: Matt Palermo
        170025 by: Marek Kilimajer
        170026 by: Matt Palermo
        170031 by: Marek Kilimajer

Re: auto_prepend/append in htaccess....
        170028 by: Jonathan Villa

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


lol
i not that feeling whaen it come to flash based questions ;)

Cheers]

"Burhan Khalid" <phplistmeidomus.com> wrote in message
news:3FB8B2DB.1010407meidomus.com...
> PAUL FERRIE wrote:
>
> > Hello again guys, thanks for the help over the past 48 hours :)
> >
> > Over the past week i have had the job of tweaking the php pages of a
friends
> > site. so far so good :)
> >
> > Now i am onto the admin area for running the website. I downloaded one
of
> > the many db managers scripts from www.hotscripts.com
> > Luckly its a very simple app, easy to mod. Anyways most of my php
knowledge
> > is in conjuction with flash www.innovativedesigns.org.uk. most of the
> > problems i have had here have been fairly simple to learn and fix.
> >
> > Now the job this week is with php+html (total newbie to this area). most
of
> > the problems i have been able to fix with some help from here as well.
> >
> > http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
> >
> > ~This is the admin area. I manged to get the drop down menu working to
> > select the revelent table and then set $tablename with the result being
> > displayed in the next page as:
> > <?
> > print "MyAdmin database for <i>$tablename</i> table";
> > ?>
> > The new page has 4 links to load other php files to edit,delete, view,
and
> > add new data to the DB
> > On the links have:
> > <a href="edit.php?tablename=$tablename">View database</a><br>
> >
> > ~Now in the edit.php i have :
> > $result = mysql_query("SELECT * FROM $tablename")or die("couldnt select
> > table");
> >
> > $tablename is not being passed with the link.
> >
> > What am i missing?
>
> RTFM http://www.php.net/security.registerglobals
> STFA
>
> This question is another one of those twice daily ones.
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
> -----------------------
> "Documentation is like sex: when it is good,
> it is very, very good; and when it is bad,
> it is better than nothing."

attached mail follows:


I am still stuck
I now have this in the navigation page
<?php
if (isset($_GET['tablename'])) {
    echo "loaded <b>{$_GET['tablename']}</b>";

} else {
 "<i>$tablename</i> did not get sent";
}
?>
this gets the tablename from the previous page from the dropdown menu
but still the other pages are not picking it up :(
Please i need to get this working

Cheers
paul

"Burhan Khalid" <phplistmeidomus.com> wrote in message
news:3FB8B2DB.1010407meidomus.com...
> PAUL FERRIE wrote:
>
> > Hello again guys, thanks for the help over the past 48 hours :)
> >
> > Over the past week i have had the job of tweaking the php pages of a
friends
> > site. so far so good :)
> >
> > Now i am onto the admin area for running the website. I downloaded one
of
> > the many db managers scripts from www.hotscripts.com
> > Luckly its a very simple app, easy to mod. Anyways most of my php
knowledge
> > is in conjuction with flash www.innovativedesigns.org.uk. most of the
> > problems i have had here have been fairly simple to learn and fix.
> >
> > Now the job this week is with php+html (total newbie to this area). most
of
> > the problems i have been able to fix with some help from here as well.
> >
> > http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
> >
> > ~This is the admin area. I manged to get the drop down menu working to
> > select the revelent table and then set $tablename with the result being
> > displayed in the next page as:
> > <?
> > print "MyAdmin database for <i>$tablename</i> table";
> > ?>
> > The new page has 4 links to load other php files to edit,delete, view,
and
> > add new data to the DB
> > On the links have:
> > <a href="edit.php?tablename=$tablename">View database</a><br>
> >
> > ~Now in the edit.php i have :
> > $result = mysql_query("SELECT * FROM $tablename")or die("couldnt select
> > table");
> >
> > $tablename is not being passed with the link.
> >
> > What am i missing?
>
> RTFM http://www.php.net/security.registerglobals
> STFA
>
> This question is another one of those twice daily ones.
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
> -----------------------
> "Documentation is like sex: when it is good,
> it is very, very good; and when it is bad,
> it is better than nothing."

attached mail follows:


PAUL FERRIE wrote:
>
> ...
> add new data to the DB
> On the links have:
> <a href="edit.php?tablename=$tablename">View database</a><br>

U are outputting those links incorrectly, because resulting HTML
contains "$tablename". Try output those links this way...

<a href="edit.php?tablename=<? echo $_GET['tablename'] ?>">View
database</a><br>

...or this way

<?
echo '<a href="edit.php?tablename='.$_GET['tablename'].'">View
database</a><br>';
?>

--
Pavel a.k.a. Papi

attached mail follows:


* Thus wrote PAUL FERRIE (infoinnovativedesigns.org.uk):
> Hello again guys, thanks for the help over the past 48 hours :)
>
> Over the past week i have had the job of tweaking the php pages of a friends
> site. so far so good :)
>
> Now i am onto the admin area for running the website. I downloaded one of
> the many db managers scripts from www.hotscripts.com

You should try phpmyadmin, you wont have to meddle around with the
code except for configuring it, which can be done in less than 30
seconds.

http://www.phpmyadmin.net/

Curt
--
"My PHP key is worn out"

  PHP List stats since 1997:
    http://zirzow.dyndns.org/html/mlists/

attached mail follows:


$im=imagecreatetruecolor(9,9);
$im2=imagecreatefrompng('tile.png');
imagecopy($im,$im2,0,0,0,0,3,3);
imagecopy($im,$im2,3,0,0,0,3,3);
imagecopy($im,$im2,6,0,0,0,3,3);
imagecopy($im,$im2,0,3,0,0,3,3);
imagecopy($im,$im2,6,3,0,0,3,3);
imagecopy($im,$im2,0,6,0,0,3,3);
imagecopy($im,$im2,3,6,0,0,3,3);
imagecopy($im,$im2,6,6,0,0,3,3);
imagepng($im);
imagedestroy($im);imagedestroy($im2);

or something like that.. :s
--
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
##########################
Please, if you are using windows, you may be infected by Swen. Please go
here to find out more:
http://us.mcafee.com/virusInfo/default.asp?id=helpCenter&hcName=swen
http://securityresponse.symantec.com/avcenter/venc/data/w32.swen.amm.html
##########################
"René fournier" <m5renefournier.com> skrev i meddelandet
news:8E61A3E5-18B0-11D8-802E-0003931DAC94renefournier.com...
I want to write a function the creates a new image composited from a
3x3 tile. The idea is that the center tile will be a photo, and the
surrounding eight images will constitute a border and shadow to the
composited image. So... The eight "border/shadow" images will always be
the same, but the center image will be unique.

Anyways, I've been playing with GD functions for a little while, and
would appreciate any suggestions on how to accomplish this. I haven't
been able to find a good tutorial on this kind of thing
specifically—compositing tiles of images into a single image.

Any ideas?

...Rene=

attached mail follows:


David T-G wrote:
> ...and then Michael said...
> >
> > I've tried installing it but I need MS Visual Studio C++ so they have to
> > make it even easier.
>
> I hate to sound like a curmudgeon, but if you want this then you should
> build it, just like John anyone else who wants it should.

That's not really the issue here. Sure, anyone can build it for their
own server. That's all well and good. But try distributing a script
that's dependent upon it and telling your clients that they must also
install it, or get their ISP to install it. That's the PITA part.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


Hello,

On 11/17/2003 06:57 AM, Michael wrote:
> I've tried installing it but I need MS Visual Studio C++ so they have to
> make it even easier.

Yes, you are right for those that want to build it from source on
Windows, having to buy MSVC++ may be a drag. I think I saw somewhere
that there is a build to build it with CygWin though.

Anyway, the Turck author provides already built extensions DLL for the
latest PHP versions. So you really do not have build it yourself.

http://sourceforge.net/project/showfiles.php?group_id=69426

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

attached mail follows:


[snip]
In practice it seems that Zend has the final say on PHP, and I think
it's
bad for the language.
[/snip]

That is just plain incorrect. If there were a final arbiter PHP would
cease to be truly open source, and I think the folks on the PHP-DEV list
would be quick to correct you.

attached mail follows:


David T-G says
> I hate to sound like a curmudgeon, but if you want this then you should
> build it, just like John anyone else who wants it should. No, I haven't
> looked at either (I don't even know what an encoder does; I *think* that
> it could be a precompiler or an obfuscator but don't really care), but
> neither can be impossible to build and so you can have it without worry
> of politics -- or you could write your own in something other than VS C++
> or get a different one or...

1. An obsfuscator scrambles all the variable, function and class names
2. An encoder stores your source in compiled form whatever that looks like
3. An accelerator speeds up the php scripts by 1 to 10 times

Option 1 and 2 are debateable whether it should be included in php. Option
3 is a no brainer that it should be included.

Why don't I make my own? I don't know how. Should I learn and do it? No
because there's already an open source encoder and accelerator. Why do
redundant work?

attached mail follows:


* Thus wrote Michael (zoominggamebox.net):
> I've tried installing it but I need MS Visual Studio C++ so they have to
> make it even easier.

There is a compiled version on the website for windows. Go to the
download section and you'll see that they have it available for
multiple version of php there.

Curt
--
"My PHP key is worn out"

  PHP List stats since 1997:
    http://zirzow.dyndns.org/html/mlists/

attached mail follows:


Michael, et al --

...and then Michael said...
%
% David T-G says
% > I hate to sound like a curmudgeon, but if you want this then you should
% > build it, just like John anyone else who wants it should. No, I haven't
...
%
% 1. An obsfuscator scrambles all the variable, function and class names
% 2. An encoder stores your source in compiled form whatever that looks like
% 3. An accelerator speeds up the php scripts by 1 to 10 times

Thanks. Very helpful.

%
% Option 1 and 2 are debateable whether it should be included in php. Option
% 3 is a no brainer that it should be included.

One would think, but not necessarily; 1) there might be other accelerators
out there and 2) it's more for the maintainers to have to keep up to date
and bug-free. Maybe, just maybe, php should stay very slim and in The
Unix Way any addons remain separate and not-required addons. [I'm used
to seeing this sort of argument about mutt's code and featureset, and so
I tend to make these counterarguments.]

%
% Why don't I make my own? I don't know how. Should I learn and do it? No

Neither do I. Someone obviously does, though, which is a nice start.

% because there's already an open source encoder and accelerator. Why do
% redundant work?

But the point is that your wish to have it would force that upon those
who write and maintain the php code. If you want it, then at the very
least put together the pieces to make it happen for a stock tarball so
that someone can download your contributed patch/enhancement and include
it in the build.

If enough people want some item included, then they mmight or might not
be able to convince the code maintainers to include that piece, and can
always fall back to making a patch to the source tarball and/or even
making a very-similar-but-yet-completely-independent product.

HTH & HAND & thanks again

:-D
--
David T-G * There is too much animal courage in
(play) davidtgjustpickone.org * society and not sufficient moral courage.
(work) davidtgworkjustpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE/uQDIGb7uCXufRwARAvg5AJ44xVFA7F8dplU6t9EXtPL7Ax6I8gCg1CiI
zwj+KisHXSg3qsgndk36CvA=
=Qhxt
-----END PGP SIGNATURE-----

attached mail follows:


Oh my god thanks Curt! I don't know when they added that in for windows but
now my scripts are flying. My scripts are pretty bloated since I'm using
both smarty and adodb and my times were hovering around 1.5 seconds but I
installed mmcache and I'm at 0.14 seconds now. Sweet!

mmcache should really take out needing visual c and put this in its place
1. Copy mmcache.dll to C:\PHP\extensions\mmcache.dll
2. Copy and paste the mmcache settings into C:\WINDOWS\php.ini

Ignore what I said earlier cuz I don't think you can make it any easier.

-----Original Message-----
From: Curt Zirzow [mailto:php-generalzirzow.dyndns.org]
Sent: November 17, 2003 10:29 AM
To: php-generallists.php.net
Subject: Re: [PHP] Include an encoder into PHP distribution?

* Thus wrote Michael (zoominggamebox.net):
> I've tried installing it but I need MS Visual Studio C++ so they have to
> make it even easier.

There is a compiled version on the website for windows. Go to the
download section and you'll see that they have it available for
multiple version of php there.

Curt
--
"My PHP key is worn out"

  PHP List stats since 1997:
    http://zirzow.dyndns.org/html/mlists/

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

attached mail follows:


Alrighty! That sheds some more light on this.
How exactly can I replicate this scenario then, using my mobile phone?

I have a Nokia 3610i i think, with MMS capabilituies and GPRS WAP.
Ive never accually thought of expanding website possibilities with this
use, how excatly do I post from my mobile?

It might be a dumb question, but when I know this I might be able to
look further into the problem.

--
Kim Steinhaug
---------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---------------------------------------------------------------

"David T-G" <davidtg-phpjustpickone.org> wrote in message
news:20031117113242.GW9710justpickone.org...

attached mail follows:


Please post some of your code. It is incredibly difficult to help you without it.

Edward Dudlik
"Those who say it cannot be done
should not interrupt the person doing it."

wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU

----- Original Message -----
From: "pnp" <pnpsoftlab.ntua.gr>
To: <php-generallists.php.net>
Sent: Monday, 17 November, 2003 05:42
Subject: [PHP] php-xml

Hi, I'm developing a web site for a greek company and I want to show some
greek texts from an xml file to an html page. The pages encoding is utf-8.
So is the xml file and the xmlparses params. But the output is a bunch of
???????...

What am I doing wrong? Is there any way to do this?

Thanks in advance,
Peter

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

attached mail follows:


* Thus wrote pnp (pnpsoftlab.ntua.gr):
> Hi, I'm developing a web site for a greek company and I want to show some
> greek texts from an xml file to an html page. The pages encoding is utf-8.
> So is the xml file and the xmlparses params. But the output is a bunch of
> ???????...

You need to set the charset for the document to a greek charset so
it knows how the characters are encoded. You also have to make sure
that that charset is on the computer viewing the page.

ie:
  header('Content-Type: text/html; charset=ISO-8895-7');

Curt
--
"My PHP key is worn out"

  PHP List stats since 1997:
    http://zirzow.dyndns.org/html/mlists/

attached mail follows:


I think i found it...

thank you for trying to help.

Peter

attached mail follows:


> from a library standpoint, it's generally just a hassle to include
> it and then pray you didn't have some whitespace following.

I hadn't thought of it that way. I run everything through a code cleaner to prevent just that, but it might be nice to stop doing so.

> code is cleaner if it has no HTML content (unless via print or echo) and
> you don't include the closing tag.

For small blocks of HTML, I'm inclined to agree. I still prefer that large blocks be printed "plainly," both from an editing and (slight) performance standpoint, but I see where you're coming from.

Edward Dudlik
"Those who say it cannot be done
should not interrupt the person doing it."

wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU

----- Original Message -----
From: "Robert Cummings" <robertinterjinn.com>
To: "Becoming Digital" <subsbecomingdigital.com>
Cc: "PHP-General" <php-generallists.php.net>
Sent: Monday, 17 November, 2003 03:42
Subject: Re: [PHP] Feature or Bug: Omission of closing PHP tag...

On Mon, 2003-11-17 at 03:32, Becoming Digital wrote:
> I'm guessing we don't have to include a '?>' anymore? Not sure I like that idea...

It's optional, so you can feel free to include it if it makes you happy.
But from a library standpoint, it's generally just a hassle to include
it and then pray you didn't have some whitespace following. IMHO the
code is cleaner if it has no HTML content (unless via print or echo) and
you don't include the closing tag.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

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

attached mail follows:


How would i pass tablename in the submit button?
Check out edit record u wil see
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

Cheers
Paul

"Paul Ferrie" <infoinnovativedesigns.org.uk> wrote in message
news:20031117113223.77893.qmailpb1.pair.com...
> Hello again guys, thanks for the help over the past 48 hours :)
>
> Over the past week i have had the job of tweaking the php pages of a
friends
> site. so far so good :)
>
> Now i am onto the admin area for running the website. I downloaded one of
> the many db managers scripts from www.hotscripts.com
> Luckly its a very simple app, easy to mod. Anyways most of my php
knowledge
> is in conjuction with flash www.innovativedesigns.org.uk. most of the
> problems i have had here have been fairly simple to learn and fix.
>
> Now the job this week is with php+html (total newbie to this area). most
of
> the problems i have been able to fix with some help from here as well.
>
> http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
>
> ~This is the admin area. I manged to get the drop down menu working to
> select the revelent table and then set $tablename with the result being
> displayed in the next page as:
> <?
> print "MyAdmin database for <i>$tablename</i> table";
> ?>
> The new page has 4 links to load other php files to edit,delete, view, and
> add new data to the DB
> On the links have:
> <a href="edit.php?tablename=$tablename">View database</a><br>
>
> ~Now in the edit.php i have :
> $result = mysql_query("SELECT * FROM $tablename")or die("couldnt select
> table");
>
> $tablename is not being passed with the link.
>
> What am i missing?
>
>
> Cheers
> Paul

attached mail follows:


I was looking for license information on the PHP site and only found "The
PHP License, version 3.0" http://www.php.net/license/3_0.txt

1 - Is this license information only applicable to PHP version 3.0?
2 - Is there no license for Version 4+ or is this now covered by GPL?

From the PHP web site:
Q. Why is PHP 4 not dual-licensed under the GNU General Public License (GPL)
like PHP 3 was?

A. GPL enforces many restrictions on what can and cannot be done with the
licensed code. The PHP developers decided to release PHP under a much more
loose license (Apache-style), to help PHP become as popular as possible.

3 - What is dual-licensed mean?

4 - Where can I find this "loose license (Apache-style)" agreement?

Thanks
Chris

attached mail follows:


On Mon, 17 Nov 2003 08:44:52 -0600, you wrote:

>I was looking for license information on the PHP site and only found "The
>PHP License, version 3.0" http://www.php.net/license/3_0.txt
>
>1 - Is this license information only applicable to PHP version 3.0?

The licence is bundled with the software.

>2 - Is there no license for Version 4+ or is this now covered by GPL?

I think you'll find that "The PHP License, version 3.0" means that it's
version 3.0 of the document, not that it only applies to version 3.0 of the
software. (I can see how it would be ambiguous).

>3 - What is dual-licensed mean?

Released under more than one licence. For example, you could release a
photograph under creative commons for non-commercial use but require anyone
who wants to use it comemrically to agree to a different licence.

>4 - Where can I find this "loose license (Apache-style)" agreement?

AFAIK 3.0 is the latest version of the document.

attached mail follows:


Hi:

Why is the "floor" function returning 27564 instead of 27565 in this
script? PHP version is 4.2.2.

Thanks!
Ruben.

#!/usr/bin/php -q

<?php

$b = 275.65 * 100;
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($b); // Incorrect. why 27564?

$b = 27565;
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($b)."\n\n"; // Correct

?>

attached mail follows:


This has to do with the floating point precision.

I quote the manual:
It is quite usual that simple decimal fractions like 0.1 or 0.7 cannot be
converted into their internal binary counterparts without a little loss of
precision. This can lead to confusing results: for example,
floor((0.1+0.7)*10) will usually return 7 instead of the expected 8 as the
result of the internal representation really being something like
7.9999999999....

This is related to the fact that it is impossible to exactly express some
fractions in decimal notation with a finite number of digits. For instance,
1/3 in decimal form becomes 0.3333333. . ..

So never trust floating number results to the last digit and never compare
floating point numbers for equality. If you really need higher precision,
you should use the arbitrary precision math functions or gmp functions
instead.

Hope this helps you

Randal

----- Original Message -----
From: "ruben" <ruben20superguai.com>
To: <php-generallists.php.net>
Sent: Monday, November 17, 2003 1:52 PM
Subject: [PHP] Unexpected result in floor function

> Hi:
>
> Why is the "floor" function returning 27564 instead of 27565 in this
> script? PHP version is 4.2.2.
>
> Thanks!
> Ruben.
>
>
>
> #!/usr/bin/php -q
>
> <?php
>
> $b = 275.65 * 100;
> echo "\n\nb= ".$b;
> echo "\nfloor(b)= ".floor($b); // Incorrect. why 27564?
>
> $b = 27565;
> echo "\n\nb= ".$b;
> echo "\nfloor(b)= ".floor($b)."\n\n"; // Correct
>
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


ruben wrote:
> Hi:
>
> Why is the "floor" function returning 27564 instead of 27565 in this
> script? PHP version is 4.2.2.
>
> Thanks!
> Ruben.
>
>
>
> #!/usr/bin/php -q
>
> <?php
>
> $b = 275.65 * 100;

$b = (int)$b;
/*
$b was a floating point number with value something like 27564.9999989,
when displayed it shows correctly 27565, but in calculations
27564.9999989 is used.

Q: Do you know why pentiums are faster than 486 processors?
A: Because 486 computes, pentium guesses.

*/
> echo "\n\nb= ".$b;
> echo "\nfloor(b)= ".floor($b); // Incorrect. why 27564?
>
> $b = 27565;
> echo "\n\nb= ".$b;
> echo "\nfloor(b)= ".floor($b)."\n\n"; // Correct
>
> ?>
>

attached mail follows:


[snip]
Yes, I am calling the fopen with two parameters.
The filename is also a string. The problem is when
I pass a string variable the fopen fails but succeeds
when I pass a constant string.
[/snip]

Can you show us the actual code for your fopen? Including the place
where the string variable is set up?

attached mail follows:


I hv physically one single server, but with different websites on it

like www.aaa.com / www.bbb.com / www.ccc.com

Now the problem is about session. What I want is login page at www.aaa.com
only but session is accessible from www.bbb.com and www.ccc.com

can it be possible, if yes how ? if no any other work around ?

Thanks in advance
manisha

attached mail follows:


Manisha Sathe wrote:

> I hv physically one single server, but with different websites on it
>
> like www.aaa.com / www.bbb.com / www.ccc.com
>
> Now the problem is about session. What I want is login page at www.aaa.com
> only but session is accessible from www.bbb.com and www.ccc.com
>
> can it be possible, if yes how ? if no any other work around ?

You can store the session information in a database that can be read
from all three websites.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
  it is very, very good; and when it is bad,
  it is better than nothing."

attached mail follows:


Hi,

I have a code that should fetch the information from another webpage.
The code find's the page, but I can't make it stop on </table> sign.

Where is the problem?

Here is the code
-
$fp=fopen("http://www.yle.fi/top40/index.php?page=lista_singlet20","r");
$buffer = fread ($fp, 1000000);

preg_match("|<tr class=\"listRow2\"><td class=\"listRow2\"><span
class=\"listIndex\">1.+\<\/table\>|is", $buffer, $regs );
$table = $regs[0];

echo "$table";
-

Thanks for advance
Sami

attached mail follows:


At 15:07 17-11-03, you wrote:
>Hi,
>
>I have a code that should fetch the information from another webpage. The
>code find's the page, but I can't make it stop on </table> sign.
>
>preg_match("|<tr class=\"listRow2\"><td class=\"listRow2\"><span
>class=\"listIndex\">1.+\<\/table\>|is", $buffer, $regs );

It probably looks for the last table tag. Is that so? Then you need to tell
the script in a modifier that it should not be greedy (not my terminology,
but the regexp term for this). The modifiers are the letters after the
patern itself, in your example the i (do not make a difference between
capital and small letters) and s ( I think: ignore line breaks). Try adding
a U for making it non greedy. If that does not help check the docs on 'non
greedy'.

attached mail follows:


On Tuesday 18 November 2003 00:03, Chris Hayes wrote:
> At 15:07 17-11-03, you wrote:

> >I have a code that should fetch the information from another webpage. The
> >code find's the page, but I can't make it stop on </table> sign.
> >
> >preg_match("|<tr class=\"listRow2\"><td class=\"listRow2\"><span
> >class=\"listIndex\">1.+\<\/table\>|is", $buffer, $regs );
>
> It probably looks for the last table tag. Is that so? Then you need to tell
> the script in a modifier that it should not be greedy (not my terminology,
> but the regexp term for this). The modifiers are the letters after the
> patern itself, in your example the i (do not make a difference between
> capital and small letters) and s ( I think: ignore line breaks). Try adding
> a U for making it non greedy. If that does not help check the docs on 'non
> greedy'.

Also, characters are being escaped unecessarily. The "table" fragment should
probably be simply:

  </table>

ie no need to escape the forward slash (/) and the greater-than sign (>).

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
America!! I saw it all!! Vomiting! Waving! JERRY FALWELLING into
your void tube of UHF oblivion!! SAFEWAY of the mind ...
*/

attached mail follows:


Chris Hayes wrote:
> At 15:07 17-11-03, you wrote:
>
>> Hi,
>>
>> I have a code that should fetch the information from another webpage.
>> The code find's the page, but I can't make it stop on </table> sign.
>>
>> preg_match("|<tr class=\"listRow2\"><td class=\"listRow2\"><span
>> class=\"listIndex\">1.+\<\/table\>|is", $buffer, $regs );
>
>
> It probably looks for the last table tag. Is that so? Then you need to
> tell the script in a modifier that it should not be greedy (not my
> terminology, but the regexp term for this). The modifiers are the
> letters after the patern itself, in your example the i (do not make a
> difference between capital and small letters) and s ( I think: ignore
> line breaks). Try adding a U for making it non greedy. If that does not
> help check the docs on 'non greedy'.

Thanks for advice! The letter U did the "thing".
Are there more modifiers than letter i,s or U and where I can find more
information on modifiers?

Thanks,
Sami

attached mail follows:


I had no problem installing php4 as sapi module and php5 as cgi executeable.
The server starts with no error messages. BUT, when I try opening a file
(phpinfo.php5 with content <?php phpinfo(); ?> the server return a 500
Internal Server Error.
Have the following lines added to httpd.conf

LoadModule php4_module "D:/php/sapi/php4apache2.dll"
ScriptAlias /php5/ "D:/php5/"
Action application/x-httpd-php5 /php5/php.exe
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php5 .php5

attached mail follows:


I had no problem installing php4 as sapi module and php5 as cgi executeable.
The server starts with no error messages. BUT, when I try opening a file
(phpinfo.php5 with content <?php phpinfo(); ?> the server return a 500
Internal Server Error.
Have the following lines added to httpd.conf

LoadModule php4_module "D:/php/sapi/php4apache2.dll"
ScriptAlias /php5/ "D:/php5/"
Action application/x-httpd-php5 /php5/php.exe
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php5 .php5

attached mail follows:


Hi!

Need to read a xml-file into an array, but searching around I havent
found a way that's easy and simple… Arent there an easy way in PHP to
accomplish this?

Sincerely

Victor

attached mail follows:


At 15:47 17-11-03, you wrote:
>Hi!
>
>Need to read a xml-file into an array, but searching around I havent found
>a way that's easy and simple… Arent there an easy way in PHP to accomplish
>this?

have you been at http://se.php.net/xml ?

attached mail follows:


Hm... I should clarify this some more. This is the result of $Array2:

Array (
[0] => Array (
  [0] => 15083
  [1] => bash
  [2] => S
  [3] => 4380
  [4] => 10:31
  [5] => 000
  [6] => sator
  [7] => 00:00:00
  [8] => -bash
  )
[1] => Array (
  [0] => 15126
  [1] => bash
  [2] => S
  [3] => 4380
  [4] => 10:31
  [5] => 000
  [6] => sator
  [7] => 00:00:00
  [8] => -bash
  )
[2] => Array (
  [0] => etc...
  )
)

What I need is to be able to assign a variable to $Array2[0] - [0] so for
the first one it would be:

  $var0 = 15083
  $var1 = bash
  $var2 = S
  $var3 = 4380
  etc...

How do I get to this point?

Susan

-----Original Message-----
From: Susan Ator
Sent: Friday, November 14, 2003 6:35 PM
To: 'CPT John W. Holmes '; ''Lowell Allen' '; 'PHP '
Subject: RE: [PHP] Having fits with input to array

Actually, what I need to do is:

  $var1 = $Array2[1]
  $var2 = $Array2[2]
  etc...

but I just seem to get

  Array

as the output of $var1, $var2, etc...

susan

-----Original Message-----
From: CPT John W. Holmes
To: Susan Ator; 'Lowell Allen'; PHP
Sent: 11/14/03 4:01 PM
Subject: Re: [PHP] Having fits with input to array

From: "Susan Ator" <SAtornpr.org>

> Perfect! That did exactly what I needed.

Good...

> Now, *ahem*, I thought I knew how to assign variables to the elements
in
> Array2 but *cough* I'm somewhat befuddled. I've not been able to find
> anything in the online php manual. Could you point me in the right
direction
> for that?

Not sure I'm following you, but

$Array2[] = $somvariable;

will add the value of $somevariable to the next element of $Array2.

Can you explain a little more what you want if that's not it.

---John Holmes...

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

attached mail follows:


----- Original Message -----
From: "Susan Ator" <SAtornpr.org>

> Hm... I should clarify this some more. This is the result of $Array2:
>
> Array (
> [0] => Array (
> [0] => 15083
[snip]
> What I need is to be able to assign a variable to $Array2[0] - [0] so for
> the first one it would be:
>
> $var0 = 15083
[snip]
> How do I get to this point?

The question is, why do you need to get to that point? I think you're doing
to much work. You already have the variable $Array2[0][0] that you can use
anywhere, why do you need to assign it to yet another variable.

Maybe you just need to look at foreach() for looping through the array?

What was your point of getting $var0, $var1, $var2, etc... there's probably
a better method for whatever you're doing.

---John Holmes...

attached mail follows:


Sorry, forgot to post to the list.

sa

-----Original Message-----
From: Susan Ator
Sent: Monday, November 17, 2003 11:12 AM
To: 'CPT John W. Holmes'
Subject: RE: [PHP] Having fits with input to array

D'oh. You're right. I have a tendency to do things the hard way. That's what
comes of getting too focused on doing things a certain way. :P

Thanks, I think that does it for me!

susan

-----Original Message-----
From: CPT John W. Holmes [mailto:holmes072000charter.net]
Sent: Monday, November 17, 2003 11:12 AM
To: Susan Ator; ''Lowell Allen' '; 'PHP '
Subject: Re: [PHP] Having fits with input to array

----- Original Message -----
From: "Susan Ator" <SAtornpr.org>

> Hm... I should clarify this some more. This is the result of $Array2:
>
> Array (
> [0] => Array (
> [0] => 15083
[snip]
> What I need is to be able to assign a variable to $Array2[0] - [0] so for
> the first one it would be:
>
> $var0 = 15083
[snip]
> How do I get to this point?

The question is, why do you need to get to that point? I think you're doing
to much work. You already have the variable $Array2[0][0] that you can use
anywhere, why do you need to assign it to yet another variable.

Maybe you just need to look at foreach() for looping through the array?

What was your point of getting $var0, $var1, $var2, etc... there's probably
a better method for whatever you're doing.

---John Holmes...

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

attached mail follows:


Hey David,

% Is it possible to run a SSH command from php?
>Sure; it's possible to run any command from php. It may not work all
>that well, though :-)

heheh, good one. As helpful as usual :-D

% coming from a windows background I have no idea about shell/SSH and am
% pretty lost.
% Doing a quick search on google for "SSH commands" and "SSH help" returned
% quite a lot
% of crap that really didnt help me learn.

>Good enough. What do you want to do?

Basically stop/restart apache when i make changes to the httpd.conf file.
But then thinking of it I realize that if I stop apache from a script, once
apache is stopped
I cant run any php to restart it...right?
So I guess my question gets cut down to basically "any good place/program to
learn/use SSH?"

 Cheers,
 -Ryan
PHP Web hosting http://Bestwebhosters.com

----- Original Message -----
From: "David T-G" <davidtg-phpjustpickone.org>
To: "PHP General list" <php-generallists.php.net>
Cc: "Ryan A" <ryancoinpass.com>
Sent: Monday, November 17, 2003 4:23 AM
Subject: Re: [PHP] SSH and php

attached mail follows:


On Monday 17 November 2003 15:02, Ryan A wrote:
> So I guess my question gets cut down to basically "any good place/program
> to learn/use SSH?"

No such thing as an 'ssh command' really.. apart from the command used to
invoke SSH. SSH (crudely) is an encrypted form of telnet.

You need a beginner's guide on unix shell commands - cd, ls, etc

attached mail follows:


>% Doing a quick search on google for "SSH commands" and "SSH help" returned
>% quite a lot
>% of crap that really didnt help me learn.
>
>>Good enough. What do you want to do?
>
>Basically stop/restart apache when i make changes to the httpd.conf file.
>But then thinking of it I realize that if I stop apache from a script,
>once apache is stopped I cant run any php to restart it...right?

Right. And you wouldn't be able to stop it in the first place, unless
youre system was so insecure that Apache ran as a privileged user.

>So I guess my question gets cut down to basically "any good place/program
>to learn/use SSH?"

I think that learning SSH isn't really what you're after - you want to
learn how to use the command line interface, which is a whole different
thing (SSH is just the intermediary program you use to access the remote
machine). It depends on the shell you're using, the operating system
you're on, the location of Apache binaries, your $PATH, and a wide range
of other factors.

In the normal case (unix OS, you have sudo or root permissions, and
everything is within your path) it's a simple one-liner, like so:

        sudo apachectl graceful

-mike.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html

attached mail follows:


Ryna --

...and then Ryan A said...
%
% Hey David,

Hiya!

%
% % Is it possible to run a SSH command from php?
% >Sure; it's possible to run any command from php. It may not work all
% >that well, though :-)
%
% heheh, good one. As helpful as usual :-D

Always there for ya, man :-)

%
% >Good enough. What do you want to do?
%
% Basically stop/restart apache when i make changes to the httpd.conf file.

There are ways to do that -- I personally would create a kick script
outside of the htdocs tree, give the apache user permission to run that,
and call that script from an https page with some authentication -- but
you always have to fall back to "if that script fails, then I need to log
in and use the shell" anyway.

% But then thinking of it I realize that if I stop apache from a script, once
% apache is stopped
% I cant run any php to restart it...right?

You certainly can't run any php web script :-)

% So I guess my question gets cut down to basically "any good place/program to
% learn/use SSH?"

As you've been shown, ssh is nothing magical; what you want to do is
learn how to use a *NIX shell. Think DOS command prompt. If you can
already use a command prompt, then try an ssh in and look around (ls,
chdir, pwd, ...).

HTH & HAND

:-D
--
David T-G * There is too much animal courage in
(play) davidtgjustpickone.org * society and not sufficient moral courage.
(work) davidtgworkjustpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE/uPWJGb7uCXufRwARAm3aAJ9J0OvMhV240NfmTWbumV+XXMQitACcDXOL
H+V96lFBvFefkxAiyTIRui4=
=2Dx5
-----END PGP SIGNATURE-----

attached mail follows:


* Thus wrote Arne Rusek (zonkmatfyz.cz):
>
> If someone is interested in reading through the whole result it could
> be downloaded from
>
> http://zonk.matfyz.cz/php_post_problem

Your problem exists here:

Server API => Command Line Interface
_ENV["SERVER_SOFTWARE"] => Boa/0.94.13

Seeing this tells me your webserver is not configured correctly,
Boa should not be using the CLI version of php it should be using
the CGI version.

Curt
--
"My PHP key is worn out"

  PHP List stats since 1997:
    http://zirzow.dyndns.org/html/mlists/

attached mail follows:


* Thus wrote Ivan Marenic (adminmilleniumtip.com):
> I did not omit content.
> Copied whole text box in sniffer using context menu comands (select all,
> copy) - pasted to news agent.
> There is no content.

I didn't see the output of phpinfo or your print_r(). that leads me
to believe that your sniffer is only catching the headers.

Curt
--
"My PHP key is worn out"

  PHP List stats since 1997:
    http://zirzow.dyndns.org/html/mlists/

attached mail follows:


> Now, if you don't see any session ID appended to the URL, that means SID
> is empty and you're more than likely depending upon cookies. So, you
> need to retrieve the session id and append it to the URL yourself.
>
> <?php
session_start();
> $sessname = session_name();
> $sessid = session_id();
>
echo $sessid;
>
> echo "<a href=\"server2/page.php?$sessname=$sessid\">Server 2</a>";
> ?>

This works. My second page has the suffix '?PHPSESSID=e6t9tu43j9tj39j...',
that matches the 'echo $sessid' I've added to your script above, so this
part did work. But to test it, I do this in my second page:

<?php
session_start();
$sessid = session_id();
echo $sessid;
?>

$sessid does echo a session_id... but not the one as the one I passed
it!!?!?! And I do see the right SID in the Address bar!

What the ???
Thanks in advance.

Guillaume
P.S.
PHP v4.3.3, with MSESSION v1.21 downloaded 2 weeks ago, thanks :)

-----Original Message-----
From: John W. Holmes [mailto:holmes072000charter.net]
Sent: Friday, November 14, 2003 8:29 PM
To: Guillaume Dupuis
Cc: php-generallists.php.net
Subject: Re: [PHP] msession - giving me a hard time

Guillaume Dupuis wrote:

> This is now my initial page:
>
> <?php
> session_start($_GET['SID']);
> echo SID;
> ?>
>
> And it returns nothing to me.

Heh... okay, let's start over.

 From Server1:

If you create a link like this:

<a href="server2/page.php?<?php echo SID; ?>">Server 2</a>

Do you see the session ID appended to that URL? If you do, then a simple
session_start() on the server2/page.php will be enough to continue the
session.

Now, if you don't see any session ID appended to the URL, that means SID
is empty and you're more than likely depending upon cookies. So, you
need to retrieve the session id and append it to the URL yourself.

<?php
$sessname = session_name();
$sessid = session_id();

echo "<a href=\"server2/page.php?$sessname=$sessid\">Server 2</a>";
?>

Now, you should see a link that has something like PHPSESSID=XXXXX.

Again, a simple session_start() on the next page will continue the session.

So, to recap:

1. Both servers only use session_start().

2. When linking between servers, you must pass the session ID in the URL
using one of the above methods

3. When staying on the same server, it appears the session ID is being
passed around in a cookie, so you don't need to do anything to those links.

Hope this helps some more... :)

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

>

attached mail follows:


From: "Guillaume Dupuis" <guillaume.dupuissand.com>

> This works. My second page has the suffix '?PHPSESSID=e6t9tu43j9tj39j...',
> that matches the 'echo $sessid' I've added to your script above, so this
> part did work. But to test it, I do this in my second page:
>
> <?php
> session_start();
> $sessid = session_id();
> echo $sessid;
> ?>
>
> $sessid does echo a session_id... but not the one as the one I passed
> it!!?!?! And I do see the right SID in the Address bar!

No reason that shouldn't be working. Let's help out PHP a little more...

<?php
session_id($_GET['PHPSESSID']);
session_start();

echo sesson_id();
?>

Try that. You're telling PHP to use the session id passed in the URL (which
it should do by default, anyhow) by calling the session_id() function before
session_start().

Are you clearing your cookies while doing all of this? session_start() on
the second page may be picking up an old cookie instead of picking up the
value in the URL...

---John Holmes...

attached mail follows:


Mea culpa!!

Even if my PHP is version 4.3.3, I had to compile it with
'--enable-trans-sid' in the configure. Now it works.

Faulty PHP doc:
PHP is capable of transforming links transparently. Unless you are using PHP
4.2 or later, you need to enable it manually when building PHP. Under UNIX,
pass --enable-trans-sid to configure. If this build option and the run-time
option session.use_trans_sid are enabled, relative URIs will be changed to
contain the session id automatically.

Now all works.

Thanks for your consistent and thorough help,
Guillaume

-----Original Message-----
From: CPT John W. Holmes [mailto:holmes072000charter.net]
Sent: Monday, November 17, 2003 11:16 AM
To: Guillaume Dupuis
Cc: php-generallists.php.net
Subject: Re: [PHP] msession - giving me a hard time

From: "Guillaume Dupuis" <guillaume.dupuissand.com>

> This works. My second page has the suffix '?PHPSESSID=e6t9tu43j9tj39j...',
> that matches the 'echo $sessid' I've added to your script above, so this
> part did work. But to test it, I do this in my second page:
>
> <?php
> session_start();
> $sessid = session_id();
> echo $sessid;
> ?>
>
> $sessid does echo a session_id... but not the one as the one I passed
> it!!?!?! And I do see the right SID in the Address bar!

No reason that shouldn't be working. Let's help out PHP a little more...

<?php
session_id($_GET['PHPSESSID']);
session_start();

echo sesson_id();
?>

Try that. You're telling PHP to use the session id passed in the URL (which
it should do by default, anyhow) by calling the session_id() function before
session_start().

Are you clearing your cookies while doing all of this? session_start() on
the second page may be picking up an old cookie instead of picking up the
value in the URL...

---John Holmes...

attached mail follows:


I have someone here at my desk arguing that Microsoft's .NET is better than
PHP - faster to process, easier and quicker to program, etc.

They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.

Any comments to help me defend PHP or to educate me?

:)

-Mike

attached mail follows:


[snip]
I have someone here at my desk arguing that Microsoft's .NET is better
than
PHP - faster to process, easier and quicker to program, etc.

They also (claim) that Microsoft's SQL is much faster and such vs.
MySQL.

Any comments to help me defend PHP or to educate me?
[/snip]

Both 'arguments' are so general as to be laughable. Come up with some
specific issues and we can go toe-to-toe.

NET v PHP
1. Platform dependency? (Run on M$ platforms v. running on a variety of
platforms, including M$)

MySQL v MSSQL
1. MSSQL is bloated. Speed is an issue. Footprint is an issue.
2. Platform dependency?

Have fun!

attached mail follows:


Hi,

        From my experiences, your coworkers are somewhat correct. I found MySQL to
be as fast in most cases, however in databases with millions of records,
MySQL started slowing down before the MS SQL did.

        As for PHP being slower to program, I disagree. Its about the same, and in
some cases, PHP might have a few more shortcuts.

        Maybe they're using some visual editors to speed them up?

-Dan Joseph

> -----Original Message-----
> From: Mike R [mailto:spycobaltspyproductions.com]
> Sent: Monday, November 17, 2003 11:07 AM
> To: php-generallists.php.net
> Subject: [PHP] Microsoft .NET arguement
>
>
>
> I have someone here at my desk arguing that Microsoft's .NET is
> better than
> PHP - faster to process, easier and quicker to program, etc.
>
> They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.
>
> Any comments to help me defend PHP or to educate me?
>
> :)
>
> -Mike
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


[snip]
...
[/snip]

http://www.sitepoint.com/article/870

GIS for Microsoft NET vs. PHP

attached mail follows:


Actually, their claim is that Microsoft environments are secure - you just
need the proper firewall (that, basically, the problems with Windows boxes
has to do with the firewall, not the OS).

That one I laughed at.

-Mike

> and next they will no doubt claim that IIS (and windowz in general) is a
> secure environment -- just the place to run your important applications.
>
>
>
> ---------- Original Message ----------
> > From: Mike R <spycobaltspyproductions.com>
> > To: php-generallists.php.net
> > Date: Monday, November 17, 2003 11:06:37 AM -0500
> > Subject: [PHP] Microsoft .NET arguement
> >
> >
> > I have someone here at my desk arguing that Microsoft's .NET is better
> > than PHP - faster to process, easier and quicker to program, etc.
> >
> > They also (claim) that Microsoft's SQL is much faster and such vs.
> > MySQL.
> >
> > Any comments to help me defend PHP or to educate me?
> >
> > :)
> >
> > -Mike
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> ---------- End Original Message ----------
>
>
>
>

attached mail follows:


Hi,

        I will give MS credit, they are aware they need to do better, and are
making strides to be better. I won't fault them on that until they give up,
or stop progressing.

        As for secure environments and code, even linux+php applications and
servers can be volnerable. I think the whole OS vs OS arguments, and Code
vs Code arguments (in regards to security) are humorous. Yes, get a good
firewall, and have an auditor audit your system and code. That will give
you a secure environment.

-Dan Joseph

> -----Original Message-----
> From: Mike R [mailto:spycobaltspyproductions.com]
> Sent: Monday, November 17, 2003 11:28 AM
> To: lists-php-replieslistmail.innovate.net
> Cc: php-generallists.php.net
> Subject: RE: [PHP] Microsoft .NET arguement
>
>
>
> Actually, their claim is that Microsoft environments are secure - you just
> need the proper firewall (that, basically, the problems with Windows boxes
> has to do with the firewall, not the OS).
>
> That one I laughed at.
>
> -Mike
>
>
>
> > and next they will no doubt claim that IIS (and windowz in general) is a
> > secure environment -- just the place to run your important applications.
> >
> >
> >
> > ---------- Original Message ----------
> > > From: Mike R <spycobaltspyproductions.com>
> > > To: php-generallists.php.net
> > > Date: Monday, November 17, 2003 11:06:37 AM -0500
> > > Subject: [PHP] Microsoft .NET arguement
> > >
> > >
> > > I have someone here at my desk arguing that Microsoft's .NET is better
> > > than PHP - faster to process, easier and quicker to program, etc.
> > >
> > > They also (claim) that Microsoft's SQL is much faster and such vs.
> > > MySQL.
> > >
> > > Any comments to help me defend PHP or to educate me?
> > >
> > > :)
> > >
> > > -Mike
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > ---------- End Original Message ----------
> >
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


I agree. I've found MS SQL (and MS Access databases) to be extremely fast
when well optimised, even with massive databases. As you can interface with
them using ODBC I prefer to use MS database backends when my clients already
have them installed alongside PHP for Win32.

C

-----Original Message-----
From: Dan Joseph [mailto:djoseph74earthlink.net]
Sent: 17 November 2003 16:26
To: php-generallists.php.net
Subject: RE: [PHP] Microsoft .NET arguement

Hi,

        From my experiences, your coworkers are somewhat correct. I found
MySQL to
be as fast in most cases, however in databases with millions of records,
MySQL started slowing down before the MS SQL did.

        As for PHP being slower to program, I disagree. Its about the same,
and in
some cases, PHP might have a few more shortcuts.

        Maybe they're using some visual editors to speed them up?

-Dan Joseph

> -----Original Message-----
> From: Mike R [mailto:spycobaltspyproductions.com]
> Sent: Monday, November 17, 2003 11:07 AM
> To: php-generallists.php.net
> Subject: [PHP] Microsoft .NET arguement
>
>
>
> I have someone here at my desk arguing that Microsoft's .NET is
> better than
> PHP - faster to process, easier and quicker to program, etc.
>
> They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.
>
> Any comments to help me defend PHP or to educate me?
>
> :)
>
> -Mike
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield. Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.

attached mail follows:


On Tuesday 18 November 2003 00:27, Mike R wrote:
> Actually, their claim is that Microsoft environments are secure - you just
> need the proper firewall (that, basically, the problems with Windows boxes
> has to do with the firewall, not the OS).
>
> That one I laughed at.

But it's true, you can solve most of the security problems by tightening up
the firewall so that nothing goes in or out.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Save the whales. Collect the whole set.
*/

attached mail follows:


You can't interface MySQL with ODBC?

-Mike

>
> I agree. I've found MS SQL (and MS Access databases) to be extremely fast
> when well optimised, even with massive databases. As you can
> interface with
> them using ODBC I prefer to use MS database backends when my
> clients already
> have them installed alongside PHP for Win32.
>
> C
>
>
> Hi,
>
> From my experiences, your coworkers are somewhat correct. I found
> MySQL to
> be as fast in most cases, however in databases with millions of records,
> MySQL started slowing down before the MS SQL did.
>
> As for PHP being slower to program, I disagree. Its about the same,
> and in
> some cases, PHP might have a few more shortcuts.
>
> Maybe they're using some visual editors to speed them up?
>
> -Dan Joseph
>
> > -----Original Message-----
> > From: Mike R [mailto:spycobaltspyproductions.com]
> > Sent: Monday, November 17, 2003 11:07 AM
> > To: php-generallists.php.net
> > Subject: [PHP] Microsoft .NET arguement
> >
> >
> >
> > I have someone here at my desk arguing that Microsoft's .NET is
> > better than
> > PHP - faster to process, easier and quicker to program, etc.
> >
> > They also (claim) that Microsoft's SQL is much faster and such
> vs. MySQL.
> >
> > Any comments to help me defend PHP or to educate me?
> >
> > :)
> >
> > -Mike
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> If you are not the intended recipient of this e-mail, please preserve the
> confidentiality of it and advise the sender immediately of any error in
> transmission. Any disclosure, copying, distribution or action taken, or
> omitted to be taken, by an unauthorised recipient in reliance upon the
> contents of this e-mail is prohibited. Somerfield cannot accept liability
> for any damage which you may sustain as a result of software viruses so
> please carry out your own virus checks before opening an attachment. In
> replying to this e-mail you are granting the right for that reply to be
> forwarded to any other individual within the business and also to
> be read by
> others. Any views expressed by an individual within this message do not
> necessarily reflect the views of Somerfield. Somerfield reserves
> the right
> to intercept, monitor and record communications for lawful business
> purposes.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Hi,

> > Actually, their claim is that Microsoft environments are secure
> - you just
> > need the proper firewall (that, basically, the problems with
> Windows boxes
> > has to do with the firewall, not the OS).
> >
> > That one I laughed at.
>
> But it's true, you can solve most of the security problems by
> tightening up
> the firewall so that nothing goes in or out.

        ...and everyone needs to keep in mind that there isn't a 100% secure
operating system, or server environment.

-Dan Joseph

attached mail follows:


On Mon, 2003-11-17 at 11:27, Mike R wrote:
> Actually, their claim is that Microsoft environments are secure - you just
> need the proper firewall (that, basically, the problems with Windows boxes
> has to do with the firewall, not the OS).
>
> That one I laughed at.
>

See how deep seeded the brainwashing is... ??

attached mail follows:


Jay Blanchard wrote:
> [snip]
> I have someone here at my desk arguing that Microsoft's .NET
> is better than PHP - faster to process, easier and quicker to
> program, etc.
>
> They also (claim) that Microsoft's SQL is much faster and such vs.
> MySQL.
>
> Any comments to help me defend PHP or to educate me? [/snip]
>
> Both 'arguments' are so general as to be laughable. Come up
> with some specific issues and we can go toe-to-toe.
>
> NET v PHP
> 1. Platform dependency? (Run on M$ platforms v. running on a
> variety of platforms, including M$)
>
> MySQL v MSSQL
> 1. MSSQL is bloated. Speed is an issue. Footprint is an issue.
> 2. Platform dependency?
>
> Have fun!

To add a little bit to this conversation, one thing I heard about the .NET
technology is that it supports multiple scripting languages in one file. Not
that it would really (usually) be the best thing, but that means that you
can use Perl, C#, PHP and ASP.NET all in the same file..

;),
Wouter

attached mail follows:


Mike R wrote:
> I have someone here at my desk arguing that Microsoft's .NET is better than
> PHP - faster to process, easier and quicker to program, etc.

I've never coded anything for .NET, so I can't speak to that. However,
in all the test my company has ever done, php on Linux/Apache blew the
doors off of .NET on Win2k/IIS when it came to speed.

> They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.

This person is just wrong here. MySQL is one of the, if not the fastest
RDMS' out there. MSSQL is, well to put it nicely, SLOW. MSSQL has more
features than MySQL (not for long though), but as far as speed goes, not
even Oracle can compete with MySQL, much less MSSQL.

> Any comments to help me defend PHP or to educate me?

There's no need to defend PHP...it speaks for itself. Not to mention
that with most MS people, it doesn't matter how much fact you show them,
they won't believe it.

> :)
>
> -Mike
>

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

attached mail follows:


On Mon, Nov 17, 2003 at 11:06:37AM -0500, Mike R wrote:
:
: I have someone here at my desk arguing that Microsoft's .NET is better
: than PHP - faster to process, easier and quicker to program, etc.
:
: They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.

Without real benchmarks, all claims on speed are just that:
unsubstantiated claims.

But one nice thing about .NET is that it provides a nice framework that
is available at all times and is fairly optimized. It's like having
PEAR installed automatically. And having your APIs consistently named
also helps the developer to more easily remember the interfaces.

attached mail follows:


For a trial, I saved the following input in ..\apache\htdocs as suggested.
 
<html>
<head>
<title>Today's Date</title>
</head>
<body>
<p>Today's Date (according to this web server) is
<?php
 echo( date('1, F ds Y.') );
?></p>
</body>
</html>
 
But this is the only thing I could see on my browser: "Today's Date (according to this web server) is"
 
After severeral trials and inspecting the httpd.conf configuration file, I tried the following input:
 
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo "<p>Hello World</p?"; ?>
 </body>
</html>
 
This time nothing appeared on my browser. I'd really appreciate some help with this one.
 
I installed apache 1.3 as a server and it runs fine each time I click on "Start Apache in Console"
 
I'm mainly interested in using these facilities for my private learning so I chose to use PHP as a module in apache - I'm a newbie to this affair! So I hope this wasn't a wrong decision. Nevertheless, the follwing are the few lines I added to the httpd.conf. file:
 
#LoadModule php4_module c:/php/sapi/php4apache.dll
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php .php3
#AddType application/x-httpd-php .phtml
#AddType application/x-httpd-php-source .phps
#AddModule mod_php4.c
#<Directory "c:/Program Files/Apache Group/Apache/htdocs">
 
I'd appreciate to hear/read from anyone who has managed to solved this sort of problem before.
 
Thanks in advance
 
Ike
 

---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

attached mail follows:


[snip]
- I'm a newbie to this affair! So I hope this wasn't a wrong decision.
Nevertheless, the follwing are the few lines I added to the httpd.conf.
file:
 
#LoadModule php4_module c:/php/sapi/php4apache.dll
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php .php3
#AddType application/x-httpd-php .phtml
#AddType application/x-httpd-php-source .phps
#AddModule mod_php4.c
#<Directory "c:/Program Files/Apache Group/Apache/htdocs">
[/snip]

All of those lines are commented out (the '#' sign). Uncomment them and
restart Apache.

attached mail follows:


what is the easiest way to convert a string like this "1,300.99" to a
number?

attached mail follows:


[snip]
what is the easiest way to convert a string like this "1,300.99" to a
number?
[/snip]

http://www.php.net/settype

attached mail follows:


From: "Jay Blanchard" <jay.blanchardniicommunications.com>
> From: "Diana Castillo" <dianainterhotel.com>
>
> > [snip]
> > what is the easiest way to convert a string like this "1,300.99" to a
> > number?
> > [/snip]
>
> http://www.php.net/settype

That'll just result in the number 1, though, since the conversion to "float"
will stop at the comma.

If you know that it's just going to be commas in there, a simple
str_replace(',','',$number) will get rid of the commas. Then PHP's type
juggling will take care of the rest for you and treat it like a FLOAT if it
needs to be. Or you can then use settype() to ensure it's a float.

---John Holmes...

attached mail follows:


[snip]
> > [snip]
> > what is the easiest way to convert a string like this "1,300.99" to
a
> > number?
> > [/snip]
>
> http://www.php.net/settype

That'll just result in the number 1, though, since the conversion to
"float"
will stop at the comma.

If you know that it's just going to be commas in there, a simple
str_replace(',','',$number) will get rid of the commas. Then PHP's type
juggling will take care of the rest for you and treat it like a FLOAT if
it
needs to be. Or you can then use settype() to ensure it's a float.
[/snip]

*oops* You are right John, I pulled the trigger too soon in myresponse.
The brain skipped the comma entirely.

attached mail follows:


Subject: MMCache segmentation faults

===8<==============Original message text===============
Hello!

I send this to mmcacheturckware.ru but It was returned. So I'll ask here if somebody have any idea.

I upgrade my php and mmcache (php 4.3.4 and mmcache 2.4.6) and
I have a lot of

[Mon Nov 17 13:49:17 2003] [notice] child pid 32974 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:18 2003] [notice] child pid 32767 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:19 2003] [notice] child pid 33282 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:20 2003] [notice] child pid 33289 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:22 2003] [notice] child pid 33291 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:24 2003] [notice] child pid 33346 exit signal Segmentation fault (11)

messages in my apache error log.

server is FreeBSD 5.1 Release.

my php.ini

zend_extension="/usr/local/lib/php/20020429/mmcache.so"
mmcache.shm_size="16"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.shm_only="0"
mmcache.compress="1"
mmcache.keys="shm_and_disk"
mmcache.sessions="shm_and_disk"
mmcache.content="shm_and_disk"

I delete cache folder when I upgrade. If i remove mmcache from php.ini
there's no problems. But strange is that pages load normaly.
  

--
Best regards,
 Uros mailto:urossir-mag.com

===8<===========End of original message text===========

--
lp,
 Uro¹

attached mail follows:


Here's what I use:

/**
 * get_text()
 *
 * $t The total text string
 * $s starting text string [e.g. <h1>]
 * $e ending text string [e.g. </h1>
 *
 * return the extracted text string. [e.g., returns string between
start and end texts.
 */
function get_text($text, $s, $e) // Get string out of text
{
    $sp = strpos($text, $s, 0) + strlen($s);
    $ep = strpos($text, $e, 0);
    return substr($text, $sp, $ep - $sp);
}

Matt Palermo wrote:

>Hello. I was wondering if anyone knew of a function to get the value
>between 2 strings. For example, lets say I have the following line:
>
>$line = "I want the value between word ONE and word TWO. Please return
>it...";
>
>Now, I want to get everything between "ONE" and "TWO". In this example it
>should return the value " and word ". Is there some sort of function I
>could use to easily do this? Please let me know if you have any ideas.
>
>Thanks,
>
>Matt
>
>

attached mail follows:


Hello List,

I am looking for a canned php form which hides the recipient email from
prying eyes. Everything I have found uses a hidden field.
--
Thank you,

David Buchmueller

---------------------------------------------------------------------
Brian Sooy & Co. | t. 440.322.5142 | www.briansooyco.com
---------------------------------------------------------------------

attached mail follows:


> I am looking for a canned php form which hides the recipient email from
> prying eyes. Everything I have found uses a hidden field.

If you only need the email address on the back end, why not encode it
(using your flavor of choice) and stick that value in the hidden field. Then,
upon submission, just decode and use.

Chris

attached mail follows:


> > I am looking for a canned php form which hides the recipient email from
> > prying eyes. Everything I have found uses a hidden field.
>
> If you only need the email address on the back end, why not encode it
> (using your flavor of choice) and stick that value in the hidden field. Then,
> upon submission, just decode and use.

Maybe I am misreading this question but why not just use id's
instead. For example, in your database you might have:

  id name email
  1 john johnexample.com
  2 fred fredexample.net

In the form you use the names, and unique ids, and the backend
will get the email addresses from the ids. This way they choose
names to send to but don't see the email addresses.

Regards,
Philip

attached mail follows:


David --

...and then David Buchmueller said...
%
% Hello List,

Hi!

%
% I am looking for a canned php form which hides the recipient email from
% prying eyes. Everything I have found uses a hidden field.

Why not just encode the recipient as "david" or "joe" or "1288" and then
determine the real address in your script based on that input. Think of
aliases with your script (or an external file if more convenient) as the
address book. Of course, if there's only one possible recipient then
there's no need to show address, alias, or anything.

% --
% Thank you,
%
% David Buchmueller

HTH & HAND

:-D
--
David T-G * There is too much animal courage in
(play) davidtgjustpickone.org * society and not sufficient moral courage.
(work) davidtgworkjustpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE/uQ7cGb7uCXufRwARAl9CAKCz3KQ3OH5/r7dujUt/iAFHBSwSEwCdFyDn
ICEpylCOqukk0P6Nz2vHwvo=
=7/P/
-----END PGP SIGNATURE-----

attached mail follows:


Is this what your looking for?
http://www.pfohlsolutions.com/projects/mailer/

-----Original Message-----
From: Philip Olson [mailto:philipcornado.com]
Sent: Monday, November 17, 2003 1:08 PM
To: Chris Boget
Cc: David Buchmueller; PHP General
Subject: Re: [PHP] Looking for Spam free php form


> > I am looking for a canned php form which hides the recipient email from
> > prying eyes. Everything I have found uses a hidden field.
>
> If you only need the email address on the back end, why not encode it
> (using your flavor of choice) and stick that value in the hidden field. Then,
> upon submission, just decode and use.

Maybe I am misreading this question but why not just use id's
instead. For example, in your database you might have:

  id name email
  1 john johnexample.com
  2 fred fredexample.net

In the form you use the names, and unique ids, and the backend
will get the email addresses from the ids. This way they choose
names to send to but don't see the email addresses.

Regards,
Philip

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

attached mail follows:


On Tuesday, November 18, 2003, at 04:30 AM, David Buchmueller wrote:

> I am looking for a canned php form which hides the recipient email from
> prying eyes. Everything I have found uses a hidden field.
>

You couldn't write one yourself?

The key is to store the email address' in a server-side array or DB,
and only give them the option of seeing the address' related name or id
in the form, rather than the address itself.

Build the form:
<?
$addr[] = array('Reception','mailexample.com');
$addr[] = array('Justin French','justinexample.com');
$addr[] = array('Bob Smith','bobexample.com');
$addr[] = array('Marketing','marketingexample.com');
?>
<select name='to'>
<?
foreach($addr as $k => $p)
        {
        echo "<option value='{$k}'>{$person[0]}</option>\n";
        }
?>
</option>

After the form is submitted, you match the recipient ID with an email
address server side, and send the email with mail().

<?
$id = $_POST['to']; // eg 3
$to = "{$addr[$id][0]} <{$addr[$id][