₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,248 members, 8,420,954 topics. Date: Friday, 05 June 2026 at 03:06 PM

Toggle theme

..... - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmasters..... (1318 Views)

1 Reply (Go Down)

..... by Ymodulus(op):
.....
Re: ..... by DualCore1: 12:33pm On Sep 10, 2011
I assume you are running on cPanel.
I have never had to do this but I have screwed a lot with cpanel so I may be able to write a simple script for this.
I will be back shortly if I get to writing a script that WORKS.
If e no work. . . erm. . . grin
Re: ..... by DualCore1: 1:11pm On Sep 10, 2011
Lol bro sorry, I have a meeting by 1pm. I'm late already. When i'm back I'll work on this. Meanwhile you can be reading up on PHP CURL.
Re: ..... by Ymodulus(op): 2:02pm On Sep 10, 2011
Thanks bro. I did a little google search and d name for this act i want to initiate is call wildcard subdomains. So pls can u help me on that
Re: ..... by DualCore1: 8:16am On Sep 12, 2011
<?php
//the variables, change this to fit your needs. you can leave the cpanel_skin variable as it is
$cpanel_skin = "x3";
$cpanel_username = "your_cpanel_username";
$cpanel_password = "your_cpanel_password";
$domain = "your_domain_name";
$subdomain = "the_sub_domain_you_want_to_create"; //in your case this should be set to the member's name tht u want to create the subdomain for


//do not edit from here -- start
$sock = fsockopen('localhost',2082);
if(!$sock) {
print('Socket error');
exit();
}

$auth = "$cpanel_username:$cpanel_password";
$pass = base64_encode($auth);
$in = "GET /frontend/$cpanel_skin/subdomain/doadddomain.html?rootdomain=$domain&domain=$subdomain\r\n";
$in .= "HTTP/1.0\r\n";
$in .= "Host:localhost\r\n";
$in .= "Authorization: Basic $pass\r\n";
$in .= "\r\n";

fputs($sock, $in);
while (!feof($sock)) {
$result .= fgets ($sock,128);
}
fclose( $sock );
//end
?>


Use it as it fits your project. . . as a function, get, curl or just as I have written it e.t.c
Re: ..... by Ymodulus(op): 8:46am On Sep 12, 2011
Thanks bro.
1 Reply

Make Your Facebook Page Updates Appear As Tweets On Your Twitter AccountTransferring Contents From Subdomain To Main Domain.I Need Free Website Hosting With Subdomain URL234

How Important Is Alexa Ranking To Website Owners And Advertisers?Free Web Training In Lekki Ajah Area.