Help - Search - Members - Calendar
Full Version: Auto subdomoain creation
Hostony Board > General Support > General Support
jasonwhat
I'm running a script on my site utilizing the xaraya cms-mysql that will allow users (charity organizations) to set up a user site. The short url will look like www.mywebsite/username . I was wondering if there is any way to have a subdomain created automatically when a new user registers for a page that would look like subdomain.website.com Similar too what happens on blogger.com when you create a blog. Thanks for any suggestions.
Alec
We do not have such script but you can try to search it at forums.cpanel.net
Niakie
I took a look at the cPanel forums and found this that might help you.

CODE
<?php
   // This script will add a subdomain and ftp account
   // Just change $login, $pass, and $domain - You shouldn't have to touch
   // anything else (unless you want to change how it looks)
   
   if (isset($create)) {
       $login = "cpanellogin";
       $pass = "cpanelpass";
       $domain = "domainname.com";
       $output = fopen ("http://$login:$pass@www.$domain:2082/frontend/x/subdomain/doad
           ddomain.html?domain=$subdomain&rootdomain=$domain", "r");
       $output = fopen ("http://$login:$pass@www.$domain:2082/frontend/x/ftp/doaddftp.h
           tml?login=$subdomain&password=$ftppass&homedir=$subdomain", "r");
       print ("Subdomain Created.<br>\n");
       print ("You can now access it at <a href=\"http://$subdomain.$domain\">http://$s
           ubdomain.$domain</a><br>\n");
       print ("You also have ftp access. Log in at <a href=\"ftp://ftp.$domain\">ftp://
           ftp.$domain</a> with the username $subdomain@$domain and the password $ftppass\n")
      ;
   } else {
   ?>
 <html>
 <head>
 <title>Automatic Subdomain Creator</title>
 </head>
 <body bgcolor="#FFFFFF" text="#000000">
 <form method="post" action="<?php print($_SERVER['PHP_SELF']); ?>">
    Subdomain: <input name="subdomain" type="text"><br>
    Password: <input name="ftppass" type="password"><br>
 <input name="create" type=submit value="Create">
 </form>
   <?php
   }
?>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here