From: [EMAIL PROTECTED] Operating system: Apache 2.0 PHP version: 4.2.3 PHP Bug Type: Output Control Bug description: Problem with using Javascript inside a Switch()
In my header and footer i've got the HTML for the layout of my site. include_once("$root/includes/header.php"); switch($mode) { case "newmap": include("$root/docent/newmap.php"); break; } include_once("$root/includes/footer.php"); inside the file newmap.php if got the php-code that i use for the site inside this code ive got some error-windows for the users. I use the script below to call them inside the file newmap.php if (mysql_num_rows (mysql_query("SELECT pparent FROM pagina WHERE pparent ='$menu->id'"))>0) { ?> <script language="JavaScript"> name = "<? echo $menu->name; ?>"; window.alert("Cannot remove'"+name+"'..! This map has one or more submaps, remove this first....!!") </script> <? } My problem is that in this switch structure the javascript runs first and i get a window but my site disapears (loses the header and footer) and when i push "ok" in the window it jumps back to the php. including header and footer again does not work. When i do this with a if else-statement i haven't got this problem. And i see the whole site with a javascript window in front. Is this a bug?? Thanx anyway Greetings Ivan Spijkers -- Edit bug report at http://bugs.php.net/?id=20491&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=20491&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=20491&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=20491&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=20491&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=20491&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=20491&r=support Expected behavior: http://bugs.php.net/fix.php?id=20491&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=20491&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=20491&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=20491&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20491&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=20491&r=dst IIS Stability: http://bugs.php.net/fix.php?id=20491&r=isapi