Home Page - Index.php.

Added on -2019-09-21

| 18 pages
| 3297 words

Trusted by 2+ million users,
1000+ happy students everyday

Showing pages 1 to 4 of 18 pages

Home Page - Index.php<?phpinclude_once('connect.php'); //include connection file?><!DOCTYPE html><html><body> <img src="logo.png " alt="logo" style="width:150px;height:150px;"> <head> <link rel="stylesheet" type="text/css" href="css/style.css"> <meta charset="UTF-8"> <title>Poll voting</title> <div class="h1"> <h1>Poll Here and Look at People Thoughts</h1> </div> <div class="h2"> <h2>Free Poll/Voting System that Is Available for Anyone</h2> </div> <!-- adding a clicable button for new page for voting--> <a href="polling.php" class="button"> Create Your Polls Here</a> </head> <header> <div class="header"> <nav class="navigation">
<div class="sign-up"> <?php if(isset($_SESSION['login'])) { ?> <a href="logout.php">log out</a> <?php } else { ?> <a href="login.php">log in</a> <a href="login.php">sign up</a> <?php } ?> </div> <div class="navbar"> <a href="#">Home</a> <a href="#">About</a> <a href="#">Help</a> <a href="#">Contact</a> </div> </nav> <div class="video-container"> <video autoplay loop muted id="video-bg"> <source src="bg.mp4" type="video/mp4"> </video> </div> </div> </body> </header> </html>
Login/SignUp Page - login.php<?phpinclude_once('connect.php'); //include connection fileif(isset($_POST['login'])) { //if user login $uname = $_POST['username']; //get username from the form $password = $_POST['password']; //get password from the form $qryChkData = mysql_query("select * from users where username='".$uname."' and user_password='".$password."'"); // query for check login //check for login $rowNum = mysql_num_rows($qryChkData); if($rowNum > 0) { $_SESSION['login'] = "Success"; header('location:polling.php'); //go to polling page } else { $_SESSION['msg'] = "E-Mail or Password Is not Correct"; //message for incorrect e-mail or password }}if(isset($_POST['signUp'])) { //if user click on signup $uname = $_POST['username']; //get username $email =$_POST['email']; //get email $password = $_POST['password']; //get password $qryInsertData = mysql_query("insert into users (username, user_email, user_password) values ('".$uname."', '".$email."', '".$password."')"); // query to signup
if($qryInsertData) { $_SESSION['login'] = "Success"; header('location:polling.php'); } else { $_SESSION['msg'] = "Error In Sign Up"; //error message for invalid login details }}?><!DOCTYPE html><html><head><title>Poll voting</title> <link rel="stylesheet" type="text/css" href="css/style.css"></head>

Found this document preview useful?

You are reading a preview
Upload your documents to download
Become a Desklib member to get accesss

Students who viewed this