27 lines
700 B
PHP
27 lines
700 B
PHP
<?php
|
|
SESSION_START();
|
|
require('connect.php');
|
|
|
|
$code = $_GET['code'];
|
|
$code = urldecode($code);
|
|
|
|
$query = "SELECT * FROM `pass_forgot` WHERE `confirm_mail`='$code'";
|
|
$result = mysql_query($query, $connection);
|
|
if(mysql_num_rows($result)==1){
|
|
$query = "UPDATE `pass_forgot` SET `confirm_mail`=NULL, `mail`=`mail_new`, `mail_new`=NULL WHERE `confirm_mail`='$code'";
|
|
mysql_query($query, $connection);
|
|
$_SESSION['confirm']=0;
|
|
|
|
$result_rows = mysql_fetch_assoc($result);
|
|
$name=$result_rows['name'];
|
|
if(strlen($name)>2){
|
|
header("Location: ../?page=leerling/$name");
|
|
}
|
|
if(strlen($name)==2){
|
|
header("Location: ../?page=docent/$name");
|
|
}
|
|
|
|
}
|
|
else{
|
|
header("Location: ../mail/confirm/?code=1");
|
|
} |