yami007 Posted March 25, 2009 Share Posted March 25, 2009 i type arabic in the input but when the htmlentities function gets it back it displays random characters like Greek i only want to get this error out of my form please help.. Link to comment https://forums.phpfreaks.com/topic/151080-solved-problem-with-htmlentities-and-arabic/ Share on other sites More sharing options...
WolfRage Posted March 25, 2009 Share Posted March 25, 2009 Ummm can you post some code so I/we can better understand what you mean? Link to comment https://forums.phpfreaks.com/topic/151080-solved-problem-with-htmlentities-and-arabic/#findComment-793741 Share on other sites More sharing options...
Yesideez Posted March 25, 2009 Share Posted March 25, 2009 Have you set the character set in the HTML header? Link to comment https://forums.phpfreaks.com/topic/151080-solved-problem-with-htmlentities-and-arabic/#findComment-793754 Share on other sites More sharing options...
yami007 Posted March 27, 2009 Author Share Posted March 27, 2009 ah sorry !! well, here's the processing code : <?php include_once("../includes/form_functions.php"); if (isset($_POST['submit'])) { $Name = mysql_prep($_POST['name']); $Time = time(); $errors = array(); $empty_name_error = '<span class="redError">( Enter the product name please !)</span>'; if ( !isset($_POST['name']) OR empty($_POST['name']) ) { $name_error = $empty_name_error; $errors[] = 'name'; } if ( empty($errors)) { $query = "INSERT INTO sales ( name, timestamp ) VALUES ( '{$Name}', '{$Time}' )"; $result = mysql_query($query); if ($result) { $message1 = '<span class="greesSuccess">the product has been added to the database</span>'; } else { $message1 = '<span class="redFail">we could not submit the form please try again later !</span>'; } } else { $message2 = '<span class="redError">you're advised to correct these errors</span>'; } } ?> and here's the form : <form action="adding_product_process.php" method="post" onsubmit="backslash('guestbooktext');BBcode_close('guestbooktext'); return verifchamps();" > <table width="80%"> <tr> <td valign="top"> product name : </td> <td><input style="font-family: Traditional Arabic; unicode-bidi: embed;"type="text" name="name" value="<?php echo htmlentities($Name); ?>" /> <span><?php echo $name_error; ?></span> <span></span> </td> </tr> <td colspan="2"><input type="submit" name="submit" value="submit" /></td> </table> Link to comment https://forums.phpfreaks.com/topic/151080-solved-problem-with-htmlentities-and-arabic/#findComment-795506 Share on other sites More sharing options...
yami007 Posted March 28, 2009 Author Share Posted March 28, 2009 ok guys, solved it the problem was in htmlentities(); i did not know that it does not support arabic characters, so i got rid of it and everything is working fine now ^^ Link to comment https://forums.phpfreaks.com/topic/151080-solved-problem-with-htmlentities-and-arabic/#findComment-795593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.