Code:
<?
include 'db.inc';
$regionName = clean($regionName, 30);
$scriptName = "5-9.php";
if (empty($regionName))
{
?>
<form action="<?=$scriptName;?>" method = "get">
<br> Enter a region to browse :
<input type="text" name="regionName" value="ALL">
(type all to see all regions)
<br>
<input type="submit" value = "show wines">
</form>
<br><a href="index.html">Home</a>
} // end if user data
[/code 5-9.php]
The error message is "Notice: Undefined variable: regionName in C:\Program Files\Apache Group\Apache2\htdocs\TMP7ykttga2gs.php on line 12"
Line 12 is actually line 3 in this case because I did not paste the entire code. The <form> loads okay. When I take out line 3 I do not get an error. The clean() function is defined in db.inc, which looks like this
[code=db.inc]
<?
$hostName = "localhost";
$databaseName = "wines";
$username = "";
$password = "";
function clean($input, $maxlength)
{
$input = substr($input, 0, $maxlength);
$input = EscapeShellCmd($input);
return ($input);
}
?>
[/code db.inc]
Two questions.
One: I named the file 5-9.php, but the error message calls it TMP7ykttga2gs.php. Why?
Two: What could be causing this error message?
Help. Thanks.