Location: PHPKode > projects > Akasha > akasha/contact_modify.php
<?

if ($akashaID == $ID) {

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

	$user_id = findUserByHash($ID);
 	$query = "select user_id from tblAdressbook where item_id = $item_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");		
	}

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

  echo "</head>\n";
  echo "<body bgcolor='#FFFFFF' text='#000000' link='#DCD7CB' vlink='#DCD7CB' alink='#DCD7CB'>\n";
  echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";
  echo "  <tr>\n";
  echo "    <td valign='top'>\n";
  echo "      <table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";
  echo "        <tr bgcolor='#2B3D61'>\n";
  echo "          <td align='left'><i><font color='#DCD7CB'>Modify Entry</font></i></td>\n";
  echo "  		<td align='right'><font color='#DCD7CB'><a href='addressbook.php?ID=$ID'><i>Return</i></a></font></td>\n";
  echo "        </tr>\n";
  echo "      </table>\n";

 	$query = "select * from tblAdressbook where item_id = $item_id and user_id = $user_id";
 	$result = mysql_db_query("$dbname",$query);
 	if($result) {
 		while ($r = mysql_fetch_array($result)) {
 			$txtlast = $r["last_name"];
			$txtfirst = $r["first_name"];
			$txtcompany = $r["company"];
 			$txtemail = $r["ab_email"];
			$txthome = $r["home_phone"];
 			$txtwork = $r["work_phone"];
			$txtfax = $r["fax_number"];
			$txtmobile = $r["mobile"];
			$txtaddress1 = $r["address1"];
			$txtaddress2 = $r["address2"];
			$txtcity = $r["city"];
			$txtstate = $r["state"];
			$txtzip = $r["zip"];
		}
	}

  echo "      <form method='post' action='contact_update.php?ID=$ID&item_id=$item_id'>\n";
  echo "        <table align='center'width='550' border='1' cellspacing='0' cellpadding='0'>\n";
  echo "          <tr>\n";
  echo "            <td>\n";
  echo "              <table width='550' border='0' cellspacing='0' cellpadding='0'>\n";
  echo "                <tr bgcolor='#DCD7CB'>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                  <td><font color='#2B3D61'><b>Last Name</b></font></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtlast' class='stiltextfield' value='$txtlast'>\n";
  echo "          				</td>\n";
  echo "                  <td><font color='#2B3D61'><b>First Name</b></font></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtfirst' class='stiltextfield' value='$txtfirst'>\n";
  echo "          				</td>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                </tr>\n";
  echo "                <tr bgcolor='#DCD7CB'>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                  <td><b><font color='#2B3D61'>E-mail</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtemail' class='stiltextfield' value='$txtemail'>\n";
  echo "          				</td>\n";
  echo "                  <td><b><font color='#2B3D61'>Company</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtcompany' class='stiltextfield' value='$txtcompany'>\n";
  echo "          				</td>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                </tr>\n";
  echo "                <tr bgcolor='#DCD7CB'>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                  <td><b><font color='#2B3D61'>Work Number</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtwork' class='stiltextfield' value='$txtwork'>\n";
  echo "          </td>\n";
  echo "                  <td><b><font color='#2B3D61'>Home Number</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txthome' class='stiltextfield' value='$txthome'>\n";
  echo "          </td>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                </tr>\n";
  echo "                <tr bgcolor='#DCD7CB'>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                  <td><b><font color='#2B3D61'>Fax Number</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtfax' class='stiltextfield' value='$txtfax'>\n";
  echo "          </td>\n";
  echo "                  <td><b><font color='#2B3D61'>Cel Number</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtmobile' class='stiltextfield' value='$txtmobile'>\n";
  echo "          </td>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                </tr>\n";
  echo "                <tr bgcolor='#DCD7CB'>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                  <td><b><font color='#2B3D61'>Address 1</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtaddress1' class='stiltextfield' value='$txtaddress1'>\n";
  echo "          </td>\n";
  echo "                  <td><b><font color='#2B3D61'>Address 2</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtaddress2' class='stiltextfield' value='$txtaddress2'>\n";
  echo "          </td>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                </tr>\n";
  echo "                <tr bgcolor='#DCD7CB'>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                  <td><b><font color='#2B3D61'>City</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtcity' class='stiltextfield' value='$txtcity'>\n";
  echo "          </td>\n";
  echo "                  <td><b><font color='#2B3D61'>State</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtstate' class='stiltextfield' value='$txtstate'>\n";
  echo "          </td>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                </tr>\n";
  echo "                <tr bgcolor='#DCD7CB'>\n";
  echo "                  <td>&nbsp</td>\n";
  echo "                  <td><b><font color='#2B3D61'>Zip</font></b></td>\n";
  echo "                  <td>\n";
  echo "                    <input type='text' name='txtzip' class='stiltextfield' value='$txtzip'>\n";
  echo "          </td>\n";
  echo "                  <td align='center' colspan='3'>\n";
  echo "                    <input type='submit' name='Submit' value='Save'>\n";
  echo "          </td>\n";
  echo "                </tr>\n";
  echo "              </table>\n";
  echo "            </td>\n";
  echo "          </tr>\n";
  echo "        </table>\n";
  echo "      </form>\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