Home  >  Q&A  >  body text

After PHP finishes executing the program, it wants to perform a form submission action.

I want to execute the SUBMIT action of a form after the SQL insert program is successfully inserted. How should I write it, fellow experts! Thank you!

if($result){
这里面应该如何写呢!
}
<form action='/1.php' name='form2' method='post'>
<input type='text' name='name' value=''>
<input type="submit" name="submit" value="UPLOAD">
</form>
PHPzPHPz2734 days ago390

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-05-16 13:16:38

    echo "<form style='display:none;' method='post' action='/1.php'>

              <input name='test' type='text' value='test' />
         
            </form>
            <script type='text/javascript'>function load_submit(){document.form1.submit()}load_submit();</script>";

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 13:16:38

    if($result){
        echo '$(function(){
            $("form").submit();
        })';
    }

    reply
    0
  • Cancelreply