View Single Post
Old Jul 12th, 2005, 10:56 AM   #1
bulio
Hobbyist Programmer
 
bulio's Avatar
 
Join Date: Jul 2004
Location: Location
Posts: 140
Rep Power: 5 bulio is on a distinguished road
Form Code problem

Hi everyone,

I've written up the basic code for my get.php script, but it doesn't seem to be working. I keep getting error: undefined index in all the lines that $_POST is on. What could be wrong?

HTML code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>
     <TITLE>Coyote Product Submit Form</TITLE>
</HEAD>

<BODY>
     <H3 ALIGN="center">Coyote website product submit form</H3>

     <FORM ACTION="get.php" METHOD="post" ENCTYPE="text/plain">
           <TABLE>
               <TR>
                    <TD>&nbsp;&nbsp;<B>Location of product:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Productl" TYPE="text" SIZE="20">
                    <BR>
                    <BR>
                    &nbsp;&nbsp;<B>Description:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Description" TYPE="text" SIZE="20">
                    <BR>
                    <BR>
                    &nbsp;&nbsp;<B>Make:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Make" TYPE="text" SIZE="20">
                    <BR>
                    <BR>
                    &nbsp;&nbsp;<B>Model:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Model" TYPE="text" SIZE="20">
                    <BR>
                    <BR>
                    &nbsp;&nbsp;<B>Year:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Year" TYPE="text" SIZE="20">
                    <BR>
                    <BR>
                    &nbsp;&nbsp;<B>Color:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Color" TYPE="text" SIZE="20">
                    <BR>
                    <BR>
                    &nbsp;&nbsp;<B>Suggested list price:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Suggested list price" TYPE="text" VALUE="$0.00" SIZE="15">
                    <BR>
                    <BR>
                    &nbsp;&nbsp;<B>Inventory Type:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Inventory Type" TYPE="text" VALUE="Container, Truck, Reefer etc." SIZE="24">
                    <BR>
                    <BR>
                    &nbsp;&nbsp;<B>Serial #:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Serial #" TYPE="text" VALUE="#" SIZE="30">
                    <BR>
                    <BR>
                    &nbsp;&nbsp;<B>Name of submitter:</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT NAME="Full name" TYPE="text" SIZE="20"></TD>
               </TR>

               <TR>
                    <TD ALIGN="center"><INPUT TYPE="submit" VALUE="Submit" STYLE="color: #ffffff; background-color: #000000"></TD>
               </TR>
          </TABLE>
     </FORM><A HREF="index.htm">Click Here</A> to submit another product to the site.
     <BR>
     <BR>
     <BR>
      

     <H3 ALIGN="center">Instructions</H3>
     <BR>
     <BR>

     <H5>1: Enter all required information into the text box. Avoid leaving blank spaces.
     <BR>
     <BR>
     2: Once you are completed, press the 'Submit' button. This will then open your e-mail client. Now you should see some text already already in the email.
     <BR>
     <BR>
     3: Now, add an attachment to the email. The attachment should be picture of the object that you want to sell.
     <BR>
     <BR>
     4: Send The email. (It will automatically be sent to the appropriate address)
     <BR>
     <BR>
     5: If you need assistance understanding the text boxes, please visit <A HREF="submit_help.htm">This Page</A>
     <BR>
     <BR>
     6: The information will soon be added to the site.</H5>
     <BR>
</BODY>
</HTML>

get.php

<?php
//Start of the PHP script
$ProductL = $_POST["Productl"]; //Gets all the variables
$Desc = $_POST['Description'];
$Make $_POST['Make'];
$Model = $_POST['Model'];
$Year = $_POST['Year'];
//Echo to the user
echo "<BR /><b>Product Location:</b>$ProdductL";
echo "<BR /><b>Description:</b>$Desc";
?>
bulio is offline   Reply With Quote