DaDaBIK
This forum is devoted to the discussion about the software DaDaBIK database front-end
the PHP Database application generator for MySQL, PostgreSQL and SQLite; also available for Wordpress.

Welcome! Log In Create A New Profile

Advanced

URL validation - hyphens

Posted by mauri 
URL validation - hyphens
March 20, 2012 11:41AM
Hi,

it seems DaDaBIK 4.3_beta considers hyphen "-" as not allowed in URL's - and it is actually valid. http://www.faqs.org/rfcs/rfc2396.html specifies what is allowed, but I guess the simplest thing to do is to avoid the trouble completely by using the PHP function:

function is_valid_url($url)
// goal: chek if an url address is valid, according to its syntax
// input: $url
// output: true if it's valid, false otherwise
{
  if ( filter_var( $url, FILTER_VALIDATE_URL ) == FALSE )
    return FALSE;
  else
    return TRUE;
} // end function is_valid_url


greetings
Mauri Tikka
mauri@machina.fi
Re: URL validation - hyphens
March 26, 2012 07:59AM
Hi Mauri I've just tried to insert http://www.ci-ao.com and it actually works.

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Sorry, only registered users may post in this forum.

Click here to login