function display_profile($uid) { $result = sql_get_profile_byID($uid); if (count($result) == 0) { echo '<h2><b>No such user!!</b></h2>'; return; } if ($result[0]['type'] == 0) { echo '<h2>😂ðŸ˜ps</h2>'; return; } else { if ($result[0]['type'] == 2) { $res = sql_get_stuInfo_byEmail($result[0]['email']); Display_stu($res); } else { if ($result[0]['type'] == 1) { $res = sql_get_empInfo_byEmail($result[0]['email']); Display_emp($res); } } } }
<style> </style> </head> <body> <?php include_once "sqlfuncs.php"; $type = $_POST["user_type"]; $name = $_POST["username"]; $email = $_POST["email"]; $pwd = $_POST["pwd"]; include_once "header.php"; $stu_res = sql_get_stuInfo_byEmail($email); $emp_res = sql_get_empInfo_byEmail($email); if ($stu_res || $emp_res) { //check if email already used print "Email used"; exit; } session_start(); $_SESSION["email"] = $email; $_SESSION["type"] = $type; $hash = md5(rand(0, 1000)); /*==== send email verifi ====*/ /*===========================*/ // to user email $to = $email; // Send email to our user require './PHPMailer/PHPMailerAutoload.php';