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 Link to comment https://forums.phpfreaks.com/topic/216170-php-script-to-grab-webpage-contents/ 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. Link to comment https://forums.phpfreaks.com/topic/216170-php-script-to-grab-webpage-contents/#findComment-1123461 Share on other sites More sharing options...
Psycho Posted October 18, 2010 Share Posted October 18, 2010 Look into cURL. Link to comment https://forums.phpfreaks.com/topic/216170-php-script-to-grab-webpage-contents/#findComment-1123463 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 Link to comment https://forums.phpfreaks.com/topic/216170-php-script-to-grab-webpage-contents/#findComment-1123553 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/ Link to comment https://forums.phpfreaks.com/topic/216170-php-script-to-grab-webpage-contents/#findComment-1123594 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.