Jump to content

[SOLVED] problem with htmlentities() and arabic !!!


yami007

Recommended Posts

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>

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.