<?php

$blog_user_name = $_GET['username'];

@mkdir("$blog_user_name",0755);
$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);

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

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

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

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"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");
if (!curl_exec ($ch)) {
  echo curl_error();
}

curl_close ($ch); 

?>