Guest Posted February 20, 2012 Share Posted February 20, 2012 Bad title, I know. What I mean is I have a code that shows a pop-up error message if you try to post with a username someone else has. Well, I use this code for my user/pass/message fields: $user = preg_replace("/[^A-Z a-z0-9]/", "", $_POST['user']); $password = preg_replace("/[^A-Za-z0-9]/", "", $_POST['password']); $message = preg_replace("/[^A-Za-z0-9]/", "", $_POST['message']); What that does is, if you post with, say, a less than or greater than sign, or some other whack character, it makes the field blank for whichever field(s) you enter other characters into. So really, when someone posts on my forums with a character I do not want them to use in their user/message, it makes the message completely blank, no matter what other allowed characters are used, and the same with the username...so the post will show up without a poster. My question is, what is a code to use so a pop-up box would show up instead of letting the post go through and post blanks? Doesn't even have to be a pop-up box, just something to say to the user, "Hey, you can't use (insert disapproved character(s) here)" and to have the post not go through. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted February 20, 2012 Share Posted February 20, 2012 This is exactly why I asked you no less than THREE times in your other thread what you were trying to accomplish. But you just ignored my question, and well, here you are. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 20, 2012 Share Posted February 20, 2012 Dude.............I'm trying to accomplish: Displaying something instead of having blocked characters post blank messages...... Quote Link to comment Share on other sites More sharing options...
litebearer Posted February 20, 2012 Share Posted February 20, 2012 are your form and php processing on same page? how are you checking the content of the variables? what steps have you to taken to inform user when invalid content is entered? In other words, show us ENTIRE code sans your db password and username. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.