Share information between php pages

Asked

Viewed 59 times

1

I am developing a WEB content and I came across a stumbling block. I have an Item Listing page (Using Jqdatatable).

Listagem de itens

It turns out that in this listing there are two links, one for editing the item referring to line, and another for exclusion.

By clicking on the change or delete icons, the user should be redirected to the respective page, and that page should receive the code of the item that the user wants to change or delete.

I don’t know what to put in "onclick" to get it done. Can someone help me?

Código Fonte

1 answer

2


You can use it location.href with PHP - GET and POST methods.

onClick="location.href='delete.php?itemId=1'"

Ai on your page that delete.php you use $_GET to recover

$itemId= $_GET['itemId'];
  • There is the possibility to put a confirmation box asking and the user really wants to delete that item?

  • Yes @D_alves . You can do this in many ways. One of them is to create a function in javascript;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.