Advertisement
Guest User

Untitled

a guest
May 24th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. <form method="POST" action="broschuere_download.php">
  2. <label> E-Mail </label>
  3. <input type="text" <?php echo "name='email' value='$email' "?>/>
  4.  
  5. <label> Passwort </label>
  6. <input type="text" <?php echo "name='password' value='$password' "?>/>
  7.  
  8. <input class="button" type="submit" <?php echo "name='submit' value='Zur Broschüre' "?> style="margin-left: 140px; width: 276px;"/>
  9. </form>
  10.  
  11. <?php
  12. // MySQL
  13. $dbhost = "host";
  14. $dbuser = "user";
  15. $dbpass = "pass";
  16. $dbname = "name";
  17. $email = $_POST["email"];
  18. $password = $_POST["password"];
  19.  
  20. $verbindung = mysql_connect($dbhost,
  21. $dbuser,$dbpass);
  22.  
  23. mysql_select_db($dbname)
  24. or die ("Die Datenbank existiert nicht.");
  25.  
  26. $abfrage = "SELECT email, password FROM besco_passwords";
  27.  
  28. $ergebnis = mysql_query($abfrage);
  29.  
  30. while($row = mysql_fetch_object($ergebnis)){
  31. if ($email === "$row->email" && $password === "$row->password"){
  32. print "<h1 style='margin-bottom: 0px;'> Vielen Dank für Ihr Interesse! <br> Bitte klicken Sie hier zum Download der Broschüre! </h1><br> ";
  33. print "Download: Rechtsklick -> 'Ziel speichern unter'<br /><br />";
  34. print "<a href='http://www.test.de' target='_blank'> Broschüre </a>";
  35. }
  36. else{
  37. print "";
  38. }
  39. }//endwhile
  40.  
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement