开发者

Including one PHP file in another

开发者 https://www.devze.com 2022-12-08 19:48 出处:网络
How can I go from one *.php file to another *.php file ? For example, if I have this in index.php: <?php

How can I go from one *.php file to another *.php file ? For example, if I have this in index.php:

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

and this in second.php:

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

I have tried include('index.p开发者_StackOverflow社区hp');, but it doesn't work at all. Any suggestions?


Do you mean a redirect?

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

精彩评论

暂无评论...
验证码 换一张
取 消