
This is a discussion on [Tutorial] Curl Login within the PHP forums, part of the Program Your Site category; ill be making a detailed regex tutorial...
| |||||||
| 111 Online | Register | Projects | Products | Members List | Calendar | Today's Posts | Search |
| |||
| Using Curl For Cj Hi Chad! i'd like to know if you can help me. I'm trying to login Commission Junction - A Global Leader in Affiliate Marketing, Online Advertising and Search Engine Marketing but it's so hard for me. I've tried with this url and this other one: https://members.cj.com/member/publisher/home.do that is the login page The 2 both url have different POST data i have to send, these POST's data are: Code: uname=REMOVED&pw=REMOVED&submit.x=19&submit.y=5 Code: uname=REMOVED&pw=REMOVED&nextpage=&go=Go Well, I've seen the first POST data i wrote change temporaly. Where you see the "19" and the "5" sometimes change. But the second POST data i wrote to you is the same always, you just need to write your id and pass. But anyway, i think the problem is for the COOKIE. When i intercept the data using ACHILLES i can see something like: Code: Cookie: cjlocale=en_US; __utma=xxxxxxxxx.xxxxxxxxxxx.xxxxxxxxxxxxx.xxxxxxxxxxxx.xxxxxxx.xxx; __utmz=xxxxxxxxx.xxxxxxxxxxx.xx.x.utmccn=(referral)|utmcsr=uk.cj.com|utmcct=/|utmcmd=referral; __utmb=xxxxxxxxx; CONTID=xxxxxxx; __utmc=xxxxxxxxxx This data changes temporaly too and sometimes include the JSESSIONID code I've tested a lot of combination of these cookies with all the CURL's functions and i can't login. Always the browser shows me the CJ login form again. As information, yesterday, i did the perfect code and it has worked fine for me, but that was just a newbie lucky because when i lost the session i wasn't be ables to login again. I've just changed the session and cookie values but it doesn't work. Now, as i said, i've tested a lot of combination, even passing the utm... values i wrote above by adding the CURLOPT_COOKIE function and it doesnt't work neither. Can u help me by saying to me what i have to write in your code to make it works perfectly for cj.com??? Thank you in advance. Reinaldo. P.D.: Sorry for my english, i know it isn't very good. |
| |||
| Quote:
The postfileds data i have to send in cj.com changes, but that's ok no problem and even the postfield data that i have to send to https://members.cj.com/member/login (that is basically the same login page) don't changes, this is better than the first one. The problem is another one, i think it is about COOKIES. When i try your code and all the codes i've been testing i can see the following line in the cookie file grabbed by COOKIEJAR function: members.cj.com FALSE / FALSE 0 JSESSIONID xxxxxxxxxxx I think this line means that CURL is logging in satisfactorily because the this cookie shows me a JSESSIONID value. When the code fails a FALSE value is shown instead the JSESSIONID value. Well, even showing the JSESSIONID value, CURL can't show me the page that i'm looking for inside the login form. I think this problem is for COOKIE values, when i intercept the data, i can see my browser is sending to CJ server utma, utmc, utmz, utmb values and even sometimes the JSESSIONID as a cookie value. Intercepting the data a lot of times, i can see this utmX values appear ramdomly. I mean, sometimes appears the utmb cookie and some other times not and it is the same for utmc, JSESSIONID and a cookie named cjuMember. This values appears ramdomly even in the same session. I'm trying to pass this __utmX values by using the CURLOPT_COOKIE function but it still not working. Do you know about the utmX cookie values and how can i pass this data to the session created by CURL??? Thank you in advance. Reinaldo. |
| |||
| hmm I am also just starting to loggin with cookies/curl. I had a little bit similar problem as you had above. I needed to log in monsterboard.nl ( ssl hiring ). I did the following thing and it worked. step 1: Quote:
This should do the job. |
| |||
| Hello, Chad, I have been playing with your script here, but still haven't gotten it to work. Some really useful tools thought, like the liveHTTPheaders thing. I originally started this little project just trying to use command line curl and putting it in a shell script: curl -d "login information password etc" http://url/index.php using live headers was a big help because it gave me the correct info to send as data (all kinds of stuff...). Finally I was logged in, but only to the redirect page ( please wait while we redirect you etc ). Couldn't seem to get past that. Interesting, when I use your script, with the same data, I don't get logged in, but get a page saying "your are unauthorized to do that". Maybe you have some input on all of this. One general question though: In the second part of the script, curl_grab_page(), am I correct in assuming that it is strictly relying on cookies to allow privileged access? I am wondering this, because I wondering if the site that I am trying to grab the page on is using some means other than cookies to "remember me" (after checking the "remember me" box on logging in). I was wondering this because I have tried capturing the cookies during a login and explicitly sending them when invoking curl, but that hasn't worked. Another general question is, in your script it appears curl is executed twice, once for the login, and once to grab the page. Does the server see this as all the same session, or does it get broken up in two sessions? Thanks for anything you can help me with here. Allasso Last edited by allasso; 01-14-2009 at 09:20 AM. |
| |||
| Video is too quite, code sucked, try this: Quote:
|
| |||
| Thanks, maybe when I have time I'll try it for academic's sake. I did what I want with this in the shell: curl -s -o /dev/null -b $cookiejar -c $cookiejar -d $login_data $site_url 2> /dev/null curl -s -b $cookiejar -c $cookiejar $site_url/page_i_want way simpler. You could use shell_exec() if you want to wrap it in PHP for some reason. |
| |||
| dfgsdfggsdcd brazilian bikini video big nipples boob pics boob job brazilian bikini video big nipples boob pics boob job http://wis.dm/users/71386-brazilianbik brazilian bikini video wis.dm - bignipples big nipples wis.dm - boobpics boob pics wis.dm - boobjob boob job |
![]() |
| |