| Add the style sheet to the page | <link href="msgbox_style.css" rel="stylesheet" type="text/css"> | ||||||
| First you need to include the main class file. | include("msgbox.inc.php"); | ||||||
| Create the instance of the class | $a=new msgBox("This is just a Message ","OKCancel","Jack Said!" ); | ||||||
| The constructor takes three parameters: The message to be displayed, The buttons in the message box and The title of the message box. |
|||||||
| Following are the valid arguments for the 2nd parameter: OKOnly: Displays only the OK Button OKCancel: Displays OK and Cancel Button AbortRetryIgnore: Abort, Retry and Cancel YesNoCancel: Yes, No, Cancel YesNo: Yes and No RetryCancel: Retry Cancel |
// these are the valid args for the second param |
||||||
| The class need an array of links to create the buttons. For each button it requires a page to which it creates the link. | // define the links $links=array("abort.php","retry.php","ignore.php"); // make the links $a->makeLinks($links); |
||||||
| The final step draws the msgBox Enjoy! |
// draw the message box $a->showMsg(); |
||||||
| The Final Code | |||||||
<link href="msgbox_style.css" rel="stylesheet" type="text/css"> |
|||||||
| Here are other samples! | |||||||
| $b=new msgBox("An unnamed file was not found","OKOnly","Setup"); # use the makeLinks() for the buttons to work $b->showMsg(); |
|
||||||
| $b=new msgBox("You need to spend more money on me before I'm going to do anything consistantly.","OKCancel"); # use the makeLinks() for the buttons to work $b->showMsg(); |
|
||||||
| $b=new msgBox("Bad Command or File Name","AbortRetryIgnore"); # use the makeLinks() for the buttons to work $b->showMsg(); |
|
||||||
|
$b=new msgBox("FATAL system error #911","YesNoCancel","Call Him!!!!!!"); # use the makeLinks() for the buttons to work $b->showMsg(); |
|
||||||
| $b=new msgBox("Do you love me?","YesNo","Love me Love me Not?"); # use the makeLinks() for the buttons to work $b->showMsg(); |
|
||||||
| $b=new msgBox("Out of order!!","RetryCancel","Damn!"); # use the makeLinks() for the buttons to work $b->showMsg(); |
|
||||||