{"id":222,"date":"2012-06-22T00:33:49","date_gmt":"2012-06-21T17:33:49","guid":{"rendered":"http:\/\/blog.kusumoto.co\/?p=222"},"modified":"2012-06-22T00:35:56","modified_gmt":"2012-06-21T17:35:56","slug":"php-form-and-savedata-in-1-files","status":"publish","type":"post","link":"https:\/\/oldblog.kusumotolab.com\/?p=222","title":{"rendered":"[PHP] Form and SaveData in 1 files!"},"content":{"rendered":"<p>\u0e42\u0e14\u0e22\u0e44\u0e1f\u0e25\u0e4c\u0e19\u0e35\u0e49 \u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e43\u0e19\u0e01\u0e32\u0e23\u0e2d\u0e2d\u0e01\u0e41\u0e1a\u0e1a\u0e44\u0e1f\u0e25\u0e4c\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1f\u0e2d\u0e23\u0e4c\u0e21\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e01\u0e23\u0e2d\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e41\u0e25\u0e30\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49\u0e44\u0e1f\u0e25\u0e4c\u0e46 \u0e40\u0e14\u0e35\u0e22\u0e27 \u0e42\u0e14\u0e22\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23 savedata \u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e04\u0e48\u0e32\u0e43\u0e19\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19 \u0e42\u0e14\u0e22\u0e21\u0e35\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49<\/p>\n<p>&nbsp;<\/p>\n<pre lang=\"php\">\r\n<?php\r\n#Form Version 1.0 By Kusumoto\r\n#http:\/\/kusumoto.co\r\n\r\ninclude(\"config.php\");\r\n$id = $_REQUEST['id'];\r\nif ($id == \"\") {\r\necho \"Error 403\";\r\nexit;\r\n}\r\n$savedata = $_REQUEST['savedata'];\r\nif ($savedata == \"true\") {\r\n$id = $_REQUEST['id'];\r\n$title = $_REQUEST['title'];\r\n$data = $_REQUEST['data'];\r\n$author = $_REQUEST['author'];\r\n\tif ($id == \"\") {\r\necho \"Error 403\";\r\nexit;\r\n}\r\nif ($title == \"\") {\r\necho \"Error 403\";\r\nexit;\r\n}\r\nif ($data == \"\") {\r\necho \"Error 403\";\r\nexit;\r\n}\r\nif ($author== \"\") {\r\necho \"Error 403\";\r\nexit;\r\n}\r\n\r\n$today_date=date(\"d-M-Y\");\r\n$today_time=date(\"h:i:s: a\");\r\n\r\nmysql_connect($host,$user,$pass)or die(\"Error Database\");\r\nmysql_select_db($db);\r\nmysql_query(\" set NAMES utf8 \");\r\n\r\n$sql = \"INSERT into note_data (subid, title, data, date, author) values ('$id','$title','$data','$today_date $today_time','$author') \";\r\n$result = mysql_db_query($db, $sql);\r\n \r\n if (!$result) {\r\n echo(\"Error in SQL \".mysql_error() );\r\n } else {\r\n echo \"Complete! Please close this window.\";\r\n }\r\n} else {\r\n?>\r\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/>\r\n<title>New Note<\/title>\r\n<style type=\"text\/css\">\r\n<!--\r\nbody,td,th {\r\n\tfont-family: tahoma;\r\n}\r\n-->\r\n<\/style><\/head>\r\n<?php\r\nmysql_connect($host,$user,$pass)or die(\"Error Database\");\r\nmysql_select_db($db);\r\nmysql_query(\" set NAMES utf8 \");\r\n$sql = \"SELECT * From note_subject where id='$id'\";\r\n$dbquery = mysql_query($sql);\r\n$result = mysql_fetch_array($dbquery);\r\nif (!$result ) {\r\necho \"Error 404\";\r\nexit;\r\n}\r\n\r\n$subcode = mysql_result($dbquery, 0, 'subcode');\r\n?>\r\n<body>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"img\/note.png\" width=\"60\" height=\"60\" \/><strong> New Note<\/strong><\/p>\r\n<form id=\"form1\" name=\"form1\" method=\"post\" action=\"newnote.php?savedata=true\">\r\n  <table width=\"588\" border=\"1\">\r\n    <tr>\r\n      <td width=\"98\">Subject Code<\/td>\r\n      <td width=\"474\"><input name=\"subcode\" type=\"text\" disabled=\"disabled\" id=\"subcode\" value=\"<?php echo $subcode; ?>\" \/>\r\n      <input name=\"subcode\" type=\"hidden\" id=\"subcode\" value=\"<?php echo $subcode; ?>\" \/>\r\n      <input name=\"id\" type=\"hidden\" id=\"id\" value=\"<?php echo $id; ?>\" \/><\/td>\r\n    <\/tr>\r\n    <tr>\r\n      <td>Note Title<\/td>\r\n      <td><input type=\"text\" name=\"title\" id=\"title\" \/><\/td>\r\n    <\/tr>\r\n    <tr>\r\n      <td>Note Retail<\/td>\r\n      <td><textarea name=\"data\" cols=\"50\" rows=\"10\" id=\"data\"><\/textarea><\/td>\r\n    <\/tr>\r\n    <tr>\r\n      <td>Author<\/td>\r\n      <td><input type=\"text\" name=\"author\" id=\"author\" \/><\/td>\r\n    <\/tr>\r\n    <tr>\r\n      <td>&nbsp;<\/td>\r\n      <td><input type=\"submit\" name=\"button\" id=\"button\" value=\"Send\" \/><\/td>\r\n    <\/tr>\r\n  <\/table>\r\n<\/form>\r\n\r\n<p>&nbsp; <\/p>\r\n<hr\/>\r\n <p><em><strong>Kusumoto Network!<\/strong><\/em><\/p>\r\n<\/body>\r\n<\/html>\r\n\r\n<?php } ?>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0e42\u0e14\u0e22\u0e44\u0e1f\u0e25\u0e4c\u0e19\u0e35\u0e49 \u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e43\u0e19\u0e01\u0e32\u0e23\u0e2d\u0e2d\u0e01\u0e41\u0e1a\u0e1a\u0e44\u0e1f\u0e25\u0e4c\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1f\u0e2d\u0e23\u0e4c\u0e21\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e01\u0e23\u0e2d\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e41\u0e25\u0e30\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49\u0e44\u0e1f\u0e25\u0e4c\u0e46 \u0e40\u0e14\u0e35\u0e22\u0e27 \u0e42\u0e14\u0e22\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23 savedata \u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e04\u0e48\u0e32\u0e43\u0e19\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19 \u0e42\u0e14\u0e22\u0e21\u0e35\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49 &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[13],"tags":[],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-php"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3OMEb-3A","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=222"}],"version-history":[{"count":4,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":226,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/222\/revisions\/226"}],"wp:attachment":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}