Good day to all of you. As the title says I need help about facebox when updating a data(s).
Here's the code for the button to show the facebox
echo '
td>
<a rel="facebox" href="../admin/c_status.php?id='.$row["userID"].'">Edit</a>
</td>
';
and here's the code inside facebox
<?php
include("../db/dbCon.php");
//$id = $_GET['id'];
//echo $id;
?>
Status
<form method="post">
<select name="selActive" id ="selActive">
<option value="ACTIVE">ACTIVE</option>
<option value="IN-ACTIVE">IN-ACTIVE</option>
<option value="GRADUATE">GRADUATE</option>
</select>
<br>
<br>
<button class="btn btn-success btn-block btn-large" name="saveChangeButton" id ="saveChangeButton">Save Changes</button>
</form>
<?php
if(isset($_POST['saveChangeButton'])){
$id = $_GET['id'];
$status = $_POST['selActive'];
$cStatus = $conn->prepare("UPDATE useraccount SET status = :status WHERE userID = :userID");
$cStatus->bindParam(':status', $status);
$cStatus->bindParam(':userID', $id);
$cStatus->execute();
}
?>
The problem I encounter is the data won't update via clicking the edit button BUT when I edit via address bar like "http://localhost/ict/admin/c_status.php". It will work.