I have a bit of code which takes the URL that someone chooses when signing up with my app and checks it. But I’d like to add the following restraints to it.
- Must be at least 3 letters
- No capitol letters
- No certain words “admin, support, etc…”
Here’s what I have so far – but it’s only looking for special letters now:
elseif($action == "validate"){
$option = $_GET["option"];
$value = $_GET["value"];
switch($option){
case "URL":
$sql = mysql_select_db($value,$connect);
if(preg_match ( "@[^A-Za-z0-9]+@i", $value ) > 0) { $valid = "FALSE"; continue; }
$sql == 1 ? $valid = "FALSE" : $valid = "TRUE";
}
1 Answer