Get content from url
3 replies



05.09.13 09:35:15 am
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.
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.
@
SnipeR's Admin Script v1.1.5 (8) <-- MOUSE ADMIN CONTROL ! <-|-> @
Weapon Detector By SnipeR95[TR] v1.2 (17)<-- WEAPON DETECTOR !




PHP:
The url the user would've to click on would be:
You'd need to write your own CREATE_RANDOM_KEY($string) function of course
Code:
1
2
3
4
5
6
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){
...
}
$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
Don't use file_get_contents, it's slow. Use cURL instead.
Code:
1
2
3
4
5
6
7
8
9
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);
$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);
okay thanks guys.

@
SnipeR's Admin Script v1.1.5 (8) <-- MOUSE ADMIN CONTROL ! <-|-> @
Weapon Detector By SnipeR95[TR] v1.2 (17)<-- WEAPON DETECTOR !







