LoginSignup
0
0

More than 1 year has passed since last update.

header関数でリダイレクトしてみる

Posted at

phpの「header」をつかってみた

header関数が優秀だったのでメモに残しておきます

使い方

※使う前に注意点↓
headerを使うときは上にhtmlを書くことができない

sample.php
<?php
header("Location:./main.php");
    exit();
?>

と記述します。
これを実行するとmain.phpに飛ぶことができます。
exit();と記述することでこれ以降のコードを実行しないようにしています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0