Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 30th, 2004, 02:56 PM
Registered User
Join Date: Jul 2004
Location: , , .
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.
Reply With Quote
  #2 (permalink)  
Old July 31st, 2004, 08:38 AM
Friend of Wrox
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts

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.

Reply With Quote
  #3 (permalink)  
Old August 2nd, 2004, 11:00 AM
Registered User
Join Date: Jul 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts

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

Reply With Quote

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 06:21 AM.

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