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

if ($akashaID == $ID) {

	include ("includes/global.inc"); 	// Global Variables
	include ("includes/functions.inc"); 	// Global Functions

	$user_id = findUserByHash($ID);

	if ($action == 1) {

   	$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");		
  	}


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

	include ("includes/head.inc"); 							// Standart Headers
	include ("stylesheets/homestyle.inc"); 			// Stylesheets


  echo "</head>\n";
  echo "<body bgcolor='#FFFFFF' text='#000000' link='#3457A9' vlink='#3457A9' alink='#009966'>\n";
  echo "<table width='100%' border='0' cellspacing='0' cellpadding='0' height='200'>\n";
  echo "  <tr>\n";
  echo "    <td valign='top' width='812'>\n";

  echo "      <table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";
  echo "              \n";
  echo "        <tr bgcolor='#D1D1D1'>\n";
  echo "          <td><b><font color='#304167'><i>Notebook-Add/Modify</i></font></b></td>\n";
  echo "        </tr>\n";
  echo "            \n";
  echo "      </table>\n";
  echo "      <form method='post' action='note_modify.php'>\n";
	if ($action ==1) {
	  echo "      <input type='hidden' name='action' value='1'>\n";
	}
  echo "      <input type='hidden' name='ID' value='$ID'>\n";
  echo "      <input type='hidden' name='note_id' value='$note_id'>\n";

  echo "        <table width='500' border='0' cellspacing='0' cellpadding='0' align='center'>\n";
  echo "          <tr>\n";
  echo "            <td bgcolor='#D1D1D1' colspan='2'>&nbsp;</td>\n";
  echo "          </tr>\n";
  echo "          <tr bgcolor='#E3E7E8'>\n";
  echo "            <td width='20%'>Note Header : \n";
  echo "              </td>\n";
  echo "            <td width='80%'>\n";
  echo "              <input type='text' name='txttitle' class='stiltextfield' value='$entry_title' size='30'>\n";
  echo "            </td>\n";
  echo "          </tr>\n";
  echo "          <tr bgcolor='#E3E7E8'>\n";
  echo "            <td align='center' colspan='2'>\n";
  echo "              <textarea name='txttext' cols='60' class='stiltextfield' rows='5'>$entry_text</textarea>\n";
  echo "              \n";
  echo "            </td>\n";
  echo "          </tr>\n";
  echo "          <tr align='right' bgcolor='#E3E7E8'>\n";
  echo "            <td align='center' colspan='2'>\n";
  echo "              <input type='submit' name='Submit' value='OK'>\n";
  echo "              \n";
  echo "            </td>\n";
  echo "          </tr>\n";
  echo "        </table>\n";
  echo "      </form>\n";
  echo "      <br>\n";
  echo "    </td>\n";
  echo "  </tr>\n";
  echo "</table>\n";
  echo "</body>\n";
  echo "</html>\n";

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

?>
Return current item: Akasha