manjunathtumkur Posted October 18, 2010 Share Posted October 18, 2010 Hi all, Am new to PHP programming and i need some help i am writing a script to grab contents of a web page specified. It is working perfectly for normal websites but for sites needing authentication its failing. Like for example i want to get all the info from "www.google.com/history" ;even though i am logged in its saying please login again n again. do i need 2 include cookies in the script. Please help me n also please provide sample scripts if possible Quote Link to comment Share on other sites More sharing options...
tyler_durden Posted October 18, 2010 Share Posted October 18, 2010 I'm sure someone can be more help than myself, but what I see happening is that you are logged in through your browser, but php runs on your host/server which is not logged in. Maybe you can pass the username/password as variables to the page/login area, not sure. I'm guessing you may need to use some type of session which is beyond my knowledge. Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 18, 2010 Share Posted October 18, 2010 Look into cURL. Quote Link to comment Share on other sites More sharing options...
manjunathtumkur Posted October 18, 2010 Author Share Posted October 18, 2010 Please can anyone provide code snippet which i can use Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 18, 2010 Share Posted October 18, 2010 Please can anyone provide code snippet which i can use I already provided an answer to help you solve this yourself. There are plenty of tutorials out there on how to implement cURL to do what you need. I see no reason to provide a piece of code that may not meet your specific needs requiring many back and forth posts to get it exactly right. If you read (and follow) a tutorial on the subject you will understand exactly what the process does and how to implement it for your specific needs. http://coderscult.com/php/php-curl/2008/05/20/php-curl-tutorial-and-example/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.