johnwayne77 Posted February 20, 2008 Share Posted February 20, 2008 I was wondering how can i make a script to login to a site, keep its status as logged and for example surf its account (2, 3 pages) without getting logged out? Quote Link to comment Share on other sites More sharing options...
Chris92 Posted February 20, 2008 Share Posted February 20, 2008 With sessions or cookies. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 20, 2008 Share Posted February 20, 2008 Quick google search came up with this tutorial: http://www.phpeasystep.com/workshopview.php?id=6 Quote Link to comment Share on other sites More sharing options...
revraz Posted February 20, 2008 Share Posted February 20, 2008 Sounds like he wants a bot that does this on another site, not his own. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 20, 2008 Share Posted February 20, 2008 Ah, if you want a PHP script for that it gets tricky. Cus cURL and similar modules make a new connection each page call. I use this, which is way over the top for what you need to do, but it's the only thing I've found that does it. http://simpletest.sourceforge.net/ Quote Link to comment Share on other sites More sharing options...
dave420 Posted February 20, 2008 Share Posted February 20, 2008 Curl is perfect for this. It can keep its cookies across multiple requests, so it will stay logged in. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 20, 2008 Share Posted February 20, 2008 Wow, just read up on php.net/curl and see that stuff was added in PHP 5.1. Good to know! Quote Link to comment Share on other sites More sharing options...
johnwayne77 Posted February 20, 2008 Author Share Posted February 20, 2008 YEAH, SO I WANT TO LOGIN TO A SITE (WWW.EXAMPLE.COM) AND BROWSE PAGE1.HTM, PAGE2.HTM, PAGE3.HTM, AVAILABLE ONLY IF I AM LOGGED IN SO U R SAYING CURL IS NOT DOING THE JOB? I WAS THINKING OF USING THAT... ANY OTHER IDEAS? Quote Link to comment Share on other sites More sharing options...
Chris92 Posted February 20, 2008 Share Posted February 20, 2008 I would just use cookies. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 20, 2008 Share Posted February 20, 2008 YEAH, SO I WANT TO LOGIN TO A SITE (WWW.EXAMPLE.COM) AND BROWSE PAGE1.HTM, PAGE2.HTM, PAGE3.HTM, AVAILABLE ONLY IF I AM LOGGED IN SO U R SAYING CURL IS NOT DOING THE JOB? I WAS THINKING OF USING THAT... ANY OTHER IDEAS? It looks like cURL can handle is as of PHP 5.1, but I haven't worked with it before. Looking around on google, here is a script for interacting with Amazon the way you describe: http://www.weberdev.com/get_example-4555.html 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.