Reputation: 28586
I have a only one .php (root/process.php
) file for multiple languages
root/en/command.htm
root/fr/command.htm
root/ru/command.htm
and so one. However, for each of commands I have a thankYou.htm
in the same folder:
root/en/thankYou.htm
root/fr/thankYou.htm
root/ru/thankYou.htm
How do I redirect the page after processing it in the process.php
?
// redirect to a thank you page
header("Location: " .$_SERVER['HTTP_REFERRER']. "\thankYou.htm");
this does not work: Error 404. Normally, if the referrer is root/ru/command.htm
by e.g., so the php should sent user to root/ru/thankYou.htm
etc.
Upvotes: 0
Views: 2140
Reputation: 32878
Try a slash instead a backslash:
header("Location: " .$_SERVER['HTTP_REFERER']. "/thankYou.htm");
Upvotes: 2
Reputation: 798526
In HTTP it's misspelled as "referer", so you want $_SERVER['HTTP_REFERER']
.
Upvotes: 2