Ask a question from expert

Ask now

Desklib - Online Library for Study Material with Solved Assignments, Essays, Dissertation

18 Pages3297 Words356 Views
   

Added on  2019-09-21

About This Document

Desklib is an online library for study material with solved assignments, essays, dissertation, etc. Get access to a wide range of study material for various subjects and courses. The website has a free poll/voting system that is available for anyone. Users can create their polls and look at people's thoughts. The website has a login/signup page for users to access the study material. The website has a polls page where users can create polls. The website has a question page where users can choose any question. The website has an answer page where users can submit their answers. The website has a result page where users can see the results of the poll.

Desklib - Online Library for Study Material with Solved Assignments, Essays, Dissertation

   Added on 2019-09-21

BookmarkShareRelated Documents
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">
Desklib - Online Library for Study Material with Solved Assignments, Essays, Dissertation_1
<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>
Desklib - Online Library for Study Material with Solved Assignments, Essays, Dissertation_2
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
Desklib - Online Library for Study Material with Solved Assignments, Essays, Dissertation_3
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>
Desklib - Online Library for Study Material with Solved Assignments, Essays, Dissertation_4

End of preview

Want to access all the pages? Upload your documents or become a member.