Bug #18215: Notice: Undefined variable: submit in C:\
| From: | orraco at hotmail dot com | Date: | Sun, 07 Jul 2002 22:41:21 +0000 |
| Subject: | Bug #18215: Notice: Undefined variable: submit in C:\ | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-13431@lists.php.net to get a copy of this message | ||
From: orraco@hotmail.com
Operating system: Win2000
PHP version: 4.2.1
PHP Bug Type: Scripting Engine problem
Bug description: Notice: Undefined variable: submit in C:\
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 bug report at http://bugs.php.net/?id=18215&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18215&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18215&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18215&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18215&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18215&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18215&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18215&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18215&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18215&r=globals