简体   繁体   English

在另一个文件中包含一个PHP文件

[英]Including one PHP file in another

How can I go from one *.php file to another *.php file ? 如何从一个* .php文件转到另一个* .php文件 For example, if I have this in index.php : 例如,如果我在index.php有这个:

<?php 
 <form method="POST" action="second.php">
 <input type="button" name="GO">
 </form>
?>

and this in second.php : 而这在second.php

  <?php
    if ($_POST['GO'])
         // HERE SHOULD BE CODE LIKE "INCLUDE" OR SOMETHING TO GO TO index.php
  ?>

I have tried include('index.php'); 我已经尝试过include('index.php'); , but it doesn't work at all. ,但根本不起作用。 Any suggestions? 有什么建议么?

Do you mean a redirect? 您是指重定向吗?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM