View Single Post
  #3 (permalink)  
Old July 21st, 2004, 07:24 AM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Ok.. here's a slightly more detailed answer...

Once your request variables are passed to PHP.. let's say via the POST method. Here is a very simple demonstration of what I was talking about.

<?php
    // This php script is the target of your form.

    // Begin the session
    session_start();

    // Transfer the POST variables to the SESSION variable, where they are stored in a session file.
    $_SESSION = $_POST;

    // Redirect to the Perl script, pass the session id via the GET method.
    location('header: perl_file.cgi?sid='.session_id());
?>

The location of the session data file varies depending on your OS. On Windows its commonly located at C:\PHP\sessiondata, on Linux its located at /tmp. You have to make sure you have the proper read permissions set to access the data.

The session file is named:
sess_232c53fe64de1a5e30df280db6095006

Where that long string of random numbers and letters is the session id.

Then the inners of the session data file looks like this:
user_id|s:2:"58";user_name|s:5:"richy";email|s:22: "me@mydomain.net";password|s:8:"mypassword";contro l|s:5:"index";

Each portion of this relates to a SESSION variable.

I dunno the required Perl.. but it shouldn't be too complicated to parse.




Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
Reply With Quote