I have a simple form to insert data to a mysql database. Data is added in both English and Russian
<form class="form" action="add.php" accept-charset="UTF-8" method="POST">
<p class="username">
<input type="text" name="name" id="name" >
<label for="name">product name</label>
</p>
<p class="description">
<input type="text" name="description" >
<label for="description">description</label>
</p>
<p class="usersubmit">
<input type="submit" name="submit" value="Send" >
</p>
</form>
PHP
//fetching and storing the form data in variables
$name = $con->real_escape_string($_POST['name']);
$description = $con->real_escape_string($_POST['description']);
//query to insert the variable data into the database
$sql="INSERT INTO products (name, description) VALUES ('".$name."','".$description ."')";
name is set to varchar(255) utf8_general_ci
description text utf8_general_ci
The above form works fine, but the problem occurs when i try to add certain Russian words.
For example, when I try to add Тегеран
as the name and submit it gives me a 404 page not found error. But when I remove Т
it works fine and data gets inserted. Another example is 35 Луи де Фюнес
, when I submit with that, it gives a 404 error but when I remove Л
it works perfectly. There are many other words with the same problem.
Can someone let me know what's causing this and how can I fix this?