Share Pastebin
Guest
Public paste!

phptest

By: a guest | Mar 22nd, 2010 | Syntax: PHP | Size: 0.68 KB | Hits: 22 | Expires: Never
Copy text to clipboard
  1. <?php
  2.  
  3. function test($user) {
  4.         $user="s10int_09162";
  5.         $password="mp8nb8";
  6.         $database="s10int_09162";
  7.        
  8.         mysql_connect(localhost,$user, $password);
  9.         @mysql_select_db($database) or die("Unable to select database");
  10.         $query = "SELECT * FROM user WHERE username='username_input'";
  11.         $result = mysql_query($query);
  12.        
  13.         echo $result;
  14.  
  15.         mysql_close();
  16.  
  17. }
  18.  
  19.         echo    "<form method=\"post\" action=".$_SERVER["PHP_SELF"].">\n";
  20.         echo    "<label>Username:</label><input name=\"username_input\" type=\"text\"/>\n";
  21.         echo    "<input type=\"submit\" name=\"submitbutton\" value=\"send\">\n";
  22.         echo    "</form>\n";
  23.         if (isset($_POST["submitbutton"]))
  24.         {
  25.                 (test($_POST["username_input"]));
  26.         }
  27.  
  28.  
  29. ?>