mysql data being inserted twice via php -


I can not understand why this function is causing many entries in my database table for my life ...

When I run the function, I end up with two recorded stacks on each other

Here's the function:

  function gener_signup_token () {$ connection = New DB_Connect (); // & lt; --- My database connection class $ ip = mysql_real_escape_string ($ _ SERVER ['REMOTE_ADDR']); $ Sign_up_token = uniqid (mt_rand (), true); $ _SESSION ['signup_token'] = $ sign_up_token; $ Sign_up_token = mysql_real_escape_string ($ sign_up_token); Include values ​​in $ Query = "` token_manager` (`ip_address`,` signup_token`) VALUES ('$ ip', '$ sign_up_token') "; Mysql_query ($ query); } Generate_signup_token ();  

The biggest piece of evidence is that this function is being called more than once Is different which signup tokens are being generated.

In addition to this, there is a second difference between joining that can be a sign of multiple page requests. If there is continuous continuation of such inequality, then I will check the access log. If there is only one page request, the function should be called more than once.


Comments