add cadastro
This commit is contained in:
26
lista/ativar.php
Executable file
26
lista/ativar.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$servername = "localhost";
|
||||
$username = "root";
|
||||
$password = "";
|
||||
$dbname = "xcmg";
|
||||
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
if ($conn->connect_error) {
|
||||
die("Conexão falhou: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["id"])) {
|
||||
$id = intval($_POST["id"]);
|
||||
$sql = "UPDATE cadastros SET status = 1 WHERE id = $id";
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
echo "success";
|
||||
} else {
|
||||
echo "error";
|
||||
}
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user