Posted by DeanL on 05/09/07 23:10
Hi guys,
I'm a total newbie at php and need a little help solving an error that
is being generated when using a script contained in one of the
O'Reilly books. The following code is used to display a simple form
with a text field and button (according to the book) but every time I
run it I get the following error:
Error:
Notice: Undefined index: search in G:\Web\Webserver\Apache2\htdocs
\simple.php on line 7
Code:
<html>
<head>
<title>Building a Form</title>
</head>
<body>
<?php
$search = $_GET["search"];
$self=$_SERVER['PHP_SELF'];
if ($search != NULL )
{
('
<form action="'.$_SERVER["PHP_SELF"].'" method="GET">
<label>Search: <input type="text" name="search" />
</label>
<input type="submit" value="Go!:" />
</form>
');
}
?>
</body>
</html>
Any help would be greatly appreciated as I'm trying to wrap my head
around php for the first time.
All the best, Dean...
[Back to original message]
|