php - best way to pass input through ajax -


As

I want to send some sensitive information such as 'User ID' through AJAX, which is the most Well, right now I'm just linking to the html tag's ID and then sharing it and using it. Please suggest a better way. I hope that there should be one for it

identification value (such as user_id ) Is not the best way to move them all at all. If you can, then I take the current user_id from one session , thus it is not possible to change a user "user_id" so that someone else has to adopt.

However, if this option is not fit in your application, you can always hashish user_id on the server side, such as:

  md5 ($ user_id. "Randomsalthere ");   

Then when you check the request, see:

$ _ POST ['secret_hash'] == MD5 ($ _ POST ['user_id '],' Randomaltere ');

link:



Comments