m tryin to create a postcode

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jay23
Forum Newbie
Posts: 12
Joined: Fri Apr 25, 2008 6:44 pm

m tryin to create a postcode

Post by jay23 »

Code: Select all

// Check for a postcode.
        if (eregi ('^[[:alnum:][A-Z]{1,2}\d{1,2} \d[A-Z]{2}}$', stripslashes(trim($_POST['pcode'])))) {
            $pc = escape_data($_POST['pcode']);
        } else {
            $pc = FALSE;
            echo '<p><font color="red" size="+1">Please enter your Postcode!</font></p>';
    }
im trying to create a postcode validation for a form but its not sumbiting the what have i done wrong can some1 help. many thanks to all u all in advance :)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: m tryin to create a postcode

Post by Kieran Huggins »

What's the error you're getting?
jay23
Forum Newbie
Posts: 12
Joined: Fri Apr 25, 2008 6:44 pm

Re: m tryin to create a postcode

Post by jay23 »

there isnt an error message. its just taht the form wont submit
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: m tryin to create a postcode

Post by John Cartwright »

your going to have to be a lot more explanatory than that..
Post Reply