I am currently working on a social networking website, and I would like the user to be able to enter the web address of another user and be redirected to his profile. The thing is, every existing user has a column in a mySQL DataBase, which specifies what page templates does he use, and the data to be inputted into this template. How can i Possibly make it so that when he inputs of example : http://www.emuze.co/users/@bob_marly (it can have a .PHP/ .HTML suffix after it), the website will query the Database, find the template, redirect to that templates page (e.g. http://www.emuze.co/temps/temp1.0.php) and use the users that a from the mySQL Database?
I know its a very long and complicated question, but i would really appreciate any help!
thanks a lot! :@
I am currently working on a social networking website, and I would like the
Share
You should give each user a row instead of a column, within a table that specifies which template is used for each user.
For example, you would have the “templates”-table, with the columns “UserID”, “Username” and “Template”. Then, the table would look something like this:
…and soforth.
Then you’d have to query which template a user has. For example, to know which template the user with UserID ‘3’ uses, assuming your mysql connection resource is stored in the variable $link:
$row[‘Template’] will result ‘temp1.0’ which you could use for including a specific CSS-stylesheet, including specific PHP-files or whatever, but you can also retrieve all other user-specific information such as $row[‘Username’]. No need for redirections.