D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
login3.php
back
Copy
<?php session_start(); if(isset($_POST['pas']) && isset($_POST['use'])){ unset($temp); if(isset($_POST['pas'])){ $_POST['pas']=trim($_POST['pas']); if(preg_match('/^[a-zA-Z0-9^$.*+\[\]{,}]/u',$_POST['pas'])) $temp=$_POST['pas']; } if(!isset($temp)){echo "Sorry! Wrong Data!"; exit();} $pas = $temp; unset($temp); if(isset($_POST['use'])){ $_POST['use']=trim($_POST['use']); if(preg_match('/^[a-zA-Z0-9^$.*+\[\]{,}]/u',$_POST['use'])) $temp=$_POST['use']; } if(!isset($temp)){echo "Sorry! Wrong Data!"; exit();} $use = $temp; $_POST['pas'] = ""; $_POST['use'] = ""; include("Connecter/dataconn.php"); $query_rsdirectory = sprintf("select * from students where matric = '%s' and passwrd = '%s' and archived='No'", mysql_real_escape_string($use), mysql_real_escape_string($pas)); $result=mysql_query($query_rsdirectory,$csn); if (!$result){ echo ("<p>Error retrieving data: " . mysql_error() . "</p>"); exit(); } $row = mysql_fetch_assoc($result); $num = mysql_num_rows($result); $_SESSION["deptsn"] = $row['programmesn']; $_SESSION["stud_name"] = $row['surname'].' '.$row['firstname'].' '.$row['othernames']; $_SESSION["matric_no"] = $row['matric']; $_SESSION["yearofentry"] = $row['yearofentry']; $query = sprintf("select a.namer as fname, b.namer as dname, c.namer as pname, d.namer as degree from faculties as a, programs as b, departments as c, programmes as d where d.sn = '%s' and d.departmentsn=c.sn and c.facultysn=a.sn and c.deptsn=b.sn and b.facultysn=a.sn", mysql_real_escape_string($_SESSION["deptsn"])); $res=mysql_query($query,$csn); $myrow = mysql_fetch_assoc($res); $_SESSION["degree"] = $myrow['degree']; $_SESSION["faculty"] = $myrow['fname']; $_SESSION["dept"] = $myrow['dname']; $_SESSION["prog"] = $myrow['pname']; if ($num != 0){ $acc="studentoftheuniversity2015byto"; $yto=$row['sn']; $_SESSION["yto"] = $row['sn']; $_SESSION["acc"] = "studentoftheuniversity2015byto"; //session_register("acc","yto"); Header("Refresh: 0; url=dstu.php"); exit(); } else { include("student.php"); } } else { include("student.php"); } ?>