dbz Posted November 23, 2009 Share Posted November 23, 2009 Hello! I'm new to php and unfortunately have a problem already. I'm trying to log into a website through a form so I can access the material on the webpage. I was told to use "curl" by a friend, and I (kinda) hijacked a script from a site showing how to do it. script: http://pastebin.com/f73513d65 Sadly, the webhosting I use has curl disabled, so I was wondering if anyone could help me discover a different way of doing it. To be honest- I don't understand how curl works, so it was a bad idea to try it to begin with it anyways, but I figured I would try to get it to work and then try to understand it. Thanks for reading and for any help you all provide! Quote Link to comment Share on other sites More sharing options...
dbz Posted November 24, 2009 Author Share Posted November 24, 2009 If I'm correct curl is some kind of library and not a standard function, so curl has to do it some way.... Does anyone know another way of doing this? Quote Link to comment Share on other sites More sharing options...
Gayner Posted November 24, 2009 Share Posted November 24, 2009 If I'm correct curl is some kind of library and not a standard function, so curl has to do it some way.... Does anyone know another way of doing this? u got curl installed? lol Quote Link to comment Share on other sites More sharing options...
dbz Posted November 24, 2009 Author Share Posted November 24, 2009 Well, the hosting wont allow curl to be installed, which is why I am looking for a different method. Quote Link to comment Share on other sites More sharing options...
Gayner Posted November 24, 2009 Share Posted November 24, 2009 Well, the hosting wont allow curl to be installed, which is why I am looking for a different method. http://php-login-script.com/ that works and is free and has plenty of nice features for u to get started, what i use man it's wonderful Quote Link to comment Share on other sites More sharing options...
dbz Posted November 24, 2009 Author Share Posted November 24, 2009 Oooooh. I think I will include that in my project actually (at a later stage when designing a UI)! However, that's no quite what I need. I will be more clear. My school has a webpage where one can get all the homework a class assigns daily; however, the website is organized *horribly*, and it takes the user about half an hour to grab all of the homework. (haha I know.) So I want to make a php script to log into my schools website, and grab the homework from all of the different pages. And I'm a little stuck at the logging into my school's webpage part. =/ Quote Link to comment Share on other sites More sharing options...
Deoctor Posted November 24, 2009 Share Posted November 24, 2009 hai open your php.ini file in the server and check for this option extension=php_curl.dll if it is commented then uncomment it off and i think the curl will work out for you.. to use the curl for an website use the below code to get it out <?php // create a new cURL resource $ch = curl_init(); $demo='http://chaitu09986025424.blog.co.in/feed/rss/'; // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "$demo"); curl_setopt($ch, curlopt_content_type,"text/xml"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLINFO_HEADER_OUT, true); // grab URL and pass it to the browser $data=curl_exec($ch); $info=curl_getinfo($ch); //var_dump(curl_getinfo($ch,CURLINFO_HEADER_OUT)); echo $info['http_code']; print_r("$data"); ?> this should give you the result of the webpage Quote Link to comment Share on other sites More sharing options...
dbz Posted November 25, 2009 Author Share Posted November 25, 2009 Thanks a ton that seems very useful and exactly what I wanted(!); however, I am wondering...What do I do with my username/password. Where do I put those two data? 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.