Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- function Post($url, $post){
- $fields_string = '';
- foreach($post as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
- rtrim($fields_string, '&');
- $curl_handle=curl_init();
- curl_setopt($curl_handle, CURLOPT_URL,$url);
- curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
- curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl_handle, CURLOPT_POST, count($post));
- curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $fields_string);
- curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Office');
- $query = curl_exec($curl_handle);
- curl_close($curl_handle);
- return $query;
- }
- $Logged = Post("http://(ip of main server)/php/login.php", array('Username' => 'FileUpload','Password' => 'Xc1Kl0X9lkI^sqweszxcaSjkhdSJKhdkajshDskaKsjdHDh'));
- if ($Logged == 'Log'){
- echo "Sending data... <br>";
- $UPLD = Post("http://(ip of main server)/Transfer.php", array('timestamp' => time()));
- echo $UPLD;
- }else{
- echo "CURL ERROR";
- }
- ?>
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Test</title>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement