Jump to content

submitting japanese text. how to do it ?


anatak

Recommended Posts

Hello,

I am trying to make a form where the button will display the action (submit, clear, send, send password) in the language the user selects.
I am trying to get this to work with english and japanese to start.
the english version works but the japanese not
Does anybody know what exactly happens when a string is submitted with a <form method="POST">

the first function is to determine if a user has set a language or has submitted a change for the language.
the second funtion is to display the dropdown menu.
the funtcion $case=button_caption(3); gets the caption out of a mysql database and is the caption displayed on the button.

I am getting desperate and thinking about giving up on multilanguage forms. (IF ONLY IE supported buttons decently)

I would be very thankfull if anyone can show me a way (any way) how to make a button with different language captions.
Maybe it can be done using images with the caption ?

Thank you for looking
anatak

[code]
<?php
//- language_set() //set the language session var if not defined or changes the session var
//- language_dropdown() //displays the dropdown menu for the languages


function language_set()
{
if(!isset($_REQUEST['submit'])){
echo "geen request submit<br />";
if(!isset($_SESSION['userlanguage'])){
$_SESSION['userlanguage']='001'; //default English
}
}else{
$submit=$_REQUEST['submit'];
echo "submit: " . $submit."<br />";
$case=button_caption(3);
// $case="'".$case."'";
echo "case: ".$case."<br />";
if ($submit==$case){echo "submit == case<br />";}
if($_REQUEST['submit']==$case){
echo "submit in case= ".$_REQUEST['submit']."<br />";
$_SESSION['userlanguage']=$_POST['Language'];
echo "language= " . $_SESSION['userlanguage']."<br />";
}
}
}



function language_dropdown()
{
//select all the available languages
$Table01 = "language";
$Query01 = "SELECT * FROM $Table01
WHERE LanguageHide = 1
ORDER BY LanguageLan_Language;";

$Table02 = "language_button";
$language = "Lan_ButLan".$_SESSION['userlanguage'];
$Query02 = "SELECT Lan_ButValue, $language FROM $Table02
WHERE Lan_ButId=3";

// echo $Query02;
//open read connection
read_connection();
//execute query
$Result01 = mysql_query($Query01) or die(mysql_error());
$Result02 = select_1_row_check($Query02);
//close read connection
read_close();
if (gettype($Result02)== 'string'){
echo 'there was a problem please contact the administrator with the following message: ';
echo $Result02;
}else{
$Row02 = mysql_fetch_array($Result02);
}
?>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']."?page=index"; ?>" >
<table>
<tr><td>Select your language</td></tr>
<tr><td>
<select name="Language">
<?php
//get results in row and display row
while($Row01 = mysql_fetch_array($Result01)){

?> <option value="<?php echo $Row01['LanguageLan_Nr']; ?>"><?php echo $Row01['LanguageLan_Language']; ?></option>
<?php
}
?>
</select>
</td></tr>
<tr><td>
<?php $button=button_caption(3); ?>
<input type="submit" name="submit" value="<?php echo $button; ?>">
<br /><a href="<?php echo $button; ?>"><?php echo $button; ?></a>

<?php echo "<br />test".$button=button_caption(3); ?>

</td></tr>
</table>
</form>
<?php
}


?>
[/code]
Link to comment
Share on other sites

I have this as header
[code]
<?php
session_start();
//IE6 session fix
header("Content-type: text/html; charset=utf-8; Cache-control: private");

[/code]

but it does not make any difference
befor I had this in my HTML
[code]
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[/code]

Link to comment
Share on other sites

Thank you for the suggesting but I have to keep everything in UTF-8 as the website has to be able to switch between languages.
changing the character set to EUC-JP is really not a good thing to do I think.

I guess there is not a real way around my problem.
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.