SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <title>Suchfeld</title>
  3. <body>
  4. <form action="" method="post" target="_self">              
  5.     <div style="float:left;margin-left:35px">
  6.         <input type="text" name="searchfield" style="border: 1px solid #c8c8c8;width:185px">
  7.         <input type="image" src="img/search.gif" name="enter_search" alt="Suche" >
  8.     <!-- <input type="submit" name="enter_search" value="Suche"> -->
  9.     </div>
  10. <br>
  11. </form>
  12. <?php
  13.     // Post-Variable bei der Suche im Feld
  14.     if(isset($_POST['enter_search']))
  15.     {
  16.         $DBHOST = "localhost";
  17.         $DBUSER = "tom";
  18.         $DBPW = "djtom751";
  19.         $con = mysql_connect($DBHOST,$DBUSER,$DBPW) or die("Verbindungsversuch fehlgeschlagen" . mysql_error());
  20.         mysql_select_db("alchemie",$con) or die("Konnte die Datenbank nicht waehlen" . mysql_error());
  21.    
  22.         $searchresult = trim(htmlentities(stripslashes(mysql_real_escape_string($_POST['searchfield']))));
  23.             $wsearch = "SELECT * FROM CSV_Gemeindeverzeichnis
  24.                     WHERE WName LIKE '%searchresult%'";
  25.                
  26.         $post = mysql_query($wsearch);
  27.         while($lpost = mysql_fetch_array($post))
  28.         {
  29.         echo "<td align='center' valign='middle' style='width:16%'><h2>".$lpost['*']."</h2></td>";
  30.         }
  31.     }  
  32. ?>
  33. </body>
  34. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top