Php coding help - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: Php coding help (/showthread.php?tid=29609) Php coding help by king_of_cool_kids on 08-07-2004 at 05:35 AM
Ok. I have a contact form on my site, and have a JavaScript code to stop multiple submitting in one go. However, recently I have been getting lots and I think it may be because people have JavaScript turned off in their browser. I was talking to a friend this morning, and he said that the same effect could be done using php, and that it is more secure and reliable. RE: Php coding help by WDZ on 08-07-2004 at 05:55 AM
That javascript probably only works until the page is refreshed... someone could send one, refresh the form, paste the message back in, send another, and so on. quote:PHP being more secure and reliable than javascript? Yes, definitely. quote:You want to stop the same person from submitting 2+ messages in a row? Does your contact script store anything on the server or just send an e-mail? If nothing is stored, the easiest method is probably setting a cookie, but that's not really secure, because the submitter could reject or delete it. A more secure method of duplicate-checking would be storing the submitter's IP address on the server (in a text file or database) and then checking/updating it next time a submission is made. RE: Php coding help by king_of_cool_kids on 08-07-2004 at 06:16 AM
ok, well, basicly, I want something (php) that will disable the submit button once clicked, and have a time span of 3 mins between submitions. RE: Php coding help by WDZ on 08-07-2004 at 06:30 AM
quote:Hmm... well, because PHP is server-side, it can't disable the submit button right away like javascript can. The user would have to reload the form before the submit button could be disabled. quote:Are you sure that's enough? Someone could spam you with almost 20 messages per hour if they were determined... If you use the cookie-based method, you could simply set a cookie with a 3-minute expiration time. With the other method, you'd have to store a time on the server along with the IP. RE: Php coding help by king_of_cool_kids on 08-07-2004 at 06:36 AM
a) Whats an fast, reliable option to stop people from submitting lots of times?? RE: Php coding help by KeyStorm on 08-07-2004 at 08:58 AM
Well, you can user sessions to do that, although people could keep restarting their browsers to override that. RE: Php coding help by king_of_cool_kids on 08-09-2004 at 05:13 AM
ok, so how do I go about (in php or another reliable coding) setting up anything to stop people from submitting things lots of times in one go by either disabling the button, or whatever?? So long as they cant click, click, click heaps of times, then im happy. RE: Php coding help by -dt- on 08-09-2004 at 06:43 AM if i remember right the noscript tag will display whats inside it insted of the javascript if scripts are off code: RE: Php coding help by king_of_cool_kids on 08-09-2004 at 06:56 AM ??? Im talking about a script that tests if Javasciprt is enabled. If so, lets the form be processed, if not, on loading the page, make the submit button grey with the words "Need Javascipt on to use form" RE: Php coding help by ddunk on 08-09-2004 at 07:10 AM http://www.webaim.org/techniques/javascript/alternatives - Read 4.2 Using the <noscript> Element, including the Example RE: Php coding help by king_of_cool_kids on 08-09-2004 at 10:33 PM Thanks Ddunk. I am now using this code: code:It works for accedental spam, |