-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcurl.php
More file actions
executable file
·52 lines (44 loc) · 1.37 KB
/
curl.php
File metadata and controls
executable file
·52 lines (44 loc) · 1.37 KB
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
<?php
$ch = curl_init();
$fields = array( 'username'=>'administrator', 'userpwd'=>'123456');
$postvars = '';
foreach($fields as $key=>$value) {
$postvars .= $key . "=" . $value . "&";
}
$url = "http://11.1.6.13/csl/check";
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST, 1); //0 for a get request
curl_setopt($ch,CURLOPT_POSTFIELDS,$postvars);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,3);
curl_setopt($ch,CURLOPT_TIMEOUT, 20);
$response = curl_exec($ch);
$response="";
#/*
$a=1;
#for($a=1; $a<1000; $a++)
{
$fields = array( 'sdate'=>date("Y-m-d"), 'edate'=>date("Y-m-d"), 'period'=>'1', 'uid'=>$a);
$fields = array( 'sdate'=>date("Y-m-d"), 'edate'=>date("Y-m-d"), 'period'=>'1');
$postvars = '';
foreach($fields as $key=>$value)
{
$postvars .= $key . "=" . $value . "&";
}
for($a=1; $a<10; $a++)
{
$postvars .= "uid=" . $a . "&";
}
$url = "http://11.1.6.13/form/Download ";
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST, 1); //0 for a get request
curl_setopt($ch,CURLOPT_POSTFIELDS,$postvars);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,3);
curl_setopt($ch,CURLOPT_TIMEOUT, 20);
$response = curl_exec($ch);
echo "$response\n\r";
}
#*/
curl_close ($ch);
?>