Re: Undefined index and variables
| From: | Fred Wright | Date: | Wed, 15 Jan 2003 17:20:41 +0000 |
| Subject: | Re: Undefined index and variables | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24865@lists.php.net to get a copy of this message | ||
<?
//This is lines 22 and 23 of Add.php
require("common.php") ;
GenerateHTMLForm();
$smt2= $_POST['Ref']; //line 22
$smt3=$_POST['Chassis']; //line 23
The form below is in common.php
function GenerateHTMLForm() {
printf("<FORM action=\"add.php\" METHOD=post>");
printf("<TABLE border=\"0\" width=\"100%%\">");
printf("<TR><TD>Reference:</TD>");
printf("<TD><INPUT TYPE=text SIZE=5 NAME=Ref></TD></TR>");
printf("<TR><TD>Chassis:</TD>");
printf("<TD><INPUT TYPE=text SIZE=25 NAME=Chassis ></TD></TR>");
printf("</TABLE>");
printf("<INPUT TYPE=submit name=\"submit\">");
printf("</FORM>" );
}
"Fred Wright" <to_637fjw@hotmail.com> wrote in message
news:20030115105508.13458.qmail@pb1.pair.com...
> Hi to all
> Being new to PHP I am naturally experiencing some minor problems.
>
> I have a form which processes Ref and Chassis data, when I load Add.php
> which does work but on loading get errors
>
> Notice: Undefined index: Ref in C:\Xitami\webpages\add.php on line 22
> Notice: Undefined index: Chassis in C:\Xitami\webpages\add.php on line 23
> How do I get rid of these undefined errors? Could anyone advise please.
> Regards
> Fred
>
> printf("<FORM action=\"add.php\" METHOD=post>");
>
> printf("<TABLE border=\"0\" width=\"100%%\">");
>
> printf("<TR><TD>Reference:</TD>");
>
> printf("<TD><INPUT TYPE=text SIZE=5 NAME=Ref ></TD></TR>");
>
> printf("<TR><TD>Chassis:</TD>");
> printf("<TD><INPUT TYPE=text SIZE=25 NAME=Chassis
> ></TD></TR>");
>
> printf("</TABLE>");
>
> printf("<INPUT TYPE=submit name=\"submit\">");
>
> printf("</FORM>" );
>
>