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/

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

[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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.