Location: PHPKode > projects > Akasha > note_modify.php
<?

if ($akashaID == $ID) {
	include ("includes/global.inc"); 	// Global Variables
	include ("includes/functions.inc"); 	// Global Functions
	$user_id = findUserByHash($ID);

	$txttitle = trim($txttitle);
	if ($txttitle == "") {
		$txttitle = "No Subject";
	}

	if ($action != 1) {
		$date = date('Y M d - H:i');
		$query = "insert into tblNotebook values(NULL,$user_id,'$txttitle','$txttext','$date')";
		$result = mysql_db_query("$dbname",$query);
	} else {

   	$query = "select user_id from tblNotebook where note_id = $note_id";
   	$result = mysql_db_query("$dbname",$query);
   	if($result) {
   		while ($r = mysql_fetch_array($result)) {
   			$auth_user = $r["user_id"];
  		}
  	}

  	$user_id = findUserByHash($ID);
  	if ($user_id != $auth_user) {
  		Header("Location: main.php?error_code=1");		
  	}

		$date = date('Y M d - H:i');
		$query = "update tblNotebook set entry_text='$txttext',entry_title='$txttitle' where user_id = $user_id and note_id = $note_id";
		$result = mysql_db_query("$dbname",$query);
	}

	Header("Location: notebook.php?ID=$ID");
} else {
		Header("Location: main.php?error_code=1");
}

?>
Return current item: Akasha