i have form within modal after submitting form it goes on .php page. so i want to prevent this from doing this. rather it should stay on the same modal. below is my php code. please let me know how to add ID of modal into header so that form will directly go onto that modal only.
<?php
include 'db.php';
if (isset($_REQUEST['insert']))
{
$contractno = $_REQUEST['contractno'];
$doctype = $_REQUEST['doctype'];
$contractdate = $_REQUEST['contractdate'];
$validupto = $_REQUEST['validupto'];
$Remark = $_REQUEST['Remark'];
$sql = mysqli_query($conn,"INSERT INTO `contract`(`projectId`, `contractNo`, `documentType`, `contractDate`, `action`, `contractValueBase`, `validUpto`, `remark`) VALUES ('".$contractno."','".$validupto."''".$doctype."''".$contractdate."''".$validupto."')");
if ($sql>0)
{
header('Location: contracts.php');
echo 'data added successfully';
}
}
?>