daily pastebin goal
55%
SHARE
TWEET

graber.php

viprajput Jun 13th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     /* gets the data from a URL */
  3.     function get_data($url) {
  4.         $ch = curl_init();
  5.         $timeout = 5;
  6.         curl_setopt($ch, CURLOPT_URL, $url);
  7.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8.         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  9.         $data = curl_exec($ch);
  10.         curl_close($ch);
  11.         return $data;
  12.     }
  13.     if (!empty($_GET['grabURL'])){
  14.         echo get_data($_GET['grabURL']);
  15.     } else {
  16.         echo ('ERROR: grabURL parameter was not specified');
  17.     }
  18. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top