I'm using PHP to submit a very simple data to db. On my page.php, I have a link, by clicking it I insert its id and some other data in the database. For example:
echo "<a href='".$base_url."?submit=$page_id'> Submit it</a>";
It generates the url like page/test-page/?submit=12
On the top of the page I get the page id with $_GET and insert it to the db in the following way:
if (isset($_GET["submit"])) {
$page_id = $_GET['submit'] //yes, its not secure.
//insert in db.
//get db success/error msg in $db_msg
}
How can I submit the data and get the database success or fail message without refreshing the page.