Ezilon.com - Target Your Audience, be Seen in Your Region

PHP sessions... Where to start from???

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 53 posts

Joined: Oct 2005

Hi everybody!
I have a problem and I was told to check out the sessions part in PHP.
What I want to deal with is the following :
I have a PHP page with a form, where the user writes some data. These data are then written into a file which is then used in a system command as input for an external program (NOTE: The data MUST be written into a file, it cannot be done elsewhise, because the external program takes a file as input).
The thing is that I must somehow create a file everytime a user enters data into the form, so I must learn something on sessions I think.
My question is, since I don't have a login system or something like that, but just want to create a different file each time (with the session_id being part of it, so that the file is unique), which session commands do I need?

Greg K's picture
Moderator

He has: 1,667 posts

Joined: Nov 2003

What does this program do? Will it create output that is also in a file named the same as the session so the user can get the results, or do you simply only need a unique filename?

If you only need a unique filename, use a timestamp YYYYMMDDHHMMSS (and if you anticipate more than one request a second, let it use fractions of a second)

This is how I created invoice numbers, broken down to 1/1000 of a second and rearanged so it is not obvious.

-Greg

[This space intentionally left blank]

Cool Geek Supplies: www.ThinkGeek.com