-
Notifications
You must be signed in to change notification settings - Fork 18
/
sign.php
53 lines (53 loc) · 1.77 KB
/
sign.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
$username = "USERNAME";
$password = "PASSWORD";
set_time_limit(600);
$suburl = "http://www.hostloc.com/member.php?mod=logging&action=login";
$loginInfo = array(
"username" => $username,
"password" => $password,
"fastloginfield" => "username",
"quickforward" => "yes",
"handlekey" => "ls",
"loginsubmit" => true
);
$login = postData($suburl,$loginInfo);
$spaceUrl = "http://www.hostloc.com/space-uid-*.html";
for($i=233;$i<246;$i++)
{
getData(str_replace("*",$i,$spaceUrl));
}
function postData($url, $post_data)
{
$ch = curl_init ();
curl_setopt($ch , CURLOPT_POST , 1);
curl_setopt($ch , CURLOPT_HEADER , 0);
curl_setopt($ch , CURLOPT_URL , $url);
curl_setopt($ch , CURLOPT_COOKIEJAR , 'hostloc.cookie');
curl_setopt($ch , CURLOPT_POSTFIELDS , $post_data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,600);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.hostloc.com/');
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
function getData($url)
{
$ch = curl_init ();
curl_setopt($ch, CURLOPT_HEADER , 0);
curl_setopt($ch, CURLOPT_URL , $url);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'hostloc.cookie');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,600);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
echo "You have got 20 points at:\n";
echo $showtime=date("Y-m-d H:i:s\n");
?>