1. Connecting to Database
2. Login(Session Start)
3. Logout(Session End)
4. Session Check
5. Login Form
6. CSS
1. Connecting to Database
$DatabaseServer = "localhost";
$DatabaseUsername = "root";
$DatabasePassword = "root";
$DatabaseName = "demo";
$Connection = mysqli_connect($DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName);
if ($Connection === false) {
die("ERROR: Could not connect. " . mysqli_connect_error());
}
2. Login
session_start();
if (isset($_POST['username']) and isset($_POST['password'])) {
$Username = $_POST['username'];
$Password = $_POST['password'];
$query = "SELECT * FROM `user` WHERE FirstName='$Username' and Password='$Password'";
$result = mysqli_query($Connection, $query) or die(mysqli_error($connection));
$count = mysqli_num_rows($result);
if ($count == 1) {
$_SESSION['username'] = $Username;
} else {
$fmsg = "Invalid Login Credentials.";
}
}
3. Logout
session_start();
session_destroy();
header('Location: login.php');
4. Session Check
if (isset($_SESSION['username'])) {
echo "<div class='session-box'>";
echo 'Welcome Mr.'.$Username = $_SESSION['username'];
echo "<br><a href='logout.php'>Logout</a>";
echo "</div>";
}else{
echo "<div class='session-box'>";
echo "You are logged out.";
echo "</div>";
}
5. Login Form
<form method="POST" class="login-box">
<div class="form-header">Please Login</div>
<div class="col-md-12">
<label>Username</label>
<input type="text" name="username" class="form-control" placeholder="Username" required>
</div>
<div class="col-md-12">
<label>Password</label>
<input type="password" name="password" class="form-control" placeholder="Password" required>
</div>
<div class="col-md-6">
<button class="btn btn-primary" type="submit">Login</button>
</div>
</form>
6.CSS
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style>
.login-box{
position: absolute;
width: 300px;
height: 270px;
z-index: 15;
top: 50%;
left: 50%;
margin: -100px 0 0 -150px;
border: 1px solid #8080804a;
border-radius: 5px;
background: #8080804a;
}
.session-box{
position: absolute;
width: 300px;
height: 100px;
z-index: 15;
top: 10%;
left: 50%;
margin: 0px 0 0 -150px;
border: 1px solid #8080804a;
border-radius: 5px;
background: #8080804a;
padding: 30px;
}
.form-control{
padding: 10px;
margin-top: 5px;
}
.btn-primary{
margin-top: 20px;
}
.form-header{
width: 299px;
height:40px;
background: #004f61;
color:white;
text-align: center;
font-size: 20px;
margin-bottom: 20px;
padding: 5px;
}
</style>
</head>
Create Database Table
CREATE TABLE `user` (
`UserID` int(12) NOT NULL,
`FirstName` varchar(48) NOT NULL,
`LastName` varchar(48) NOT NULL,
`Email` varchar(128) NOT NULL,
`Password` varchar(20) NOT NULL,
`City` varchar(48) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `user` (`UserID`, `FirstName`, `LastName`, `Email`, `Password`, `City`) VALUES
(7, 'Rahul', 'Rajshekaran', 'Rahul@zzz.xxx', 'Rahul@123', 'Pune'),
(8, 'Mahesh', 'Krishna', 'Mahesh@xxx.xxx', 'Mahesh@123', 'Delhi');
Result
You can actively talk with our experts through Staples Chat Support. They will help you 24/7 to address all your device problems.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteBook Flights to Nashville. Get Cheap flights to Nashville Guaranteed on a huge option of flights deals to Nashville. Grab this attractive offer now.
ReplyDeleteWonder in the new place full of museums and parks by taking Flights From New York to Las Vegas. Get your bookings done with our travel agents and make your next journey adventurous. Book soon to get early bird offers.
ReplyDeleteExtremely common to handle banking errors like QuickBooks Error code 9999. When such an error takes place, the machine tends to freeze for a couple of seconds on repeat. This example can obviously affect business awfully. If you want to Fix QuickBooks Error 9999 then you may contact our ProAdvisors.
ReplyDeleteYou are able to download Office.com/setup com setup on the internet for receiving the benefits of word, excel and other utilities that are extremely helpful for documentation and also for company purposes. We give you online assistance for each and every sort of problems and assistance from Office.
ReplyDeleteOffice.com/setup
https://www.scribd.com/presentation/444882619/QuickBooks-Support-Phone-Number-1-844-232-0202
ReplyDeletehttps://www.4shared.com/file/f_QPNLWpea/QuickBooks_Support_Phone_Numbe.html
http://www.filefactory.com/file/12i0ntvcefrj/QuickBooks%20Support%20Phone%20Number%20%2B1-844-232-0202.pptx
https://www.edocr.com/v/12na4ql1/js9167631/QuickBooks-Support-Phone-Number-1-844-232-0202
https://issuu.com/js9167631/docs/quickbooks_support_phone_number__1-_036f98b537c6b8
https://www.dropbox.com/s/3rdled7ttg5ozbk/QuickBooks%20Support%20Phone%20Number%20%2B1-844-232-0202.pptx?dl=0
https://www.slideserve.com/fiksqb/quickbooks-support-phone-number-1-844-232-0202-powerpoint-ppt-presentation-9769416
https://www.sharepresentation.com/fiksqb/quickbooks-support-phone-number-18442320202-1580383588jEJ0E5821
https://www.mediafire.com/file/uwprpuujk9v7so4/QuickBooks_Support_Phone_Number_+1-844-232-0202.pptx/file
Nice post thanks for sharing. Read mine also:
ReplyDeleteHow to Install AOL Desktop Gold
Blerk error 1 in AOL Mail
WINDSTREAM EMAIL NOT WORKING
Prevent malware from being installed in Mozilla Firefox
Unable to sign into my bellsouth.net email account
Hi there, just became aware of your blog through Google, and found that it's really informative. I’m going to watch out for brussels. I will be grateful if you continue this {in future}. Many people will be benefited from your writing. Cheers! nature's way Singapore
ReplyDeleteAir China Airlines Customer Service is available 24*7 to help you. Reach experts at Air China Airlines Customer Service Phone Number now for queries.
ReplyDeleteThis is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. app development services
ReplyDeleteWow! Thank you! I always needed to write on my website something like that. Can I implement a part of your post to my site? events backdrop
ReplyDeleteSweet blog! I found it while surfing around on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! List of Accounting & Tax Companies in Singapore
ReplyDeleteBest Deals at Safemartshop, an international prescription service provider, which contracts with International dispensaries and USA pharmacies, is a leader in referring orders for prescription and non-prescription medications on behalf of customers throughout the world
ReplyDeleteSafemartshop
buy hydrocodone online
buy oxycodone online
buy oxycontin online
buy percocet online
buy vicodin online
buy norco online
buy adderall online
buy xanax online
If you are QuickBooks user and getting QuickBooks error 2107 then you can read the post and fix it or Call Quickbooks Helpline Number 1-800-242-0792.
ReplyDeleteQuickBooks error 2107
Fix QuickBooks error
Quickbooks Helpline Number
Quickbooks Support Number
If you suddenly find yourself in Facebook jail and you don't even know how this happened, then here you will get detailed information on how to get yourself out of Facebook jail.
ReplyDeleteblocked from posting on Facebook
Facebook Jail
how long does Facebook block you
get out from Facebook Jail
Intuit has recommended some solutions which could correct the error with expert guidance from QuickBooks Error 15243 ProAdvisors. Stick to the resolution steps within the given sequence so your best results can be obtained.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteQuickBooks Error 6175 is an easy and trustworthy program for almost any business now each day. QuickBooks program can handle data that is employed by every business to produce their venture, track their records and in addition tracks their transaction.
ReplyDeleteThere are various other reasons as well that are mentioned below. Methods to resolve the QuickBooks Error 83 are mentioned you'll want to opt in accordance with the reason associated with problem.
ReplyDeleteThe development of artificial intelligence (AI) has propelled more programming architects, information scientists, and different experts to investigate the plausibility of a vocation in machine learning. Notwithstanding, a few newcomers will in general spotlight a lot on hypothesis and insufficient on commonsense application. machine learning projects for final year In case you will succeed, you have to begin building machine learning projects in the near future.
ReplyDeleteProjects assist you with improving your applied ML skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include projects into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Final Year Project Centers in Chennai even arrange a more significant compensation.
Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account.
The Nodejs Projects Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Using QuickBooks software, the user can simply create invoices in QuickBooks and invoice tax payments with the filing invoice tax returns of the organizations. So get proper and complete guidance on how to create many types of invoices by connecting to our amazing QuickBooks Support Phone Numberr services.
ReplyDeleteDespite being a technological invention, Big Data Analytics is an art that handled correctly can drive your business to success. Although it could be the most preferable and reliable way of taking important decisions there are challenges such as cultural barrier. data science course syllabus
ReplyDeleteBest Deals at buyonlinekart, an international prescription service provider, which contracts with International dispensaries and USA pharmacies, is a leader in referring orders for prescription and non-prescription medications on behalf of customers throughout the world
ReplyDeletebuyonlinekart
Best place to buy hydrocodone online Hydrocodone is used to relieve severe pain. Again, hydrocodone is only used to treat people who are expected to need medication to relieve severe pain around-the-clock for a long time and who cannot be treated with other medications or treatments. Call Now 1-805-335-6339.
ReplyDeletebuy hydrocodone online
Buy Oxycontin Online. OxyContin (oxycodone HCl) is indicated for the management of pain severe enough to require daily, around-the-clock, long-term opioid treatment and for which alternative treatment options are inadequate. Limitations of Use. Call Now 1-805-335-6339.
ReplyDeletebuy oxycontin online
Buy Percocet Online which is used to help relieve moderate to severe pain. It contains a opioid (narcotic) pain reliever (oxycodone) and a non-opioid pain reliever (acetaminophen). Oxycodone works in the brain to change how your body feels and responds to pain. Call Now 1-805-335-6339.
ReplyDeletebuy percocet online
In the event that you are hoping to buy Vicodin online or you want Vicodin for sale, Our online drug store is the ideal asset for individuals to get their medications without remedy or any issues or ponderousness. We endeavor to profit each time you shop with us. For the reason that At our online store, you save money and get more. Call Now 1-805-335-6339.
ReplyDeletebuy vicodin online
Buy Norco online Buy Norco online-without prescription,without any hassle with securepharma . We have best panel of doctors registered with us,who is taking care of all formalities like valid doctor’s prescription and all.To buy Norco online please make an order on our website or you can also call our executive. Call Now 1-805-335-6339.
ReplyDeletebuy norco online
Buy Adderall online for Adults and children now without prescription, only at heyleel.com It is a time-released drug so that its effects and benefits are given throughout the day and people who need it can perform well without symptoms from their condition. Call Now 1-805-335-6339.
ReplyDeletebuy adderall online
Buy Xanax online Alprazolam , sold as the trade name Xanax among others, is a short-acting benzodiazepine. It is most commonly used in short term management of anxiety disorders, specifically panic disorder or generalized anxiety disorder . Call Now 1-805-335-6339.
ReplyDeletebuy xanax online
Aivivu - đại lý vé máy bay, tham khảo
ReplyDeletevé máy bay đi Mỹ
vé máy bay tết 2021 giá rẻ
giá vé máy bay đi toronto Canada
vé máy bay đi Pháp giá rẻ
giá vé máy bay từ Hà Nội đi Anh
vé máy bay giá rẻ uy tín
combo đà nẵng giá rẻ
combo quy nhơn tháng 7
visa trung quốc bao nhiêu ngày
At percocetonline, you can safely and secure buy percocet online without prescription. Products are of the best quality from FDA Approved facilities. The packaging is safe and shipping is 100% discreet and delivery is very fast.
ReplyDeleteBuy Percocet Online
Buy Ambien Online
Buy Norco Online
Buy Adderall Online
Buy Xanax Online
Best Sellers Prime Customer Service New Releases Today's Deals Find a Gift Books Gift Cards Kindle Books Fashion Pharmacy Amazon Basics Toys & Games Sell Amazon Home Computers Coupons Video Games Home Improvement Automotive #FoundItOnAmazon ... we offer a number of options for customer support.
ReplyDeleteAmazon customer service phone number
Amazon prime customer support phone number
Amazon prime customer service
Nowwiz
Best Deals at buyonlinekart, an international prescription service provider, which contracts with International dispensaries and USA pharmacies, is a leader in referring orders for prescription and non-prescription medications on behalf of customers throughout the world
ReplyDeletebuyonlinekart
buy hydrocodone online
buy oxycodone online
buy oxycontin online
buy percocet online
buy vicodin online
buy norco online
buy adderall online
buy xanax online
Aivivu - đại lý vé máy bay, tham khảo
ReplyDeletevé máy bay đi Mỹ giá rẻ 2021
các chuyến bay từ mỹ về việt nam hiện nay
vé máy bay đi Los Angeles
chuyến bay thương mại từ canada về việt nam