Forum Moderators: coopster

Message Too Old, No Replies

Script to enable members to host a profile page on subdomains

         

happy martin

2:12 pm on Oct 17, 2007 (gmt 0)

10+ Year Member



Hi,

I've got a number of domains that are sitting idle. I want to offer members the opportunity to create their own subdomain and to host their own profile page on it.

Ideally I'd like the person to have assistance creating the profile page e.g. with simple ways for them to select a layout template, an upload feature to add photos, wysiwyg editing etc.

Does anybody know of a script that will do this?

Best wishes,

Martin

phparion

10:06 am on Oct 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am not sure if there is any such FREE script out there which does so much for you.

the idea is simple though time consuming when you make it for you. So I will encourage you to try making one for yourself.

dwighty

10:23 am on Oct 19, 2007 (gmt 0)

10+ Year Member



Just out of interest, how would you go about having a form on a website automatically creating a new subdomain?

PHP_Chimp

7:07 pm on Oct 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could use the file [uk3.php.net] functions.
This will not help you with getting a subdomin as that is something done well before the php level, as each subdomain would need need setting up at the server level. All of the sites that I run are on shared servers so there is no way for php to access that sort of root level to add DNS records to the name server.

Could you not just let them create there own directories? As that is something more easily done with the file system and php.

phparion

6:01 am on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You will need your own server for this functionality. A shared hosting plan cannot do this.

You can write shellscripts which creates subdomains by editig http.conf file.

the process will be simple, first you will mkdir to create a folder for the user, then run the shellscript / bashscript to configure the server to point the subdomain.domain.com to your recently created folder for the user.

But for all this you will need a dedicated server.

ashishp

3:00 pm on Oct 23, 2007 (gmt 0)

10+ Year Member



for subdomains, you also setup a wildcard DNS, where all subdomains resolve to a single directory on the web server.

This can be achieved by adding the following line to your zone file:

* IN CNAME www

and

ServerAlias *

to your httpd.conf

Then the index.php in that directory extracts the username from username.example.com and looks up the record from the DB and dislpays the profile page.

All you need to do is make sure there are unique usernames in the database and to return a 404 header if the username does not exist.

HTH