Guest User

Untitled

a guest
Jul 4th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <?php
  2.  
  3. function OpenCon()
  4. {
  5. $dbhost = 'localhost';
  6. $dbuser = 'root';
  7. $dbpass = '0000';
  8. $db = 'mydatabase';
  9.  
  10. $conn = new mysqli($dbhost, $dbuser, $dbpass, $db) or die ("Connect failed: %sn". $conn -> error);
  11.  
  12. return $conn;
  13. }
  14.  
  15. function CloseCon($conn)
  16. {
  17. $conn -> close();
  18. }
  19.  
  20. ?>
  21.  
  22. <?php
  23.  
  24. include 'connection.php';
  25.  
  26. $conn = OpenCon();
  27.  
  28. echo "Connected Successfully";
  29.  
  30. CloseCon($conn);
  31.  
  32. ?>
  33.  
  34. <form id='register-form' action="database/reg.php" method='post'>
  35. <input type="text" maxlength="15" name="usr" placeholder="Username" required>
  36. <input type="text" name="fname" placeholder="First Name" required>
  37. <input type="text" name="lname" placeholder="Last Name" required>
  38. <input type="email" name="mail" placeholder="Email" required>
  39. <input type="password" name="psw" placeholder="Password" required>
  40. <input type="password" placeholder="Re Password" required>
  41. <button type='submit'> Εγγραφή</button>
Add Comment
Please, Sign In to add comment