-2
how do I create a php button that when it has some status in the database it is disabled, when no database status is enabled
-2
how do I create a php button that when it has some status in the database it is disabled, when no database status is enabled
1
I suppose you’re using PHP mixed with HTML, so it would look something like this:
<?php
// restante do código onde você pega o status no banco e guarda na variável $status_banco, por exemplo
$status_botao = $status_banco == true ? "" : "disabled";
// seta a propriedade 'disabled' do botão de acordo com o status
print "<button ".$status_botao."> Botão </button>";
?>
However, the ideal is to completely separate PHP code from HTML, search a little about PHP templates.
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
Button in PHP? Implementing a PHP graphical interface or this button is HTML?
– Woss
Welcome to Stackoverflow please refer to the following link https://answall.com/help/how-to-ask
– Amadeu Antunes
You can create a bool in the database (true or false) and when it is false, you will check with ajax and disable it, when it is true, you enable. Do with Ajax.
– Lucas de Carvalho