Input name

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Depending on certain other conditions I need to read in a specific input  
name from a form.

This works...


But occasionally there is a value of x in this name that can be changed by  
other conditions.

When processing the form I can not get this syntax right. I have tried these  

$test2=$_POST['realname' & $x];
$test3=$_POST["'realname' & $x"];
$test6=$_POST["'realname'" & "$x"];

Any ideas of the syntax when including a variable x in a $post input  

Garry Jones

Re: Input name

$value = $_POST['realname' . $x];


$value = $_POST["realname$x"];

should both work if $x is alphanumeric character [a-zA-Z0-9_]. If $x
contains dot '.' you need to replace it with underscore '_' (e.g.
result of image map).

If this doesn't help, post a bit more code and examples


Site Timeline