Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/location/location.php
<?php
function loc_register($location)
{
// insert the new location into the database
$query = "insert into Location (Location) values ('$location')";
$oreon->database->database->query ($query) or die("Query database error !");
}				 

echo('test');

if (!isset($_POST['submit']))
	{
	// Show the form
	include('include/location/location_form.inc.php');
				        exit;
	}else{
		
				
// Check if any of the fields are missing
        if (empty($_POST['location'])) {
		// Reshow the form with an error
		$reg_error = '<p class="error">One or more fields missing</p>';
		include 'include/location/register_form.inc.php';
		exit;
		}

	// Everything is ok, register
	loc_register ($_POST['location']);

    echo 'New Location Added';
}
?>
																																									
Return current item: phpMyPrepaid