05-27-2009, 09:06 AM
|
#2 (permalink)
|
|
The Contributor
Join Date: Oct 2008
Location: UK
Posts: 30
Thanks: 0
|
Thats not really the most efficient way of creating a user based site, think if you had 100 users, would you like all of them to have a page each. You would have one page for the users, in which the content would change dynamically depending on the user.
However to do what you asked, one solution might be:
PHP Code:
$con = mysql_connect(localhost,username,password) or die (mysql_error()); mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM Persons");
while($row = mysql_fetch_array($result)){ $userPage = $row['UserPage']; }
header('Location: $userPage');
This is part of the login code. When the user signs up, you would need to create a new page with the appropriate content then put the url to that page in the database along with the username and password. That way when a user logs in you can retrieve the url and redirect them to their own page.
Like I said, a single page with dynamic content would be better for a site with multiple users. :)
|
|
|
|