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
https://forums.phpfreaks.com/topic/81369-language-switch-problem/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.