I am totally new to php (and this forum) but used to code in java a while ago. I have an app I am trying to figure out and the first thing is a simple username/password login page that I can't get the two text fields to show up when I browse to the php page.
It used to work so I am not sure what is going on. Below is all the code that makes up this login php page. But, if you upload this to a web server and try to browse to it, the page appears blank. No text fields show up but should. Is there something in the functions.php file I should be looking at or something? Can someone help me with this please?
<?php
#login page
include('sqlConn.php');
include('functions.php');
if(isset($_POST['submit'])){
$username = $_POST['userName'];
$password = md5($_POST['passWord']);
#check username and password in DB
$query = "SELECT * FROM users WHERE userName='$username' AND password='$password' LIMIT 1";
$results = $db->query($query);
if($results->num_rows == 1){
#successful login processed
$cookieString = encryptText($username);
setcookie('loginCookie', $cookieString, time()+21600);
#$status = 'Welcome<br />';
$sidebar = 'links.php';
}
else {
#unsuccessful login attempt
$sidebar = 'baduser.html';
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Admin Console</title>
</head>
<frameset cols="200,*" frameborder="no" border="0" framespacing="0">
<frame src="<? echo $sidebar; ?>" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />
<frame src="about:blank" name="mainFrame" id="mainFrame" title="mainFrame" />
</frameset>
<noframes><body>
<? echo $status; ?>
</body>
</noframes></html>