Advertisement
Guest User

Untitled

a guest
Oct 12th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.44 KB | None | 0 0
  1. <?php
  2.         $COUNT_FILE = "count_data.txt";
  3.  
  4.         $fp = fopen("$COUNT_FILE", "r+");
  5.  
  6.         flock($fp, 1);
  7.  
  8.         $count = fgets($fp, 4096);
  9.  
  10.         $count += 1;
  11.  
  12.         fseek($fp,0);
  13.  
  14.         fputs($fp, $count);
  15.  
  16.         flock($fp, 3);
  17.  
  18.         fclose($fp);
  19.  
  20.         error_reporting(E_ALL ^ E_DEPRECATED);
  21.  
  22.          $aye = htmlspecialchars($_GET['search']);
  23.  
  24.         $s = 0;
  25.  
  26.         $e = 6;
  27.  
  28.         $next = $s + $e;
  29.  
  30.         $prev = $s - $e;
  31.  
  32. echo " <!DOCTYPE html>
  33. <html xmlns='http://www.w3.org/1999/xhtml'>
  34. <head>
  35. <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
  36. <title>Sigant Database Search</title>
  37. <style>
  38.  
  39. a:link {
  40.    text-decoration: none;
  41. }
  42.  
  43. a:visited {
  44.    text-decoration: none;
  45. }
  46. a:hover {
  47.    text-decoration: underline;
  48. }
  49. .search {
  50.    width: 400px;
  51. }
  52.  
  53. #left {
  54.    margin: 0 auto;
  55.    color: red;
  56. }
  57.  
  58. .search {
  59.    border-bottom: 1px solid transparent;
  60.    border-left: 1px solid transparent;
  61.    border-right: 1px solid transparent;
  62.    border-top: 1px solid transparent;
  63.  
  64. }
  65.  
  66. form {
  67.    background-color: #e3e3e3;
  68.    color: red;
  69. }
  70.  
  71. #results font {
  72.    color: #3498db;
  73. }
  74.  
  75. #results font h3 {
  76.    color: #252525;
  77. }
  78.  
  79. table {
  80.        align:left;
  81.        background-color:#D3D3D3;
  82.        width:100%;
  83. }
  84. </style>
  85. </head>
  86.  
  87. <body bgcolor='#eee'>
  88. <font color='#ffffff'>
  89. <form name='myform' action='search.php' method='GET'>
  90.    <table>
  91.      <td width='100px'>
  92.        <a href='index.php'><img src='logo.png' width='100px' height='40px' alt='Home'></a>
  93.      </td>
  94.      <td width='400px'>
  95.        <input name='search' type='text' class='search' placeholder='Search Sigant Library Database Breach' required/>
  96.      </td>
  97.      <td>
  98.        <input name='query' type='image' src='search.png' alt='Submit' height='24px' width='24px'>
  99.      </td>
  100.      <tr>
  101.      <td colspan=3>
  102. </form>
  103. "
  104. ;
  105.  
  106. $db = mysql_connect('localhost','sigantxy_search','prodigydisk') or die('Could not connect to database.');
  107. mysql_select_db('sigantxy_search',$db);
  108. $search = mysql_real_escape_string($aye);
  109. $search = str_replace(' ','%',$search);
  110.  
  111. $search_exploded = explode (' ',$search);
  112. $search_exploded = str_replace(' ','', $search_exploded);
  113.  $x = 0;
  114.  foreach( $search_exploded as $search_each ) { $x++; $construct = " ";
  115.  if( $x == 1 ) $construct .= "email LIKE '%$search_each%' ";
  116.  else $construct .= "AND email LIKE '%$search_each%' ";
  117.  } $construct = " SELECT name, email, password, ip FROM infinityhax WHERE $construct LIMIT 50";
  118.  
  119.  
  120. $run = mysql_query( $construct );
  121.  
  122. $foundnum = mysql_num_rows($run);
  123.  
  124.  
  125. $run_two = mysql_query($construct);
  126. $search=str_replace('%',' ',$search);
  127.  
  128.   if ($foundnum==0)
  129.  
  130.    echo "</td></table><div align='left'><p><font color='#191919'>
  131.   <br>
  132.   <br>
  133.   <font face='Calibri' size=4'>No results found for <b>$search</b>. Read Suggestions For more information.<br> <br>
  134.  
  135.   1. Try to <b>search for more specific words</b>.
  136.   <br>
  137.   2. Make sure all words are <b>spelled correctly</b>.
  138.   <br>
  139.   3. If any of these suggestions then it <b>may not be present in our database</b>.</font>
  140.   <br>
  141.   <br>
  142.   <br>
  143.   </font>
  144. </p></div>";
  145.   else
  146.   {
  147.  
  148.  
  149.    echo "<font face='Calibri' color='gray' size='3'>Showing <b>$foundnum</b> results for <b>$search.</b></font></td></table><p>
  150. <div align='left'>"
  151. ;
  152.  
  153.     while ($runrows = mysql_fetch_assoc($run_two))
  154.    {
  155.     //get data
  156.     //woody is your daddy
  157.    $name = $runrows['name'];
  158.    $email = $runrows['email'];
  159.    $password = $runrows['password'];
  160.    $ip = $runrows['ip'];
  161.    echo "
  162.   <div id='left'>
  163.        <h4>
  164.        <div id='results'>
  165.        <font face='Calibri' color='#191919' class='shit'><h3>___________________________________________</h3></font>
  166.        <font face='Calibri' color='##3498db'><h3>Username: $name</h3></font></a>      
  167.        <font face='Calibri' color='#191919'>Email: $email<br></font><br>  
  168.        <font face='Calibri' color='#191919'>IP: $ip<br></font><br>
  169.        <font face='Calibri' color='#191919'>Password: $password<br></font><br>
  170.        </div>
  171.  
  172.   ";
  173. }
  174. ?>
  175. <?php
  176. if (!$s<=0)
  177.  
  178.  echo "
  179. <font face='Segoe UI Light'><a href='search.php?search=$search&s=$prev'></a></font>";
  180.  
  181. $i =1;
  182. for ($x=0;$x<$foundnum;$x=$x+$e)
  183. {
  184.  
  185.  
  186.  echo " <a href='search.php?search=$search&s=$x'>$i</a> ";
  187.  
  188.  
  189. $i++;
  190.  
  191.  
  192. }
  193.  
  194. if ($s<$foundnum-$e)
  195.   echo "<a href='search.php?search=$search&s=$next'></a>";
  196.  
  197.     }
  198. ?>
  199. </font>
  200. </body>
  201. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement