We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message
Contact Forum Editor

Send an email to our Forum Editor:


PLEASE NOTE: Your name is used only to let the Forum Editor know who sent the message. Both your name and email address will not be used for any other purpose.

Tech Helproom


It's free to register, to post a question or to start / join a discussion


 

Resticting categories in forms.


Awestruck

Likes # 0

I use HTML forms with a PHP handler to obtain emailed feedback. Some retarded low lives use these to email gobbeldygook and dodgy links. How can I restrict what is entered ? For instance I wish to restrict some text entries to numbers only. And to prevent web addresses being entered in textareas. I know how to check that an email address has the correct syntax but that is the extent of my abilty to insist on certain entry formats.
Awestruck

Like this post
Awestruck

Likes # 0

I found some code that did the trick

//check that no urls have been inserted in the message text area
if (strpos ($message, '://')||strpos ($message, 'www') !==false){
header( "Location: $errormsgurl" );
exit ;
}

I hope others will find this helpful
Thank you for all your concern and help

Like this post

Reply to this topic

This thread has been locked.



IDG UK Sites

Windows 10 release date, price, features UK: Staggered release with PCs coming first this summer -...

IDG UK Sites

In defence of BlackBerrys

IDG UK Sites

Why we should reserve judgement on Apple ditching Helvetica in OS X/iOS for the Apple Watch's San...

IDG UK Sites

MacBook Pro 15in preview: better battery life, faster storage and a new discrete graphics chip may...