Jump to content

Recommended Posts

Hi Everybody

 

Please help, I am doing a webpage with two different languages. So I have a folder 'english' with all the files and a folder 'deutsch' with the same files called the same names. In the english navigation I have a button where I can choos the same page but in german. And I know there is a way to switch the root folder but still link to the same file.....  I dont know if you understand what I mean but I found some kind of code, but just dont know how to get it to work....

 

switch($_REQUEST['language'])

{

case 'englisch': HEADER(Location:/english');

break;

case 'deutsch':       HEADER(Location:/deutsch');

}

 

Does anyone here know what I am talking about and any clue on how I could solve this problem??? I would realy aprechiate your help. Thanks a lot....

 

???

Link to comment
https://forums.phpfreaks.com/topic/72918-switch_requestlanguage/
Share on other sites

If you want to use a switch statement, you can make it include whatever files you want.

 

<?php
switch($_REQUEST['language'])
   {
   case 'english':    include_once('/englishfile.php');
               break;
   case 'deutsch':         include_once('/deutshfile.php');
   }

 

I don't particularly reccommend this way, But it is a way you could do it.

 

Regards ACE

thanks a lot for all the info. The link's are verry usefull for further projects. But for now I just wann solve that one problem with the switch. the thing is I dont wanna include anything, I just wanna redirect to the same file in another directorie.... anymore sugestions? My client doesnt wanna get a database.....

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.