tags:

views:

113

answers:

2

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.

+2  A: 

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

Ignacio Vazquez-Abrams
+2  A: 

Try a slash instead a backslash:

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