Jump to content

[SOLVED] header('location: ');


next

Recommended Posts

I'm trying to redirect when user is logged out:

http://localhost/ahk_php/sidebar_links/logout.php

to

http://localhost/ahk_php/index.php

here's my code, logout.php:

<?php
session_start();
require_once($_SERVER['DOCUMENT_ROOT'] . '/ahk_php/config.php');
session_destroy();
header('location: ' . $_SERVER['HTTP_HOST'] . '/ahk_php/index.php');
?>

But here instead of: http://localhost/ahk_php/index.php

i get: http://localhost/ahk_php/sidebar_links/localhost/ahk_php/index.php

 

Why is it appending instead of replacing url completely?

Link to comment
https://forums.phpfreaks.com/topic/114860-solved-headerlocation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.