Guest
Public paste!

Untitled

By: a guest | Mar 22nd, 2010 | Syntax: PHP | Size: 1.79 KB | Hits: 32 | Expires: Never
Copy text to clipboard
  1. <?php
  2. $link = mysql_connect('localhost', 'yui', 'iyu');
  3. $lacz = mysql_select_db ( 'dfg' );
  4.  
  5. $limit = 10;
  6.  
  7. echo "
  8.         <title> CFGFactory.com - Commands Dictionary </title>
  9.         <style type='text/css'>
  10.         html, body {
  11.         font-family: Tahoma, sans-serif, arial, helvetica;
  12.         decoration: none;
  13. }
  14.         </style>
  15.         <center>
  16.          <br><br><br><a href='search.php'><img src='http://hubex.cfgfactory.pl/cmd.png' border='0'></a>
  17.         <a href='search.php'></a><br><br><br>
  18.         <form action='".$_SERVER[PHP_SELF]."' method='post'>
  19.  
  20.         <input type='text' name='fraza' size='32'>
  21.         <br><br><input type='image' src='bttn.jpg' />
  22.         </form>";
  23.  
  24. if($_POST){
  25.    
  26.         $query = "SELECT name,opis,sample FROM cmd WHERE name='".$_POST['fraza']."' OR opis LIKE '%".$_POST['fraza']."%'";
  27.         $result = mysql_query($query);
  28.  
  29.  
  30.  
  31. if(mysql_num_rows($result) < $limit){
  32.  
  33.         echo '<br><br><table border="1" width="950" height="86" cellspacing="0" cellpadding="0" bordercolor="#00000" bordercolorlight="#00000" bordercolordark="#00000">
  34.         <tr>
  35.               <td height="35" width="244" align="center" valign="middle"><b>Name</b></td>
  36.               <td height="35" width="408" align="center" valign="middle"><b>Description</b></td>
  37.               <td height="35" width="316" align="center" valign="middle"><b>Sample</b></td>
  38.         </tr>';
  39.  
  40.         while($rec = mysql_fetch_assoc($result)){
  41.  
  42.         echo '
  43.                 <tr>
  44.               <td height="0" width="244" align="center" valign="middle">'.$rec['name'].'</td>
  45.               <td height="0" width="408" align="center" valign="middle">'.$rec['opis'].'</td>
  46.               <td height="0" width="316" align="center" valign="middle">'.$rec['sample'].'</td>
  47.       </tr>';
  48.  
  49. }
  50.  
  51. echo '</center></table>';
  52.  
  53. }else{
  54.  
  55. echo '<br><br>Search engine found too much commands. Precisely your search phrase.';
  56.  
  57. }
  58. }
  59.  
  60.  
  61.  
  62. ?>