Jump to content

Recommended Posts

:shrug:

 

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!

Link to comment
https://forums.phpfreaks.com/topic/240200-using-input-with-a-variable-name-tag/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.