Possible Duplicate:
PHP URL encoding retaining invalid url characters
I use a form similiar below in admin panel . Where admin can login and post status(uses both database and file system).
<form method="post" action="post.php">
Title : <input type="text" name="title">
Content : <textarea name="status" rows="10" cols="60"></textarea>
</form>
In post.php
$title = trim(strip_tags($_REQUEST['title']));
If an admin posts a status. A folder will be create with the entered title and the title name is stored in mysql database. But when an admin use Special characters like “?” , the url is encoded something like this http://example.com/title? and it shows 404 not found. So how can i replace special characters of title element to entity number.
It will be helpful if the answer is in php
Try this
$title = trim(strip_tags($_POST[‘title’]));
followed by
urlencode($title);
Should do what you need.
http://de3.php.net/manual/en/function.urlencode.php