<?php

session_start();
include 'config.php';
include 'check_function.php';
$UserName = $_SESSION["UserName"];
$Password = $_SESSION["Password"];
$UserName1 = $_POST["username"];
$Old1 = $_POST["old"];
$New1 = $_POST["new"];
$ConfirmPassword1 = $_POST["confirm"];
$UserNameGood = Check_UserName($UserName, $UserName1);
$PasswordGood = Check_Password($Old1, $Password);
$validPasswordGood = Check_validPassword($New1);
$ConfirmPasswordGood = Check_ConfirmPassword($ConfirmPassword1, $New1);
$error = false;
if ($UserNameGood != "UserName confirmation success") {
    //if any one error occurred, refresh to the former page and save the typing history
    $error = true;
    ?>
  <script type="text/javascript">
    alert("wrong username.");
    history.back();
  </script>
<?php 
}
if ($PasswordGood != "check password success") {
    $error = true;
    ?>
  <script type="text/javascript">
    alert("wrong password name.");
Exemple #2
0
//file that check the input info and add the user to database
//get the user info
$UserName1 = $_POST["UserName"];
//Username
$Password1 = $_POST["Password"];
//password
$ConfirmPassword1 = $_POST["ConfirmPassword"];
//confirmpassword
$Email1 = $_POST["Email"];
//email
$actnum = "";
include 'config.php';
include 'check_function.php';
$UserNameGood = Check_validusername($UserName1);
$PasswordGood = Check_validPassword($Password1);
$EmailGood = Check_Email($Email1);
$ConfirmPasswordGood = Check_ConfirmPassword($Password1, $ConfirmPassword1);
$error = false;
if ($UserNameGood != "check username success") {
    $error = true;
    ?>
	<script type="text/javascript">
    alert("illegal username.");
    history.back();
	</script>
	<?php 
}
if ($PasswordGood != "check valid password success") {
    $error = true;
    ?>