moola Posted December 16, 2006 Share Posted December 16, 2006 Say there's a page where you have to enter my username and password... Is there a way to get php to automatically put those in and log in so i can get into my members area and get the info I want. Because if I don't log in my script won't work... Quote Link to comment Share on other sites More sharing options...
drifter Posted December 16, 2006 Share Posted December 16, 2006 not really sure what you want here?do you mean something like cookies and have the username and password pre populated?do you mean like doing a form post to by pass the login?I am guessing based on the question you are talking about some pre made script? what script? Quote Link to comment Share on other sites More sharing options...
moola Posted December 16, 2006 Author Share Posted December 16, 2006 Maybe I should reword my question with an exampleSay I want to log on to hotmail to check my email. I want my php script to log me in and gather the information from the inbox using fget($url). If i use fget without logging in I wont be able to get my mail or access things a member cannot thats why i want to see if i can log in through the script itself without me having to do it manually. Quote Link to comment Share on other sites More sharing options...
Hypnos Posted December 16, 2006 Share Posted December 16, 2006 If you want to write a script like you said (checking your hotmail email), then you have to have it login, get the cookie, and send the cookie back when it requests the page for your inbox. Quote Link to comment Share on other sites More sharing options...
trq Posted December 16, 2006 Share Posted December 16, 2006 Take a look at the [url=http://php.net/curl]curl[/url] extension. Quote Link to comment Share on other sites More sharing options...
drifter Posted December 16, 2006 Share Posted December 16, 2006 there is a class on phpclasses.org that I found that uses the curl extensions. - It has cookie collection and such built in.I did a search there last week for "post request" and found it. Quote Link to comment Share on other sites More sharing options...
moola Posted December 17, 2006 Author Share Posted December 17, 2006 [quote author=Hypnos link=topic=118891.msg486301#msg486301 date=1166304469]If you want to write a script like you said (checking your hotmail email), then you have to have it login, get the cookie, and send the cookie back when it requests the page for your inbox. [/quote]How do you get it to login??Thanks I'll check the curl extension. Quote Link to comment Share on other sites More sharing options...
NHStars Posted December 17, 2006 Share Posted December 17, 2006 You can also use a socket connection and send raw http requests. I used to do this a lot in Visual Basic and it works just the same with php. Quote Link to comment Share on other sites More sharing options...
moola Posted December 17, 2006 Author Share Posted December 17, 2006 Ok this isn't helping too much because I'm a newbie at php. I'm really not sure how to do it 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.