Jump to content

Making site more dynamic


alang

Recommended Posts

Hi All,

just a bit of an overview to the way my site is at the moment - Currently user's sign up for their own personal area which will be located at mydomain.com/uname. For each signup I create a database for them and manually create the folder and upload the files. This was fine at the start and everything does work perfectly and I have created some scripts to go someway to automating the process but the site now has hundreds of members and if I do an update or add a new feature i have to drag and drop it into each user directory which is now a very tedious task.

 

Now I want to change this and make the site completely dynamic so that the members are all using the same source files. I was thinking that all the current files would need to remain but instead of having content they would just include the file from somewhere one level up so for example mydomain.com/uname/index.php would just contain include '../sourcefiles/index.php' and then to add features or do an update I would only have to update sourcefiles/index.php or whatever file needed updating. I can't help but think that while this would work, there must be a better way to do it??

 

Can anyone offer any words of wisdom? Thanks for any help given!  :)

Link to comment
Share on other sites

if you'd like to hire me to do it for you, that'd be good for me, however, if you want to do it yourself..

 

You could just put an htaccess file in your main directory like:

 

mydomain.com/

 

and in there the .htaccess file

 

THEN inside that you do

 

RewriteEngine On

RewriteCond %{REQUEST_URI} !-d

RewriteCond %{REQUEST_URI} !-f

RewriteRule ^(.*)$ user_index.php?query=$1

 

and then in the PHP to actually parse the string as it could be you use $_SERVER['QUERY_STRING'] and then you get after the 'query=' and then seperate by '=' and then parse them into your own GET array, I think $_POST should still be sent or carried over by the rewrite..

 

and then in user_index.php you handle all the data, and it WILL simulate the look and feel of your already existing system, except instead of hundreds of folders, you'll just have 1 file accessing 1 folder, or no folders, depending on how you code it :)

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.