Jump to content

valitdation address


wenxi

Recommended Posts

You have a '\' infront of the ']'. Not correct. Should be a space in between I guess.

 

You sure some adresses arent longer than 50? Btw, I should seperate streetname (with or without house number (can be seperate)), city, province, country, postal code

 

FD

Link to comment
https://forums.phpfreaks.com/topic/55592-valitdation-address/#findComment-274789
Share on other sites

so what is the code like? If i want to chunk them all up?

 

if (!ereg("^[a-zA-Z0-9-]{3,100}$", $_REQUEST['tfaddress']))

        {

            $adderr = "* Please Enter a valid address name that only contain letter, space and -";

            $error++;

        }

 

Link to comment
https://forums.phpfreaks.com/topic/55592-valitdation-address/#findComment-274981
Share on other sites

If you wanna validate Urls You can use this

if (preg_match('/(?P<protocol>\w+):\/\/(?P<domain>[-A-Z0-9.]+)(?P<file>\/[-A-Z0-9+&@#\/%=~_|!:,.;]*)?(?P<parameters>\\?[-A-Z0-9+&@#\/%=~_|!:,.;]*)?/i', $url, $m)) {
print_r($m);//Matched
} else {
//Not Matched
}

Hope it helps.

Link to comment
https://forums.phpfreaks.com/topic/55592-valitdation-address/#findComment-277408
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.