0

By custom user links, i mean like for example when a user registers to the website, a page is created specifically for that user with a link.

For Example

https:/domain.com/users/customerName

Then after creating the link, the website will automatically customize the website by using a clone of a specific webpage.

*Btw i've already took Care of the Login/Register part. I just need to know how custom user links would work.

TarangP
  • 2,711
  • 5
  • 20
  • 41
  • 1
    You use a database to hold the data for each user. By creating a custom ID for each user and binding it to a login, when a user goes to his profile page you can use PHP to fetch all the data needed and fill the page with the gathered information. – Granny Dec 22 '17 at 12:45
  • 1
    Have you ever Seen this ? http://www.htaccess-guide.com/ – TarangP Dec 22 '17 at 12:54
  • You could have a PHP script that creates a folder.. but I'm not sure what you mean with a clone of a website. Sounds complicated. Whats the idea? – putvande Dec 22 '17 at 12:57
  • This link could help you https://stackoverflow.com/questions/812571/how-to-create-friendly-url-in-php – Nitin Dhomse Dec 22 '17 at 13:01
  • You might also want to consider using the users *id* or some other generated unique id instead of the users name. Because what do you do when two users have the same name? – kscherrer Dec 22 '17 at 13:23

3 Answers3

2

Option 1: example.com/user

Use a single PHP file and an .htaccess file. Check out How to create friendly URL in php?

Option 2: user.example.com

Create sub-domains for each user, also uses .htaccess. Check out How to let PHP to create subdomain automatically for each user?

Option 3: example.com?user=name

Create a single php file and use $_GET parameters. This is the most usual and easiest way to customize the website based on the user who registered and logged in. (usually using user ID number: example.com/profile.php?user=71)

Of course there's also Session handling.

Jay A. Little
  • 3,239
  • 2
  • 11
  • 32
0

I think you searching for URL rewriting concept. If user login the page no need to clone the page.you could access the same page with this user data and specification(dynamic page).Many the page content with php functions

URL rewriting

you could the function in .htaccess if user enters the page

http://example.com/someuser

its rewrite the url with

http://example.com?q=someuser

if you see the url bar its like special page for the user.

prasanth
  • 22,145
  • 4
  • 29
  • 53
0

It's actually fairly simple. You just use GET within PHP and the URL would be something like http://example.com/user?id=4453623 - If you've ever been on facebook you'll notice they use PHP for the profile pages and much other things too. If you go to your profile page, you'll notice a "id=" variable up in the URL and that's how they determine which profile page to display to you.

This is basically what @Granny commented.