#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Pennsylvania, USA
    Posts
    37
    Rep Power
    15
    In a previous SSI perl script that I wrote, the last statements were:

    print "content-type: text/htmlnn";
    exit 0;

    Instead of writing these statements, is it possible to do:
    print header (-cookie=>$ID); ?

    I was originally auto-submitting a form within the cgi script (using imbedded javascript) that would call a php3 script that created the cookie, checked for the cookie, then redirected to a URL. While that worked fine, now they are telling me that they want this new URL to be displayed in a new opened window with certain features like toolbars=no, height=xx, width=xxx, etc. I can't do that in the php page with a redirect.

    So, now I'm thinking I could execute the cgi-script (which updates the database) via an SSI call. When it returns to the html from where it's called, the client can open up a new window with the appropriate URL. BUT, I need a cookie set before that happens, or other things on the site won't work properly. I can't send the ID via query-strings because it passes through html pages prior to being needed.

    Any thoughts? Sorry if I didn't explain this very well.

    Sharon
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    pls explain it very clearly.....

    ------------------
    SR -
    shiju.dreamcenter.net

    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Pennsylvania, USA
    Posts
    37
    Rep Power
    15
    I'll try - it's not easy to explain. This will be long.....

    Here's my current process:
    A user on an internal system indicates that they want to view the tutorial, which is on a server. The internal system is setup to pass a userid and password to a 'tracking system' - my scripts. My job in the tracking system is to set them up on the database, set a cookie (so we know later that they're visiting the tutorial as they pass through multiple static pages), and then transfer them to the tutorial at a specific URL. This is working fine, but they want the tutorial, when they get there, to appear in a new window, opened to a specific size and without toolbars.

    My cgi-script (the first thing receiving control from this internal system) updates the database and then creates a hidden form, which is autosubmitted to a PHP script. This PHP script then sets a cookie, calls itself back to make sure it's set, and if it is - it redirects to the tutorial. It is only being done this way so I can check to make sure they have cookies enabled before proceeding.

    When the php script redirects after it's finished with the cookie check - it can't open up the tutorial in a new window (that can't be done with a redirect).

    SO - I'm considering changing the process so that my cgi-script will be executed as an SSI call from the internal system and IT will set the cookie rather than submitting the form to the php script.

    I know that the last statement of an SSI has to be the
    print "content-type: text/htmlnn";
    exit 0;
    in order to return to the .shtml that has called it. What I'm asking is: instead of printing the content-type statement, can I create a cookie as the last thing that happens before returning to the .shtml? There won't be a check in place to make sure cookies are enabled, but this is the best option I can come up with.

    It's difficult to test these scenarios because the internal system is live - so I'm trying to determine the viability of this solution before I ask them to make changes to that internal system.

    Sharon

IMN logo majestic logo threadwatch logo seochat tools logo