iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Internet Security Discussion Forum This forum is for the discussion of security related issues. If you find a new Phishing scheme, spyware, virus or malicious site - let us know about it. If any of the above found you... here's where you ask for help.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-26-2007, 07:05 PM
WebProWorld New Member
 
Join Date: Nov 2003
Location: Hamilton
Posts: 21
fpeter RepRank 0
Default Form security

Hi everyone

I've been trying for weeks now to find a solution to my problem but can't find it anywhere, hope there is someone out there that can help.

It took me months to get a form to look the way I wanted it to and to get it to do what it should, which is send me the information.

Now my problem is that I am getting a lot of forms submitted with web addresses in the fields.

Firstly, Is there any way to stop these links being added or a way to just delete or reject the infomation?

Secondly, one of my forms asks for the websites URL to be added but can I restrict the form to only accept .com and .co.uk websites and delete the rest?

Is there a line of code I can add to the cgi script to do this or how do I configure the script.

Would really appreciate some help on this guys
Reply With Quote
  #2 (permalink)  
Old 07-27-2007, 10:49 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,661
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Form security

It is possible to filter these strings out in the script that processes the form submissions. What language is the CGI script in? Also, for the web addresses that you want removed, is it link code that is being entered, or just the domain name being entered, or a full url?

To filter out all URLs other than .com and .co.uk, the following code should work:
PHP Code:
if (eregi("^(http://){0,1}[a-z0-9\-_.]*(.com|.co.uk)$"$_POST['url'])) {
     
$url $_POST['url'];
} else {
     
$url FALSE;

__________________
The best way to learn anything, is to question everything.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Internet Security Discussion Forum

Thread Tools
Display Modes

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
Form Post Redirect to Form Get GiftsForYouBiz Web Programming Discussion Forum 0 09-26-2006 05:51 PM
Form problems using Visual Form Mail whatever Graphics & Design Discussion Forum 7 01-04-2006 04:14 PM
Form to Thank You ohlson Graphics & Design Discussion Forum 16 12-27-2005 11:27 AM
Pre-populating an HTML Form with Data from Another HTML Form ambassador Web Programming Discussion Forum 3 06-19-2005 10:12 PM
Form Help nooksandniches Web Programming Discussion Forum 4 09-29-2004 06:39 AM


All times are GMT -4. The time now is 11:08 PM.



Search Engine Optimization by vBSEO 3.3.0