phpapachehttp-redirectwampssi

How can I redirect using a PHP script called from an SSI?


On a WAMP server, I have a server-side include in a file, a.shtml, composed of the following code:

<!--#include virtual="./req.php"-->

The contents of req.php are:

<?php
Header("Location:index.php");
echo "still here";
?>

When I open a.shtml, I see the text still here, but the page has made no attempt to redirect itself. Why is this? And is there any way to make it work?

Thanks for the help

EDIT: The reason I want to do this is because I have some session variables that I want to influence the way the PHP script acts. If the session variables are not set, I need it to redirect to a login page. I know I can just write the entire thing in PHP, but I'd like to do it this way if possible. If it's not possible to change header information from an included PHP file from SSI, then I'll just do it entirely in PHP.


Solution

    1. it's impossible

    2. you don't need that.

    just address tour script that set session variables directly, not through ssi