Can't get PHP to produce Alert() box

A

Anonymous

Guest
I have following code:

Code:
$msg=dbCheck($database); // check if db exists

if(substr($msg, 0,2)!="OK") {
[b]    
echo "<script type='text/javascript'>alert(".$msg.")</script>";[/b]

exit();
}

It will not produce the alert() box.

Found this on the internet as an example in several places but can't make it work.

Help to get it working appreciated.

R
 
More importantly how is checking if a database exists have anything to do with this script or better yet what is the purpose of it? I mean isn't more important to check to see if the message exists?
 
Back
Top