Add to Google

How To Create Subdomain Using Php? - creating subdomain automatically after signing up

free web hosting
Open Discussion > CONTRIBUTE > The Internet > Web Design

How To Create Subdomain Using Php? - creating subdomain automatically after signing up

dragonfang00
Hi everyone,

i really don't know if this is the right place, so please just move this to the right category..

now here's my problem:

I want to create a website for my high school batch graduated last 2004 so we can interact to our old friends. but i want it to be like ning.com, myspace.com or friendster.com that you can add your own layout (css) for your profile and putting the new user in it's own profile page (using a subdomain for their own profile page)

can anyone tell me how to automatically create the subdomain and putting the CSS and other files in the subdomain automatically? thanks in advance..

Comment/Reply (w/o sign-up)

shadowx
I dont think there is a way to add the subdomain using PHP, however it may be possible to set up your host to redirect subdomains so that if i went to blah.yourhost.com it would redirect to: yourhost.com/blah even though the "blah" subdomain doesnt actually exist.... if that makes sense?


Comment/Reply (w/o sign-up)

minimcmonkey
I don't think there is a way, unless you have specific software for things like reseller hosting on your host management.
On thing to do, would be to set up your 404 error page, so that it breaks down the URL, and checks if there is a subdomain on it, then checks if that is a user name, if so, it redirects to that users page(s)

Comment/Reply (w/o sign-up)

anwiii
QUOTE(dragonfang00 @ Nov 4 2008, 01:40 AM) *
I want to create a website for my high school batch graduated last 2004 so we can interact to our old friends. but i want it to be like ning.com, myspace.com or friendster.com that you can add your own layout (css) for your profile and putting the new user in it's own profile page (using a subdomain for their own profile page)

can anyone tell me how to automatically create the subdomain and putting the CSS and other files in the subdomain automatically? thanks in advance..


basically you want to automatically create pages when people sign up. you don't need to automatically create sub domains to do this though. you do however need to automatically create directories for each individual user signup. is there a reason why you would want to create individual subdomains rather than individual directories?

now to answer your question, i believe there are simple scripts floating around here and there for $100 or so which will do what you want. if you need more advanced programming, i suggest hire a programmer. other than that, i hope someone someone can answer your question better because i would love to look at a script that does this.

 

 

 


Comment/Reply (w/o sign-up)

galexcd
What you can do is add a new wildcard subdomain. You can do this with DNS management like the tutorial I linked to below tells you to, but if you do not have access to your DNS management you can just add a new subdomain in your cpanel. To make it wildcard just add *.yourdomain.com. After doing this give the server some time to update, but if you did it right any subdomain you go to should return the same output as your root domain name (i.e. your index page).

After you add *.yourdomain.com create the .htaccess file below, and then all you have to do is have php make new directories in your root folder with the dynamic subdomain you want.
QUOTE
This code should be placed in the htaccess file in the root of your domain, i.e. domain.com/.htaccess

CODE
<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   Options +Indexes
   RewriteEngine On
   RewriteBase /
   RewriteCond %{HTTP_HOST} !www.domain.com$ [NC]
   RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).domain.com [NC]
   RewriteRule (.*) %2/$1 [L]
</IfModule>
[/quote]


Source

Comment/Reply (w/o sign-up)

dragonfang00
QUOTE(anwiii @ Nov 5 2008, 12:55 AM) *
basically you want to automatically create pages when people sign up. you don't need to automatically create sub domains to do this though. you do however need to automatically create directories for each individual user signup. is there a reason why you would want to create individual subdomains rather than individual directories?

now to answer your question, i believe there are simple scripts floating around here and there for $100 or so which will do what you want. if you need more advanced programming, i suggest hire a programmer. other than that, i hope someone someone can answer your question better because i would love to look at a script that does this.


well, i can do this but I don't know the code.. I don't really need to hire a programmer because I can actually do it.. the thing is I don't know the code for the automatic creation of subdomain/directories and putting/creating the files in that directory..

QUOTE(galexcd @ Nov 5 2008, 01:09 AM) *
What you can do is add a new wildcard subdomain. You can do this with DNS management like the tutorial I linked to below tells you to, but if you do not have access to your DNS management you can just add a new subdomain in your cpanel. To make it wildcard just add *.yourdomain.com. After doing this give the server some time to update, but if you did it right any subdomain you go to should return the same output as your root domain name (i.e. your index page).

After you add *.yourdomain.com create the .htaccess file below, and then all you have to do is have php make new directories in your root folder with the dynamic subdomain you want.
Source


thanks.. I'll try it on my host and if I can do it i'll use it on my project.. XD thanks a lot..

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Recent Queries:-
  1. create subdomain php - 203.69 hr back. (1)
  2. create sub domain like myspace php - 260.73 hr back. (1)
Similar Topics

Keywords : create, subdomain, php, creating, subdomain, automatically, signing

  1. Creating A Floating Javascript Docking Menu
    (1)
  2. Creating A Fully Featured Cms
    I am in the process of creating a fully featured CMS and need help (0)
    Hello, my name is Derek and I am in the process of creating a CMS. My CMS will be slightly different
    than most, because I am creating it for business purposes. I own a business, Black Development &
    Produktionz, LLC. and I am creating all of my own services that I will need, such POS (web based to
    be integrated with virtually any OS), a scheduling system (for appointment and so that my client
    will be able to schedule based on open time slots), an emailing system (which I know will require
    more than effort than a normal CMS because it will depend on hosting and so forth), ....
  3. Creating A Good Website, How?!
    (19)
    Creating a good website, How?! I looked at many forums, searching on now to create a good website,
    by good I meant good website interface. For example, Trap17 have this amazing flash header, and nice
    design… I searched and searched, I found that many people started with a photoshop picture, then
    they make it come true by requesting a website coder (A.K.A. Programmer) to code the whole website
    for it. If, I said if, I were good a art, I can design a good nice picture off photoshop, and I
    know how to code, does that means I can make a good website? Please post any comm....
  4. Help Creating A Profile Website
    how do i make a profile website (17)
    Ok this is my idea: I am making a website about anime. Its function is add anime, review anime,
    search anime, anime information. Users can make a profile. People can make a profile which they can
    edit to theire likes with html to give it a fancy look.(this is what my problem is about) What i
    would like to know is how can i accomplish this. I already have the database for the anime titles
    etc ready, the only thing that needs to be done is the profile section. If you have any tutorial,
    tip or guide i would really really appriciate it. Thx in advance. ....
  5. I've Given A Friend A Subdomain
    I need a cPanel (3)
    Hi there a friend of mine was absolutely desperate for a webpage so, me being the kind but stupid
    person that I am, made him a sub-domain, and set up the ftp account. However if he wants to install
    something in the future that uses Mysql I have to make him a database and a user etc, etc My
    question is, is it possible to give him something like cpanel? could i install it on the sub-domain?
    So that he can have controls like mysql, file manager, site submission? If it is possible, It needs
    to be VERY cheap! free is ideal! I think I've found a file manager but it'....
  6. What Do You Prefer? A Subdomain Or A Url With A Folder Name?
    (16)
    Hi everyone, please see the poll and respond! Let me elaborate here, say if there was a website,
    the url itself was around 6 or 7 letters long such as trap17.com, that sort of length, now would you
    prefer to see a subdomain on this site, such as sub.site.com or have a folder name in the URL like
    site.com/sub, I want the URL to be as easy to remember and as catchy as possible and im not sure
    which method would give the best results here. In line with my last post i would appreciate any
    links to a website where i can find information like this. But please respond to my ....
  7. Creating A Site For Web Design/development.
    (4)
    Hey I've been thinking about starting my own website for website design/development. I can think
    of many different ways I could do this but I'm looking for the fastest, most simple, and most
    effective way of programing it. So let me explain what I want to do with this site. First off I
    will be selling websites, both custom and template. I need to know the best way for people to pay
    for them. I don't know if I should use pay pal or what. I don't have any expirience in that
    area. I also want to try to buy a server and host websites myself. Now I know how ....
  8. A Quick Guide To Creating A 'blog' Website
    I use the term 'blog' in the loosest sense of the word (1)
    Hello all, first post here, nice idea you've got going with the whole credit thing /smile.gif"
    style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> So i thought i'd do my
    bit and write up a quick tutorial on what i've found with my time on the net. Before we start,
    i'd just like to say that when i say 'blog', dont think of a site where all you can do
    is type up your life. No. What I mean is intergrating a program into your site that allows you to
    post news with ease while still still being able to keep the site open to other t....
  9. Where Can Ii Get Free Good Subdomain Hosting
    Where can iI get free good subdomain hosting (2)
    I want persons to help me and other persons out by making a list of were we can get good subdomain
    hosting from. addyour.net orgfree.com netfirms.com www.guyanadesign.noads.biz And this will be a
    direct violation of the TOS. See, you should've read the rules first. Now I have to issue a
    ban. More paperwork... ....
  10. Give Me Suggestions
    creating a site (7)
    i am creating a site which aims at webmasters and internet addicts . i need tips on which service
    should i provide through my site so that they keep coming back. also suggest any good scripts which
    i can use in my site.....
  11. Tips On Creating Your Own Search
    PHP/MySQL Integrated search on your site (1)
    I'm not a professional web developer but I've learned a lot since I used Macromedia
    Dreamweaver. The latest version 8 supports PHP 5. If you select PHP as your working language, you
    can use this software to automatically add dynamic content to your website with MySQL as a
    requisite. If you have a MySQL database containing records like a songs information database, then
    you might probably not be able to add a good search page to your website which will search records
    in the database. I faced the same problem, but now I'm able to create one sophisticated datab....
  12. Creating Login To Your Web Site
    (13)
    I am really interested in creating the login for my web site. I have no experience in data base
    building but if some one has good tutorials about how to create the database and setup everything
    for the login, please post the information in here. Specifically I'm interested in setaild
    description of HOW TO CREATE A DATABSE, HOW TO CONNECTED TO YOUR web hosting, WHICH SPECIFIC
    PROGRAMS you need to make it and other usefull info regarding the setup. Thank you very much....
  13. Creating Cateories With Unlimited Sub-categories
    (1)
    This tutorial will show you how to create a script so that you can have multiple categories with
    unlimited sub-categories in each. They can be as deep as you want. This is very useful for
    organising data/items. A prime example of this is a link directory which has multiple categories.
    QUOTE Ok first of all I will just briefly explain how this will work - the logic behind it. I will
    then move on to writing the actual script which will manage the categories and put specific
    data/information into its category. The Logic Behind Categories If youve got a fairly decent a....
  14. Blog Or Forum?
    And can anything post automatically to the board? (10)
    As I get closer and closer to launching my personal website I am looking for the final puzzle piece
    to link everything together. What I would like to accomplish is a posting board that sends “new
    message has been posted, click here ” each time when I post a new message. This posting board is
    not necessary open to the public, as it is intended to submit new articles only by internal site
    managers. I would like this posting board to have online submit form or, if possible, receiving it
    via email and posting automatically. The posting board would only have less than 8 cate....
  15. Move/delete Image On Webpage Automatically?
    (2)
    Hi, Im creating a website that sells carpets and basically ive created webpages with the picture and
    checkboxes underneath the pictures so users can select which carpet they want! Once they submit the
    form, we get the order including form details! The problem is that once the user checks the
    checkboxes, i want to be able to delete that image from that webpage or move that picture to another
    location in the folders i have stored on the server. The reason is becuase evry carpet is unique so
    that two people cant order the same carpet! Now wat is the best way 2 do this..... ....

    1. Looking for create, subdomain, php, creating, subdomain, automatically, signing

Searching Video's for create, subdomain, php, creating, subdomain, automatically, signing




advertisement



How To Create Subdomain Using Php? - creating subdomain automatically after signing up