Jump to content

Internet Explorer doesn't work the same as firefox?


Perad

Recommended Posts

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/

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

[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]

[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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.