{"id":3513,"date":"2017-08-16T12:14:36","date_gmt":"2017-08-16T09:14:36","guid":{"rendered":"http:\/\/kamil-abzalov.com\/tutorials\/submit-form-to-php\/"},"modified":"2020-04-09T00:23:12","modified_gmt":"2020-04-08T21:23:12","slug":"submit-form-to-php","status":"publish","type":"post","link":"https:\/\/kamil-abzalov.com\/en\/tutorials\/php\/submit-form-to-php\/","title":{"rendered":"Submit form to php"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; fullwidth=&#8221;on&#8221; _builder_version=&#8221;3.22&#8243;][et_pb_fullwidth_header title=&#8221;Submit form to php&#8221; content_max_width=&#8221;none&#8221; _builder_version=&#8221;3.16&#8243; button_one_letter_spacing_hover=&#8221;0&#8243; button_two_letter_spacing_hover=&#8221;0&#8243; button_one_text_size__hover_enabled=&#8221;off&#8221; button_two_text_size__hover_enabled=&#8221;off&#8221; button_one_text_color__hover_enabled=&#8221;off&#8221; button_two_text_color__hover_enabled=&#8221;off&#8221; button_one_border_width__hover_enabled=&#8221;off&#8221; button_two_border_width__hover_enabled=&#8221;off&#8221; button_one_border_color__hover_enabled=&#8221;off&#8221; button_two_border_color__hover_enabled=&#8221;off&#8221; button_one_border_radius__hover_enabled=&#8221;off&#8221; button_two_border_radius__hover_enabled=&#8221;off&#8221; button_one_letter_spacing__hover_enabled=&#8221;on&#8221; button_one_letter_spacing__hover=&#8221;0&#8243; button_two_letter_spacing__hover_enabled=&#8221;on&#8221; button_two_letter_spacing__hover=&#8221;0&#8243; button_one_bg_color__hover_enabled=&#8221;off&#8221; button_two_bg_color__hover_enabled=&#8221;off&#8221;][\/et_pb_fullwidth_header][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; _builder_version=&#8221;3.22&#8243;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;3.25&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; custom_padding=&#8221;0px|||&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_dcsbcm_divi_breadcrumbs_module homebreadcrumbtext=&#8221;Home&#8221; hide_currentbreadcrumb=&#8221;off&#8221; _builder_version=&#8221;4.4.2&#8243; custom_padding=&#8221;0px|||&#8221; hover_enabled=&#8221;0&#8243; fontsbreadcrumbs_font_size_tablet=&#8221;51&#8243; fontsbreadcrumbs_line_height_tablet=&#8221;2&#8243; fontsseperator_font_size_tablet=&#8221;51&#8243; fontsseperator_line_height_tablet=&#8221;2&#8243; fontsbreadcrumblinks_font_size_tablet=&#8221;51&#8243; fontsbreadcrumblinks_line_height_tablet=&#8221;2&#8243;][\/et_pb_dcsbcm_divi_breadcrumbs_module][et_pb_text _builder_version=&#8221;3.27.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]In this lesson you will learn how to submit form to php. Each of you were registering on  sites, entering login and password and so on. After this lesson you can submit any data to server and make simple validation.<!--more--><br \/>\n[\/et_pb_text][et_pb_video src=&#8221;https:\/\/www.youtube.com\/watch?v=UES4FZeYKw4&#8243; _builder_version=&#8221;3.0.47&#8243;][\/et_pb_video][et_pb_text _builder_version=&#8221;3.27.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]You can submit form to the server with two methods &#8211; GET or POST. Difference between them, that data with GET method pass with url. You understand, passing login and password is not a good idea. You need to use POST method. On the server some script recieves data from html form. But where do we find this data. PHP put this data to global array &#8211; $_POST or $_GET (depending on the submit method). Like any other array, these arrays have got keys. Keys are name attributes from html form. Values are user data.<br \/>\n[\/et_pb_text][et_pb_dmb_code_snippet title=&#8221;Code lesson&#8221; code=&#8221;PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KCTxtZXRhIGNoYXJzZXQ9IlVURi04Ij4KCTx0aXRsZT5Eb2N1bWVudDwvdGl0bGU+Cgk8bGluayByZWw9InN0eWxlc2hlZXQiIGhyZWY9Imh0dHBzOi8vbWF4Y2RuLmJvb3RzdHJhcGNkbi5jb20vYm9vdHN0cmFwLzMuMy43L2Nzcy9ib290c3RyYXAubWluLmNzcyI+CjwvaGVhZD4KPGJvZHk+CgkKCTxkaXYgY2xhc3M9ImNvbnRhaW5lciI+CgkJPGRpdiBjbGFzcz0icm93Ij4KCQkJPGRpdiBjbGFzcz0iY29sLW1kLTEyIj4KCQkJCTxmb3JtIGFjdGlvbj0iZm9ybS5waHAiIG1ldGhvZD0icG9zdCI+CgkJCQkgIDxkaXYgY2xhc3M9ImZvcm0tZ3JvdXAiPgoJCQkJICAgIDxsYWJlbCBmb3I9ImxvZ2luIj7Qm9C+0LPQuNC9PC9sYWJlbD4KCQkJCSAgICA8aW5wdXQgdHlwZT0idGV4dCIgY2xhc3M9ImZvcm0tY29udHJvbCIgaWQ9ImxvZ2luIiBuYW1lPSJsb2dpbiI+CgkJCQkgIDwvZGl2PgoJCQkJICA8ZGl2IGNsYXNzPSJmb3JtLWdyb3VwIj4KCQkJCSAgIDxsYWJlbCBmb3I9InBhc3NvcmQiPtCf0LDRgNC+0LvRjDwvbGFiZWw+CgkJCQkgICAgPGlucHV0IHR5cGU9InBhc3N3b3JkIiBjbGFzcz0iZm9ybS1jb250cm9sIiBpZD0icGFzc3dvcmQiIG5hbWU9InBhc3N3b3JkIj4KCQkJCSAgPC9kaXY+CgkJCQkgIDxidXR0b24gdHlwZT0ic3VibWl0IiBjbGFzcz0iYnRuIGJ0bi1kZWZhdWx0Ij7QntGC0L\/RgNCw0LLQuNGC0Yw8L2J1dHRvbj4KCQkJCTwvZm9ybT4KCQkJPC9kaXY+CgkJPC9kaXY+Cgk8L2Rpdj4KCgo8L2JvZHk+CjwvaHRtbD4KCjw\/cGhwCgp2YXJfZHVtcCgkX1BPU1QpOwoKdmFyX2R1bXAoZW1wdHkoJF9QT1NUWydwYXNzd29yZCddKSk7CgokbG9naW4gPSAkX1BPU1RbJ2xvZ2luJ107CiRwYXNzd29yZCA9ICRfUE9TVFsncGFzc3dvcmQnXTsKCmlmKGVtcHR5KCRsb2dpbikgfHwgZW1wdHkoJHBhc3N3b3JkKSkgewoJZWNobyAiRXJyb3IiOwp9IGVsc2UgewoJZWNobyAi0JLRiyDQuNGB0L\/QvtC70YzQt9GD0LXRgtC1INC70L7Qs9C40L0gJGxvZ2luINC4INC\/0LDRgNC+0LvRjCAkcGFzc3dvcmQiOwp9&#8243; admin_label=&#8221;\u041a\u043e\u0434 \u0443\u0440\u043e\u043a\u0430&#8221; style=&#8221;docco&#8221; linenums=&#8221;on&#8221; usetabwidth=&#8221;on&#8221; tabwidth=&#8221;4&#8243; _builder_version=&#8221;4.4.2&#8243; hover_enabled=&#8221;0&#8243;]PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KCTxtZXRhIGNoYXJzZXQ9IlVURi04Ij4KCTx0aXRsZT5Eb2N1bWVudDwvdGl0bGU+Cgk8bGluayByZWw9InN0eWxlc2hlZXQiIGhyZWY9Imh0dHBzOi8vbWF4Y2RuLmJvb3RzdHJhcGNkbi5jb20vYm9vdHN0cmFwLzMuMy43L2Nzcy9ib290c3RyYXAubWluLmNzcyI+CjwvaGVhZD4KPGJvZHk+CgkKCTxkaXYgY2xhc3M9ImNvbnRhaW5lciI+CgkJPGRpdiBjbGFzcz0icm93Ij4KCQkJPGRpdiBjbGFzcz0iY29sLW1kLTEyIj4KCQkJCTxmb3JtIGFjdGlvbj0iZm9ybS5waHAiIG1ldGhvZD0icG9zdCI+CgkJCQkgIDxkaXYgY2xhc3M9ImZvcm0tZ3JvdXAiPgoJCQkJICAgIDxsYWJlbCBmb3I9ImxvZ2luIj7Qm9C+0LPQuNC9PC9sYWJlbD4KCQkJCSAgICA8aW5wdXQgdHlwZT0idGV4dCIgY2xhc3M9ImZvcm0tY29udHJvbCIgaWQ9ImxvZ2luIiBuYW1lPSJsb2dpbiI+CgkJCQkgIDwvZGl2PgoJCQkJICA8ZGl2IGNsYXNzPSJmb3JtLWdyb3VwIj4KCQkJCSAgIDxsYWJlbCBmb3I9InBhc3NvcmQiPtCf0LDRgNC+0LvRjDwvbGFiZWw+CgkJCQkgICAgPGlucHV0IHR5cGU9InBhc3N3b3JkIiBjbGFzcz0iZm9ybS1jb250cm9sIiBpZD0icGFzc3dvcmQiIG5hbWU9InBhc3N3b3JkIj4KCQkJCSAgPC9kaXY+CgkJCQkgIDxidXR0b24gdHlwZT0ic3VibWl0IiBjbGFzcz0iYnRuIGJ0bi1kZWZhdWx0Ij7QntGC0L\/RgNCw0LLQuNGC0Yw8L2J1dHRvbj4KCQkJCTwvZm9ybT4KCQkJPC9kaXY+CgkJPC9kaXY+Cgk8L2Rpdj4KCgo8L2JvZHk+CjwvaHRtbD4KCjw\/cGhwCgp2YXJfZHVtcCgkX1BPU1QpOwoKdmFyX2R1bXAoZW1wdHkoJF9QT1NUWydwYXNzd29yZCddKSk7CgokbG9naW4gPSAkX1BPU1RbJ2xvZ2luJ107CiRwYXNzd29yZCA9ICRfUE9TVFsncGFzc3dvcmQnXTsKCmlmKGVtcHR5KCRsb2dpbikgfHwgZW1wdHkoJHBhc3N3b3JkKSkgewoJZWNobyAiRXJyb3IiOwp9IGVsc2UgewoJZWNobyAi0JLRiyDQuNGB0L\/QvtC70YzQt9GD0LXRgtC1INC70L7Qs9C40L0gJGxvZ2luINC4INC\/0LDRgNC+0LvRjCAkcGFzc3dvcmQiOwp9[\/et_pb_dmb_code_snippet][et_pb_comments _builder_version=&#8221;4.4.2&#8243; custom_margin=&#8221;30px||||false|false&#8221; hover_enabled=&#8221;0&#8243;][\/et_pb_comments][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this lesson you will learn how to submit form to php. Each of you were registering on sites, entering login and password and so on. After this lesson you can submit any data to server and make simple validation. You can submit form to the server with two methods &#8211; GET or POST. Difference [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 html \u0444\u043e\u0440\u043c\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u0432\u0430\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435, \u0432\u0432\u043e\u0434\u044f \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0432\u043e\u0434\u0438\u043b \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u0430 \u0432 \u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u0431\u0438\u043d\u0435\u0442 \u0438 \u0442.\u043f. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0440\u043e\u043a\u0430 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043b\u044e\u0431\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0444\u043e\u0440\u043c\u044b \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<!--more-->\r\n\r\nhttps:\/\/www.youtube.com\/watch?v=UES4FZeYKw4\r\n\r\n\u0414\u0430\u043d\u043d\u044b\u0435 \u0441 \u0444\u043e\u0440\u043c\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 - get \u0438 post. \u0420\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c get, \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0443\u0440\u043b. \u041b\u0435\u0433\u043a\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0444\u043e\u0440\u043c\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c post. \u0414\u0430\u043d\u043d\u044b\u0435 \u0441 \u0444\u043e\u0440\u043c\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0441\u043a\u0440\u0438\u043f\u0442. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c PHP \u0441\u043a\u0440\u0438\u043f\u0442, \u043d\u043e \u043a\u0443\u0434\u0430 \u043e\u043d\u0438 \u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442. \u0410 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043e\u043d \u0438\u0445 \u0432 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0443\u043f\u0435\u0440 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 - $_POST \u0438\u043b\u0438 $_GET (\u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0444\u043e\u0440\u043c\u044b). \u041a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u044d\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0438\u043c\u0435\u044e\u0442 \u043a\u043b\u044e\u0447\u0438 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041a\u043b\u044e\u0447\u0430\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 name \u0432 \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0444\u043e\u0440\u043c\u044b, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 (\u0432 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438, \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0435 \u043f\u0443\u0441\u0442\u044b\u0435, \u0445\u043e\u0442\u044f \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443).\r\n\r\n\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0445\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u043e\u0432\u043d\u043e \u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434 \u044f \u0437\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u0443\u0440\u043e\u043a \u0438 \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440 \u043d\u0435 \u0436\u0430\u043b\u0435\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0447\u0430\u043b \u044d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0438 \u0445\u043e\u0447\u0443 \u0437\u0430 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u0432\u0430\u0441 \u0437\u0430 \u0442\u0430\u043a\u0443\u044e \u043c\u043e\u0449\u043d\u0443\u044e \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044e \u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0443\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043c\u043e\u0447\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u0432\u0430\u0441. \u0416\u0435\u043b\u0430\u044e \u0432\u0430\u043c \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432!\r\n\r\n\u041a\u043e\u0434 \u0443\u0440\u043e\u043a\u0430:\r\n\r\n<pre><code><!DOCTYPE html>\r\n<html>\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>Document<\/title>\r\n    <link rel=\"stylesheet\" href=\"https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.3.7\/css\/bootstrap.min.css\">\r\n<\/head>\r\n<body>\r\n\r\n    <div class=\"container\">\r\n        <div class=\"row\">\r\n            <div class=\"col-md-12\">\r\n                <form action=\"form.php\" method=\"post\">\r\n                  <div class=\"form-group\">\r\n                    <label for=\"login\">\u041b\u043e\u0433\u0438\u043d<\/label>\r\n                    <input type=\"text\" class=\"form-control\" id=\"login\" name=\"login\">\r\n                  <\/div>\r\n                  <div class=\"form-group\">\r\n                   <label for=\"passord\">\u041f\u0430\u0440\u043e\u043b\u044c<\/label>\r\n                    <input type=\"password\" class=\"form-control\" id=\"password\" name=\"password\">\r\n                  <\/div>\r\n                  <button type=\"submit\" class=\"btn btn-default\">\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c<\/button>\r\n                <\/form>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n\r\n<\/body>\r\n<\/html>\r\n\r\n<?php\r\n\r\nvar_dump($_POST);\r\n\r\nvar_dump(empty($_POST['password']));\r\n\r\n$login = $_POST['login'];\r\n$password = $_POST['password'];\r\n\r\nif(empty($login) || empty($password)) {\r\n    echo \"Error\";\r\n} else {\r\n    echo \"\u0412\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043b\u043e\u0433\u0438\u043d $login \u0438 \u043f\u0430\u0440\u043e\u043b\u044c $password\";\r\n}\r\n\r\n<\/code><\/pre>","_et_gb_content_width":"","footnotes":""},"categories":[273,219],"tags":[240],"class_list":["post-3513","post","type-post","status-publish","format-standard","hentry","category-php","category-tutorials","tag-php-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Submit form to php - Kamil Abzalov&#039;s blog<\/title>\n<meta name=\"description\" content=\"In this lesson we will consider submit form to php and make simple validation in server side.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Submit form to php - Kamil Abzalov&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"In this lesson we will consider submit form to php and make simple validation in server side.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0441\u0430\u0439\u0442 \u041a\u0430\u043c\u0438\u043b\u044f \u0410\u0431\u0437\u0430\u043b\u043e\u0432\u0430\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/kamabzalov\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-16T09:14:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-08T21:23:12+00:00\" \/>\n<meta name=\"author\" content=\"Kamil&#039; Abzalov\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Submit form to php\" \/>\n<meta name=\"twitter:description\" content=\"In this lesson we will consider submit form to php and make simple validation in server side.\" \/>\n<meta name=\"twitter:creator\" content=\"@kamabzalov\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kamil&#039; Abzalov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/php\\\/send-data-to-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/php\\\/send-data-to-server\\\/\"},\"author\":{\"name\":\"Kamil' Abzalov\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#\\\/schema\\\/person\\\/9c53360f21b83306ba40c2231573c600\"},\"headline\":\"Submit form to php\",\"datePublished\":\"2017-08-16T09:14:36+00:00\",\"dateModified\":\"2020-04-08T21:23:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/php\\\/send-data-to-server\\\/\"},\"wordCount\":900,\"commentCount\":0,\"keywords\":[\"php\"],\"articleSection\":[\"PHP\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/php\\\/send-data-to-server\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/php\\\/send-data-to-server\\\/\",\"url\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/php\\\/send-data-to-server\\\/\",\"name\":\"Submit form to php - Kamil Abzalov's blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#website\"},\"datePublished\":\"2017-08-16T09:14:36+00:00\",\"dateModified\":\"2020-04-08T21:23:12+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#\\\/schema\\\/person\\\/9c53360f21b83306ba40c2231573c600\"},\"description\":\"In this lesson we will consider submit form to php and make simple validation in server side.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/php\\\/send-data-to-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/php\\\/send-data-to-server\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/php\\\/send-data-to-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\\\/\\\/kamil-abzalov.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Submit form to php\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#website\",\"url\":\"https:\\\/\\\/kamil-abzalov.com\\\/\",\"name\":\"\u0441\u0430\u0439\u0442 \u041a\u0430\u043c\u0438\u043b\u044f \u0410\u0431\u0437\u0430\u043b\u043e\u0432\u0430\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kamil-abzalov.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#\\\/schema\\\/person\\\/9c53360f21b83306ba40c2231573c600\",\"name\":\"Kamil' Abzalov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g\",\"caption\":\"Kamil' Abzalov\"},\"sameAs\":[\"https:\\\/\\\/kamil-abzalov.com\\\/\",\"https:\\\/\\\/www.facebook.com\\\/kamabzalov\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/kamabzalov\",\"https:\\\/\\\/x.com\\\/kamabzalov\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/kamabzalov\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Submit form to php - Kamil Abzalov's blog","description":"In this lesson we will consider submit form to php and make simple validation in server side.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/","og_locale":"en_US","og_type":"article","og_title":"Submit form to php - Kamil Abzalov's blog","og_description":"In this lesson we will consider submit form to php and make simple validation in server side.","og_url":"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/","og_site_name":"\u0441\u0430\u0439\u0442 \u041a\u0430\u043c\u0438\u043b\u044f \u0410\u0431\u0437\u0430\u043b\u043e\u0432\u0430","article_author":"https:\/\/www.facebook.com\/kamabzalov","article_published_time":"2017-08-16T09:14:36+00:00","article_modified_time":"2020-04-08T21:23:12+00:00","author":"Kamil' Abzalov","twitter_card":"summary_large_image","twitter_title":"Submit form to php","twitter_description":"In this lesson we will consider submit form to php and make simple validation in server side.","twitter_creator":"@kamabzalov","twitter_misc":{"Written by":"Kamil' Abzalov","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/#article","isPartOf":{"@id":"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/"},"author":{"name":"Kamil' Abzalov","@id":"https:\/\/kamil-abzalov.com\/#\/schema\/person\/9c53360f21b83306ba40c2231573c600"},"headline":"Submit form to php","datePublished":"2017-08-16T09:14:36+00:00","dateModified":"2020-04-08T21:23:12+00:00","mainEntityOfPage":{"@id":"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/"},"wordCount":900,"commentCount":0,"keywords":["php"],"articleSection":["PHP","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/","url":"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/","name":"Submit form to php - Kamil Abzalov's blog","isPartOf":{"@id":"https:\/\/kamil-abzalov.com\/#website"},"datePublished":"2017-08-16T09:14:36+00:00","dateModified":"2020-04-08T21:23:12+00:00","author":{"@id":"https:\/\/kamil-abzalov.com\/#\/schema\/person\/9c53360f21b83306ba40c2231573c600"},"description":"In this lesson we will consider submit form to php and make simple validation in server side.","breadcrumb":{"@id":"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kamil-abzalov.com\/videouroki\/php\/send-data-to-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/kamil-abzalov.com\/en\/"},{"@type":"ListItem","position":2,"name":"Submit form to php"}]},{"@type":"WebSite","@id":"https:\/\/kamil-abzalov.com\/#website","url":"https:\/\/kamil-abzalov.com\/","name":"\u0441\u0430\u0439\u0442 \u041a\u0430\u043c\u0438\u043b\u044f \u0410\u0431\u0437\u0430\u043b\u043e\u0432\u0430","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kamil-abzalov.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kamil-abzalov.com\/#\/schema\/person\/9c53360f21b83306ba40c2231573c600","name":"Kamil' Abzalov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g","caption":"Kamil' Abzalov"},"sameAs":["https:\/\/kamil-abzalov.com\/","https:\/\/www.facebook.com\/kamabzalov","https:\/\/www.linkedin.com\/in\/kamabzalov","https:\/\/x.com\/kamabzalov","https:\/\/www.youtube.com\/user\/kamabzalov"]}]}},"_links":{"self":[{"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/posts\/3513","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/comments?post=3513"}],"version-history":[{"count":7,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/posts\/3513\/revisions"}],"predecessor-version":[{"id":31888,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/posts\/3513\/revisions\/31888"}],"wp:attachment":[{"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/media?parent=3513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/categories?post=3513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/tags?post=3513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}