Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <?php
  2. //Kontrola existence databáze
  3. if ($db = new SQLiteDatabase('benny.db')) {
  4. $q = @$db->query('SELECT id FROM credit');
  5. if ($q === false) {
  6. $db->queryExec('CREATE TABLE credit (id int AUTO_INCREMENT,time DATETIME,surf FLOAT(8,4),banner FLOAT(8,4),PRIMARY KEY (id));');
  7. }
  8. }
  9.  
  10.  
  11. $cokie="UserAutoLogin=Vorisajad3c0a4519fa129f6e7dad5d62839501; PHPSESSID=8c9ij9lmrdeve4talqkju2oe32";
  12. $ch = curl_init();
  13. curl_setopt($ch, CURLOPT_URL, 'http://www.benny-surf.de/login.php?page=account');
  14. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  15. curl_setopt($ch, CURLOPT_HEADER, 1);
  16. curl_setopt($ch, CURLOPT_COOKIE, $cokie);
  17. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  18. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  19. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
  20. $output = curl_exec($ch);
  21.  
  22. $pos = strpos($output,"Eigener Verdienst",0);
  23. $pos2 = strpos($output,"rechts\">",$pos);
  24. $pos3 = strpos($output,"</span>",$pos2);
  25. $surf = substr($output,$pos2+8,$pos3-$pos2-8);
  26. $cr = floatval(str_replace(",",".",str_replace(".","",$surf)));
  27.  
  28. $pos = strpos($output,"Sonstige Einnahmen",$pos);
  29. $pos2 = strpos($output,"rechts\">",$pos);
  30. $pos3 = strpos($output,"</span>",$pos2);
  31. $banner = substr($output,$pos2+8,$pos3-$pos2-8);
  32. $cr2 = floatval(str_replace(",",".",str_replace(".","",$banner)));
  33.  
  34. echo "Nasurfovano: ".$cr."<br>";
  35. echo "benner: ".$cr2."<br>";
  36. echo "celkem: ".($cr+$cr2-1000);
  37.  
  38. if(isset($_GET["write"])) {
  39. $db->queryExec('INSERT INTO credit VALUES (null,DATETIME(\'now\'),'.$cr.','.$cr2.');');
  40. }
  41.  
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement