Using PHP to get the source code of a URL I must be logged in to reach
        Posted  
        
            by Maxwell
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Maxwell
        
        
        
        Published on 2010-05-27T15:17:42Z
        Indexed on 
            2010/05/27
            15:21 UTC
        
        
        Read the original article
        Hit count: 318
        
I am trying to write a PHP script that will get the source code of a page in my Amazon account. However, to reach that page, I must be logged in. From what I understand, I should be able to accomplish this by posting the correct request headers, and then capturing the HTML response. Is that correct? If so, I'd really appreciate it if someone could explain to me how exactly I would do this. If it's not right, I'd love to hear the correct way of doing it!
I've used Firebug to get the request and response headers I need. It's just a matter of what to do with them now. I read elsewhere on this site that you can't send a request with the PHP post method, and that perhaps using cURL is the way to go. I really know nothing about cURL, so the more info the better.
Also, feel free to point me to some useful tutorials on this topic.
Thanks!
Max
© Stack Overflow or respective owner