if (isset($_POST['username'], $_POST['password'], $_POST['country'], $_POST['age']))
{
require("db.inc.php");
require("create_account.php");
require("encrypt.php");
$_POST['username'] = strtolower($_POST['username']);
$_POST['password'] = strtolower($_POST['password']);
$username = strip_tags(mysql_real_escape_string($_POST['username']));
$password = strip_tags(mysql_real_escape_string($_POST['password']));
$password = md5($username.$sha1.$password.$sha2.$username);
$country = strip_tags(mysql_real_escape_string($_POST['country']));
$age = $_POST['age'];
$registration_ip = $_SERVER['REMOTE_ADDR'];
//$profile_picture = $_FILES['profile_image'];
$profile_picture = file_get_contents('php://input', 'r');
$data = array();
parse_str($profile_picture, $data);
$profile_picture = $data['profile_image'];
$userRegistration = array("USERNAME" => $username,
"PASSWORD" => $password,
"COUNTRY" => $country,
"AGE" => $age,
"PROFILE_PICTURE" => $profile_picture,
"REGISTRATION_IP" => $registration_ip);
//print_r($userRegistration);
createAccount($userRegistration); //this function handles the user registration queryes and files
}