Simple College Notice Board

Hey Guys! In this tutorial i'm gonna teach you how to create a Simple College Notice Board. This simple tutorial is created in PHP and Bootstrap for better responsive design and function of the said project. We create this Simple College Notice Board for a special purposes to the Colleges or every School's, the purpose of this project is to make the Student, Teacher or Staff Remind or Notice in every activities or announcements. And only the admin of the school can use this project, the admin can send a message individually to the student, teacher and staff. Every message that the admin creates or send to the receiver the receiver will accept a message from the admin so the receiver will notify or notice if their's an activity or announcement.

Sample Code

Notify.php - This is the first page or the index of the application, it compose of HTML content and a PHP script to display and creates messages in a single page.
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Simple College Notification Board</title>
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <link rel = "stylesheet" href = "bootstrap/css/bootstrap.css" type = "text/css"/>
  7. <link rel = "stylesheet" href = "bootstrap/css/bootstrap.min.css" type = "text/css"/>
  8. </head>
  9. <body>
  10. <div class="container">
  11.         <div id="content" align="center">
  12.                 <form action="notifyexec.php" method="post">
  13.                 <h1>Simple College Notice Board</h1><hr/>
  14.                 <p>Choose Where To Send The Notice</p>
  15.                 <select name="position" class="ed">
  16.                         <option value="student">Student</option>
  17.                         <option value="teacher">Teacher</option>
  18.                         <option value="staff">Staff</option>
  19.                 </select><br/><br/>
  20.                 Message<br>
  21.                 <textarea type="text" name="message" class="ed" rows="5" class="form-control"></textarea><br/><br/>
  22.                 <input type="submit" class="btn btn-primary" value="Send" id="button1">
  23.                 </form>
  24.         </div><hr/>
  25.  
  26. <table class="table table-bordered">
  27. <h2 align="center">Message Log</h2><hr/>
  28.     <thead>
  29.       <tr>
  30.         <th>Student</th>
  31.         <th>Teacher</th>
  32.         <th>Staff</th>
  33.       </tr>
  34.     </thead>
  35.     <tbody>
  36.       <tr>
  37.         <td><div id="content">
  38.                         <?php
  39.                         include('connect.php');
  40.                         $result = mysql_query("SELECT * FROM noticemsg WHERE position='student'");
  41.                                         while($row = mysql_fetch_array($result))
  42.                                                 {
  43.                                                         echo '<li>'.$row['message'].'</li>';
  44.                                                 }
  45.                         ?>
  46.                         <div class="clearfix"></div>
  47.                         </div></td>
  48.         <td><div id="content">
  49.                         <?php
  50.                         include('connect.php');
  51.                         $result = mysql_query("SELECT * FROM noticemsg WHERE position='teacher'");
  52.                                         while($row = mysql_fetch_array($result))
  53.                                                 {
  54.                                                         echo '<li>'.$row['message'].'</li>';
  55.                                                 }
  56.                         ?>
  57.                         <div class="clearfix"></div>
  58.                         </div></td>
  59.         <td><div id="content">
  60.                         <?php
  61.                         include('connect.php');
  62.                         $result = mysql_query("SELECT * FROM noticemsg WHERE position='staff'");
  63.                                         while($row = mysql_fetch_array($result))
  64.                                                 {
  65.                                                         echo '<li>'.$row['message'].'</li>';
  66.                                                 }
  67.                         ?>
  68.                         <div class="clearfix"></div>
  69.                         </div></td>
  70.       </tr>
  71.     </tbody>
  72. </table>
  73. </div><div id="footer" align="center"><a href="https://www.sourcecodester.com">Sourcecodester &copy 2016</a></div>
  74. </body>
  75. </html>
NotifyExec.php - This is for the execution of the message from the admin through the receiver.
  1. <?php
  2. include('connect.php');
  3. function clean($str)
  4.         {
  5.                 $str = @trim($str);
  6.                 if(get_magic_quotes_gpc())
  7.                         {
  8.                         $str = stripslashes($str);
  9.                         }
  10.                 return mysql_real_escape_string($str);
  11.         }
  12. $position = clean($_POST['position']);
  13. $message = clean($_POST['message']);
  14.  
  15. mysql_query("INSERT INTO noticemsg (position, message) VALUES ('$position','$message')");
  16.         header("location: notify.php");
  17. ?>
result Hope that you learn in my tutorial. And don't forget to LIKE & SHARE this website. Enjoy Coding.

Comments

nice project that you post.continue in this a wey

You write some excellent tutorials and I have learned from them. But, how about helping us learn by using mysqli? Only constructive criticism and not being ungrateful... Truly appreciate the time you take to create these tutorials.

I am getting an error, HTPP ERROR 500 Local Host is unable to process this Command

Add new comment