Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php session_start(); ?>
- <html>
- <?php
- $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");
- $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($GetName)
- //$Name Declared as a result of the search
- $_SESSION['Name'] = $Name;
- echo "Welcome " . $Name . ";
- else
- echo "Sorry";
- }
- </html>
- ?>
Add Comment
Please, Sign In to add comment