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

Best Christmas 2014 UK tech deals, Boxing Day 2014 UK tech deals & January sales 2015 UK tech...

IDG UK Sites

Apple's 2014 highlights: the most significant Apple news of 2014

IDG UK Sites

Watch this heartwarming Christmas short by Trunk for composer John Rutter

IDG UK Sites

Ultimate iOS 8 Tips: 35 awesome and advanced tips for using iOS 8 on iPhone and iPad