Simulate a browser?

Discussion in 'PHP' started by frawsty, Apr 24, 2007.

  1. #1
    I am parsing the file contents of a remote web. My target data is a session id which is generated on the remote server. It's an encoded string that is 32 chars long. The problem is that this session doesn't get generated when I get the file contents via php, only when I view the page source from my browser.

    Is their a way to have the remote server assign a session variable to my php app? Did this make sense? I'm trying to automate something but I'm getting stuck because the target doesn't give out the session var unless it's to a browser request.
     
    frawsty, Apr 24, 2007 IP
  2. dzysyak

    dzysyak Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Actually everything can be emulated from php. For example you can write your own browser in PHP following the HTTP 1.0/1.1 specs. Or you can use curl, wget or some text browser. It depends on what youare trying to do and what is alowed by your hosting. As for me I wold try to use curl first.
     
    dzysyak, Apr 24, 2007 IP
  3. frawsty

    frawsty Peon

    Messages:
    134
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That worked. After a few hours I was able to design the code to do exactly what I wanted! Thanks dzysyak. Please PM me a website of yours or some ad I can click for you. This reaaaally reaaaally helped! Thanks!
     
    frawsty, Apr 24, 2007 IP
  4. reza56

    reza56 Active Member

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    CURL is best thing for this.
     
    reza56, Apr 25, 2007 IP
  5. frawsty

    frawsty Peon

    Messages:
    134
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    He said that yesterday. Grats on the post whoring.
     
    frawsty, Apr 25, 2007 IP