Where is the probem in this code (javascript)?

Posted by user318068 on Stack Overflow See other posts from Stack Overflow or by user318068
Published on 2010-04-15T23:23:49Z Indexed on 2010/04/16 0:33 UTC
Read the original article Hit count: 238

Filed under:
|

Hi

I have a problem in my code.

can anybody help me ...

<html>
    <body>
    <script type="text/javascript">
        <?php
        $conn = mysql_connect("localhost","root");
        mysql_select_db("tr", $conn); 
        $q = mysql_query("SELECT message FROM messages WHERE to_viewed = '0' ");

        if (mysql_num_rows($q)) {
            require('pm.php');
            ?>
            var answer = confirm("you have new message ");
            <?php
        }
        ?>
        if (answer) {
            window.location = "http:>>>/";
        } else {
        }

    //-->
    </script>
</body>
</html>

Thanks ....

The error that appears in my code is that the confirm is not working if I open my page (no output)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about php