How to pop an alert message box using PHP?

adil picture adil · Dec 13, 2012 · Viewed 765.2k times · Source

How to pop an alert message box using PHP?

Answer

Peter Gluck picture Peter Gluck · Dec 13, 2012

You could use Javascript:

// This is in the PHP file and sends a Javascript alert to the client
$message = "wrong answer";
echo "<script type='text/javascript'>alert('$message');</script>";