Redirect to page a came from when logged in

I have tried to make a function that returns to the site I was on when i pressed log in, but it gives me the error:
[15-Feb-2013 08:04:56 UTC] PHP Warning: end() expects exactly 1 parameter, 0 given in /Users/camillaandersen/Documents/MDU/Interaktion/PHP/dag4/site/login.php on line 31

Line 31 is where it says end();

First i need to explain my coding
On each site a set a variable with the path to the site
I include a file called common, where i set the cookie.
Then in the login file I set a variabel url, wich i want to use in setting the header location, but here it fails.

Can you please help me figure out what the problem is?

[php]
$path = “gallery.php”;
include(‘include/common.php’);

setcookie(“last_visited”,"");
setcookie(“last_visited”,$path);

$url = isset($_COOKIE[‘last_visited’]) ? $_COOKIE[‘last_visited’] : “./”;

header(“Location: ./” . $url);
end();
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service