search

Home  >  Q&A  >  body text

js passes multiple values ​​to php

I just learned PHP, and then I saw that a value passed is
function doDel(id) {
if(confirm('Confirm deletion?')) {
window.location='action.php? action=mdel&w_id=' id;
}
}
I want to pass two. Can you change it based on this (I made it up below, it is wrong)
function up(id, p_id){
if(confirm('Confirmation completed?')) {
window.location='action.php?action=mcom&w_id=' id '&p_id=' p_id;
}
}

YOSIN_LYOSIN_L2354 days ago1141

reply all(1)I'll reply

  • 无忌哥哥

    无忌哥哥2018-06-15 09:14:02

    It is possible to pass multiple values, but you have to bind the value you want to pass in the click event.

    reply
    0
  • YOSIN_L

    Yeah, thank you. I found out that I wrote something wrong in another PHP file. No wonder I couldn’t receive the value.

    YOSIN_L · 2018-06-15 09:36:07
  • Cancelreply