Cookies/Sessions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Cookies/Sessions

Post by William »

Dear All,

I was wondering if it was possible to use PHP and login to another site and it installs cookies/sessions on the php script and lets it stay loggedin to get data. Basicly a way the PHP can parse a page that you have to be loggedin to see it.
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

Of coarse it is possible, however, doing it from scratch is very tedious, I'm not really sure, but I think Curl (cUrl?) is capable of keeping track of sessions, cookies etc for such things.

If Curl is not what you are looking for (or possible solution) then I am most positively certain that such a project already exists on the internet which can accomplish this.
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Post by William »

Awsome thank you very much, I play online MMORPG's and I wanted to try to make a PHP file that actaully had maby a iframe of some sorte with the site on it. and at the top of my iframe it had tons of features
to do things on the site, any exploits .ect it could do. Basicly like a cheat. Thanks alot :D
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

hehe be careful though, I bet cheating goes under same "law" as exploiting a website/webserver. (if you intend to keep it public)
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Post by William »

Yeah it does :P, But it will be fun anyways :D, I have been banned from this 1 game so many times :P
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

The Hidden Viper wrote:Awsome thank you very much, I play online MMORPG's and I wanted to try to make a PHP file that actaully had maby a iframe of some sorte with the site on it. and at the top of my iframe it had tons of features
to do things on the site, any exploits .ect it could do. Basicly like a cheat. Thanks alot :D
exploits? like what?

you could find yourself in serious trouble, 99.999% of EULA's have this covered, and believe me, they can take you 'to the full extent of the law'
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Post by William »

Code: Select all

<?php

########################
# ********** Hack v1.0
########################
$domain = "**********.***";
$username = "iamcool";
$password = "bVVStkMnS4";
$params = "uid=" . $username . "&pword=" . $password;

$socket = fsockopen($domain,80);
fputs($socket,"POST login_scripts/login.php HTTP/1.1\r\n");
fputs($socket,"Referer: BH\r\n");
fputs($socket,"Host: Host\r\n");
fputs($socket,"Accept: text/html\r\n");
fputs($socket,"User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\r\n");
fputs($socket,"Content-type: application/x-www-form-urlencoded\r\n");
fputs($socket,"Content-length: " . $params . "\r\n");
fputs($socket,"Connection: Close\r\n");
fputs($socket,"\r\n");
fputs($socket,$variables."\r\n");
 
 
 
while(!feof($socket)){
    $a = fgets($socket,256);
    if ($a){
        echo $a."<br>";
    }
}

?>
Is the script that I have currently instead of curl. It seems to get a bad request. Any ideas?
Post Reply