ob_start();
include_once($_SERVER['DOCUMENT_ROOT']."/_inc/mng_cnn.php");
include_once($_SERVER['DOCUMENT_ROOT']."/_inc/functions.php");
include_once($_SERVER['DOCUMENT_ROOT']."/_inc/user_manage.php");
if(isset($_SESSION["OK"])){header("Location: /-/experimental/my/index.php"); unset($_SESSION["OK"]); exit();}
$SCRIPT = $_SERVER['PHP_SELF'];
$QS = $_SERVER['QUERY_STRING'];
$cur_qs = (isset($_REQUEST['cur_qs'])? trim($_REQUEST['cur_qs']): "");
$act = (isset($_REQUEST["act"])? $_REQUEST["act"]: "");
$id = (isset($_REQUEST["id"])? (int)$_REQUEST["id"]: 0);
$cur_qs = (isset($_REQUEST["cur_qs"])? $_REQUEST["cur_qs"]: $QS);
?>
include_once($_SERVER['DOCUMENT_ROOT']."/-/english/includes/toolbar_en.php");
if($_POST){
$mail = left($_POST["mail"], 100);
$pass = $_POST["pass"];
$re_pass = $_POST["re_pass"];
$name = $_POST["name"];
$family = $_POST["family"];
$msg_error = NULL;
//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
if(!valid_email($mail)) $msg_error .= "Invalid Email Address
";
if(!valid_pass_repass($pass, $re_pass)) $msg_error .= $USR_MNG_FEEDBACK;
//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
if(is_null($msg_error)){
$rs_un = mysql_query("Select pk_infid From std_info ORDER BY pk_infid DESC LIMIT 1");
$cur_year = substr(get_jalali_date(date("Y-m-d")), 2, 2);
//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
if(mysql_num_rows($rs_un)==1 && ereg("^[8-9]{1}[0-9]{5}$", mysql_result($rs_un, 0)) ){
$last_no = (int)right(mysql_result($rs_un, 0), 4);
$last_no ++;
$new_no = $cur_year.str_pad($last_no, 4, "0", STR_PAD_LEFT);
}
else{
$last_no = "";
$new_no = $cur_year.str_pad($last_no, 4, "0", STR_PAD_LEFT);
}
//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
mysql_query("Insert Into std_info(pk_infid, mail, password, name, family, session_id, last_login, s_date, actived, portrait)
Values('$new_no', '$mail', '". md5($pass) ."', '".str_in_db($name, 50)."',
'".str_in_db($family, 50)."', NULL, NULL, NULL, '0', '')") or die(mysql_error());
$_SESSION["OK"] = "OK".session_id();
mkdir($_SERVER['DOCUMENT_ROOT']."/-/experimental/$new_no", 0755);
chmod ($_SERVER['DOCUMENT_ROOT']."/-/experimental/$new_no",0777);
$source_file = $_SERVER['DOCUMENT_ROOT']."/_inc/std_index.php";
$dest_file = $_SERVER['DOCUMENT_ROOT']."/-/experimental/$new_no/index.php";
if(!copy($source_file, $dest_file)) die("failed to copy $source_file");
echo("
Dear ".$name."
Your registration is successful
Here is your user information
Your home page: http://".$_SERVER['REMOTE_ADDR']."/$new_no/
Your user ID: $new_no
(Please keep this number. You can announce it to friends to view your page)
Your Password: $pass
Click Here for login
");
include_once($_SERVER['DOCUMENT_ROOT']."/-/english/includes/footer_en.php");
exit();
}
}
else{
$mail = "";
$pass = "";
$re_pass = "";
$name = "";
$family = "";
}
?>
Student Section
include_once($_SERVER['DOCUMENT_ROOT']."/-/english/includes/footer_en.php");?>