如果其他条件形式行动

时间:2016-07-22 11:15:23

标签: php forms if-statement

我们可以在表单操作中使用if else条件:

<form action="<?php if(condition)
{
//redirect to some view file or show error
//run some queries

}
else
{
//redirect to another view
}
 ?>" method="post">

1 个答案:

答案 0 :(得分:2)

试试这个

    <?php if(condition)
    {
//your html code goes here
    echo <<<HTML
<!--some codes-->
    HTML;
    }   else    {
    //your another html code goes here
    echo <<<HTML
<!-- some another codes codes-->
    HTML;
    }