How to create web separate pages for user profiles using PHP and mySql? URL rewriting? -


i trying figure out best way/how go -

i relatively new mysql , php , need create user profile pages display different values mysql database have been uploaded each user -

for example if clicked on john's profile, page display john's name, age, other values have stored on john in mysql table. perspective of else logged in wants view john's page.

since index.php files different web pages in own folders (i.e. page, settings page, etc) thought have user profile folder , index.php outputs right information in accordance $user_id of user clicked. way can think accomplish this.

my problem not allow person access user profile via url (i.e. website.com/user1) , not sure approach best/correct way create user profile pages. have explored this question , read on url rewriting still unclear -

what correct way create separate user profile web pages , how url rewriting tie actual contents of page's index file?

is there way (this poorly worded) store separate index.php file each user within existing mysql column , direct file when clicked?

hard answer without knowing how structure of application looking.

but common way, , simple implementation to:

  • create profile.php (profile-action in user-controller or whatever..)
  • add user-id url, yourapplication/profile.php?userid=12
  • in profile.php fetch data belongs given userid (first validate id etc...)
  • fill html fetched data

so in short: create view, fill in dynamic data depending on userinput


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -