Jump to content

Creating php pages on the fly.


lifeasalounge

Recommended Posts

I am creating a website for travel journals. A user signs up and they get their own mini website that contains a journal, photo album and map. I am having a problem. When a user signs up, the pages of their website are copied from a default folder to their own folder. The problem is, i am not sure how i can embed thei user id into the pages on the fly so that when someone opens their website, the page retrieves journal entries and photo albums that are linked to their user id.

Does anyone know how i can go about this? Just to make it clear, i am trying to create pages or copy pages on the fly, but they need to contain a user id but i am not sure how to get the user id embedded into the page if each page is just copied from a default.

Thanks.
Link to comment
Share on other sites

I am doing something similar to this. I'm not sure if this will help, but I'll try to make a suggestion.

I have a page that is being used as a template to output different games. What I am doing is putting the name of the game in the URL such as

[code]www.mysite.com/page.php?id=name[/code]

I'm sure you probably have a Session variable with the user name is it, so you could even use the session variable to define what the name is in the URL. Now on the template page, you can say:

[code]$name =$_GET['id'];[/code]

and then pull from your database where the name is equal to the user name assuming you are using the id as the username. Hope that helps.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.