Propeng 0 Report post Posted September 29, 2007 (edited) Is this script correct? index.php: <?php if (isset($_COOKIE["disp_name"])) $_GET['name'] = $_COOKIE['disp_name']; else setcookie("disp_name", Anonymous, date()+99);?><html> <head> <title>Display Name - DZN</title> <!-- METAS --> <meta name="verify-v1" content="oyEmG+TJ87xHGXl8NQS6GHJ8rcRDkFG4oXnYWtqddGk=" /> </head> <body> <div align="center"> <form action="proccess.php" method="get"> <?php if ($_GET["name"]=="") {$_GET['name']="Anonymous";} ?> Dislpay Name: <input type="text" value=<?php echo $_GET['name']; ?> name="name" /> <input type="submit" value="Enter Website!" /> </form> </div> <?php $wn = "Download Zone Network"; $swn = "DZN"; ?> </body></html> proccess.php: <head> <title>Proccessing Request...</title> <meta http-equiv="Refresh" content="1; URL=main.php" /> <b>Please wait...</b></head><?php setcookie("disp_name", $_GET['name'], date()+99);?> main.php: <?php function customError($errno, $errstr) { echo "<div align='center'><b>Error:</b> [$errno] $errstr<br /></div>"; echo "<div align='center'>Ending Script</div>"; die(); }?><?php //Page Config. //REQUIRE $_GET['name'] = $_COOKIE['disp_name']; /* do: echo (remember) */ // echo $_GET['name'] // if ($_COOKIE['disp_name']=="") { $_GET['name'] = "Guest"; } function currentlyOnline() { echo ""; } set_error_handler("customError"); function showCO ($showCO) { echo "ddd"; } while ($showCO=="true") { showCO(); }?><?php echo "<title>Welcome back, " . $_GET['name'] . "! - DZN</title>"; showCO ($showCO); $showCO = "true";?> (Not all the file; just the piece that encounters the problem) Everything goes fine, but when i enter main.php, it displays: Error: [8]Undefined variable: showCO Ending Script Is this script wrong? If it has, please reply. I know that the problem is in the main.php only, but i copied all of them if you want to test it. Edited September 29, 2007 by Propeng (see edit history) Share this post Link to post Share on other sites
TavoxPeru 0 Report post Posted September 29, 2007 main.php: <?php function customError($errno, $errstr) { echo "<div align='center'><b>Error:</b> [$errno] $errstr<br /></div>"; echo "<div align='center'>Ending Script</div>"; die(); }?> (Not all the file; just the piece that encounters the problem) Everything goes fine, but when i enter main.php, it displays: Is this script wrong? If it has, please reply. I know that the problem is in the main.php only, but i copied all of them if you want to test it. I think that the problem is related with the brackets that you use in your customError() function. Try this: <?php function customError($errno, $errstr) { echo "<div align='center'><b>Error:</b> [" . $errno . "] $errstr<br /></div>"; echo "<div align='center'>Ending Script</div>"; die(); }?>Best regards, Share this post Link to post Share on other sites
robert2411 0 Report post Posted September 29, 2007 put this error_reporting(E_ALL); abover you main script directly after <?php Share this post Link to post Share on other sites