Jump to content

[SOLVED] php header regirect


Jagarm

Recommended Posts

header("Location: URL"); please note the URL is the absolute URI so myfile.php won't work correctly

your need to use "http://{$_SERVER['HTTP_HOST']}/Blar.php"

 

<?php
/* Redirect to a different page in the current directory that was requested */
$host  = $_SERVER['HTTP_HOST'];
$uri   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'mypage.php';
header("Location: http://$host$uri/$extra");
exit;
?>

header("Location: URL"); please note the URL is the absolute URI so myfile.php won't work correctly

your need to use "http://{$_SERVER['HTTP_HOST']}/Blar.php"

 

<?php
/* Redirect to a different page in the current directory that was requested */
$host  = $_SERVER['HTTP_HOST'];
$uri   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'mypage.php';
header("Location: http://$host$uri/$extra");
exit;
?>

 

I did that that but still doesn't work, is not the url that is wrong

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.