Advertisement
Guest User

Untitled

a guest
Jun 15th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. INDEX.html:
  2. <form action="dbstatus.php" method="post">
  3. DB IP:
  4. <input type="text" size="24" maxlength="20" name="dbip"><br><br>
  5. DB Username:
  6. <input type="text" size="24" maxlength="20" name="dbuser"><br><br>
  7. DB Worldname:
  8. <input type="text" size="24" maxlength="20" name="dbworld"><br><br>
  9. DB Password:
  10. <input type="password" size="24" maxlength="20" name="dbpw"><br>
  11.  
  12. <input type="submit" value="Connect to Database">
  13. </form>
  14.  
  15.  
  16. dbstatus.php:
  17.  
  18. <?php
  19. $dbworld = $S_POST["dbworld"];
  20. $connection = mysql_connect($_POST["dbip"], $_POST["dbuser"], $_POST["dbpw"]);
  21. echo "Worlddb: " . $dbworld ;
  22. echo "User: " . $_POST["dbuser"];
  23. if(!mysql_select_db($dbworld))
  24. {
  25. echo'<font color=red><b>Fehler beim Verbinden mit der Datenbank</b></font>';
  26. }
  27. else
  28. {
  29. echo'<font color=green><b>Erfolgreich mit der Datenbank verbunden!</b></font>';
  30. }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement