Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- @session_start();
- $host="localhost";
- $username="root";
- $password="";
- $db_name="school";
- $tbl_name="tbl_login";
- mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- $StudentID= $_POST['StudentID'];
- $Password= $_POST['Password'];
- $BirthMonth= $_POST['BirthMonth'];
- $BirthDay= $_POST['BirthDay'];
- $BirthYear= $_POST['BirthYear'];
- $result=mysql_query("select * from tbl_login where StudentID='".mysql_real_escape_string($StudentID)."'");
- $count=mysql_num_rows($result); // This will check the result
- if($count==1 ){
- //$GetName="Select Name FROM $tbl_name WHERE StudentID='$StudentID'"; // getting the name in the DB
- $Name=mysql_fetch_array($result);
- //$Name Declared as a result of the search
- $_SESSION['Name'] = $Name['StudentID'];
- echo "Welcome ".$Name."";
- }
- else {
- echo "Sorry";
- }
- ?>
Add Comment
Please, Sign In to add comment