Can't get PHP to produce Alert() box

Links for php scripts

Moderators: gesf, Michalio

Post Reply
pizzipie

I have following code:

Code: Select all

$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
iago

What does dbCheck() exactly return?
Strider64

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