Forum Moderators: coopster

Message Too Old, No Replies

Liitle bit on sessions?

         

ktsirig

11:01 pm on Feb 27, 2006 (gmt 0)

10+ Year Member



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?

IamStang

2:17 am on Feb 28, 2006 (gmt 0)

10+ Year Member



<?
session_start();
header("Cache-control: private"); <<-- prob. wont need this part
$session_id = session_id();
?>

Then you can write $session_id to the file just like the rest of your data.

I'm fairly new to php myself, so maybe someone will tell you a different method or correct mine if wrong.

Regards,
IamStang