Para todos los que han tratado de hacer: echo "<script type='text/javascript'> alert('serial invalido') </script>";
header('Location: index.php?qr='.$qr);
Saben que el alert nunca se va a mostrar, para ello se debe hacer:
function popup($vMsg,$vDestination) {
echo("<html>\n");
echo("<head>\n");
echo("<title>System Message</title>\n");
echo("<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=iso-8859-1\">\n");
echo("<script language=\"javascript\" type=\"text/javascript\">\n");
echo("alert('$vMsg');\n");
echo("window.location = ('$vDestination');\n");
echo("</script>\n");
echo("</head>\n");
echo("<body>\n");
echo("</body>\n");
echo("</html>\n");
}
popup('Serial invalido','index.php?qr='.$qr);
Espero que el codigo les sirva