Here is the example HTML code I am using:
HTML Code:
<form id="form1" name="form1" method="post" action="">
<p>
Submit everything here:
<input name="text" type="text" id="text" />
<input type="submit" name="Submit" value="Submit" />
</p>
And here is the example PHP code (located on the same page):
PHP Code:
<?php echo($_POST['text']); ?>
As you can see, I'm simply using this form to accept text input, and when clicking "Submit", the page refreshes and outputs the POST data.
And now, here's the problem... When typing a word using international characters (e.g. ﺮﺫﺾﺻﺹﺶﻊ <-- I have no idea what that means, btw), I get this outputted to my browser: ﺮﺫﺾﺻﺹﺶﻊ. Yes, it's the exact same thing, but if I take a closer look inside the HTML code, I can see that these letters look like this:
Code:
& #65198;& #65195;& #65214;& #65211;& #65209;& #65206;& #65226;
(Edit: THERE ARE NO SPACES BETWEEN & and #, the forum keeps parsing these codes into arabic characters, and that's why I had to split them)
What should I do when I want to use these characters for something else? E.g. put them inside a MySQL database? I don't want them to be in this form! How do I convert them back to their original form? Any ideas?
PS: Tried fiddling around with the chr() and ord() functions, but I would rather take a look if there are any simpler ways to solve this!
__________________
Please login or register to view this content. Registration is FREE - My humble homecooked blog (with extra salt)
Last edited by bureX; 04-21-2006 at 01:31 PM..
|