Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do i get values of multiple inputs in php
    primarykey
    data
    text
    <p>I am writing an sql embedded in php database. I am facing a problem when dealing with user inputs. I have a php file where the user can select the type of search. For example, select all data entries or limit the search to a given id num, name, last name... This the code where the user selects type of search</p> <pre><code> &lt;select name="type" &gt; &lt;option value="fm"&gt; Faculty Member Search &lt;/option&gt; &lt;tr&gt;&lt;td&gt;List all Faculty Members&lt;input type="checkbox" name="list[]" value="listAll" &gt; &lt;div&gt; &lt;label class="textClick"&gt; List By Id&lt;input type="checkbox" name="list[]" value="listId" &gt; &lt;/label&gt; &lt;input class="text" type="text" size = "8" placeholder="Insert Id" name="listById" &gt; &lt;/div&gt; &lt;div&gt; &lt;label class="textClick"&gt;List By First Name &lt;input type="checkbox" name="list[]" value="listName" &gt;&lt;/label&gt; &lt;input class="text" type="text" placeholder="Insert Name" name="list" &gt; &lt;/div&gt; &lt;div&gt; &lt;label class="textClick"&gt;List By Last Name&lt;input type="checkbox" name="list[]" value="listFname" &gt;&lt;/label&gt; &lt;input class="text" type="text" placeholder="Insert Last Name" name="listLast" &gt; &lt;/div&gt; &lt;/select&gt; &lt;input type="submit" value="Get Info"&gt; </code></pre> <p>Now in the other php file (where search is actually done) i can't seem to get the values of the user's inputs.. This the part where my code goes wrong</p> <pre><code>if($_POST["type"]=="fm"){ Print "LIST IS" . $_POST["list"]; if($_POST['list']=="listAll") { ?&gt; &lt;h1&gt; Listing ALL Faculty Members &lt;/h1&gt;"; &lt;?php </code></pre> <p>this code gave me the following output:</p> <p>LIST IS</p> <p>I tried both $_POST['list'] and $_POST["list"] but my code just doesn't seem to pass the if condition </p>
    singulars
    1. This table or related slice is empty.
    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.
    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