jmwalloh Posted June 1, 2014 Share Posted June 1, 2014 Hi, i need to code a script that login to a website after supplying a username and password, then downloads a file after every 24 hrs. Any suggestions ?? Link to comment Share on other sites More sharing options...
Ansego Posted June 1, 2014 Share Posted June 1, 2014 Hi, You could use cookies to keep the user logged in, you can see more descriptive information about cookies @ http://www.php.net/manual/en/function.setcookie.php Not sure what you mean by download a file every 24hrs? Are you downloading to client or to the server? What does this file contain and file type? If downloading to the user, the user needs to be connected to the webpage before anything will download. Link to comment Share on other sites More sharing options...
jmwalloh Posted June 1, 2014 Author Share Posted June 1, 2014 Hi, You could use cookies to keep the user logged in, you can see more descriptive information about cookies @ http://www.php.net/manual/en/function.setcookie.php Not sure what you mean by download a file every 24hrs? Are you downloading to client or to the server? What does this file contain and file type? If downloading to the user, the user needs to be connected to the webpage before anything will download. The URL for the site is https://www.23andme.com/you/download/ I need to download this zipped file to my machine on a daily basis at a specific time say 9PM. The zipped file contains a text file. Link to comment Share on other sites More sharing options...
Jacques1 Posted June 1, 2014 Share Posted June 1, 2014 You need a cron script which runs at the desired times. You also need an HTTP library like cURL to make the requests. Your script first sends your credentials to the login page and gets back a session cookie. Then you request the file while including the session cookie. The manual will tell you how to use cURL. Note that using automated scripts may violate the terms of use. Link to comment Share on other sites More sharing options...
jmwalloh Posted June 6, 2014 Author Share Posted June 6, 2014 Hi, i need to create a PHP script that logs in to a certain website [23andme.com]and downloads a given file. I have seen some article on this like http://www.binarytid...-with-curl-php/ but my problem is to deal with one having an action like =====> action ="/user/signin/" Any suggestion will be highly appreciated. Thanks Link to comment Share on other sites More sharing options...
Jacques1 Posted June 7, 2014 Share Posted June 7, 2014 (edited) Any suggestion will be highly appreciated. Did you see that three people have already replied? So what exactly do you not understand about our suggestions? How the URL looks like is irrelevant for the general logic. cURL doesn't care if the path is “/my_login_script.php” or “/my/login/script”. Edited June 7, 2014 by Jacques1 Link to comment Share on other sites More sharing options...
mac_gyver Posted June 8, 2014 Share Posted June 8, 2014 topic abandoned by the op - locked... Link to comment Share on other sites More sharing options...
Recommended Posts