Hello i am working on a project to create a wiki site and i have to create a profile page where it displays the username and a list of pages they can view and a seprate list of pages they can view and edit. i have no idea how to create this profile page. i already have created the login script i have taken out the name of the dbhost,user and password to show you on here i do have the real host,user and password filled in on the script on my computer
<?php
if(!$_POST['username'] | !$_POST['password']) {
die ('You did not fill in a required field. Please Go back to the login page');
header('Refresh: 5; URL=login.php');
}
$dbhost = 'host_name';
$dbuser = 'user';
$dbpass = 'password';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'dbname';
mysql_select_db($dbname, $conn);
$username = $_POST['username'];
$password = sha1($_POST['password']);
$sql = "select * from users where username='$username' and password='$password'";
$result = mysql_query($sql, $conn);
if (mysql_num_rows($result)!= 1) {
echo "Login failed"; }
header('Location: blank.php');
// } else {
// $_SESSION['username'] = "$username";
// $_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
// include "profile.php";
?>
Also the table that username is in is users and the table that contains page_name is web_pages