douzhushen_9776 2014-05-15 17:52
浏览 16
已采纳

PHP重定向问题[重复]

This question already has an answer here:

At the moment, I have form in my index.html file:

<div id="submit">
    <form action="upload.php" method="post" enctype="multipart/form-data">
    Select your file: <input type="file" name="file"><br><br>
    <input type="submit" value="Upload">
    </form>
</div><!--end submit-->

It runs the code I have in the upload.php file however, I would like the page to return to the index.html file.

How do I accomplish this?

</div>
  • 写回答

1条回答 默认 最新

  • dongxiqian2787 2014-05-15 17:54
    关注

    After you're done processing the form in upload.php, include the code:

    header('Location: index.html');
    exit;
    

    This will only work if upload.php isn't actually outputting anything (including whitespace).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?