Note that there are some explanatory texts on larger screens.

plurals
  1. POUndefined Index in php (I've searched all over internet, and stackoverflow, tried almost everything)
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/4261133/php-notice-undefined-variable-and-notice-undefined-index">PHP: “Notice: Undefined variable” and “Notice: Undefined index”</a> </p> </blockquote> <p><code>enter code here</code>this is php code</p> <pre><code>$choice_spc_port = $_POST["txtSpace"]; (THIS LINE GIVES UNDEFINED INDEX NOTICE) $choice_loc = $_POST["txtLocation"]; (THIS LINE GIVES UNDEFINED INDEX NOTICE) </code></pre> <p>And this is HTML Form</p> <pre><code>&lt;form id="animalform" name="animalform" method="post" action="animalform.php"&gt; &lt;div class="wrapper"&gt; &lt;strong&gt;&lt;span&gt;*&lt;/span&gt; Text Space portion:&lt;/strong&gt; &lt;div class="formText"&gt; &lt;input type="radio" name="txtSpace" value="HR"/&gt;Text space for Horse.&lt;br /&gt; &lt;input type="radio" name="txtSpace" value="ZB"/&gt;Text Space For Zebra&lt;br /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="wrapper"&gt; &lt;strong&gt;&lt;span&gt;*&lt;/span&gt; Animal Location:&lt;/strong&gt; &lt;div class="formText"&gt; &lt;input type="radio" name="txtLocation" value="txtSetXY"/&gt; Specify Animal Location&lt;br /&gt; &lt;div style="padding-left:20px;"&gt; X: &lt;input type="text" id="locField" name="txtXLocation"&gt; &lt;span&gt;Taking (x=1,y=1) top left box. Increment +1 in value of X moving right&lt;/span&gt;&lt;br /&gt; Y: &lt;input type="text" id="locField" name="txtYLocation"&gt; &lt;span&gt;Taking (x=1,y=1) top left box. Increment +1 in value of Y moving downwards&lt;/span&gt;&lt;br /&gt; &lt;/div&gt; &lt;input type="radio" name="txtLocation" value="Default"/&gt;Default &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Query to insert in database</p> <pre><code>$insert = "INSERT INTO dbForm (db_space_portion, db_animal_location) VALUES ('{$choice_spc_port}', '{$choice_loc}')"; </code></pre> <p>I tried the same in firefox and those two lines give notice as mentioned in bracket. Also on internet many people are looking for solution. So I think this question will help many out there.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload