Bug #18215 Updated: Notice: Undefined variable: submit in C:\

From: Date: Sun, 07 Jul 2002 22:44:04 +0000
Subject: Bug #18215 Updated: Notice: Undefined variable: submit in C:\
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13432@lists.php.net to get a copy of this message
ID: 18215 Updated by: jan@php.net Reported By: orraco@hotmail.com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Win2000 PHP Version: 4.2.1 New Comment: In PHP 4.2.0, the 'register_globals' setting default changed to be off. See http://www.php.net/release_4_2_0.php for more info. We are sorry about the inconvenience, but this change was a necessary part of our efforts to make PHP scripting more secure and portable. Previous Comments: ------------------------------------------------------------------------ [2002-07-07 18:41:20] orraco@hotmail.com Although new to PHP I have been testing a few web Utilities. I have downloaded some'code that provides a ping function. I have tested my PHP install to the best of my knowledge its correct but still recieve an error Notice: Undefined variable: submit in C:\Documents and Settings\Administrator\My Documents\My Webs\php-ping.php on line 14 I have been testing on a local machine running Windows NT 5.0 build 2195 and Microsoft-IIS/5.0 the code is as follows <?php // This script was writen by webmaster@theworldsend.net, Aug. 2001 // http://www.theworldsend.net // This is my first script. Enjoy. // // Put it into whatever directory and call it. That's all. // //------------------------- $max_count = "10"; //maximum count for ping command $os = "win"; // win or unix (unix means all flavors of linux as well) // ------------------------- // // nothing more to be done. If ($submit == "Ping!") { If ($count > $max_count) { echo 'Maximum for count is '.$max_count; echo '<a href="php-ping.php">Back</a>'; $again = True; } else { If (ereg(" ",$host)) { echo 'No Space in Host field allowed !'; echo '<a href="php-ping.php">Back</a>'; $again= True; } else { echo("Ping Output:<br>"); echo("<pre>"); $host = escapeshellarg($host); $count = escapeshellarg($count); if ($os =="win") { system("ping -n $count $host", $list); } else { system("ping -t $count $host", $list); }; echo("</pre>"); } } } else { echo ' <html><body> <form methode="post" action="php-ping.php"> Enter IP or Host <input type="text" name="host"></input> Enter Count <input type="text" name="count" size="2" value="4"></input> <input type="submit" name="submit" value="Ping!"></input> </form> </body></html>'; } ?> Please can you help I have tried all that I can think of. I can remove the error message via php.ini but would like it to work and return a value. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18215&edit=1

« previous php.bugs (#13432) next »