php - Posting several vars via JavaScript -


i want post via javascript several vars can't, doesn't anything.

after script done running, want send vars via post can read them "$_post" , use them in php script

here example of script

function finish() {  var cnt1 = 50;  var tim = 60;  var hecho = 1;  $.post("index.php", { t:tim }, { m:cnt1 }, { e:hecho } ); } 

i this:

top.location.href="index.php?e="+hecho+"&t="+tim+"&m="+cnt1; 

but don't want use because users see variables, want use post bit harder hack.

what doing wrong?

you put variables single object:

$.post("index.php", { t:tim, m:cnt1, e:hecho } ); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -