PHP Alert Box

Welcome to my_alert: A PHP-JS based Alert System!

An aleternative of JavaScript’s Ugly alert() function! 😉

It Uses JS actually to make alert-boxes & PHP for the easiest-maintanence of codes.


Live Demo: Go to this link, checkout the effects and message-box. Don’t worry about the language!

How to Use?

Upload the Directory “my_alert” to your server root. Remember, this location is important, since we will be including source files from this directory.

You may also use your own directory, in that case configure it at my_alert.php

Next steps are simple:

Open the page where you want to use my_alert. On the Document HEAD, type the following:

<?php require_once('my_alert.php'); // This is the location where the file is stored.
my_alert_head(); ?>

On the Document BODY, type following code:

<?php my_alert_body(); ?>

IT’s done! Now you can use my_alert whenever on your Page!

PHP Demo:

By PHP, you can type following to add a simple alert:

<?php my_alert('Hello', 'This is a message!'); ?>

// If you want to redirect to an URL after showing the message, you may also put the optional parameters:

<?php my_alert(‘Hello’, ‘This is an OK message’, 1, ‘‘); ?>

// The Third parameter is an OK – look & Feel! There are 4 such status:

// 0: Information (default), 1: OK, 2: Error, 3: Warning JavaScript? Demo:

JavaScript Demo:

By JavaScript, you can type following to add a simple alert:

<script type = "text/javascript">
      my_alert('hello', "This is working!");

There are More Opportunities!

*Explore the source-codes to use the self-explained functions!

*Change the css files as necessary to use your customized message boxes!

*In PHP, you can use a my_alert_die(*parameters*) function to show an alert-box & then die or die_back!


Works Best with Firefox & Opera. Also works in Explorer.


The product is Open-Source, & free, of course. However, when using directly, or being customized, you must keep the Author-information intact for legal use. 🙂


Download from Official Site | Download from Mirror (Google)


Shafiul Azam

Progmaatic Developers Network ||

You may also jump to:


3 thoughts on “PHP Alert Box

  1. The link to live demo does not work any more — seems the domain got expired 😦

    Instead, visit this page and go to the bottom of the page. Click any of the links (About this site / Submit your site/ Contact us!) and you will see the effect.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s