son Posted December 30, 2008 Share Posted December 30, 2008 I check some input fields before letting user upload data. Now I found that the dash character prevents user uploading data although I allowed it in my reg expressions. I would appreciate if you had a look at: if (!eregi ('^[[:alnum:]\ \:\-\?\&]{2,200}$', stripslashes(trim($_POST['heading'])))) { $h = FALSE; $errors['heading'] = '\'Heading\' not in correct format or too long'; } else { $h = escape_data($_POST['heading']); $heading_echo = $h; } I also tried without the dash escaped? Where am I going wrong?Son Link to comment Share on other sites More sharing options...
son Posted December 31, 2008 Author Share Posted December 31, 2008 Moved now the dash character to the end and works as:if (!eregi ('^[[:alnum:]\ \:\?\&\-]{2,200}$', stripslashes(trim($_POST['heading'])))) {Does anyone know what is the difference? Although it is working now, do not really get why it did not work before...Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.