This is a simple system/program
Push Notification in PHP. This simple code creating a message and passes through the receiver. It has a three components where to send the messages, the
Student,
Teacher,
Staff just for the example.
Sample Code
Script for executing the message.
<?php
include('connect.php');
function clean($str)
{
{
}
}
$position = clean($_POST['position']);
$message = clean($_POST['message']);
mysql_query("INSERT INTO notificatiion (position, message) VALUES ('$position','$message')");
header("location: notify.php");
?>
And the Script for recieving the message
<?php
include('../connect.php');
$result = mysql_query("SELECT * FROM notificatiion WHERE position='student'");
{
echo '<li>'.$row['message'].'</li>';
}
?>
And that's all. Just
download the source code below if you like and enjoy modifying. I hope you learn.