JavaScrip and PHP together Hey ALL, I really do not understand what's going on. In my code below I try to inform the user that the number added to him already exists in database but in my JavaScrit's if-else the line "<?php $tst = TRUE; ?>" ever run, even the user wants to add the number. What's happened??
Thanks, WMarini/ ---------------------------------------------------------------------------- --- ... <body> <?php $tst = FALSE; ... $contact_ins = "insert into contato (nome) values ('$name');"; mysql_query( $contact_ins ) OR die( mysql_error() ); //Check if numero exists. if( CheckNumber( $numero ) ) { ?> <script language="JavaScript"> if ( window.confirm("Number to be added exists.\nContinue?") ) { //The user wants to add the number defined. <?php $tst = FALSE; ?> break; } else { //User does not want to add the number. <?php $tst = TRUE; ?> ; } </script> <?php } if( $tst == FALSE ) { //Add the number, Don't care! ... } ... ?> </body> </html> ---------------------------------------------------------------------------- --- -- Wagner Marini ---- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php