Location: PHPKode > projects > Protoforge > protoforge_v1.2/protoforge/user_resources/edit_User_Resource_submit.php
<?php
require_once('../config.inc.php');
require(PF_INCLUDE.'verifyUserID.inc.php');

try {
	$User_Resource = new User_Resource();
	$User_Resource->postPopulate($_POST);
	if ($User_Resource->is_error())
		throw new Exception($User_Resource->get_error_string());
	if ($uid != $User_Resource->get_user_id())
		throw new Exception('You do not have permission to edit this User_Resource.');
	if (require_once(PF_BASE.'connect.php'))
		$link = connect();
	$User_Resource->dbUpdate($link);
	if ($User_Resource->is_error())
		throw new Exception($User_Resource->get_error_string());

	if (isset($_POST['redirect'])) { $redirect = $_POST['redirect']; }
	else if (isset($_GET['redirect'])) { $redirect = $_GET['redirect']; }
	else { $redirect = PF_ROOT.'user_resources/User_Resource.php?id='.$User_Resource->get_user_res_id().'&'; }

	$d = new Decode($redirect);
	header('Location: '.$d->redirect());
} catch (Exception $e) {
	$pfutil = new PFUtil();
	$pfutil->error_page( $e->getMessage() );
}
?>
Return current item: Protoforge