Help - Search - Members - Calendar
Full Version: Unique Member Page
Zymic Webmaster Forums > Zymic Free Web Hosting > Tutorials
uncled1023
ok, here comes another one!! This tutorial will help you to make a unique members page for each member of your user system. It will also allow other members to view that members page along with thier own.

1)open your members.php file
2)under the <body> add the following code:
CODE
<?php

require 'db_connect.php';

if ($article = $_GET['art'] == $_SESSION['username']) {
?>
Welcome to your member profile!  This is where you can edit your information, check your mail, compose a new message, and delete your account.
<table align="center" border="1" cellspacing="0" cellpadding="3">
<tr><td>
<?php
$article = $_GET['art'];
echo "Username: ",$article;
?></td></tr>
<br><br><tr><td>
<?php
$article = $_GET['art'];
$qry = "SELECT show_email FROM users WHERE username = '".$article."'";
$show_email = $db_object->query($qry);
$db_show_email = $show_email->fetchRow();
if($db_show_email['show_email'] != 1) {
?>[You have chosen not to show your email]
<?php } else {
$article = $_GET['art'];
$qry = "SELECT email FROM users WHERE username = '".$article."'";
$email = $db_object->query($qry);
$db_email = $email->fetchRow();
echo "Email: ",$db_email['email'];
}
?>
<br><br></tr></td><tr><td>
<?php
$article = $_GET['art'];
$qry = "SELECT website FROM users WHERE username = '".$article."'";
$website = $db_object->query($qry);
$db_website = $website->fetchRow();
echo "Website: ",$db_website['website'];
?><br><br></tr></td><tr><td>
<?php
$article = $_GET['art'];
$qry = "SELECT regdate FROM users WHERE username = '".$article."'";
$regdate = $db_object->query($qry);
$db_regdate = $regdate->fetchRow();
echo "Registration Date: ",$db_regdate['regdate'];
?><br><br></tr></td><tr><td>
<?php
$article = $_GET['art'];
$qry = "SELECT location FROM users WHERE username = '".$article."'";
$location = $db_object->query($qry);
$db_location = $location->fetchRow();
echo "Location: ",$db_location['location'];
?><br><br></tr></td></table>




//edit your website

<a href="YOURWEBSITE/logout.php">Log Out</a>
<?php


}



else {  
?>
<table align="center" border="1" cellspacing="0" cellpadding="3">
<tr><td>
<?php
//Get the value
$article = $_GET['art'];
echo "Username: ",$article;
?>
<br><br></tr></td><tr><td>
<?php
$article = $_GET['art'];
$qry = "SELECT show_email FROM users WHERE username = '".$article."'";
$show_email = $db_object->query($qry);
$db_show_email = $show_email->fetchRow();
if($db_show_email['show_email'] != 1) {
?>[You have chosen not to show your email]
<?php } else {
$article = $_GET['art'];
$qry = "SELECT email FROM users WHERE username = '".$article."'";
$email = $db_object->query($qry);
$db_email = $email->fetchRow();
echo "Email: ",$db_email['email'];
}
?>
<br><br></tr></td><tr><td>
<?php
$article = $_GET['art'];
$qry = "SELECT website FROM users WHERE username = '".$article."'";
$website = $db_object->query($qry);
$db_website = $website->fetchRow();
echo "Website: ",$db_website['website'];
?><br><br></tr></td><tr><td>
<?php
$article = $_GET['art'];
$qry = "SELECT regdate FROM users WHERE username = '".$article."'";
$regdate = $db_object->query($qry);
$db_regdate = $regdate->fetchRow();
echo "Registration Date: ",$db_regdate['regdate'];
?><br><br></tr></td><tr><td>
<?php
$article = $_GET['art'];
$qry = "SELECT location FROM users WHERE username = '".$article."'";
$location = $db_object->query($qry);
$db_location = $location->fetchRow();
echo "Location: ",$db_location['location'];
?><br><br></tr></td></table>

//edit your website


<a href="YOURWEBSITE/logout.php">Log Out</a>
<?php

}

?>


That is it!! now you have a form that will tell your user all the information that he has in the database, and will allow other users to view that persons profile!!

REMEMBER!!!!
on any link to your members site, you must have the code look like this:
CODE
<a href ="<?php require 'db_connect.php';
echo "/members.php?art=",$_SESSION['username'];
?>">Members only</a>


and always in any page that uses the user database, make sure the following code is above the <head> tag:
CODE
<?php
require 'db_connect.php';
?>


Thank you all and good night!
wozzym
g00d job smile.gif
Banjo
Iv got the edit profile page working for uncled1023, he may release the source for that if any one wants it.
oziyn
another great tut by uncled1023

buddy ur awsome.....it wud be nice to talk to u 1 on 1 once......i have thousands of questions lol
uncled1023
lol, sure. if you have msn messenger, mine is uncled1023@hotmail.com or aim is uncledisback
oziyn
ok cool il add u then
Liqfan
Nice tut! Appreciate you sharing it, but not for absolute beginners biggrin.gif Since it's just copy/paste for noobies (referring to me mostly tongue.gif), we don't actually learn anything about what does what. But hey, it's far more than what I can do, so great tut !
Dragonius
Can you release the source for the edit page as well?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.