Jump to content

Once Member Register creates page


DeCarlo

Recommended Posts

Hello Coddy Guys,im trying to do simple website creator

Maybe i don't have Disease Centres probably do not have the imagination to do

or something else. I wan't to do.

when member is registered and he got template that chosed in registration.

how to create new folder with users template.

Maybe you got it.

Thanks.

Link to comment
Share on other sites

You shouldn't create a file each time a member registers.

 

Instead, you should have one file that takes the users ID in the query string, and displays the details you'd like based on that ID. Check out the $_GET superglobal array.

 

Then again, you may actually need a user to have his/her own folder, in which case Adam's posts will be relevant.

Link to comment
Share on other sites

Let me get this right, are you allowing your users to choose the template or there is only one default template?

 

Best way is to create a folder for each user and copy the files to it.

 

If the there is only one template,

 

<?php

// includes your necessary files
include_once('include/database.php');
include_once('process.php');

// Gets the username
$user = $_GET['reuname'];

// specifies the folder where you want the folder to be created & the user folder.
$folder = "thefolder";
$userfolder = $folder . "/" . $user;

// makes the directory and copy the template.
mkdir($userfolder);

// specifies the template location.
$template = "template/default.php";

// specifies the index file for the user.
$userfile = $userfolder . "/index.php";

copy($template, $userfile);
?>

Link to comment
Share on other sites

If you want the user to be able to choose the template. just change the template.

<?php

// includes your necessary files
include_once('include/database.php');
include_once('process.php');

// Gets the username
$user = $_GET['reuname'];

// specifies the folder where you want the folder to be created & the user folder.
$folder = "thefolder";
$userfolder = $folder . "/" . $user;

// makes the directory and copy the template.
mkdir($userfolder);

// get the template and specifies the template location
$template = "template/" . $_GET['tpl'] . ".php";

// specifies the index file for the user.
$userfile = $userfolder . "/index.php";

copy($template, $userfile);
?>

Link to comment
Share on other sites

Ok or maybe i can do with wildcard user gets 2nd domain

like james.qwerty.com,and then users register gots template

he can edit template Texts and something more.

i see in future that user can turn and turn off some advances.

Thanks for the replays.

Link to comment
Share on other sites

Best way is to create a folder for each user and copy the files to it.

 

I disagree. Let the user choose their template from a list of available templates and store the selection. Then you can dynamically include() the correct template at run time. No need to copy identical files all over the server.

Link to comment
Share on other sites

DeCarlo, no need to pm me to ask a question regarding a response I have made in your thread. Just ask your question in the thread.

 

Anyway, the process of implementing what I suggested above is very simple. When you register the person you would have to store their information some where. I will assume you are using a database. In that database you simply create a field to store the template the user selected during the registration process. You can either store the actual file name of the template they chose or create a table in the database for the template info and then you would store the ID of the template they chose. There are benefits and drawbacks to both methods.

 

Then when the user logs in you can retrieve their selected template from the database and store the name in a session variable. Then use that session variable wherever you need to use the template.

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.