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


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

7 Years
Discussion Span
Last Post by diafol

You need to create a page in (x)html. And have your "placeholders" (variables) output data from a file or DB. E.g.

<p>Name: <?php echo $dbdata['username'];?></p>

There are a few ways to do this - also see "heredoc" in the php manual.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.