我们可以在表单操作中使用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">
答案 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;
}