Re: Can I get the IP address from a visitor?
| From: | Olav | Date: | Tue, 01 Dec 2009 13:07:02 +0000 |
| Subject: | Re: Can I get the IP address from a visitor? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300175@lists.php.net to get a copy of this message | ||
Lars Kristiansson wrote:
[..]
> My goal is to create purchase-orders written on unique files, and to
> separate them my idea was to baptize files with the IP addresses, which
> would ive each visitor an unique purchase-order...
>
> Any hints to a newbie?
Yes. Do NOT use IP adresses as identifiers. Just forget about it.
People share connections, e.g. when they are in the same building or when
they are using the same proxy. People use domestic/consumer internet
connections that have dynamic IP addresses. Identifying people by their
IP address is therefore stupid.
If it is just to have a key to some data, you could try using a GUID. And
check when you generate one that it doesn't already exist (though the
chance is extremely small, it is not zero). Or just use some serial
number like everyone else does ;)
It may look boring to make files like order0001, order0002 etc. But it
works.
Any reason you are not storing your orders in a database?