Creating subdomains in PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • canstocker
    Junior Member
    • Mar 2004
    • 26

    #1

    Creating subdomains in PHP

    Hello everyone,

    How would I create subdomains in PHP?

    Specifically, I currently have URLs that look like this www.domain.com/page.php?ID=4
    www.domain.com/page.php?ID=3

    etc...

    I would like to create subdomains using PHP (for when I add new records) so that the subdomain points to the url.

    For example: s3.domain.com would be the equivalent of www.domain.com/page.php?ID=3

    Is this possible?

    Dan.
  • canstocker
    Junior Member
    • Mar 2004
    • 26

    #2
    If this isn't possible, is it possible to at least use PHP to create subdomains that point to subfolders?

    Dan.

    Comment

    • james
      Senior Member
      • Mar 2004
      • 183

      #3
      It should be possible to use cURL to simulate a login into your cpanel account, then create the subdomain(s) from there.

      There are scripts that do this for email forwarders, so I would assume it wouldn't be too difficult to do the same for subdomains.

      Comment

      Working...