I'm having a little problem, I'm creating an application and I plan to have two forms on the same page. It turns out that when I run the first one, I have no problems, but when I run the second, the first one returns, and because it has no data an error occurs. To try to work around this problem I created an input hidden:
<input type="hidden" name="opti" value="1">
<input type="hidden" name="opti" value="2">
<input type="hidden" name="opti" value="3">
Since the first line is in the first form and the other two are in the second. I intended that although they were on the same page that did not conflict and for that I created a cycle if :
if (isset($_POST['opti']) == '1')
{
// Executa o calculo quando existir
if ($_SERVER['REQUEST_METHOD']== "POST")
{
$fabric = $_POST['Fabric'];
$spare = $_POST['Spare'];
$xres = $_POST['Xres'];
$yres = $_POST['Yres'];
$mspeed = $_POST['Mspeed'];
$lents = $_POST['Lents'];
$sensor = 1280;
Calculos
}
}elseif (isset($_POST['opti']) == '2')
{ tabela}
Then when I load the first form , I can do all the calculations without problem, but then when I want to create the table, with the second form , the first and the fields are blank gives error.
Thank you.
Page code is here: link