Question

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.

Was it helpful?

Solution

Try a slash instead a backslash:

header("Location: " .$_SERVER['HTTP_REFERER']. "/thankYou.htm");

OTHER TIPS

In HTTP it's misspelled as "referer", so you want $_SERVER['HTTP_REFERER'].

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top