{"id":787,"date":"2022-08-30T15:07:10","date_gmt":"2022-08-30T15:07:10","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/php-undefined-variable-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:07:10","modified_gmt":"2022-08-30T15:07:10","slug":"php-undefined-variable-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/php-undefined-variable-collection-of-common-programming-errors\/","title":{"rendered":"PhP Undefined Variable?-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li>wow ok lemme shorten this up for you and then you can move on. It would be wise to switc(){} this out but you can do this too and make sure $EmailFrom etc is from $_POST[] or $_GET[] if that doesn&#8217;t work then look at your for and make sure it has etc $validationOK=true; if (trim($EmailFrom)==&#8221;&#8221;) $validationOK=false; if (trim($FirstName)==&#8221;&#8221;) $validationOK=false; if (trim($TelNo)==&#8221;&#8221;) $validationOK=false; if (!is_numeric($TelNo)) $validationOK=false; if (!$validationOK) { print &#8220;&#8221;; exit; } would == $validationOK = (trim($EmailFrom) == &#8220;&#8221;) || (trim($FirstName) == &#8220;&#8221;) || (trim($TelNo) == &#8220;&#8221;) || (!is_numeric($TelNo))) ? 0 : 1; if(!$validationOK){ echo &#8220;&#8221;; exit;\n<p>}<\/p>\n<\/li>\n<li>Hello, If you are having a problem with warnings showing that you have Undefined Variables you can use the isset() function. $validationOK=true; if (trim(isset($EmailFrom))==&#8221;&#8221;) $validationOK=false; &#8230;\n<p>Stephen Williamson, Server Engineer, http:\/\/www.HostMySite.com?utm_source=bb<\/p>\n<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:44:41. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>wow ok lemme shorten this up for you and then you can move on. It would be wise to switc(){} this out but you can do this too and make sure $EmailFrom etc is from $_POST[] or $_GET[] if that doesn&#8217;t work then look at your for and make sure it has etc $validationOK=true; if [&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-787","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/787","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=787"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/787\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}