简体   繁体   中英

How to set PHP session in onclick event HTML without POST/ GET/FORM

I have a problem with my work. There is a repetition for button and value based on database. I want to set PHP session when button HTML get clicked for identification which one value and button in repetition is clicked.But it's impossible to used FORM/POST/GET. because FORM tag already used for another need which is used in the same page. So it can't used FORM/POST/GET twice, right?

Here's my Code

<?php
while($result=pg_fetch_row($call)){
    echo
            "<tr>
            <td  align=\"center\" class=\"form\">$result[0]</td>
            <td align=\"center\"  class=\"form\">$result[1]</td>
            <td align=\"center\" class=\"form\">$result[2]</td>
            <td align=\"center\" class=\"form\">$result[3]</td>
            <td  class=\"form\" width=\"2%\">
                  <a id=\"selector\" href=\"#\"><img width=\"120%\"height=\"130%\" src=\"../img/view.png\"/></a>
            </td>
            </tr>\n";
  }
?>

The button in Code

<td  class=\"form\" width=\"2%\"> <a id=\"selector\" href=\"#\"><img  width=\"120%\"height=\"130%\" src=\"../img/view.png\"/></a>
</td>

I want to set PHP session to catch it in another page which is the another page would be a popup page in this current page.

What am i supposed to do? Thankyou in Advanced. if you don't understand, let me know. :D

Maybe you are looking for something like localStorage

With local storage, web applications can store data locally within the user's browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM