I want to get html form element by post with the name being a php variable
<form method="post" action="action.php"><input type="submit" name="'.$name.'"></form>
$var=$_POST['What do i put here?'];
try this, use $_POST array in foreach:
foreach ($_POST as $key => $value) echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
i hope it will be helpful.