Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 31st, 2005, 7:50 PM   #1
david
Newbie
 
Join Date: Mar 2005
Posts: 2
Rep Power: 0 david is on a distinguished road
Unhappy Restrict 1 form submit per IP

Dear I have website it also have a feedback form.
I am using cgiemail form v1.6

The user mostly submit the feedback form more than one time.
Some times a form submitted more that 10 times with the same Ip address.

I want to restrict submit with one IP Address for atleast 24 hours.

My site hosted at linux \ unix based server
I do not know JSP or PHP.


Please help me to solve this problem
email me at davidjohny@yahoo.com
Thankyou in advance
David

Last edited by david; Mar 31st, 2005 at 7:54 PM. Reason: changing colour
david is offline   Reply With Quote
Old Mar 31st, 2005, 11:16 PM   #2
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
I'll help you as soon as you post in something besides that annoying large font.
tempest is offline   Reply With Quote
Old Apr 1st, 2005, 1:35 AM   #3
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
1. yes anoying font

2. dont restrict by ip address, according to website i only have 1 external ip address yet i have 3 pc's on my network so therefore if 3 people want to submit from the same network they cant due to being on the same ip address.
Berto is offline   Reply With Quote
Old Apr 2nd, 2005, 11:46 AM   #4
magic_e
Programmer
 
Join Date: Jan 2005
Posts: 44
Rep Power: 0 magic_e is on a distinguished road
not sure if this will help but i'd have a look into sessions/cookies and how to limit there life. a dont think it goes off ips but i think it goes off the actual users computer


have fun

magic e

Last edited by magic_e; Apr 2nd, 2005 at 11:54 AM.
magic_e is offline   Reply With Quote
Old Apr 3rd, 2005, 6:40 AM   #5
Overmind
Professional Programmer
 
Overmind's Avatar
 
Join Date: Jun 2004
Location: South Africa, Johannesburg
Posts: 301
Rep Power: 5 Overmind is on a distinguished road
Quote:
2. dont restrict by ip address, according to website i only have 1 external ip address yet i have 3 pc's on my network so therefore if 3 people want to submit from the same network they cant due to being on the same ip address.
But then people could just delete the cookie :/ A good idea might be to use both, but allow the form to be used maybe 3 times by one ip, but once for each cookie...just an idea :/
__________________
[SIGPIC][/SIGPIC]
Overmind is offline   Reply With Quote
Old Apr 4th, 2005, 3:27 AM   #6
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
true but the only proper way would be to have a user loging and keep track of if the user has posted during the current day.
Berto is offline   Reply With Quote
Old Apr 4th, 2005, 4:29 PM   #7
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
It's simple...

create database restrict (
    id int not null primary key auto_increment,
    ip varchar(35),
    time timestamp
);

[php]
<?php
mysql_connect("localhost", "root", "");
mysql_select_db("");

mysql_query("delete from restrict where time >= " . time() + (24*3600));

$result = mysql_query("select * from restrict where ip =\"{$_SERVER['REMOTE_ADDR'}\"");

if(mysql_num_rows($result) == 0) {
$sql = "insert into restrict values('', '{$_SERVER['REMOTE_ADDR']}', '" . time() . "')";
mysql_query($sql);
} else {
die("You cannot access this page for 24hrs after you viewed it last...");
}

mysql_close();
?>
[/php]
tempest is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:52 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC