Guest User

Untitled

a guest
Jun 17th, 2016
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $host = "localhost";
  4. $username = "user";
  5. $password = "pass";
  6. $dbname = "dbname";
  7.  
  8. mysql_connect($host,$username,$password) or die(mysql_error());
  9. mysql_select_db($dbname) or die(mysql_error());
  10. mysql_query("SET NAMES utf8");
  11.  
  12. $graph = file_get_contents("https://holanu.com/json/log/post?id=33333"); // this is correct
  13. $decode = json_decode($graph);
  14. foreach ($decode->data as $account) {
  15. mysql_query(UPDATE car
  16. SET acc='.mysql_real_escape_string($account->acc).'
  17. WHERE user_id='mysql_real_escape_string($account->user_id)'
  18. );
  19. }
  20.  
  21. // impt
  22. function get_html($url) {
  23. $ch = curl_init();
  24. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  25. curl_setopt($ch, CURLOPT_URL, $url);
  26. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  27. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  28. curl_setopt($ch, CURLOPT_FAILONERROR, 0);
  29. $data = curl_exec($ch);
  30. curl_close($ch);
  31. return $data;
  32. }
  33. ?>
Add Comment
Please, Sign In to add comment