Making the form Secure & Restricting Chars

This is a discussion on "Making the form Secure & Restricting Chars" within the PHP Forum section. This forum, and the thread "Making the form Secure & Restricting Chars are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 2nd, 2007, 18:05
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Making the form Secure & Restricting Chars

I need to know how i can make my form input box secure, because I've heard of entering something which will then delette your site I only have one input box so it should be a quick task.

I also need to know how i can restrict characters like @-)("£$%^&*( etc etc. I only want letters & numbers to be entered. Thanks.
Reply With Quote

  #2 (permalink)  
Old Aug 2nd, 2007, 18:11
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Making the form Secure & Restricting Chars

Try this - PHP Mail Form: Secure and Protected
Reply With Quote
  #3 (permalink)  
Old Aug 2nd, 2007, 18:56
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Making the form Secure & Restricting Chars

That seems far to complex for me to just jump into, got anything a little more less complex and just what i need? I think i just need strip splashes for one.
Reply With Quote
  #4 (permalink)  
Old Aug 2nd, 2007, 20:00
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Making the form Secure & Restricting Chars

stripslashes is one of the things you do not want to just add - PHP adds extra slashes to protect the casual user against injection attacks, and you should ONLY use striplashes once you understand how it works.

If you want to check whether a field ONLY contains letters and numbers, you can write:

Code: Select all
if (strspn(strtolower($_REQUEST[myfield]) ,"0123456789abcdefghijklmnopqrstuvwxyz") < strlen($_REQUEST[myfield])) {
    .... problem handling code here
} else { 
    ..... code for good case here
}
Reply With Quote
Reply

Tags
restricting, secure

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
restricting access to folders on server sudhakararaog PHP Forum 3 Mar 30th, 2008 18:48
PHP mail() --> Making a Form / Validating Input / Sending an email c010depunkk PHP Forum 4 Jan 17th, 2008 06:35
Passwords - restricting access to the webpage or parts of it pengyou Starting Out 5 May 24th, 2007 11:38
Secure E-mail form troubles BGarner PHP Forum 2 Mar 15th, 2007 20:22
Making a form for newsletter subscription jamesbowers Web Page Design 16 Jan 4th, 2007 09:36


All times are GMT. The time now is 01:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43