is the "PID" that is assigned to each process item, (from doing ps
-ax) would display them all, but not sure how to display the current
one using php.
I know there is a way of doing it with PERL but not sure if there is
with PHP.
Any replies would be appreciated.
It doesn't look like it. phpinfo() tells me nothing. What do you want it
for? You have to bear in mind that it may only be valid for a single
page load as the next request may be sent to a fresh apache child.
My point about it possibly not being valid between pages still stands
though.
I want it for creating a "session id" unique to that user, based on
the time the pid was issues and the pid itself, so that the session id
can be as small a value as possible but still unique.
In that case why not use sessions? If you use session_start() at the top
of your pages then a unique session id will be gewnerated for you.
You can still create such an ID using a more static parameter - such as the
user's IP address. I've done this before, created a unique identifying
string for each visiting user by crypt()-ing the IP address using the
person's browser identifier as seed. Then chuck that into a database and as
soon as the user returns from the same IP using the same browser, you'll
know they've been there before because the same encrypted string will be
generated again and you can check for its existence in the database. Or
easier - use sessions =)
Albe
I am trying another, shorter method. session id's are too long. And
want to be able to find out the pid for a new method.
This still has possible problems, what if you are going through a
caching server, or you are sharing an IP with someone with the same
browser version.
Doing it the way with a pid is a guarenteed method, relying on an IP
or browser agent can have flaws. So really just want to know if it is
possible to get the pid, anyone know?
Too long for what?
--
Andy Hassall <an...@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
as simple as that