{"id":796,"date":"2022-08-30T15:07:19","date_gmt":"2022-08-30T15:07:19","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/help-with-undefined-index-in-php-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:07:19","modified_gmt":"2022-08-30T15:07:19","slug":"help-with-undefined-index-in-php-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/help-with-undefined-index-in-php-collection-of-common-programming-errors\/","title":{"rendered":"Help with undefined index in PHP?-Collection of common programming errors"},"content":{"rendered":"<p>programming-amp-design Retrieving original web address<br \/>\ndiscoverer: anonymous <img decoding=\"async\" src=\"http:\/\/l.yimg.com\/sc\/28222\/answers2\/images\/a\/i\/identity\/nopic_48.png\" \/> Helo, I have a little problem, How can I define index &#8220;pagina&#8221; in php because I have a script in PHP and show me a error: &#8220;Notice: Undefined index: pagina in&#8230;&#8230;. on line 51&#8221; where on line 51 is: &#8220;$pagina = $_GET[&#8216;pagina&#8217;];&#8221;<\/p>\n<p>Thank you<\/p>\n<ol>\n<li>You could define it in a form or query string (like: index.php?pagina=1), but you should probably also change the code on line 51 to: $pagina = &#8216;1&#8217;;\n<p>if (isset($_GET[&#8216;pagina&#8217;])) $pagina = $_GET[&#8216;pagina&#8217;];<\/p>\n<\/li>\n<li>You try to read a value from the $_GET array that is not defined, so you are getting a notice-message. To resolve this, you can either test if the variable is set before reading its value: if (ISSET($_GET[&#8216;pagina&#8217;])) $pagina = $_GET[&#8216;pagina&#8217;]; Or you can disable NOTICE-messages with the following line at the top of your script: error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));\n<p>This disables WARNINGS as well.<\/p>\n<\/li>\n<\/ol>\n<p>Source of the problem\uff1a answers.yahoo<\/p>\n<p>Web site is in building<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:46:01. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>programming-amp-design Retrieving original web address discoverer: anonymous Helo, I have a little problem, How can I define index &#8220;pagina&#8221; in php because I have a script in PHP and show me a error: &#8220;Notice: Undefined index: pagina in&#8230;&#8230;. on line 51&#8221; where on line 51 is: &#8220;$pagina = $_GET[&#8216;pagina&#8217;];&#8221; Thank you You could define it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-796","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=796"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/796\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}