<?php if (session_id() == '') { session_start(); $_SESSION["base_url"] = "http://" . $_SERVER['SERVER_NAME'] . "/niias/"; if (strpos($_SERVER['SERVER_NAME'], 'localhost') !== false) { $_SESSION["base_url"] = "http://localhost/online/"; } } include_once '../oesdb.php'; if ($_POST['stdsubmit']) { $result = executeQuery("select * from student where deleted=0 and emailid='" . $_REQUEST['email'] . "'"); if (mysql_num_rows($result) > 0) { $r = mysql_fetch_array($result); if (md5(escMysqlStr($_REQUEST['password'])) == $r['stdpassword']) { $_SESSION['stdname'] = $r['emailid']; $_SESSION['stdid'] = $r['stdid']; $_SESSION['paid'] = $r['paid']; unset($_SESSION['message']); $_SESSION['success'] = "You are successfully logged in"; header('Location: ' . $_SESSION["base_url"] . 'student/stdwelcome.php'); exit; } else { $_SESSION['message'] = "Invalid email and Password."; } } else { $_SESSION['message'] = "Check Your email and Password."; } closedb(); header('Location: ' . $_SESSION["base_url"] . 'student/student-login.php'); exit;
$result = executeQuery($query); if (empty($_REQUEST['email']) || empty($_REQUEST['password']) || empty($_REQUEST['repass'])) { $_SESSION['message'] = "Some of the required Fields are Empty"; } else { if ($_REQUEST['password'] != $_REQUEST['repass']) { $_SESSION['message'] = "Password and Repeat Password are not equal"; } else { if (mysql_num_rows($result) > 0) { $_SESSION['message'] = "Sorry this email is already registered"; } else { $query = "insert into student (fname, lname, stdname, stdpassword, emailid, contactno, address, city, pincode) values('" . escMysqlStr($_REQUEST['fname']) . "','" . escMysqlStr($_REQUEST['lname']) . "','" . escMysqlStr($_REQUEST['email']) . "','" . md5(escMysqlStr($_REQUEST['password'])) . "','" . escMysqlStr($_REQUEST['email']) . "','" . escMysqlStr($_REQUEST['contactno']) . "','" . escMysqlStr($_REQUEST['address']) . "','" . escMysqlStr($_REQUEST['city']) . "','" . escMysqlStr($_REQUEST['pin']) . "')"; if (!@executeQuery($query)) { $_SESSION['message'] = mysql_error(); } else { $_SESSION['success'] = "Your Account has been Successfully Created."; $query = "select stdid, paid, emailid from student where emailid = '" . escMysqlStr($_REQUEST['email']) . "'"; $result = executeQuery($query); $r = mysql_fetch_array($result); unset($_SESSION['message']); $_SESSION['stdname'] = $r['emailid']; $_SESSION['stdid'] = $r['stdid']; $_SESSION['paid'] = $r['paid']; header('Location: student-payment.php'); exit; } } } } closedb(); header('Location: student-registration.php'); exit;
if (session_id() == '') { session_start(); $_SESSION["base_url"] = "http://" . $_SERVER['SERVER_NAME'] . "/niias/"; if (strpos($_SERVER['SERVER_NAME'], 'localhost') !== false) { $_SESSION["base_url"] = "http://localhost/online/"; } } include_once '../oesdb.php'; if (isset($_POST['register'])) { if (empty($_REQUEST['payment_type']) || empty($_REQUEST['ammount']) || empty($_REQUEST['number'])) { $_SESSION['message'] = "Some of the required Fields are Empty"; } else { $query = "select * from payment_detail where stdid=" . $_SESSION['stdid'] . ";"; $result = executeQuery($query); if (mysql_num_rows($result) > 0) { $query = "update payment_detail set payment_type='" . escMysqlStr($_REQUEST['payment_type']) . "', payment_date='" . date('Y-m-d H:i:s') . "', ammount=" . escMysqlStr($_REQUEST['ammount']) . ", number='" . escMysqlStr($_REQUEST['number']) . "' where stdid=" . $_SESSION['stdid'] . ";"; } else { $query = "insert into payment_detail (stdid, payment_type, payment_date, ammount, number) " . "values(" . $_SESSION['stdid'] . ",'" . escMysqlStr($_REQUEST['payment_type']) . "','" . date('Y-m-d H:i:s') . "'," . escMysqlStr($_REQUEST['ammount']) . ",'" . escMysqlStr($_REQUEST['number']) . "');"; } if (!@executeQuery($query)) { $_SESSION['message'] = mysql_error(); } else { closedb(); header('Location: stdwelcome.php'); exit; } } closedb(); header('Location: student-payment.php'); exit; }