I do not understand what your question is.
Although a bit confusing, the code you are showing should work fine.
If this is the simpler option you are looking for, I would prefer to do it like this:
if(isset($_POST['page_form']))
{
switch ($_POST['page_form'])
{
case "1":
break;
case "2":
break;
default:
die ("something not right there");
}
}
EDIT:
try it. I would be surprised if this did not work.
<?php
if(isset($_POST['page_form']))
{
switch ($_POST['page_form'])
{
case "1":
echo "form 1 submitted<br>";
break;
case "2":
echo "form 2 submitted<br>";
break;
default:
die ("something not right there");
}
foreach ($_POST as $var => $val) echo "$var => $val<br>";
}
?>
<form method="post">
<input type="text" name="test">
<input type="submit" name="submit">
<input type="hidden" name="page_form" value="1">
</form>
<form method="post">
<input type="text" name="test">
<input type="submit" name="submit">
<input type="hidden" name="page_form" value="2">
</form>
, , :
<?php
if(isset($_POST['page_form']))
{
foreach ($_POST as $var => $val) echo "$var => $val<br>";
}
?>