POST issues with a certain variable name
Posted: Tue Apr 14, 2009 10:41 pm
I've looked at this, and I just cannot figure it out.
My PHP code outputs the following HTML snippet on my form page. There are several iterations of this depending on the number of lines output from the previous form's SQL query. The number on the end of each name is incremented by one for each row.
The form posts this to my next page when the user hits 'submit'. However, for some reason, I cannot import the 'interfaceX' variable. Here is my next page's PHP code where I have some echo commands for debugging ($x is a looping variable....loop not shown):
When leaving this as is, I get the following error after hitting 'submit' on the first form page:
What is wrong with the $interface variable here? Is there something awry with using that variable with other two interface_xxxxxxx variables?
Thanks in advance!!!!
My PHP code outputs the following HTML snippet on my form page. There are several iterations of this depending on the number of lines output from the previous form's SQL query. The number on the end of each name is incremented by one for each row.
Code: Select all
<td><input type="text" name="client_as1" value=""</td>
<td><input type="text" name="interface1" value=""</td>
<td><input type="text" name="interface_speed1" value=""</td>
<td><input type="text" name="interface_encapsulation1" value=""</td>
Code: Select all
$client_as = $_POST[client_as . $x];
$interface = $_POST[interface . $x];
$interface_speed = $_POST[interface_speed . $x];
$interface_encapsulation = $_POST[interface_encapsulation . $x];
...
...
echo $client_as;
echo "\n";
echo $interface;
echo "\n";
echo $interface_speed;
echo "\n";
echo $interface_encapsulation;
echo "\n";
When I comment out the following, everything works fine:Parse error: syntax error, unexpected T_INTERFACE, expecting ']' in /home/user123/www-develop/path/path/filename.php on line 38
Code: Select all
//$interface = $_POST[interface . $x];
Thanks in advance!!!!