Can't get PHP to produce Alert() box

Links for php scripts

Moderators: gesf, Michalio

Post Reply

I have following code:

Code: Select all

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

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

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.


What does dbCheck() exactly return?

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?
Post Reply