July 12th, 2000, 11:07 AM
My site is in Dutch and English available.
Nowadays I give links for UK-version something like: "link.html?version=UK".
(Default is Dutch -> "link.html")
The problem is a next link they use on the next page falls back in NL-version. Is there a way to store the contents of the version-variable in a environment-like variable? So that a visitor will allways have UK (variable set) or Dutch pages (unset).
July 12th, 2000, 11:43 AM
Are you using sessions?
If so, you can use a session variable.
Alternatively, you can:
- Store the language in a cookie.
- Pass the querystring to every page.
July 12th, 2000, 01:30 PM
I generally don't use sessions, I just store everything in the url like so....
That way, if the page was opened with a value for version, it will load every link with that url parameter.
July 13th, 2000, 07:24 AM
Well never though of using sessions... I guess spiders like them. -->
Using the normal way may give trouble being indexed by search engines --> "link.html?bla=bla"
July 13th, 2000, 08:37 AM
If you don't want to use sessions or cookies, then you'll just have to code the original value of $version into every page. Let's say on the first page they click and $version is set to "UK", so on your next page, if you want to link to mypage.html, you'll have to use mypage.html?version=<?php echo $version; ?>, if you have a form, you'll have to include a hidden form element to passs along version. <input type=hidden name=version value="<?php echo $version; ?>">
sesions or cookies would be easier. it'd also be easy to just have two totally different directories with each version. that way once you choose a version, you're in the right directory and all of the pages in the dir are in the same language.