tags:

views:

68

answers:

2

Hello,

I am accessing a url which needs authentication, so for authentication i am using cookie something like this

$out = "GET $path HTTP/1.0\r\nHost: $host\r\nCookie: user=$cookie\r\n\r\n";
$fp = fsockopen($host, 80, $errno, $errstr, 30) or htmlerror('Bandwidth limit exceeded, please try again later.');
fwrite($fp, $out);

so i wanted to know whether instead of cookie how can i use directly username and password in variable $out

Thank You

A: 

I had a quick view on HTTP GET REQUEST, you might try to insert something into the query part of the URI

$out = 'GET /?username=$user&password=$encryptedPW HTTP/1.1'

$out .= '/n' . 'Host: $host'

daemonfire300
A: 

it didnt work, just using it with cookie

Shishant