Wrox Programmer Forums
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 30th, 2004, 02:56 PM
Registered User
 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Language toggle

I'm making a page that supports two languages. To control the text, I'm going to use the method I've seen on PHP-Nuke where all non-database text is stored in variables and included from a language file.

Currently I have an image button in the menu that toggles a variable in the address bar. I'm using $_GET to pull the variable to dynamically generate the include language file as well as to change the certain layout graphics.

This method fails when I go to other sections of my site and the language variable isn't carried over. I've checked PHP.net but was unable to find an answer.
 
Old July 31st, 2004, 08:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If the get value is used to set the language on every page, it surely has to be in the querystring of every page. Your answer, then is simply to change every internal link on your site to:
<a href="page.php?lingo=<?php echo $_GET['lingo']; ?>">

Not terribly elegant, though.

Dan
 
Old August 2nd, 2004, 11:00 AM
Registered User
 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there a way to make it more elegant? By including it as a session variable or cookie?






Similar Threads
Thread Thread Starter Forum Replies Last Post
hi xml toggle effect gauravkg XSLT 1 September 8th, 2006 09:04 AM
Toggle/Drilldown help...please!!! s15199d Reporting Services 4 March 24th, 2006 04:11 PM
Toggle CheckBox g_vamsi_krish ASP.NET 1.0 and 1.1 Basics 1 February 13th, 2006 03:00 AM
Toggle Buttons ctekk2005 Access 3 June 15th, 2005 03:36 AM
Toggle Key calvados VB.NET 2002/2003 Basics 2 December 17th, 2004 10:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.