දන්න කෙනෙක් මට මේක හදාගන්න උඩු කරන්නකෝ
මට මේකේ php එකේ රිසල්ට් එකට අනුව html alert එක වෙනස් වෙන්න හදාගන්න ඕනේ
Code:
<?php
if(isset($_POST['submit'])) {
$date = $_POST['date'];
$type = $_POST['type'];
$catagory = $_POST['catagory'];
$amount = $_POST['amount'];
global $connection;
$query = "INSERT INTO log(date,type,catagory,amount)";
$query .= "VALUE ('$date', '$type','$catagory','$amount')";
$result = mysqli_query($connection, $query);
if($result) {
$success =[COLOR="green"] true[/COLOR];
$msg = [COLOR="darkorange"]"Successfully updated"[/COLOR];
} else {
$success = [COLOR="red"]false[/COLOR];
$msg = [COLOR="darkorange"]"Failed to update"[/COLOR];
}
}
?>
Code:
<div
class="alert [COLOR="Red"]alert-warning[/COLOR] [COLOR="green"]alert-success[/COLOR]" role="alert">
[COLOR="DarkOrange"]{msg text}[/COLOR]
</div>
මට මේකේ php එකේ රිසල්ට් එකට අනුව html alert එක වෙනස් වෙන්න හදාගන්න ඕනේ




kochchara try kalath AJAX, JS therenne nane 
or wena mokak hari.. so hema dema try karanna nettam igena ganna ba 
