#1
  1. No Profile Picture
    webganzter
    Guest
    Devshed Newbie (0 - 499 posts)
    I want to use PHP to read the value in the cookie that was set by this CGI script :
    cookie.cgi
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    #!/usr/bin/perl

    print "Content-Type: text/htmln";
    print "Set-Cookie: test123=hello; path=/~ritti/;nn";
    [/quote]

    I tried by using
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <?php
    echo $HTTP_COOKIE_VARS["test123"];
    ?>[/quote]
    OR
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <?php
    echo $HTTP_COOKIE;
    ?>[/quote]
    Both not work,.. Could anybody help me???

    Thanks you so much
  2. #2
  3. No Profile Picture
    donarb
    Guest
    Devshed Newbie (0 - 499 posts)
    Try $test123, PHP creates all variables for you that are returned by the client, including cookies.
  4. #3
  5. No Profile Picture
    webganzter
    Guest
    Devshed Newbie (0 - 499 posts)
    Hi,.
    That $test123 didn't work out too.
    ,,, The cookie was build by cgi which was created by perl ,.. and i want to use PHP to read it...

    how could i do that???
  6. #4
  7. No Profile Picture
    matt_hz
    Guest
    Devshed Newbie (0 - 499 posts)
    Hi!

    I tried you're code but I changed the variable name from test123 to cookie and it worked.

    In my PhP code I used what donarb said.
    <? echo $cookie; ?>

Similar Threads

  1. Doing File uploads using a PHP as CGI
    By phoebebright in forum PHP Development
    Replies: 4
    Last Post: February 16th, 2004, 04:49 AM
  2. Replies: 0
    Last Post: February 12th, 2004, 11:56 AM
  3. Replies: 0
    Last Post: February 2nd, 2004, 05:44 PM
  4. Problem in running php in tomcat
    By hssuma in forum PHP Development
    Replies: 0
    Last Post: January 29th, 2004, 05:13 AM

IMN logo majestic logo threadwatch logo seochat tools logo