Jump to content

CREATING SUB DOMAINS


Net123

Recommended Posts

hello i am making a script that means a like "blog creator" now i am having trouble in creating sub domains don't wanna do it with wild cards and .htaccess tricks ...it can be made some errors and i can't send queries about the user the their folder means(sub domains) if i sended query string for identify the site then no anyone would like my site ..so i wanna create sub domains with script some of they mading this way and i am fell 'good in create sub domains using php i googled about this script but i can't the script or tutorials anywhere so i posted my question here anyone could help me ? i am using cpanel 11 version

Link to comment
Share on other sites

If your host allows it then cPanel has an API that you can use to create a subdomain. There's also the issue of DNS though, you still need to update the DNS records for your domain to point the subdomain to the correct IP. http://docs.cpanel.net/twiki/bin/vief/SoftwareDevelopmentKit/WebHome#cPanel WHM's API

Link to comment
Share on other sites

i just wanna create folder's like "how cpanel submoain creator" i sit needs to add dns records ??i am not saying about how to create subdomain from web host manager "like account" my grammer could be little wrong b'coz i dont know much

Link to comment
Share on other sites

I'm not sure what you're asking. Again, you can use cPanel's API to create a subdomain, and you also need to update your DNS records to point the new subdomain to your server. You said you don't want to use wildcards, so that means you have to update DNS records every time you add a subdomain. If you used a wildcard record then you wouldn't need to do that.

Link to comment
Share on other sites

oh are u saying about the api of cpanel......if i used this cpanel apihttps://github.com/CpanelInc/xmlapi-php/blob/master/xmlapi.php andrequire_once('xmlapi.php.inc'); $xmlapi = new xmlapi('127.0.0.1'); $xmlapi->password_auth('root','password'); $xmlapi->set_debug(1); print $xmlapi->api1_query('accountname','SubDomain','addsubdomain',array('sub','domain.com',0,0,'/public_html/folder')) is it wil create subdomains in my server and will keep my dns ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...