{"id":320,"date":"2021-02-02T13:25:00","date_gmt":"2021-02-02T13:25:00","guid":{"rendered":"https:\/\/wshop.fi\/eng\/?p=320"},"modified":"2021-03-28T13:26:16","modified_gmt":"2021-03-28T13:26:16","slug":"php-ispostback-equivalent-function-code-snippet","status":"publish","type":"post","link":"https:\/\/wshop.fi\/eng\/php-ispostback-equivalent-function-code-snippet\/","title":{"rendered":"PHP Ispostback Equivalent Function &#8211; Code Snippet"},"content":{"rendered":"\n<p>There is a function called ispostback in asp.net. However there isn\u2019t one in PHP. You use do it to check if a page is a postback. The snippet of code below will create a PHP ispostback function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Determine whether the page was requested by GET or POST.\nfunction isPostBack()\n   {\n      return ($_SERVER&#91;'REQUEST_METHOD'] == 'POST');\n   }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">PHP ispostback equivalent<\/h2>\n\n\n\n<p>You may wan to add this PHP ispostback function equivalent to a library of PHP functions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is a function called ispostback in asp.net. However there isn\u2019t one in PHP. You use do it to check if a page is a postback. The snippet of code below will create a PHP ispostback function. PHP ispostback equivalent You may wan to add this PHP ispostback function equivalent to a library of PHP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":278,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":{"0":"post-320","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-coding"},"_links":{"self":[{"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/posts\/320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/comments?post=320"}],"version-history":[{"count":1,"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/posts\/320\/revisions"}],"predecessor-version":[{"id":321,"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/posts\/320\/revisions\/321"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/media\/278"}],"wp:attachment":[{"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/media?parent=320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/categories?post=320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wshop.fi\/eng\/wp-json\/wp\/v2\/tags?post=320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}