Perad Posted March 4, 2008 Share Posted March 4, 2008 There is a flash button on my website. When the button is pressed the person is redirected to a language page. The language page then changes their languages and returns them to the previous page. I thought that what I did was awesome and so simple. <?php session_start(); $_SESSION['language'] = 'Eng'; $back = $_SERVER['HTTP_REFERER']; header("Location: $back"); ?> In Firefox it works, in Internet Explorer it redirects the user to the flash header, not the webpage which they came from. Check it out. http://www.jasonstanleydesign.co.uk/showcase/site/ Quote Link to comment Share on other sites More sharing options...
shocker-z Posted March 4, 2008 Share Posted March 4, 2008 I think this may be because of the activex control for flash being represented by a separate entity. Try this mate <?php session_start(); $_SESSION['language'] = 'Eng'; ech o $_SERVER['HTTP_REFERER']; ?> ech o has a space in as the forum is a bit frigged and wont allow me to submit posts with the word ech o without the space. What does it return? I'm guessing it will be the sqf location. Might want to set it to direct them to the homepage as they are unlikley to read 3 pages in english then suddenly realise that they are french. They are most likley just going to click straight away. Regards Liam Quote Link to comment Share on other sites More sharing options...
haku Posted March 4, 2008 Share Posted March 4, 2008 [pre]You can write echo If you put your code in brackets like you are supposed to. ----------------------------------------------- OP - You shouldn't need to go to another page at all. I have done the exact same thing you are doing and I basically did it like this. If your site is bilingual, you can add a link in your page using the following code: echo "<a href=\"process_language_change.php?return=" . urlencode(PHP_SELF) . "\">Japanese</a>"; Note: 1)set 'Japanese' to whatever language you use 2) I actually dont use the php self command, I use a function that I found on the net. The forum wont let me post it though. Then, in process_language_change.php you set this code: $deadline = time() + (3600*24*14); ($_COOKIE['language'] == "jp") ? setcookie("language" , "en", $deadline, "/schools/") : setcookie("language", "jp", $deadline, "/schools/"); header ("Location: " . urldecode($_GET['return'])); Note: this script relies on the language being stored in a cookie called 'language'. Now if you have more than one language, then you do the exact same thing, except instead of a link, you create a mini form with one drop down menu. You set the action of the form to be the same as the href of the link I provided above. Then in the processing page, you set the cookie to equal the p.o.s.t value of whatever is selected from the drop down menu.[/pre] Quote Link to comment Share on other sites More sharing options...
shocker-z Posted March 4, 2008 Share Posted March 4, 2008 [pre]You can write echo If you put your code in brackets like you are supposed to. Come on i've done well over 1,000 posts dont you think i tried that? lol It was bout 30-60 minutes before the site got hacked. I couldn't even upload a txt file as i got access denied and the issue with it not posting was not a general thing. Had issues creating new topics also. Regards Liam Quote Link to comment Share on other sites More sharing options...
haku Posted March 4, 2008 Share Posted March 4, 2008 haha my bad! Fair enough - I was having troubles posting that exact same post in which I said that, so I hear what you are saying. Quote Link to comment Share on other sites More sharing options...
shocker-z Posted March 4, 2008 Share Posted March 4, 2008 It's alright mate, the site has been tipsy all day! It got totally redirected to a hacking site earlier. Liam Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.