<?php

// include WordPress
require_once('../../../wp-load.php');
require_once(ABSPATH . WPINC . '/registration.php');

// attempt to create User
$id = wp_create_user($_GET['username'], $_GET['password'], $_GET['email']);

// dump array
if (is_numeric($id)) {

	echo '<p class="success">'.__('Your account has been successfully created! Thank you.','news').'</p>';
	// update other data
	wp_update_user( array ( 'ID' => $id, 'first_name' => $_GET['firstname'], 'last_name' => $_GET['lastname'] ) ) ;

// Errors?
} else {

	$array = (array) $id;
	foreach($array as $value) {
		if (is_array($value)) {
			foreach($value as $k => $v) {
				foreach($v as $l) {
					echo '<p class="error">'.$l.'</p>';
				}
			}
		}
	}

}

?>