du kan lave det med en session.
vilkaar.php
- <?php
- session_start();
- ?>
- <html>..<!-- sidens indhold her -->..</html>
- <?php
- $_SESSION["last_page"] = array_pop(explode("/",__FILE__));
- ?>
opret.php
- <?php
- session_start();
- if(isset($_SESSION["last_page"]) && $_SESSION["last_page"] != "vilkaar.php")
- {
- header("location: vilkaar.php");
- exit;
- }
- ?>
- <html>..<!-- sidens indhold her -->..</html>
- <?php
- $_SESSION["last_page"] = array_pop(explode("/",__FILE__));
- ?>