HostNode.com :: HostSeeker's Talk
Home Register FAQ Members List Calendar Mark Forums Read
Go Back   HostNode.com :: HostSeeker's Talk > Main Forums > Webmasters Chit Chat > Profiles
Reply
 
LinkBack Thread Tools Rate Thread Display Modes
(#1 (permalink))
Old
thejib thejib is offline
Registered User
thejib is on a distinguished road
 
Posts: 15
Join Date: Jan 2004
Profiles - 01-25-2004, 04:26 PM

I am trying to make a profile system for my website, so that each user has their own profile...

I want to be able to put into my browser:

http://www.jiblob.com/profile?profileid=18 and have the profile for the user with user_id which is 18 to show up show up...

I am new to PHP, and I have only just started to make my own codes, becaus eI think that I am getting to grips with it... I have made this code:

Quote:
<?php
include ('http://www.jiblob.com/header.inc');
$page_title = 'Viewing Profile';

if (isset($profileid) > 0) {
$id = "$profileid";
echo "$id";

// Connect to the Database
// This file contains the database access information. This file also establishes a connection to MySQL and selects the database.

// Set the database access information as constants.
DEFINE ('DB_USER', 'ds');
DEFINE ('DB_PASSWORD', 'dsagffdg');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'dsagfdg');

if ($dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD)) { // Make the connnection.

if (!mysql_select_db (DB_NAME)) { // If it can't select the database.

// Handle the error.
my_error_handler (mysql_errno(), 'Could not select the database: ' . mysql_error() );

// Print a message to the user, include the footer, and kill the script.
echo '<p><font color="red">The site is currently experiencing technical difficulties. We apologize for any inconvenience.</font></p>';
include_once ('http://www.jiblob.com/footer.inc');
exit();

} // End of mysql_select_db IF.

} else { // If it couldn't connect to MySQL.

// Print a message to the user, include the footer, and kill the script.
my_error_handler (mysql_errno(), 'Could not connect to the database: ' . mysql_error());
echo '<p><font color="red">The site is currently experiencing technical difficulties. We apologize for any inconvenience.</font></p>';
include_once ('http://www.jiblob.com/footer.inc');
exit();

}

// End of Connection code

$query = "SELECT username, first_name, last_name, email FROM userdata WHERE user_id='$id'";
$result = @mysql_query ($query);

if ($result > 0) {

echo '<table width="98%" border="1">';
echo '<td><font face="verdana" size="3">', $row[0]; '</td>';
echo '</table>';
}
}
?>
and It is supposed to show the username. The page does show up, but just doesnt work...

I think it is to do with:

Quote:
$query = "SELECT username, first_name, last_name, email FROM userdata WHERE user_id='$id'";
and:


Quote:
echo '<td><font face="verdana" size="3">', $row[0]; '</td>';
Help would be much appriciated :)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +2. The time now is 05:57 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0
vB.Sponsors
© 2003 - 2007 HostSeeker.com - All rights reserved