Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-09-2012, 05:00 AM   PM User | #1
TheCracker
New Coder

 
Join Date: Sep 2010
Posts: 65
Thanks: 4
Thanked 0 Times in 0 Posts
TheCracker is an unknown quantity at this point
How can i login to this page using cURL

Hello,

I'm trying to log in into this website using cURL but i'm getting HTTP/1.1 401 Unauthorized error, anyone faced such problem before??

http://p3.grab8.com/1/

thanks in advance
TheCracker is offline   Reply With Quote
Old 06-09-2012, 06:31 AM   PM User | #2
Microsuck
Regular Coder

 
Microsuck's Avatar
 
Join Date: Oct 2011
Location: 127.0.0.1
Posts: 123
Thanks: 44
Thanked 5 Times in 5 Posts
Microsuck is an unknown quantity at this point
We're not helping you cheat people out of money.
__________________
PHP Code:
<?php echo "Microsuck says hi!"?>
Microsuck is offline   Reply With Quote
Old 06-09-2012, 07:17 AM   PM User | #3
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,904
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
if you have a valid account there (in which case you aint cheating I assume) then you need curl to pass the username and password in the correct authentication type.. I dont use curl but I grabbed this of the net
PHP Code:
curl_setopt($chCURLOPT_HTTPAUTHCURLAUTH_BASIC);
curl_setopt(CURLOPT_USERPWD'[username]:[password]'
remember there are different types of AUTH e.g. basic and digest the above uses BASIC
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Old 06-09-2012, 05:34 PM   PM User | #4
TheCracker
New Coder

 
Join Date: Sep 2010
Posts: 65
Thanks: 4
Thanked 0 Times in 0 Posts
TheCracker is an unknown quantity at this point
I'm getting this error
Quote:
Warning: Wrong parameter count for curl_setopt()
you know how to fix this please?

PHP Code:
$ch curl_init();
curl_setopt($chCURLOPT_URL'http://p3.grab8.com/1/');
curl_setopt($chCURLOPT_RETURNTRANSFER0);
curl_setopt($chCURLOPT_HEADER1);

curl_setopt($chCURLOPT_HTTPAUTHCURLAUTH_BASIC);
curl_setopt(CURLOPT_USERPWD'user:pass');

curl_setopt($chCURLOPT_COOKIEJAR'rapid8.txt');
curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
$content curl_exec($ch);
curl_close($ch); 
TheCracker is offline   Reply With Quote
Old 06-09-2012, 11:45 PM   PM User | #5
Microsuck
Regular Coder

 
Microsuck's Avatar
 
Join Date: Oct 2011
Location: 127.0.0.1
Posts: 123
Thanks: 44
Thanked 5 Times in 5 Posts
Microsuck is an unknown quantity at this point
Quote:
Originally Posted by firepages View Post
if you have a valid account there (in which case you aint cheating I assume) then you need curl to pass the username and password in the correct authentication type.. I dont use curl but I grabbed this of the net
PHP Code:
curl_setopt($chCURLOPT_HTTPAUTHCURLAUTH_BASIC);
curl_setopt(CURLOPT_USERPWD'[username]:[password]'
remember there are different types of AUTH e.g. basic and digest the above uses BASIC
He doesn't. He stole the cookie. It's most likely in his rapid8.txt file.

His username also doesn't help his case.
__________________
PHP Code:
<?php echo "Microsuck says hi!"?>
Microsuck is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:33 PM.


Advertisement
Log in to turn off these ads.