hey everyone,
I have a quite enervating problem here. i am trying to read a webpage, that automatically sets the site language according to the system language. Ie, my host is located in denmark, and hence the whole webpage is in danish. You can however reset the language to whatever language you want on a 'settings' menu, which is using cookies. So, my question being: can you somehow set a cookie on the file reader, making it read the webpage in english instead of the default language?
Help would be very much appreciated!
setting cookie "on self" when reading another webp
Moderator: General Moderators
You will have to have the language files yourself, if that's what you're asking. You'll have to have a language file or similar for each language that you want the site to be in.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Yeah, I'm sure.
The cookie could set a value for the site to load the appropriate language file.
e.g.
Of course, the rest of your site will need to be able to deal with the constants or variables or whatever defined in lang/en.php (for example).
There's no functions to translate your web site to a different language. You'll have to do it on your own, or perhaps find a third party language translater (if they exist in the manner you wish).
The cookie could set a value for the site to load the appropriate language file.
e.g.
Code: Select all
if (isset($_COOKIE['lang']) && in_array($_COOKIE['lang'], $allowedLanguages))
{
require 'lang/' . $_COOKIE['lang'] . '.php';
}There's no functions to translate your web site to a different language. You'll have to do it on your own, or perhaps find a third party language translater (if they exist in the manner you wish).
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
sorry if i didn't explain my problem good enough.
this has nothing to do with my webpage; i'm trying to read (with file i/o) another webpage, which has a cookie-based language system. And, when i'm reading this webpage, i don't want it to be in danish or whatever - i want it to be in english, so that my regex matches don't have to be translated. i'm working on a php based meta-search engine you see
this has nothing to do with my webpage; i'm trying to read (with file i/o) another webpage, which has a cookie-based language system. And, when i'm reading this webpage, i don't want it to be in danish or whatever - i want it to be in english, so that my regex matches don't have to be translated. i'm working on a php based meta-search engine you see
Send the cookie data with the request for the page. It's a pain to do using fsockopen(), but really easy using Curl http://uk3.php.net/curl .