I have built a form for adding new members. In the form, I have a line that reads:
I then verify that the data is correct using:HTML Code:<p><b>Roll:</b> <input type="text" name="roll" size="10" maxlength="10" /> <small>either "user" or "admin"</small></p>
I am not getting past this check, and I have tried several different approaches.PHP Code:if (preg_match ('%^(admin|user])$%', stripslashes(trim($_POST['roll'])))) {
$rl = escape_data($_POST['roll']);
} else {
$rl = FALSE;
echo '<p><font color="red" size="+1">Please enter a valid roll!</font></p>';
}
Is this a good way to test that the roll is correct?
Why



Reply With Quote


)

Bookmarks