How To use toggle button with php

I would like to insert a toggle button on one of the pages to test but I stocked.

Can anyone tell me how can I get data from this code? I want to send data to MySQL table with php as if the button off =0 if on=1.

This is the toggle botton code.

PHP is server side, buttons (controls) are client side. So no, you can’t use a toggle button. You can send a value to the server side script and based on that value do different things.

can you explain me how to do?

So what are you trying to do as the ultimate goal?

I want to use it as a switch button so this button will change the active and inactive rows.
So if it is off then the row will inactive.
This is the plan.
If you know a better way to do, I am open for all solutions.

So you want to update anything that has an inactive status permanently or just for that viewing? One deals with modifying to view, the other is a call to update the database.

I have 2 tables
first active product
second inactive
I want to use a toggle button on these tables next to each product and when I click on the button on let’s say the second row then this row disappears and go to the second table and same from the second to the firs table.

image

this image is an example
these are the active rows
if you click on the toggle button that rows going to the inactive table

Why would you create two tables for that? You just have a column on the one table that has an inactive flag, or a dateRemoved column that says not to use it.

if is possible that good for me also

Sponsor our Newsletter | Privacy Policy | Terms of Service