|
|
|
|
![]() ![]() |
Sep 29 2007, 09:15 AM
Post
#1
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 11 Joined: 24-September 07 Member No.: 25,093 |
Is this script correct?
index.php: CODE <?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: CODE <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: CODE <?php (Not all the file; just the piece that encounters the problem)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"; ?> Everything goes fine, but when i enter main.php, it displays: QUOTE 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. This post has been edited by Propeng: Sep 29 2007, 09:18 AM |
|
|
|
Sep 29 2007, 11:46 AM
Post
#2
|
|
|
Super Member Group: [HOSTED] Posts: 740 Joined: 8-April 06 From: Lima - Peru Member No.: 12,579 |
main.php: CODE <?php (Not all the file; just the piece that encounters the problem)function customError($errno, $errstr) { echo "<div align='center'><b>Error:</b> [$errno] $errstr<br /></div>"; echo "<div align='center'>Ending Script</div>"; die(); } ?> 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: CODE <?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, |
|
|
|
Sep 29 2007, 08:37 PM
Post
#3
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 23 Joined: 27-September 07 Member No.: 25,159 |
put this error_reporting(E_ALL); abover you main script directly after <?php
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 22nd August 2008 - 03:11 AM |