SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How i Further Use Cookie in Php

    i want the value cookie that i got from the following code further used in php script to visit next url because value of cookie used in url ....how i can save value of cookie and again use it in my php script

    suppose cookie is JSESSIONID GT1~A555400D38C7F737D383DEEBA8A30CE3.GT.1
    and my next url is
    http://www.url.com/q.action?id=A5554...BA8A30CE3.GT.1

    <?php
    $cookie=tempnam("/tmp","CURLCOOKIE");
    $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7";
    ;

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $login);
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
    curl_setopt($ch, CURLOPT_PROXY, $proxy);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_REFERER, $login);
    $html=curl_exec($ch);

    ?>

  2. #2
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    plz reply any expert

  3. #3
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Can you echo out the cookie value onto your screen?

  4. #4
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes cups ..i want to echo cookie on screen.. i am using temperory save of cookie plz provide declartion in which i save cookie in special path with my own name that i want


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •