So, I looked through different posts and other resources and I still cannot make it work. Seems basic and common but I am lost. Here is my code. Page "test_start.php":
<html>
<head>
<title>Test</title>
</head>
<body>
<p>Click <a href="test_script.php">here</a></p>
</body>
</html>
Page "test_script.php":
<?php
session_start();
$_SESSION['passed']="My text!";
header("Location: test_ultima.php");
?>
Page "test_ultima.php":
<?php session_start(); ?>
<html>
<head>
<title>Something</title>
</head>
<body>
<p>This text shows, so redirect worked!</p>
<?php
echo "<p>Result isset: ".isset($_SESSION['passed'])."</p>";
echo "<p>I passed:".$_SESSION['passed']."</p>";
?>
</body>
</html>
When I click on the link I see the following:
This text shows, so redirect worked!
Result isset:
I passed:
What am I doing wrong? Please, if you can, also explein why and how it shall work...
Added Note: The first file is .php because in the end it will contain also some php code... this is obviously an example to first make it work and understand how it works...