Hi!
I'd like to ask how to redirect from one PHP to another PHP provided that they are in a different directory. I already found a code that can redirect from one PHP page to another PHP page. However, that is only in the same directly. The code is shown below:
PHP Code:
<?php
/* Redirect to a different page in the current directory that was requested */
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'anotherpage.php';
header("Location: http://$host$uri/$extra");
exit;
?>
I'd like to know how to redirect to another page in an upper directory.
----> index.php
----> idliketogohere.php
[subfolder]
--> currentpage.php
--> anotherpage.php