reading webpage with file_gets_content after loggin in.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    reading webpage with file_gets_content after loggin in.

    I am using file_get_conten ts to read the content of a page.But unfortunately, the information I actually need to filter out is only shown if I am logged in.

    Any solution for how I can read the page after I do the login?

    Thanks
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    pass the login and password along with the url.

    Code:
    http://login:password@domain.tld:port/

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      Originally posted by Dormilich
      pass the login and password along with the url.

      Code:
      http://login:password@domain.tld:port/
      Didn't work that way. If I try using this in the browser, even then it doesn't work. It says something like "this site does not need authentication. ... "

      So that means this thing works with htaccess authentication, not the cookie/session authentication.

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Ok, got the solution.
        file_get_conten ts is not the right choice but curl is!

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          Originally posted by hsriat
          So that means this thing works with htaccess authentication, not the cookie/session authentication.
          I think it’s the other way round.

          Comment

          • hsriat
            Recognized Expert Top Contributor
            • Jan 2008
            • 1653

            #6
            Originally posted by Dormilich
            I think it’s the other way round.
            If you type the link (including login:password) in your browser, you can only visit the page with htaccess, not cookies/session authentication.

            Comment

            Working...