- Joined
- Jan 14, 2005
- Messages
- 395
- Reaction score
- 2
hello,
i was trying to make a login script for my own game.
i want that i login and goto domain.be/?p=ranking
when it logged but it must remember the username aswell how i can do this?
i got his so far
Thanks
passie
i was trying to make a login script for my own game.
i want that i login and goto domain.be/?p=ranking
when it logged but it must remember the username aswell how i can do this?
i got his so far
PHP:
<?php
//extract data from the post
extract($_POST);
//set POST variables
$url = 'http://nhc.hostei.com/?p=login';
$fields = array(
'username'=>urlencode("testaccount"),
'password'=>urlencode("test123") ,
'method' => 'POST'
);
//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
//execute post
$result = curl_exec($ch);
echo $result;
//close connection
curl_close($ch);
?>
Thanks
passie