Jump to content

language switch problem


rilana

Recommended Posts

Hello everyone

I am making a multilanguage site. Meaning that the english Navigation will have a little (d) for german.

And by clicking on it the same page from a different folder should be displayed. So far I cam up with:

 

<?php 

function sprache() { 

switch($_REQUEST['language'])
{
case 'englisch': 	HEADER("Location:/english/");
				break;
case 'deutsch':	    HEADER("Location:/deutsch/");
}

}  
?>

 

For the header in each document and

 

<a href="?language=deutsch">deutsch</a>

for the link that should call the funktion

 

I am shure that this should be a verry easy task, but my knowledge of php and coding

are not verry good as you can see. I realy would aprechiate to get some help, some pointers

how to get this thing working.

 

Thank you verry much, Rilana

Link to comment
Share on other sites

thanks

 

something is defenetly happening now. but it doesn't work fully yet.

When I klick on de (d) it cant find the page because it is looking in the

wrong directory. I used this code....

 

<?php 

function sprache() { 

switch($_REQUEST['language'])
{
case "english":
header("Location: " . $_SERVER['DOCUMENT_ROOT'] . "../english/");
exit;
break;

case "deutsch":
header("Location: " . $_SERVER['DOCUMENT_ROOT'] . "../deutsch/");
exit;
break;
}

}  
?>

 

And unsted of going ../english it goes english/deutsch maby the $_SERVER['DOCUMENT_ROOT'] has something to do with that.

thats why I tryed ../deutsch but it still doesn't work.

 

Thanks again.

Link to comment
Share on other sites

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.