mramine364

screen_capture_index_phantomjs

Jan 26th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2.  
  3. $path = "";
  4.  
  5. if( isset($_GET['url']) ){
  6.  
  7.     $url = $_GET['url'];
  8.  
  9.     $timestamp = round(microtime(true) * 1000);
  10.     $fn = $timestamp;
  11.     $path = $fn.".png";
  12.  
  13.     $output  = exec('phantomjs capture.js '.$url.' '.$path);
  14. }
  15.  
  16. ?>
  17. <form>
  18.     <input type="url" name="url" placeholder="URL to capture">
  19.     <input type="submit">
  20. </form>
  21.  
  22. <br>
  23. <img src="<?= $path ?>" alt="">
Advertisement
Add Comment
Please, Sign In to add comment