If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

I also did a bit of research and found UK landline and mobile numbers contain 11 digits, and the landlines range from 01200 up to 01997 (with the exception of around 50 which are 'not in use' (according to wikipedia)).

is all you really need for a phone number unless you want to allow international numbers (which I assume you dont)

from my experience people will often add spaces (even when you tell them not to)...e.g. '04033 55555'
so you might be well to $input=str_replace(' ','',$input) , then check for strlen() and is_numeric().

I'll have a play around with that code and read up on preg_replace(). Regular Expressions are complicated to understand. Tried using an example code someone gave the other day so thought I'd read up on it.

Can't find any good documentation anywhere for detailed explanations etc.

That is used before additional checking to make sure it is just numbers. Those are the most common things used when someone is entering a phone number or credit card number. After that "cleaning" additional checking is done to make sure it's the proper length and only numeric (and, in the case of a credit card number for example, whether or not it passes MOD10 check).

Regular Expressions are complicated to understand. Tried using an example code someone gave the other day so thought I'd read up on it.....

yup I hate regular expressions as well and the documentation confuses me more often than not , that said the above simply replaces anything that is not a number from 0-9 and is better than string replace (in this case) since it will replace newlines/tabs/+ etc , err well anything that is not a digit

Just wondering what kind of validation would I have to perform on a drop-down list? Never used one in my forms before so I'm not quite sure if I need to validate anything?

I have 2 text areas so the only validation I perform on these 2 is making sure the user entered 400 characters or less.

I was racking my brains last night thinking of a way that my list needs to be validated and to be honest I cannot think of one. The value which someone selects will always be 'default' or one of the product names i.e 'benches' or 'gates'.

The only thing I can see to validate is whether or not the user selected something, in which case I need to distinguish which product it was.

OK, with you now.
Like you said the user can only select from one of the dropdown boxes so in theory you can only ever get one of your pre-determined values.

That said, if someone was to create a POST request to your webpage via CURL or simply from creating their own form its possible they could add their own options so you need to be aware of that.

Normally you would counter that by ensuring that the POST data came from your server and assuming that ALL user input is potentially evil.
You could check that the incoming product_options is one of your predetermined values or run a filter_var() or more regex to check its a string etc, in your case its probably best to check for one of your predetermined values.