Which characters make a URL invalid?

In general URIs as defined by RFC 3986 (see Section 2: Characters) may contain any of the following 84 characters: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;= Note that this list doesn’t state where in the URI these characters may occur. Any other character needs to be encoded with the percent-encoding (%hh). Each part of the URI has further restrictions about … Read more

My form’s validate() is not working

You should use document.getElementsByName if you want to fetch the value using name attribute. I would recommend to do it by “id” attribute. function submitFunction() { var firstName = document.getElementsByName(“first_Name”)[0].value; if (firstName == “” || firstName == null || firstName.length == 0) { alert(“First Name is required”); return false; } } Also add return to … Read more

how to make a function that validates fields in a form? php [closed]

Here is a simple implementation – function validateUserName($uname){ $illegalCharacters = array(‘!’,’@’,’#’); // first check the length $length = strlen($uname); if ($length < 5 && $length > 10){ return false; }else{ // now check for illegal characters foreach($illegalCharacters AS $char){ if (strpos($uname,$char) != -1){ return false; } } } return true; } $userName = “user1905577”; if … Read more