TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-17-2008, 07:56 PM   #21 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by khile View Post
just in a php file
erm....

then do..?

PHP Code:


 
if ($_GET['your_language']=="en")
{
   echo 
' THE ENGLISH DOCUMENT CONTENT HERE ';
} else if (
$_GET['your_language']=="de")
{
echo 
' THE GERMAN DOCUMENT CONTENT HERE ';

__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-18-2008, 09:27 AM   #22 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Quote:
Originally Posted by Orc View Post
erm....

then do..?

PHP Code:


 
if ($_GET['your_language']=="en")
{
   echo 
' THE ENGLISH DOCUMENT CONTENT HERE ';
} else if (
$_GET['your_language']=="de")
{
echo 
' THE GERMAN DOCUMENT CONTENT HERE ';

Lol, he's picky
__________________
Tanax is offline  
Reply With Quote
The Following User Says Thank You to Tanax For This Useful Post:
Orc (04-18-2008)
Old 04-22-2008, 03:37 PM   #23 (permalink)
The Contributor
 
Evulness's Avatar
 
Join Date: Apr 2008
Location: Tampa, FL
Posts: 65
Thanks: 6
Evulness is on a distinguished road
Default

i think i understand what he wants....
a language switch...
erm give me a moment, i haven't used switch much...

How are you storing your language data though?
you could do something like this maybe?
Code:
<?php
$lang_status = $_GET['language_status'];

if ($lang_status) {
switch ($lang_status){
case 'de': 
$check_status_lang ='de';
    break;
case 'nl':
$check_status_lang ='nl';
    break;
case 'ru':
$check_status_lang ='ru';
    break;
default:
    $check_status_lang ='en';
endswitch;
}
}
that might not work directly, just a quick script to show what i ment...

Depending on how your storing your data... include/echo/return/print whatever the data you want... or do what orc posted... pretty much the same thing...

PHP: switch - Manual
for more info
__________________
"Knowledge is power. Abuse it."~Evulness
My portfolio: www.evularts.com
Send a message via AIM to Evulness
Evulness is offline  
Reply With Quote
Old 04-22-2008, 03:41 PM   #24 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Evulness View Post
i think i understand what he wants....
a language switch...
erm give me a moment, i haven't used switch much...

How are you storing your language data though?
you could do something like this maybe?
Code:
<?php
$lang_status = $_GET['language_status'];

if ($lang_status) {
switch ($lang_status){
case 'de': 
$check_status_lang ='de';
    break;
case 'nl':
$check_status_lang ='nl';
    break;
case 'ru':
$check_status_lang ='ru';
    break;
default:
    $check_status_lang ='en';
endswitch;
}
}
that might not work directly, just a quick script to show what i ment...

Depending on how your storing your data... include/echo/return/print whatever the data you want... or do what orc posted... pretty much the same thing...

PHP: switch - Manual
for more info
thats pretty much what we've been talking about the whole time, but yeah you can use switch, either way.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 04-22-2008, 04:20 PM   #25 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

That switch doesn't make any sense though, it's just applying the same string to a different variable. Wouldn't

PHP Code:
if (!empty($lang_status)) {
    
$check_status_lang $lang_status;
} else {
    
$check_status_lang "en";

be a much quicker way of doing that? Or even better,

PHP Code:
$check_status_lang = (empty($lang_status)) ? "en" $lang_status
I haven't read this whole thread, so I'm just offering up some alternatives to the last example there. I like switches, but I'm also partial to having the shortest code possible sometimes too.
-m
delayedinsanity is offline  
Reply With Quote
Old 04-22-2008, 06:57 PM   #26 (permalink)
The Wanderer
 
blayne4k's Avatar
 
Join Date: Apr 2008
Location: Trapped in my own little world.
Posts: 14
Thanks: 0
blayne4k is on a distinguished road
Default

Im confused about what hes asking, I think he has a huge document showing both of them and wants an anchor? Im not even sure
blayne4k is offline  
Reply With Quote
Old 04-22-2008, 07:36 PM   #27 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Okay, do you want it to return data from a database, straight text from the file, or what? At first I thought you were trying to install language modules, as did others I think. Easy enough, check the data, and return something based on that. Then I read back through and it looks like you may be wanting to return a portion of a text file, based on the query string?

Show us everything you have so far. I think this should be as easy as using a switch, but I'm not clear on what's going on so far.
delayedinsanity is offline  
Reply With Quote
Old 04-23-2008, 05:23 AM   #28 (permalink)
The Contributor
 
Evulness's Avatar
 
Join Date: Apr 2008
Location: Tampa, FL
Posts: 65
Thanks: 6
Evulness is on a distinguished road
Default

I said it might not work :0P

he hasn't said how he's storing the data... so we can't really tell him how to do whatever it is he's looking to do...
__________________
"Knowledge is power. Abuse it."~Evulness
My portfolio: www.evularts.com
Send a message via AIM to Evulness
Evulness is offline  
Reply With Quote
Old 04-23-2008, 04:11 PM   #29 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Oh we can still tell him what to do. Never needed a reason before!
-m
delayedinsanity is offline  
Reply With Quote
Old 04-23-2008, 04:34 PM   #30 (permalink)
The Contributor
 
Evulness's Avatar
 
Join Date: Apr 2008
Location: Tampa, FL
Posts: 65
Thanks: 6
Evulness is on a distinguished road
Default

LOL too true!
Its up to him if he wants to listen or not.
__________________
"Knowledge is power. Abuse it."~Evulness
My portfolio: www.evularts.com
Send a message via AIM to Evulness
Evulness is offline  
Reply With Quote
Old 04-23-2008, 09:10 PM   #31 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

In status.php:

PHP Code:
if($_GET['check_status_lang'] == 'en')
{
    echo 
'en part';
}
else if(
$_GET['check_status_lang'] == 'de')
{
    echo 
'de part';
}
else
{
    echo 
'invalid language!';

__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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


All times are GMT. The time now is 02:33 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design