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

try {
	if (!isset($_SESSION['User_Resource']))
		throw new Exception('No User_Resource selected.<br/><a href="index.php">Search User_Resource</a>');
	if ($uid != $_SESSION['User_Resource']->get_user_id())
		throw new Exception('You do not have permission to delete this User_Resource.');
	if (require_once(PF_BASE.'connect.php'))
		$link = connect();
	$_SESSION['User_Resource']->dbDelete($link);
	if ($_SESSION['User_Resource']->is_error()) {
		$err = $_SESSION['User_Resource']->get_error_string();
		unset($_SESSION['User_Resource']);
		throw new Exception($err);
	} else {
		if (isset($_POST['redirect'])) { $redirect = $_POST['redirect']; }
		else if (isset($_GET['redirect'])) { $redirect = $_GET['redirect']; }
		else { $redirect = PF_ROOT.'users/user_resources.php'; }
		unset($_SESSION['User_Resource']);
		header('Location: '.PF_ROOT.'user_resources/index.php');
	}
} catch (Exception $e) {
	$pfutil = new PFUtil();
	$pfutil->error_page( $e->getMessage() );
}
?>
Return current item: Protoforge