I have a simple php coding problem here. I have a button id 'register' for user to click. But the code below does not run it once the button is clicked.
<?php
try {
if (isset($_POST['register'])) {
require_once('library.php');
$user_id = $identity->user_id;
$status_type = 'M';
$data = array('status' => $status_type);
$dbWrite->update('user', $data, "user_id = $user_id");
header('Location: main.php');
exit;
}
} catch (Exception $e) {
echo $e->getMessage();
}
Anyone can help me ?