MySQL Forums
Forum List  »  PHP

PHP noob. Creating Login.php
Posted by: D F
Date: August 17, 2016 01:01PM

I'm newly into an intensive 8 week program for using PHP and MySQL. I've been asked to create a database, this, that, and the other thing. Our professor is very hands off. So I need guidance!

The part of the assignment that I'm stuck on is this:

You need to create a new page called login.php, where you can enter your Emp_ID and Emp_Password. After clicking submit, it should then take the values you have entered and query the Employee table for them.

The coding I have that I'm struggling with is this:

________________________________________________________________

<?php
include("DF_Employee.php");

if($_SERVER["REQUEST_METHOD"] == "POST") {
$Emp_ID = mysqli_real_escape_string($db,$_POST['eid']);
$Emp_Password = mysqli_real_escape_string($db,$_POST['eps']);

$sql = "SELECT id FROM login WHERE empid = '$empid' and password = '$epass'";
$result = mysqli_query($db,$sql);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
$active = $row['active'];

____________________________________________________________________



With include("DF_Employee.php"); it displays all of the text at the top of my page. I don't want to display the text. So I wrote include("employee.sql"); which is just as unhelpful. I definitely need some guidance as to where this information should be pointing.

Options: ReplyQuote


Subject
Written By
Posted
PHP noob. Creating Login.php
D F
August 17, 2016 01:01PM
D F
August 17, 2016 03:23PM
D F
August 17, 2016 09:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.