Advertisement
Guest User

Untitled

a guest
May 28th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. // das die connect.php
  2. // <?php
  3.  
  4.     // MySQL connect information.
  5. //  $c_username = "";
  6. //  $c_password = "";
  7. //  $c_host = "localhost";
  8. //  $c_database = ""; // un so ne
  9.  
  10.     // Connect.
  11. //  $connection = mysql_connect($c_host, $c_username, $c_password)
  12. //  or die ("It seems this site's database isn't responding.");
  13.  
  14. //  mysql_select_db($c_database)
  15. //  or die ("It seems this site's database isn't responding.");
  16.  
  17. // ?>
  18.  
  19.  
  20.  
  21. <?php
  22.     $err=0;
  23.     $regex='/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,4}$/';
  24.     require_once("connect.php");
  25.    
  26. function check($input,$msg){
  27.     if ($input == '') {
  28.         echo($msg);
  29.         $err++;
  30.     }
  31. }
  32.  
  33. function escape($input){
  34.     if( get_magic_quotes_gpc() ) {
  35.             $input = stripslashes($input);
  36.     }
  37.     if ( !is_numeric($_POST[$input]) ) {        
  38.             $input = mysql_real_escape_string($input);
  39.     }        
  40.     return $input;
  41. }
  42.    
  43.    
  44.    
  45.    
  46.     check('search','Please enter a username!<br>');  // msq injection vereiteln
  47.     $sql = mysql_query('SELECT Nachname,Vorname,Datum FROM kontakte WHERE Nachname = "' . $search . '" ORDER BY Datum DESC');
  48.     while($row_lol = mysql_fetch_object($qry))
  49.     {
  50.         echo $row_lol->Vorname;
  51.     }
  52.        
  53.        
  54.    
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement