How to restrict the user to make infinite records by setting the value of the $ _POST [] array of the browser?

advertisements

I have 2 pages Page 1

     <span id="error"></span
     <input type="text" name="email" id="email"/>
     <input type="password" name="pass" id="pass"/>
     <input type="button" value="register" id="reg"/>

     <script>
     var email_r=$('#email').val();
     var pass_r=$('#pass').val();
     $('#reg').on('click', function(){
      $('#error').load('register.php',{ email:email_r , pass: pass_r });
});
     </script>

Page 2
on page 2 I check unique email Id and registration is done,
anyone can set the value through browser and perform infinite registration bomb, how can I secure my login process that will restrict user to misuse it?


Basically there is no easy solution to prohibit malicious activities. You always have to leave the possibility to use the site (since it is the reason you implemented it at first) and this leaves room for malicious activities. You have to differentiate the malicious requests from the "good" requests. This is not easy.

You might search for "captcha" or "honeypot" on the internet and implement an own solution or use an existing one (e.g. http://areyouahuman.com). This is a topic which cannot be answered in one sentence and there is no fits-all solution. If you have no clue at all and do not want to invest too much time, I would recommend searching for an open ready-to-use captcha provider. There are some out there, although I cannot recommend one. These are easy to integrate and provide a good basis.

If your problem is more like a DOS (denial of service) "attack" (like 10 registrations per second), you might search for this keyword. This topic is even more complicated.