Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,231 members, 7,818,781 topics. Date: Monday, 06 May 2024 at 02:55 AM

..... - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / ..... (1246 Views)

Make Your Facebook Page Updates Appear As Tweets On Your Twitter Account / Transferring Contents From Subdomain To Main Domain. / I Need Free Website Hosting With Subdomain URL (2) (3) (4)

(1) (Reply) (Go Down)

..... by Ymodulus: 10:59am On Sep 10, 2011
.....
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: 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: 8:46am On Sep 12, 2011
Thanks bro.

(1) (Reply)

Where Is Nairaland Email Notification? / Php Source Code For Calling Calling Individual Student Online Results / External Laptop Battery Bank Solution Last 11hrs Of Non Stop Power For 13000k

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.