<form action="<?php if(isset($redirect)&& $redirect == "f"){echo "#";}
else{ ?>add_new_item2.php?user_id=<?php echo $_GET['user_id']; }?>" method="post">
//no need to expose this area here
<input type="submit" value="submit" name="submit" />
</form>
//the processor
<?php
if(isset($_POST['submit']))
{
$redirect = "f";
if(whatever)
{
//the if condition comes here
}
else //all if conditions are satisfied
{
$redirect = "t";
}
}
我想做的很简单,在表单操作中我希望操作为 action="#" 如果尚未满足 if 条件并且如果满足,则操作将为 action="add_new_item2.php?user_id=123"