26 lines
552 B
PHP
Executable File
26 lines
552 B
PHP
Executable File
<?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();
|
|
|
|
|
|
|