Location: PHPKode > projects > PHP File Database > fdat/profile.php
<?php
/*
###############################################################################
# profile.php                                                                 #
###############################################################################
# FDat (File Database) Beta Version                                           #
# Open-Source Project by Jeffrey Gelens (hide@address.com)                  #
# =========================================================================== #
# Copyright (c) 2001 Jeffrey Gelens - All Rights Reserved                     #
#                                                                             #
# This program is free software; you can redistribute it and/or               #
# modify it under the terms of the GNU General Public License                 #
# as published by the Free Software Foundation; either version 2              #
# of the License, or (at your option) any later version.                      #
###############################################################################
*/
require ('sources/functions.php');
require ('settings.php');

mysql_connect ($database['host'], $database['username'], $database['password']) or die ("Kan geen verbinding maken met server!");
mysql_select_db ($database['name']) or die ("Kan geen verbinding maken met database!");

$check = check($PHP_SELF);
if (!$check) {
  echo "Je bent niet ingelogd of sessie tijd is verlopen!!!";
  exit;
}

head();
head2();


if ($send == "change") {

  $username = get_User($koekje);

  if ($password == $password2) {

    $password = md5($password);

    $sql = "UPDATE users SET password='$password' WHERE username = '$username'";
    $result = mysql_query($sql);
    echo "Wachtwoord veranderd! <br><br>";
    }
  else {
    echo "Wachtwoorden verschillen!<br><br>";
  }
}
?>


Verander Wachtwoord:<br>
<form action="profile.php" method="post">
<table>
  <tr>
    <td> Wachtwoord: </td>
    <td><input type="password" name="password"> </td>
  </tr>
  <tr>
    <td> Wachtwoord (herhalen): </td>
    <td> <input type="password" name="password2"> </td>
  </tr>

</table>

<input type="submit" value="Verander Wachtwoord">
<input type="hidden" name="send" value="change">
</form>

<?php
foot();
?>
Return current item: PHP File Database