Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get the value of a changing attribute from a php form?
    text
    copied!<p>I am pulling information to be displayed from my database and what id like to happen is when the user clicks on a selection, its takes them to a form that would be just for that selection. So i have one form and im trying to pull the name attribute whose value is set but $form_id which gets its value depending on the person chosen. on the top id get the attribute's value displayed in my url bar which i dont mind, but i cant seem to echo it out. After I am able to pull the value i will then place it back into the database. Please see code below. Thank you!</p> <p>EDIT: For further clarification, i am pulling a list of names and ID's from the database. I am also pulling just the ID a second time and assigning it to form_id. I display this information on a button because when you click that button it should take you to a form that will then ask you for information that will be added to the row that holds your form_id. My problem is that form_id isnt coming over as the variable but what its assigned to ex. if form id assumes the value of 7, as per the id it pulls from the database, a $_GET(['form_id']) no longer works because 7 is what is being sent over, not form_id</p> <p>Before you submit form (click button):</p> <pre><code>&lt;?php while($pro_showcase = mysqli_fetch_assoc($pro_s)) { $form_id = $pro_showcase['performance_id']; echo "&lt;div class=\"xs-col-4 col-sm-offset-2 separate\"&gt;&lt;form role=\"form\"action=\"judge-form.php\" method=\"get\"&gt;&lt;button name=\"$form_id\" type=\"submit\" class=\"btn btn-danger\"&gt; &lt;p&gt;ID: "; echo implode("&lt;br&gt; ",$pro_showcase); echo "&lt;/p&gt;&lt;/button&gt;&lt;/form&gt;&lt;/div&gt;"; } ?&gt; </code></pre> <p>After submission, where it submits to:</p> <pre><code>&lt;?php if (isset($_GET['submit'])) { $n = $_GET["$form_id"]; echo $n; } ?&gt; </code></pre>
 

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