Advertisement
jiue123

Code load a page PHP and copy result into new file html

Aug 9th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. $iduser=$_SESSION['iduser'];
  2.  
  3. $id_tp=$_SESSION['id_tp'];
  4.  
  5. $user=$_SESSION['user'];
  6.  
  7. $ch = curl_init("http://localhost/php/FamilyCenter/view.php?id_tp=$id_tp&iduser=$iduser"); //take all code from page view.php (you creat page view.php as you want)
  8.  
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  10.  
  11. curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
  12.  
  13. $content = curl_exec($ch); // load page view.php and return result
  14.  
  15. $file = "$user/$user-$id_tp.html"; // path you want put new file
  16.  
  17. file_put_contents($file,$content); // copy result of $content and put it into new file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement