Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/location/register.php
<?php


if (!isset($_POST['submit']))
{
	// Show the form
	include 'include/location/register_form.inc.php';
//	exit;
}
else
{
	// Check if any of the fields are missing
	if (empty($_POST['usernamel']) || empty($_POST['location']) || empty($_POST['priv']) ||empty($_POST['password']) || empty($_POST['confirmpass']))
	{
		// Reshow the form with an error
		$reg_error = 'One or more fields missing';
		include 'include/location/register_form.inc.php';
		exit;
		}

		// Check if the passwords match
		if ($_POST['password'] != $_POST['confirmpass'])
		{

			// Reshow the form with an error
			$reg_error = 'Your passwords do not match';
			include 'include/location/register_form.inc.php';
			exit;
			}

		// Everything is ok, register
		user_register ($_POST['usernamel'], $_POST['password'], $_POST['location'], $_POST['priv']);

		echo("New user was added");

}

?>
Return current item: phpMyPrepaid