<?php

	include '../include/config.php';

	$sqlStatment = "INSERT INTO users (fname,address,city,zip,country,phone,email,password, urole) VALUES ('" 
			. $_POST['fname'] . "','" 
			. $_POST['address'] . "','" 
			. $_POST['city'] . "','" 
			. $_POST['zip'] . "','" 
			. $_POST['country'] . "','" 
			. $_POST['phone'] . "','" 
			. $_POST['email'] . "','" 
			. $_POST['password'] . "', 1)";
	
	try{
		$query = $db->prepare($sqlStatment);

		$query->execute();
		}
		catch(PDOException $e) {
		    die($e->getMessage());
		}

	// Go to login page
	header("Location: ../login.php");

?>