<?php
require_once('../../config.inc.php');
require(PF_INCLUDE.'verifyUserID.inc.php');
try {
$User_Resource_Comment = new User_Resource_Comment();
$User_Resource_Comment->postPopulate( $_POST );
if ($User_Resource_Comment->is_error())
throw new Exception($User_Resource_Comment->get_error_string());
if ($uid != $User_Resource_Comment->get_user_id())
throw new Exception('The user ID you provided does not match your user ID');
if (require_once(PF_BASE.'connect.php'))
$link = connect();
$User_Resource_Comment->dbInsert( $link );
if ($User_Resource_Comment->is_error())
throw new Exception($User_Resource_Comment->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_Comment->get_user_res_id().'&'; }
$d = new Decode($redirect);
header('Location: '.$d->redirect());
} catch (Exception $e) {
$pfutil = new PFUtil();
$pfutil->error_page( $e->getMessage() );
}