English Get content from url

3 replies
Goto Page
To the start Previous 1 Next To the start
05.09.13 09:35:15 am
Up
SnipeR95
User
Offline Off
Hi everyone. I need get content from url but i can't.

in "unrealsoftware.de/dev.php" a link to check user if logged usgn. if logged, return 1 else return 0.

I am making a 'website' and i need control User was logged to usgn. How i get the '1' or '0' value from this link?

Thanks.
@file cs2d SnipeR's Admin Script v1.1.5 (8) <-- MOUSE ADMIN CONTROL ! <-|-> @file cs2d Weapon Detector By SnipeR95[TR] v1.2 (17)<-- WEAPON DETECTOR !
05.09.13 11:23:44 am
Up
ohaz
User
Offline Off
PHP:
Code:
1
2
3
4
5
6
$nick = "ohaz";
$randomKey = CREATE_RANDOM_KEY($nick);
$valid = file_get_contents("http://www.unrealsoftware.de/connect.php?keyof=".urlencode($nick)."&iskey=".urlencode($random_key));
if ($valid){
...
}

The url the user would've to click on would be:
Code:
1
<a href="http://www.unrealsoftware.de/connect.php?setkey=<? echo $randomKey; ?>" target="_new">http://www.unrealsoftware.de/connect.php?setkey=<? echo $randomKey; ?></a>


You'd need to write your own CREATE_RANDOM_KEY($string) function of course
https://ohaz.engineer - Software Engineering
05.09.13 11:31:11 am
Up
SD
User
Offline Off
Don't use file_get_contents, it's slow. Use cURL instead.
Code:
1
2
3
4
5
6
7
8
9
$url = 'http://www.unrealsoftware.de/connect.php?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
05.09.13 01:55:38 pm
Up
SnipeR95
User
Offline Off
okay thanks guys.
@file cs2d SnipeR's Admin Script v1.1.5 (8) <-- MOUSE ADMIN CONTROL ! <-|-> @file cs2d Weapon Detector By SnipeR95[TR] v1.2 (17)<-- WEAPON DETECTOR !
To the start Previous 1 Next To the start