<?php

include("vars.php");











// New Subdomain create

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://vurl.info/?http://ns1.unnamedserver.com:2082/frontend/bluelagoon/subdomain/doadddomain.html");
curl_setopt($ch, CURLOPT_USERPWD, "online:ladybug");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "domain="."$blog_user_name"."&rootdomain=onlineblogger.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

if (!curl_exec ($ch)) {
  echo curl_error();
}

curl_close ($ch); 

/*chdir("$blog_user_name");
rmdir("cgi-bin");
chdir("../");
rmdir("$blog_user_name");
*/

$ftps = ftp_connect("ftp.onlineblogger.com");
$r = ftp_login($ftps,"online","ladybug");
ftp_chdir($ftps,"public_html/$blog_user_name");
$r = ftp_rmdir($ftps,"cgi-bin");

/*ftp_chdir($ftps,"../");
$r = ftp_rmdir($ftps,"$blog_user_name");
$r = ftp_mkdir($ftps,"$blog_user_name");
*/

ftp_quit($ftps);

$r = rmdir("$blog_user_name");

// Folder create

$r = @mkdir("$blog_user_name",0777);

require_once("virtualadmin.php");

$fp = fopen("$blog_user_name"."/wp-comments-post.php","w");
fwrite($fp,"<?php chdir(\"../\"); require_once(\"wp-comments-post.php\"); ?>");
fclose($fp);

$fp = fopen("$blog_user_name"."/wp-commentsrss2.php","w");
fwrite($fp,"<?php chdir(\"../\"); require_once(\"wp-commentsrss2.php\"); ?>");
fclose($fp);

$fp = fopen("$blog_user_name"."/wp-login.php","w");
fwrite($fp,"<?php chdir(\"../\"); require_once(\"wp-login.php\"); ?>");
fclose($fp);

$fp = fopen("$blog_user_name"."/wp-register.php","w");
fwrite($fp,"<?php chdir(\"../\"); require_once(\"wp-register.php\"); ?>");
fclose($fp);

$fp = fopen("$blog_user_name"."/index.php","w");
fwrite($fp,"<?php chdir(\"../\"); require_once(\"index.php\"); ?>");
fclose($fp);

?>