I am attempting to send a form with the input as submit. I want the input name to be a variable so I can distinguish where this input is sent from and act accordingly in when processing the input.
I can't seem to get this variable name to change and I only get the actual variable name to be sent instead of the value of the variable. The variable I am trying to send is mem_or_ven. "$mem_or_ven", the name is literal: $mem_or_ven. If I leave out the quotes, no luck, either. I would appreciate any help!!
Here is my code:
<?php
if (isset($_POST["member_x"])) {
$mem_or_ven = "member"; }
?>
<form id="loginForm" name="loginForm" method="post" action="register-exec.php">
<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<th>First Name </th>
<td><input name="fname" type="text" class="textfield" id="fname" /></td>
</tr>
<tr>
<th>Last Name </th>
<td><input name="lname" type="text" class="textfield" id="lname" /></td>
</tr>
<td> </td>
<td><input name="$mem_or_ven" type="submit" name="Submit" value="Register" /></td>
</tr>
</table>
</form>
THX!