Re: [PHP] Passing Objects between scripts and guarateeing thata language has been choosen.

This is a discussion on Re: [PHP] Passing Objects between scripts and guarateeing thata language has been choosen. within the PHP General forums, part of the PHP Programming Forums category; [snip] How can I guarantee that a language is always choosen? I mean how is this done professionally? What do ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-04-2003
Matt Matijevich
 
Posts: n/a
Default Re: [PHP] Passing Objects between scripts and guarateeing thata language has been choosen.

[snip]
How can I guarantee that a language is always choosen? I mean how is
this
done professionally?
What do I have to write at the beginning of every page?
[/snip]


You have a bunch of options.

on each page you could add something like this to everypage:

if (!isset($_SESSION['language'])){
header("Location: pick_language.php");
}

This will make sure you have a language chosen on each page

to set the language sessions variable you could use something like
this:
$_SESSION['language'] = $_POST['language'];

You could set a permanent cookie (be careful because some users block
cookies) once the user picks a language, then use that cookie to set a
session variable. This would be helpful is someone bookmarked the page,
something like this:

if (isset($_COOKIE['language'])) {
$_SESSION['language'] = $_COOKIE['language'];
}

but there is many more ways to do this. I would try a bunch of
differnet things just to see how things work.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:26 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0