473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Notice: Undefined index: Scales ...but it is defined? :S

Hey,

I'm thinking this is something simple, as I'm a PHP/Web Dev newb, been asked to develop an app for work, so I'm stumbling my way through this, any how, I get the error:

Notice: Undefined index: Scales in C:\wamp\www\TS\upload.php on line 31

Here is a bit of the code that declares it:

Expand|Select|Wrap|Line Numbers
  1. <p></p></div>
  2.       <p>&nbsp;</p>
  3.       <p>&nbsp;&nbsp;&nbsp; <strong>Scales:</strong></p>
  4.       <p>&nbsp;&nbsp; &nbsp;<textarea rows="6" cols="50" name="Scales"></textarea>&nbsp;</p>
  5.       <p>&nbsp;&nbsp; &nbsp;<strong>Comments:</strong></p>
  6.       <p>&nbsp;&nbsp; &nbsp;<textarea rows="6" cols="50" name="Comments"></textarea>&nbsp;</p>
  7.       <p>&nbsp;&nbsp; 

And the code in the upload.php file that calls it trying to upload it to the DB:

Calling it into a variable:
Expand|Select|Wrap|Line Numbers
  1. $Scales =  $_POST["Scales"];
  2.  
Uploading to DB:

Expand|Select|Wrap|Line Numbers
  1. if ( !( $database = odbc_connect( "tradespend", "chrisbwamp","")))
  2. die( "Could not connect to database" );
  3.  
  4. $headerSQL = odbc_prepare($database, "INSERT INTO WebForm (Action,WebID,StartDate,EndDate,RequestType,TSH1,TSH2,TSH3,TSH4,SoldTo,CustomerType,EndUserNames,Scales,Comments,Status,EnteredBy)
  5. VALUES('$action','$WebID','$sdate','$edate','$RequestType','$TSH1','$TSH2','$TSH3','$TSH4','$SoldTo','$CustomerType','$EndUserNames','$Scales','$Comments','$Status','$EnteredBy');" ); 
  6.  
  7. if (!odbc_execute( $headerSQL))
  8. {
  9. /* error */
  10. echo "<h1>Insert of Header data has failed! Please contact IThelpdesk@pintys.com and reference Chris Beach</h1>";
  11. //break;
  12. }
  13.  
I have a bunch of fields working this way, most work, and about 4 of them are giving the same error as above.

Any ideas?
Aug 16 '10 #1
22 2175
zorgi
431 Expert 256MB
Can you give us more of the code from your form? I guess first part of your pasted code is the form. It sounds as if things are not getting posted properly.
Aug 16 '10 #2
I warn you, it is not pretty, but thank you very much for replying!

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3. session_start();  
  4. if(isset($_SESSION['loggedin']))
  5. {
  6.   if(($_SESSION['loggedin']) == 'true')
  7. {
  8.     // echo 'yes true';
  9. }
  10.      else
  11. header("location:login.php");
  12. // echo 'no not true';
  13. }
  14. else
  15. header("location:login.php");
  16. // echo 'no';
  17. ?>
  18.  
  19.  
  20.  
  21. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  22. <html><head><title>Trade Spend Request Form</title>
  23. <meta name="GENERATOR" content="MSHTML 8.00.6001.18928">
  24. <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
  25. <script>
  26. function getXMLHTTP() { //fuction to return the xml http object
  27.         var xmlhttp=false;    
  28.         try{
  29.             xmlhttp=new XMLHttpRequest();
  30.         }
  31.         catch(e)    {        
  32.             try{            
  33.                 xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
  34.             }
  35.             catch(e){
  36.                 try{
  37.                 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  38.                 }
  39.                 catch(e1){
  40.                     xmlhttp=false;
  41.                 }
  42.             }
  43.         }
  44.  
  45.         return xmlhttp;
  46.     }
  47.  
  48.  
  49.     function getCity($elementID,strURL) {        
  50.  
  51.         var req = getXMLHTTP();
  52.  
  53.         if (req) {
  54.  
  55.             req.onreadystatechange = function() {
  56.                 if (req.readyState == 4) {
  57.                     // only if "OK"
  58.                     if (req.status == 200) {                        
  59.                         document.getElementById($elementID).innerHTML=req.responseText;                        
  60.                     } else {
  61.                         alert("There was a problem while using XMLHTTP:\n" + req.statusText);
  62.                     }
  63.                 }                
  64.             }            
  65.             req.open("GET", strURL, true);
  66.             req.send(null);
  67.         }
  68.  
  69.     }
  70. </script>
  71. <script language="javascript"> 
  72. function toggle() {
  73.     var ele = document.getElementById("hiddenConditions");
  74.     var text = document.getElementById("displayText");
  75.     if(ele.style.display == "block") {
  76.             ele.style.display = "none";
  77.         text.innerHTML = "More";
  78.       }
  79.     else {
  80.         ele.style.display = "block";
  81.         text.innerHTML = "hide";
  82.     }
  83. </script>
  84.  
  85. <script language="javascript" type="text/javascript" src="datetimepicker.js"> 
  86. </script>
  87.  
  88.  
  89. <?php 
  90.  
  91.   //Function to Connect to Daisy, execute Sql SELECT statement, and convert results to an array as a return value
  92. function sqlSelect($daisySelect)
  93. {
  94.   //connect to a DSN, "daisy" 
  95. $conn = odbc_connect('daisy','chrisbwamp',''); 
  96. if ($conn) 
  97.   //The SQL statement that will query the database 
  98.   $query = $daisySelect; 
  99.  
  100.   //Perform the query 
  101.   $result=odbc_exec($conn, $query); 
  102.  
  103.   //Convert results to an array
  104.   while(odbc_fetch_row($result))
  105.   { 
  106.      for($i=1;$i<=odbc_num_fields($result);$i++)  
  107.           {
  108.              $selectArray[]=odbc_result($result,$i);
  109.           }
  110.   } 
  111. return $selectArray;
  112. }
  113.  else echo "ODBC not connected, please contact ITHelpdesk@pintys.com";  
  114. }
  115.  
  116. ?>
  117. <style>
  118. <!--
  119. h1 { font-family: Arial, sans-serif; font-size: 30px; }
  120. h2 { font-family: Arial, sans-serif; font-size: 18px; }
  121.  
  122. body,p,b,i,em,dt,dd,dl,sl,caption,th,td,tr,u,blink,select,option,form,div,li { font-family: Arial, sans-serif; font-size: 12px; }
  123.  
  124.  
  125. /* IE Specific */
  126. body, textarea {
  127.   scrollbar-3dlight-color: #DDDED6;
  128.   scrollbar-highlight-color: #FDE7A2;
  129.   scrollbar-face-color: #FABD05;
  130.   scrollbar-shadow-color: #CA9904;
  131.   scrollbar-darkshadow-color: #805B32;
  132.   scrollbar-arrow-color: #000000;
  133.   scrollbar-track-color: #F8EFE2;
  134. }
  135. /* END IE Specific */
  136.  
  137.  
  138. a.mainlink:link { text-decoration: none; color: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; }
  139. a.mainlink:visited { text-decoration: none; color: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; }
  140. a.mainlink:hover { text-decoration: underline; color: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; }
  141. -->
  142.  
  143. </style>
  144.  
  145. </head>
  146. <body bgcolor="#ffffff">
  147. <p>
  148. <table border="0" cellspacing="1" cellpadding="3" width="780" bgcolor="#fabd05" 
  149. align=center>
  150.   <tbody>
  151.   <tr>
  152.     <td bgcolor="#fabd05">
  153.       <p align="center"><br><strong>&nbsp;<font size="7">Trade Spend Request 
  154.       </font></strong></p></td></tr>
  155.   <tr>
  156.     <td bgcolor="#fabd05">
  157.       <p align="center"><font 
  158.   color=#fabd05><strong></strong></font>&nbsp;</p></td></tr>
  159.   <tr>
  160.     <td bgcolor="#ffffff">
  161.       <form method="post" name="tradespend" 
  162.       action="upload.php">
  163.       <p>&nbsp;</p>
  164.       <fieldset 
  165.       style="Z-INDEX: 0; WIDTH: 360px; HEIGHT: 75px; LEFT: 146px"><legend>Web 
  166.       Form:</legend>
  167.       <p>&nbsp;&nbsp;&nbsp;&nbsp;<strong>Action:</strong> <select 
  168.       style="Z-INDEX: 0; TOP: 237px; LEFT: 209px" size=1 name=Action><option 
  169.         selected value=Create>Create</option> <option value="Edit">Edit</option> 
  170.         <option value="Display">Display</option> <option 
  171.         value=Delete>Delete</option> 
  172.       &lt;\SELECT&gt;</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Web 
  173.       ID:</strong> <input style="Z-INDEX: 0; TOP: 236px; LEFT: 360px" 
  174.       name=WebID></p></fieldset> 
  175.       <p>&nbsp;&nbsp;&nbsp;<strong>Start Date:</strong>&nbsp;&nbsp;&nbsp; <input 
  176.       style="WIDTH: 78px; HEIGHT: 22px" id=sdate size=10 name=sdate><a 
  177.       href="javascript:NewCal('sdate','ddmmyyyy')"><img border="0" 
  178.       alt="Pick a date" src="cal.gif" width=16 height=16></a> 
  179.       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>End Date:&nbsp; 
  180.       </strong>&nbsp;<input style="WIDTH: 78px; HEIGHT: 22px" id="edate" size="10" 
  181.       name=edate><a href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  182.       alt="Pick a date" src="cal.gif" width=16 height=16></a></p>
  183.       <p><strong>&nbsp;&nbsp;&nbsp; Request Type:</strong> <select size="1" 
  184.       name=RequestType><option selected value=New>New</option> <option 
  185.         value=Incremental/Change>Incremental/Change</option> 
  186.       &lt;\SELECT&gt;</select>&nbsp;&nbsp;&nbsp;&nbsp;</p>
  187.       <p>&nbsp;&nbsp;&nbsp; </p>
  188.       <p><strong>&nbsp;&nbsp;&nbsp;&nbsp;Trade Spend Hierarchy:</strong> </p>
  189.       <p>&nbsp;&nbsp;&nbsp;&nbsp;<select size="1" name="TSH1"><option selected 
  190.         value=test>test</option> &lt;\SELECT&gt;</select>&nbsp;&nbsp; <select 
  191.       size=1 name=TSH2><option selected value=test>test</option> 
  192.       &lt;\SELECT&gt;</select>&nbsp;&nbsp;<select size="1" name="TSH3"><option 
  193.         selected value=test>test</option> 
  194.       &lt;\SELECT&gt;</select>&nbsp;&nbsp;<select size="1" name="TSH4"><option 
  195.         selected value=test>test</option> &lt;\SELECT&gt;</select></p>
  196.       <p>&nbsp; &nbsp; <strong>Sold-to:</strong> <select size="1" 
  197.         name=SoldTo><option selected value=10000>10000</option> 
  198.       &lt;\SELECT&gt;</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Customer 
  199.       Type:</strong> <select size="1" name="CustomerType"><option selected 
  200.         value=Deleted>Deleted</option> <option value="Food Service">Food 
  201.         Service</option> <option value="Industrial">Industrial</option> <option 
  202.         value=Intercompany>Intercompany</option> <option 
  203.         value=Retail>Retail</option> &lt;\SELECT&gt;</select></p>
  204.       <p>&nbsp;&nbsp; &nbsp;<strong>End User Name(s):</strong></p>
  205.       <p>&nbsp; &nbsp; 
  206.       <textarea rows="6" cols="50" name="EndUserNames"></textarea>&nbsp;</p>
  207.       <p>&nbsp;&nbsp; &nbsp;<strong><font color="#454453" size="3" 
  208.       face=Verdana>Condition Records:</font></strong></p>
  209.       <hr>
  210.  
  211.       <p>&nbsp;&nbsp;&nbsp;&nbsp;<strong><em>Item 
  212.       Type</em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  213.       <em>Material 
  214.       Number</em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>Forecasted&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  215.       UOM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Discount&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  216.       Unit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  217.       Program&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  218.       End 
  219.       Date<br>&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;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  220.       Volume&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;&nbsp;Rate</em></strong></p>
  221.       <div id="div1">&nbsp;&nbsp; 
  222.  
  223.  
  224.  
  225.       <select size="1" name="itemType1" onChange="getCity('material1','findcity.php?itemType='+this.value)"><option selected 
  226.         value=""></option> <option value="Material">Material</option><option value="PH1">PH1</option> <option 
  227.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  228.         value=PH4>PH4</option> &lt;\SELECT&gt;</select>           
  229.        <span id="material1">
  230. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city1" id="city1">
  231.  </select>    </span>           
  232. <input style="WIDTH: 69px; HEIGHT: 22px" size="6" 
  233.       name=ForecastedVollume1><select size="1" name="UOM1"><option 
  234.         value=></option> <option value="Carton">Carton</option> <option value="KG">KG</option> 
  235.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="4" 
  236.       name=DiscountRate1><select size="1" name="Unit1"><option value=""></option> <option 
  237.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  238.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  239.         &lt;\SELECT&gt;</select><select style="width: 110px;" size="1" name="Program1"><option selected 
  240.         value=></option> <option 
  241.         value=1>Conditions: Price</option> <option 
  242.         value=2>Extra Charge</option> <option 
  243.         value=3>ZCS    Case/KG/%Discount</option> <option 
  244.         value=4>Fees (Lump Sum)</option> 
  245.         <option value=5>Special Promotion</option> 
  246.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="sdate1" 
  247.       size=10 name=sdate1><a href="javascript:NewCal('sdate1','ddmmyyyy')"><img 
  248.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  249.       style="WIDTH: 78px; HEIGHT: 22px" id=edate1 size=10 name=edate1><a 
  250.       href="javascript:NewCal('edate1','ddmmyyyy')"><img border="0" 
  251.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  252.  
  253.  
  254.             <select size="1" name="itemType2" onChange="getCity('material2','findcity.php?itemType='+this.value)"><option selected 
  255.         value=""></option> <option value="Material">Material</option><option value="PH1">PH1</option> <option 
  256.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  257.         value=PH4>PH4</option> &lt;\SELECT&gt;</select>    
  258.  
  259.        <span id="material2">
  260. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city2" id="city2">
  261.  </select>    </span>
  262.  
  263. <input style="WIDTH: 69px; HEIGHT: 22px" size="6" 
  264.       name=ForecastedVollume2><select size="1" name="UOM2"><option 
  265.         value=></option> <option value="Carton">Carton</option> <option value="KG">KG</option> 
  266.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="4" 
  267.       name=DiscountRate2><select size="1" name="Unit2"><option value=""></option> <option 
  268.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  269.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  270.         &lt;\SELECT&gt;</select><select style="width: 110px;" size="1" name="Program2"><option selected 
  271.         value=></option> <option 
  272.         value=1>Conditions: Price</option> <option 
  273.         value=2>Extra Charge</option> <option 
  274.         value=3>ZCS    Case/KG/%Discount</option> <option 
  275.         value=4>Fees (Lump Sum)</option> 
  276.         <option value=5>Special Promotion</option> 
  277.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="sdate2" 
  278.       size=10 name=sdate2><a href="javascript:NewCal('sdate2','ddmmyyyy')"><img 
  279.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  280.       style="WIDTH: 78px; HEIGHT: 22px" id=edate2 size=10 name=edate2><a 
  281.       href="javascript:NewCal('edate2','ddmmyyyy')"><img border="0" 
  282.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  283.  
  284.  
  285.        <select size="1" name="itemType3" onChange="getCity('material3','findcity.php?itemType='+this.value)"><option selected 
  286.         value=""></option> <option value="Material">Material</option><option value="PH1">PH1</option> <option 
  287.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  288.         value=PH4>PH4</option> &lt;\SELECT&gt;</select>    
  289.  
  290.        <span id="material3">
  291. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city3" id="city3">
  292.  </select>    </span>
  293.  
  294. <input style="WIDTH: 69px; HEIGHT: 22px" size="6" 
  295.       name=ForecastedVollume3><select size="1" name="UOM3"><option 
  296.         value=></option> <option value="Carton">Carton</option> <option value="KG">KG</option> 
  297.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="4" 
  298.       name=DiscountRate3><select size="1" name="Unit3"><option value=""></option> <option 
  299.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  300.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  301.         &lt;\SELECT&gt;</select><select style="width: 110px;" size="1" name="Program3"><option selected 
  302.         value=></option> <option 
  303.         value=1>Conditions: Price</option> <option 
  304.         value=2>Extra Charge</option> <option 
  305.         value=3>ZCS    Case/KG/%Discount</option> <option 
  306.         value=4>Fees (Lump Sum)</option> 
  307.         <option value=5>Special Promotion</option> 
  308.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="sdate3" 
  309.       size=10 name=sdate3><a href="javascript:NewCal('sdate3','ddmmyyyy')"><img 
  310.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  311.       style="WIDTH: 78px; HEIGHT: 22px" id=edate3 size=10 name=edate3><a 
  312.       href="javascript:NewCal('edate3','ddmmyyyy')"><img border="0" 
  313.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  314.  
  315.  
  316.  
  317.  
  318.       <select size="1" name="ItemType">
  319.       <option selected 
  320.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  321.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  322.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><?php
  323. $arrProductNum=sqlSelect("SELECT Material_ID + ' - ' + DESCRIPTION AS Expr1
  324. FROM VW_TradeSpend_Material ORDER BY Material_ID ASC");
  325. ?>
  326. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name=MaterialNumber> 
  327. <?php
  328. foreach($arrProductNum as $products) { 
  329.       echo'<option value="'.$products.'">'.ltrim($products,"0").'</option>'; } 
  330.       echo "</select>"; 
  331. ?> <input style="WIDTH: 69px; HEIGHT: 22px" size="6" 
  332.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  333.         value=Carton>Carton</option> <option value="KG">KG</option> 
  334.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="5" 
  335.       name=DiscountRate><select size="1" name="Unit"><option selected 
  336.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  337.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  338.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  339.         value=Classifications>Classifications</option> <option 
  340.         value=Go>Go</option> <option value="Here">Here</option> 
  341.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  342.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  343.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  344.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  345.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  346.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  347.  
  348.  
  349.  
  350.       <select size="1" name="ItemType"><option selected 
  351.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  352.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  353.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><?php
  354. $arrProductNum=sqlSelect("SELECT Material_ID + ' - ' + DESCRIPTION AS Expr1
  355. FROM VW_TradeSpend_Material ORDER BY Material_ID ASC");
  356. ?>
  357. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name=MaterialNumber> 
  358. <?php
  359. foreach($arrProductNum as $products) { 
  360.       echo'<option value="'.$products.'">'.ltrim($products,"0").'</option>'; } 
  361.       echo "</select>"; 
  362. ?> <input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  363.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  364.         value=Carton>Carton</option> <option value="KG">KG</option> 
  365.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  366.       name=DiscountRate><select size="1" name="Unit"><option selected 
  367.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  368.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  369.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  370.         value=Classifications>Classifications</option> <option 
  371.         value=Go>Go</option> <option value="Here">Here</option> 
  372.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  373.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  374.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  375.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  376.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  377.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  378.       <select size="1" name="ItemType"><option selected 
  379.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  380.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  381.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  382.       name=MaterialNumber><option selected 
  383.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  384.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  385.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  386.         value=Carton>Carton</option> <option value="KG">KG</option> 
  387.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  388.       name=DiscountRate><select size="1" name="Unit"><option selected 
  389.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  390.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  391.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  392.         value=Classifications>Classifications</option> <option 
  393.         value=Go>Go</option> <option value="Here">Here</option> 
  394.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  395.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  396.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  397.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  398.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  399.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  400.       <select size="1" name="ItemType"><option selected 
  401.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  402.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  403.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  404.       name=MaterialNumber><option selected 
  405.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  406.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  407.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  408.         value=Carton>Carton</option> <option value="KG">KG</option> 
  409.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  410.       name=DiscountRate><select size="1" name="Unit"><option selected 
  411.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  412.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  413.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  414.         value=Classifications>Classifications</option> <option 
  415.         value=Go>Go</option> <option value="Here">Here</option> 
  416.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  417.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  418.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  419.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  420.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  421.       alt="Pick a date" src="cal.gif" width=16 height=16></a> </div>&nbsp;&nbsp; 
  422.       <select size="1" name="ItemType"><option selected 
  423.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  424.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  425.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  426.       name=MaterialNumber><option selected 
  427.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  428.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  429.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  430.         value=Carton>Carton</option> <option value="KG">KG</option> 
  431.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  432.       name=DiscountRate><select size="1" name="Unit"><option selected 
  433.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  434.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  435.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  436.         value=Classifications>Classifications</option> <option 
  437.         value=Go>Go</option> <option value="Here">Here</option> 
  438.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  439.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  440.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  441.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  442.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  443.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp; 
  444.       &nbsp;<select size="1" name="ItemType"><option selected 
  445.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  446.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  447.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  448.       name=MaterialNumber><option selected 
  449.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  450.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  451.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  452.         value=Carton>Carton</option> <option value="KG">KG</option> 
  453.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  454.       name=DiscountRate><select size="1" name="Unit"><option selected 
  455.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  456.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  457.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  458.         value=Classifications>Classifications</option> <option 
  459.         value=Go>Go</option> <option value="Here">Here</option> 
  460.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  461.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  462.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  463.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  464.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  465.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  466.       <select size="1" name="ItemType"><option selected 
  467.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  468.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  469.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  470.       name=MaterialNumber><option selected 
  471.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  472.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  473.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  474.         value=Carton>Carton</option> <option value="KG">KG</option> 
  475.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  476.       name=DiscountRate><select size="1" name="Unit"><option selected 
  477.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  478.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  479.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  480.         value=Classifications>Classifications</option> <option 
  481.         value=Go>Go</option> <option value="Here">Here</option> 
  482.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  483.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  484.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  485.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  486.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  487.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  488.       <select size="1" name="ItemType"><option selected 
  489.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  490.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  491.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  492.       name=MaterialNumber><option selected 
  493.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  494.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  495.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  496.         value=Carton>Carton</option> <option value="KG">KG</option> 
  497.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  498.       name=DiscountRate><select size="1" name="Unit"><option selected 
  499.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  500.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  501.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  502.         value=Classifications>Classifications</option> <option 
  503.         value=Go>Go</option> <option value="Here">Here</option> 
  504.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  505.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  506.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  507.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  508.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  509.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  510.       <select size="1" name="ItemType"><option selected 
  511.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  512.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  513.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  514.       name=MaterialNumber><option selected 
  515.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  516.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  517.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  518.         value=Carton>Carton</option> <option value="KG">KG</option> 
  519.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  520.       name=DiscountRate><select size="1" name="Unit"><option selected 
  521.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  522.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  523.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  524.         value=Classifications>Classifications</option> <option 
  525.         value=Go>Go</option> <option value="Here">Here</option> 
  526.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  527.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  528.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  529.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  530.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  531.       alt="Pick a date" src="cal.gif" width=16 height=16></a> 
  532.       <div></div>
  533.       <div id="div2">&nbsp;&nbsp; <select size="1" name="ItemType"><option selected 
  534.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  535.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  536.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  537.       name=MaterialNumber><option selected 
  538.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  539.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  540.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  541.         value=Carton>Carton</option> <option value="KG">KG</option> 
  542.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  543.       name=DiscountRate><select size="1" name="Unit"><option selected 
  544.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  545.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  546.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  547.         value=Classifications>Classifications</option> <option 
  548.         value=Go>Go</option> <option value="Here">Here</option> 
  549.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  550.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  551.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  552.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  553.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  554.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  555.       <select size="1" name="ItemType"><option selected 
  556.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  557.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  558.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  559.       name=MaterialNumber><option selected 
  560.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  561.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  562.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  563.         value=Carton>Carton</option> <option value="KG">KG</option> 
  564.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  565.       name=DiscountRate><select size="1" name="Unit"><option selected 
  566.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  567.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  568.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  569.         value=Classifications>Classifications</option> <option 
  570.         value=Go>Go</option> <option value="Here">Here</option> 
  571.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  572.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  573.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  574.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  575.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  576.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  577.       <select size="1" name="ItemType"><option selected 
  578.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  579.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  580.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  581.       name=MaterialNumber><option selected 
  582.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  583.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  584.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  585.         value=Carton>Carton</option> <option value="KG">KG</option> 
  586.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  587.       name=DiscountRate><select size="1" name="Unit"><option selected 
  588.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  589.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  590.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  591.         value=Classifications>Classifications</option> <option 
  592.         value=Go>Go</option> <option value="Here">Here</option> 
  593.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  594.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  595.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  596.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  597.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  598.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  599.       <select size="1" name="ItemType"><option selected 
  600.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  601.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  602.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  603.       name=MaterialNumber><option selected 
  604.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  605.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  606.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  607.         value=Carton>Carton</option> <option value="KG">KG</option> 
  608.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  609.       name=DiscountRate><select size="1" name="Unit"><option selected 
  610.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  611.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  612.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  613.         value=Classifications>Classifications</option> <option 
  614.         value=Go>Go</option> <option value="Here">Here</option> 
  615.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  616.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  617.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  618.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  619.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  620.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  621.       <select size="1" name="ItemType"><option selected 
  622.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  623.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  624.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  625.       name=MaterialNumber><option selected 
  626.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  627.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  628.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  629.         value=Carton>Carton</option> <option value="KG">KG</option> 
  630.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  631.       name=DiscountRate><select size="1" name="Unit"><option selected 
  632.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  633.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  634.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  635.         value=Classifications>Classifications</option> <option 
  636.         value=Go>Go</option> <option value="Here">Here</option> 
  637.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  638.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  639.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  640.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  641.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  642.       alt="Pick a date" src="cal.gif" width=16 height=16></a> </div>&nbsp;&nbsp; 
  643.       <select size="1" name="ItemType"><option selected 
  644.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  645.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  646.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  647.       name=MaterialNumber><option selected 
  648.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  649.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  650.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  651.         value=Carton>Carton</option> <option value="KG">KG</option> 
  652.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  653.       name=DiscountRate><select size="1" name="Unit"><option selected 
  654.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  655.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  656.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  657.         value=Classifications>Classifications</option> <option 
  658.         value=Go>Go</option> <option value="Here">Here</option> 
  659.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  660.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  661.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  662.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  663.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  664.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp; 
  665.       &nbsp;<select size="1" name="ItemType"><option selected 
  666.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  667.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  668.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  669.       name=MaterialNumber><option selected 
  670.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  671.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  672.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  673.         value=Carton>Carton</option> <option value="KG">KG</option> 
  674.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  675.       name=DiscountRate><select size="1" name="Unit"><option selected 
  676.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  677.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  678.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  679.         value=Classifications>Classifications</option> <option 
  680.         value=Go>Go</option> <option value="Here">Here</option> 
  681.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  682.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  683.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  684.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  685.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  686.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  687.       <select size="1" name="ItemType"><option selected 
  688.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  689.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  690.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  691.       name=MaterialNumber><option selected 
  692.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  693.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  694.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  695.         value=Carton>Carton</option> <option value="KG">KG</option> 
  696.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  697.       name=DiscountRate><select size="1" name="Unit"><option selected 
  698.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  699.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  700.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  701.         value=Classifications>Classifications</option> <option 
  702.         value=Go>Go</option> <option value="Here">Here</option> 
  703.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  704.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  705.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  706.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  707.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  708.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  709.       <select size="1" name="ItemType"><option selected 
  710.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  711.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  712.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  713.       name=MaterialNumber><option selected 
  714.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  715.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  716.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  717.         value=Carton>Carton</option> <option value="KG">KG</option> 
  718.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  719.       name=DiscountRate><select size="1" name="Unit"><option selected 
  720.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  721.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  722.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  723.         value=Classifications>Classifications</option> <option 
  724.         value=Go>Go</option> <option value="Here">Here</option> 
  725.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  726.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  727.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  728.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  729.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  730.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  731.       <select size="1" name="ItemType"><option selected 
  732.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  733.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  734.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  735.       name=MaterialNumber><option selected 
  736.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  737.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  738.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  739.         value=Carton>Carton</option> <option value="KG">KG</option> 
  740.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  741.       name=DiscountRate><select size="1" name="Unit"><option selected 
  742.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  743.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  744.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  745.         value=Classifications>Classifications</option> <option 
  746.         value=Go>Go</option> <option value="Here">Here</option> 
  747.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  748.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  749.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  750.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  751.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  752.       alt="Pick a date" src="cal.gif" width=16 height=16></a> 
  753.       <p></p>
  754.       <div></div><a id="displayText" href="javascript:toggle();">More</a> 
  755.       <div style="DISPLAY: none" id="hiddenConditions">&nbsp;&nbsp; <select size="1" 
  756.       name=ItemType><option selected value=Material>Material</option> <option 
  757.         value=PH1>PH1</option> <option value="PH2">PH2</option> <option 
  758.         value=PH3>PH3</option> <option value="PH4">PH4</option> 
  759.       &lt;\SELECT&gt;</select><select size="1" name="MaterialNumber"><option 
  760.         selected value="10000 - Chicken Fingers">10000 - Chicken 
  761.         Fingers</option> &lt;\SELECT&gt;</select><input 
  762.       style="WIDTH: 69px; HEIGHT: 22px" size=7 name=ForecastedVollume><select 
  763.       size=1 name=UOM><option selected value=Carton>Carton</option> <option 
  764.         value=KG>KG</option> &lt;\SELECT&gt;</select><input 
  765.       style="WIDTH: 54px; HEIGHT: 22px" size=6 name=DiscountRate><select size="1" 
  766.       name=Unit><option selected value=Percent>Percent</option> <option 
  767.         value=KG>KG</option> <option value="Carton">Carton</option> <option 
  768.         value="Lump $">Lump $</option> &lt;\SELECT&gt;</select><select size="1" 
  769.       name=Program><option selected 
  770.         value=Classifications>Classifications</option> <option 
  771.         value=Go>Go</option> <option value="Here">Here</option> 
  772.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  773.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  774.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  775.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  776.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  777.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp; 
  778.       &nbsp;<select size="1" name="ItemType"><option selected 
  779.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  780.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  781.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  782.       name=MaterialNumber><option selected 
  783.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  784.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  785.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  786.         value=Carton>Carton</option> <option value="KG">KG</option> 
  787.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  788.       name=DiscountRate><select size="1" name="Unit"><option selected 
  789.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  790.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  791.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  792.         value=Classifications>Classifications</option> <option 
  793.         value=Go>Go</option> <option value="Here">Here</option> 
  794.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  795.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  796.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  797.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  798.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  799.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  800.       <select size="1" name="ItemType"><option selected 
  801.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  802.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  803.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  804.       name=MaterialNumber><option selected 
  805.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  806.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  807.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  808.         value=Carton>Carton</option> <option value="KG">KG</option> 
  809.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  810.       name=DiscountRate><select size="1" name="Unit"><option selected 
  811.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  812.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  813.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  814.         value=Classifications>Classifications</option> <option 
  815.         value=Go>Go</option> <option value="Here">Here</option> 
  816.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  817.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  818.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  819.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  820.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  821.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  822.       <select size="1" name="ItemType"><option selected 
  823.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  824.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  825.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  826.       name=MaterialNumber><option selected 
  827.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  828.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  829.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  830.         value=Carton>Carton</option> <option value="KG">KG</option> 
  831.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  832.       name=DiscountRate><select size="1" name="Unit"><option selected 
  833.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  834.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  835.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  836.         value=Classifications>Classifications</option> <option 
  837.         value=Go>Go</option> <option value="Here">Here</option> 
  838.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  839.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  840.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  841.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  842.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  843.       alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
  844.       <select size="1" name="ItemType"><option selected 
  845.         value=Material>Material</option> <option value="PH1">PH1</option> <option 
  846.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  847.         value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
  848.       name=MaterialNumber><option selected 
  849.         value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
  850.         &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
  851.       name=ForecastedVollume><select size="1" name="UOM"><option selected 
  852.         value=Carton>Carton</option> <option value="KG">KG</option> 
  853.       &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
  854.       name=DiscountRate><select size="1" name="Unit"><option selected 
  855.         value=Percent>Percent</option> <option value="KG">KG</option> <option 
  856.         value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
  857.         &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
  858.         value=Classifications>Classifications</option> <option 
  859.         value=Go>Go</option> <option value="Here">Here</option> 
  860.       &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
  861.       size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
  862.       border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
  863.       style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
  864.       href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
  865.       alt="Pick a date" src="cal.gif" width=16 height=16></a> 
  866.       <p></p></div>
  867.       <p>&nbsp;</p>
  868.       <p>&nbsp;&nbsp;&nbsp; <strong>Scales:</strong></p>
  869.       <p>&nbsp;&nbsp; &nbsp;<textarea rows="6" cols="50" name="Scales"></textarea>&nbsp;</p>
  870.       <p>&nbsp;&nbsp; &nbsp;<strong>Comments:</strong></p>
  871.       <p>&nbsp;&nbsp; &nbsp;<textarea rows="6" cols="50" name="Comments"></textarea>&nbsp;</p>
  872.       <p>&nbsp;&nbsp; 
  873.       &nbsp;<strong>Status:</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  874.       &nbsp;<input name="Status"></p>
  875.       <p>&nbsp;&nbsp;&nbsp; <strong>Entered By: </strong> <input 
  876.       name=EnteredBy value="<?php print $_SESSION['loggedinName'];?>"/></p>
  877.       <p>&nbsp;</p>
  878.       <p>&nbsp;</p>
  879.       <p>&nbsp;</p>
  880.  
  881.  <p>&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;&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;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  882. <input value="Submit" type="submit" name="submit"><input value="Reset" type="reset" name="reset"> 
  883.       </form></p></td></tr>
  884.   <tr>
  885.     <td bgcolor="#ffffff">&nbsp;</td></tr></tbody></table></ P></p>
  886. <p>&nbsp;</p>
  887. <p>&nbsp;</p>
  888. <p>&nbsp;</p>
  889. <p>&nbsp;</p><font size="1"><font size="1"></font></a></p></font></font></body></html>
  890.  

And My Upload.php:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. //error_reporting(E_ALL ^ E_NOTICE);  
  3. //condition record variables
  4.  
  5. $sdates = array($_POST["sdate1"],$_POST["sdate2"],$_POST["sdate3"]);
  6. $edates = array($_POST["edate1"],$_POST["edate2"],$_POST["edate3"]);
  7. $itemTypes = array($_POST["itemType1"],$_POST["itemType2"],$_POST["itemType3"]);
  8. $citys = array($_POST["city"],$_POST["city2"],$_POST["city3"]);
  9. $ForecastedVolumes = array($_POST["ForecastedVollume1"],$_POST["ForecastedVollume2"],$_POST["ForecastedVollume3"]);
  10. $UOMS = array($_POST["UOM1"],$_POST["UOM2"],$_POST["UOM3"]);
  11. $DiscountRates = array($_POST["DiscountRate"],$_POST["DiscountRate2"],$_POST["DiscountRate3"]); 
  12. $Units = array($_POST["Unit1"],$_POST["Unit2"],$_POST["Unit3"]); 
  13. $Programs = array($_POST["Program1"],$_POST["Program2"],$_POST["Program3"]); 
  14.  
  15. //web form variables
  16.  
  17. $action = $_POST["Action"];
  18. $WebID = $_POST["WebID"];
  19. $sdate = $_POST["sdate"];
  20. $edate = $_POST["edate"];
  21. $RequestType = $_POST["RequestType"];
  22. $TSH1 = $_POST["TSH1"];
  23. $TSH2 = $_POST["TSH2"];
  24. $TSH3 = $_POST["TSH3"];
  25. $TSH4 = $_POST["TSH4"];
  26. $SoldTo = $_POST["SoldTo"];
  27. $CustomerType = $_POST["CustomerType"];
  28. $EndUserNames = $_POST["EndUserNames"];
  29. $Status = $_POST["Status"];
  30. $EnteredBy = $_POST["EnteredBy"];
  31. $Scales =  $_POST["Scales"];
  32. $Comments = $_POST["Comments"];
  33.  
  34. print_r($_POST);
  35.  
  36. function sqlSelect($daisySelect)
  37. {
  38.   //connect to a DSN, "daisy" 
  39. $conn = odbc_connect('daisy','chrisbwamp',''); 
  40. if ($conn) 
  41.   //The SQL statement that will query the database 
  42.   $query = $daisySelect; 
  43.  
  44.   //Perform the query 
  45.   $result=odbc_exec($conn, $query); 
  46.  
  47.   //Convert results to an array
  48.   while(odbc_fetch_row($result))
  49.   { 
  50.      for($i=1;$i<=odbc_num_fields($result);$i++)  
  51.           {
  52.              $selectArray[]=odbc_result($result,$i);
  53.           }
  54.   } 
  55. return $selectArray;
  56. }
  57.  else echo "ODBC not connected";  
  58. }
  59.  
  60.  
  61.  
  62.  
  63. // connect to ODBC
  64. if ( !( $database = odbc_connect( "tradespend", "chrisbwamp","")))
  65. die( "Could not connect to database" );
  66.  
  67. $headerSQL = odbc_prepare($database, "INSERT INTO WebForm (Action,StartDate,EndDate,RequestType,TSH1,TSH2,TSH3,TSH4,SoldTo,CustomerType,EndUserNames,Scales,Comments,Status,EnteredBy)
  68. VALUES('$action','$sdate','$edate','$RequestType','$TSH1','$TSH2','$TSH3','$TSH4','$SoldTo','$CustomerType','$EndUserNames','$Scales','$Comments','$Status','$EnteredBy');" ); 
  69.  
  70. if (!odbc_execute( $headerSQL))
  71. {
  72. /* error */
  73. echo "<h1>Insert of Header data has failed! Please contact IThelpdesk@pintys.com and reference Chris Beach</h1>";
  74. //break;
  75. }
  76. //else echo  "<h1>Header data was successfully uploaded to the database</h1>";
  77.  
  78. $stmt2=sqlSelect("SELECT MAX(WebID) FROM dbo.WebForm");
  79. print "the web ID is $stmt2[0]";
  80. // loop through the itemTypes, if they selected one, then insert that line into the database
  81. foreach ($itemTypes as $key => $value) {
  82. if ( $value != "" ) {
  83. /* run insert */
  84. print " $key";
  85. print " $value";
  86.  
  87.  
  88. $stmt = odbc_prepare($database, "INSERT INTO ConditionRecords (ItemType,Material,ForecastedVolume,UOM,DiscountRate,Unit,Program,StartDate,EndDate,HeaderKey)
  89. VALUES('$itemTypes[$key]','$citys[$key]','$ForecastedVolumes[$key]','$UOMS[$key]','$DiscountRates[$key]','$Units[$key]','$Programs[$key]','$sdates[$key]','$edates[$key]','1');" );
  90.  
  91. if (!odbc_execute( $stmt))
  92. {
  93. /* error */
  94. echo "<h1>Upload to database has failed!</h1>";
  95. //break;
  96. }
  97. else echo  "<h1>Trade Spend Request was successfully uploaded to the database</h1>";
  98.  
  99. }
  100. }
  101.  
  102. ?>
  103.  
Aug 16 '10 #3
zorgi
431 Expert 256MB
Woooooooooooow that is not pretty. I ignored it all, copy - pasted your code and submitted the form. It worked. So I guess the problem is somewhere in your upload.php. Can we see more of that code?
Aug 16 '10 #4
zorgi
431 Expert 256MB
I have trouble reproducing that error. What are 4 fields giving you that error?
Aug 16 '10 #5
Yeah, sorry for the ugliness :( My first time making a site, I used a form builder to lay everything out, unfortunately it did a messy job of formatting the HTML code.

These are the fields that fail:


Notice: Undefined index: city2 in C:\wamp\www\TS\upload.php on line 8

Notice: Undefined index: city3 in C:\wamp\www\TS\upload.php on line 8

Notice: Undefined index: edate in C:\wamp\www\TS\upload.php on line 20

Notice: Undefined index: Scales in C:\wamp\www\TS\upload.php on line 31

Notice: Undefined index: Comments in C:\wamp\www\TS\upload.php on line 32


...At least my upload.php is somewhat pretty? :D
Aug 16 '10 #6
Now I'm getting even more confused.

I changed around the code a bit. On my form, I have rows of drop downs and fields. The first 3 are correct, and getting data from the database, the rest were just place holders until I was sure everything was working.

Well, I replaced most of the place holders with the code from the first 3 rows of drop downs and input boxes (incrementing variable names with a number), and now when I submit the form, Comments and Scales does not give an undefined index error, and it now contains a value.

However, I still get:


Notice: Undefined index: city in C:\wamp\www\TS\upload.php on line 8

Notice: Undefined index: city2 in C:\wamp\www\TS\upload.php on line 8

Notice: Undefined index: city3 in C:\wamp\www\TS\upload.php on line 8

What are the typical reasons it isn't able to populate a variable using $_POST ? Do DIV's or any tags come into effect? I don't get why my city variables just plain don't work.
Aug 16 '10 #7
zorgi
431 Expert 256MB
Its very difficult to look through your code. Sometime the best way to do things is to do them from scratch or all over again. All I can see is that your city Select Boxes are probably not getting populated. You should have some sort of default value set for them in your HTML like:

Expand|Select|Wrap|Line Numbers
  1. <select name="city">
  2.     <option value="no city selected">---</option>
  3. </select>
  4.  
or an extra check in your Upload.php. Something like this:

Expand|Select|Wrap|Line Numbers
  1.   if(isset($_POST['city'])){
  2.     $city = $_POST['city'];
  3.   }else{
  4.     $city = "no city selected";
  5.   }
  6.  
Aug 16 '10 #8
Thanks for the reply, I've had some fires at work and couldn't come back until now.

It's definitely NOT setting the $_POST variable for the "city" drop downs, I just don't get why, is it possible the <SPAN> is some how preventing this?

I basically have a drop down that you select that determines what gets populated in the "city" drop down:
Expand|Select|Wrap|Line Numbers
  1. <code>
  2.  
  3.  <select size="1" name="itemType1" onChange="getCity('material1','findcity.php?itemType='+this.value)"><option selected 
  4.         value=""></option> <option value="Material">Material</option><option value="PH1">PH1</option> <option 
  5.         value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
  6.         value=PH4>PH4</option> &lt;\SELECT&gt;</select>
  7. </code>
This is the function for it:
Expand|Select|Wrap|Line Numbers
  1. <code>
  2.     function getCity($elementID,strURL) {        
  3.  
  4.         var req = getXMLHTTP();
  5.  
  6.         if (req) {
  7.  
  8.             req.onreadystatechange = function() {
  9.                 if (req.readyState == 4) {
  10.                     // only if "OK"
  11.                     if (req.status == 200) {                        
  12.                         document.getElementById($elementID).innerHTML=req.responseText;                        
  13.                     } else {
  14.                         alert("There was a problem while using XMLHTTP:\n" + req.statusText);
  15.                     }
  16.                 }                
  17.             }            
  18.             req.open("GET", strURL, true);
  19.             req.send(null);
  20.         }
  21.  
  22.     }
  23. </code>
which then populates the "material1" <span>

Like I said, I've been stumbling through all of this, I got it all working, except for getting the value from the city drop down (it does populate).

Expand|Select|Wrap|Line Numbers
  1. <code>
  2.  <span id="material1">
  3. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city1" id="city1">
  4.  </select>    </span>
  5. </code>
Aug 17 '10 #9
I wrote a whole long response, and it stated it had to be approved before it was shown, that was yesterday...what gives?
Aug 18 '10 #10
Dormilich
8,658 Expert Mod 8TB
that’s this forum’s spam filter, it sometimes catches even post, that are not spam.

back to the topic, when you load your page for the first time, there are no POST data available, since you didn’t submit the form. you need to check your form data before use as mentioned in post #8.
Aug 20 '10 #11
Thanks for the reply, and the explanation of the SPAM filter.

I think I understand post 8, setting it to a default value if it isn't already set, I just don't understand why mine is not getting set.

I set the drop down to a value, and then hit submit to submit the form, all of my other POST variables are set, but this specific one is not, it's also the only one using AJAX...I've spent endless time staring at the code, it's got to be something I don't know about.
Aug 20 '10 #12
JKing
1,206 Expert 1GB
What does the response text look like?
Aug 20 '10 #13
Notice: Undefined index: city1 in C:\wamp\www\TS\upload.php on line 8

So city1 is a drop down in my main php page, then when the form is submitted (to upload.php), I try to set a variable to the $_POST["city"] value, but it's not setting (for some reason)
Aug 20 '10 #14
JKing
1,206 Expert 1GB
Sorry I should have been more specific.

Can you copy and paste the html that is produced by the ajax call to populate the drop down.
Aug 20 '10 #15
Ahhh, that's a good idea actually, and I don't see the drop-down being populated in HTML, so I guess that is my problem :(

Expand|Select|Wrap|Line Numbers
  1.  <select size="1" name="itemType1" onChange="getCity('material1','findcity.php?itemType='+this.value)"><option selected 
  2.         value=""></option> <option value="M">Material</option><option value="1">PH1</option> <option 
  3.         value=2>PH2</option> <option value="3">PH3</option> <option 
  4.         value=4>PH4</option> &lt;\SELECT&gt;</select>           
  5.  
ItemType1 is selected, which then calls a function which populates the drop down, city1.

Expand|Select|Wrap|Line Numbers
  1. <span id="material1">
  2. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city1" id="city1">
  3.  </select>    </span>
  4.  
I can see all of the values in the drop down, but it doesn't look like the values are anywhere in the HTML...now I am really confused.
Aug 20 '10 #16
JKing
1,206 Expert 1GB
That's because the ajax adds in the text after the html has been posted to the browser.

You will need to grab the HTML from the file the AJAX is calling. Have a look in there and make sure it is formatted properly with values for each option in the select.

Alternatively you could use Firebug which is a browser addon to inspect the HTML after it has been changed by the javascript.
Aug 20 '10 #17
THANK YOU, that makes sense to me, I'll take a look and report back (possibly not until monday).
Aug 20 '10 #18
Ok, I've found the problem, and spend the past couple hours trying to solve it, but I'm just not getting it. If anyone could give me a pointer that would be awesome

I have my first drop down, which when selected runs the getcity function:

Expand|Select|Wrap|Line Numbers
  1. <select size="1" name="itemType1" onChange="getCity('material1','findcity.php?matNum=citys1&itemType='+this.value)"><option selected 
  2.         value=""></option> <option value="M">Material</option><option value="1">PH1</option> <option 
  3.         value=2>PH2</option> <option value="3">PH3</option> <option 
  4.         value=4>PH4</option> &lt;\SELECT&gt;</select>           
  5.        <span id="material1">
  6. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city1" id="city1">
  7.  </select>    </span>           
  8.  
The getcity function:

Expand|Select|Wrap|Line Numbers
  1.     function getCity($elementID,strURL) {        
  2.  
  3.         var req = getXMLHTTP();
  4.  
  5.         if (req) {
  6.  
  7.             req.onreadystatechange = function() {
  8.                 if (req.readyState == 4) {
  9.                     // only if "OK"
  10.                     if (req.status == 200) {                        
  11.                         document.getElementById($elementID).innerHTML=req.responseText;                        
  12.                     } else {
  13.                         alert("There was a problem while using XMLHTTP:\n" + req.statusText);
  14.                     }
  15.                 }                
  16.             }            
  17.             req.open("GET", strURL, true);
  18.             req.send(null);
  19.         }
  20.  
And the page that it calls, this has the code that replaces the drop down I have, with the dynamic content, the only problem is, I have 10 of these drop downs, so this function is called each time one is selected, I'm not sure how to have the NAME of the drop down dynamic, for example, the first drop down be called city1, the next city2, etc.. I can manually set the name to be city1, and the first drop down will work great, but none of the others will.

Specifically this line in the below code:

Expand|Select|Wrap|Line Numbers
  1. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name=<?php"'.$matNum1.'"?>>
  2.  
You can see I have the name=$matNum1 .. hoping it would pull the "citys1" name I passed it from the previous page, but that's not working, I just need to get this name being dynamic so each time I call this function, it uses the same name as the drop down it is replacing.

The full findcity.php code:

Expand|Select|Wrap|Line Numbers
  1. <?php $itemType=$_GET['itemType'];
  2. $matNum1=$_GET['matNum'];
  3.  
  4. function sqlSelect($daisySelect)
  5. {
  6.   //connect to a DSN, "daisy" 
  7. $conn = odbc_connect('daisy','chrisbwamp',''); 
  8. if ($conn) 
  9.   //The SQL statement that will query the database 
  10.   $query = $daisySelect; 
  11.  
  12.   //Perform the query 
  13.   $result=odbc_exec($conn, $query); 
  14.  
  15.   //Convert results to an array
  16.   while(odbc_fetch_row($result))
  17.   { 
  18.      for($i=1;$i<=odbc_num_fields($result);$i++)  
  19.           {
  20.              $selectArray[]=odbc_result($result,$i);
  21.           }
  22.   } 
  23. return $selectArray;
  24. }
  25.  else echo "ODBC not connected, please contact ITHelpdesk@pintys.com, reference Chris Beach";  
  26. }
  27.  
  28. if ( $itemType == "M" ) 
  29.     $arrProductNum=sqlSelect("SELECT Material_ID + ' - ' + DESCRIPTION AS Expr1 FROM VW_TradeSpend_Material ORDER BY Material_ID ASC");
  30. elseif( $itemType == "1" )
  31.       $arrProductNum=sqlSelect("SELECT DISTINCT LEVEL1_DESC FROM pintys.PROD_HIERARCHY");
  32. elseif( $itemType == "2" )
  33.       $arrProductNum=sqlSelect("SELECT DISTINCT LEVEL2_DESC FROM pintys.PROD_HIERARCHY");
  34. elseif( $itemType == "3" )
  35.       $arrProductNum=sqlSelect("SELECT DISTINCT LEVEL3_DESC FROM pintys.PROD_HIERARCHY");
  36. elseif( $itemType == "4" )
  37.       $arrProductNum=sqlSelect("SELECT DISTINCT LEVEL4_DESC FROM pintys.PROD_HIERARCHY");
  38. ?>
  39.  
  40. <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name=<?php"'.$matNum1.'"?>>
  41. <option></option>
  42.  
  43. <?php
  44. foreach($arrProductNum as $products) { 
  45. echo'<option value="'.$products.'">'.ltrim($products,"0").'</option>'; } 
  46.       echo "</select>"; 
  47. ?>
  48.  
I've attempted to send the word "citys1" in my drop down in my own form, and have the "findcity.php" pick it up as matNum1, and use it as the "name" so it could be dynamic, but it's not working :(
Aug 23 '10 #19
Got it! :)

I used an HTML array (I didn't know they existed), this solved that problem.

Thanks for all the help.
Aug 23 '10 #20
Dormilich
8,658 Expert Mod 8TB
what is an HTML array?
Aug 23 '10 #21
I take it by your answer, no such thing exists :p

I'm new to all of this, so not sure the proper name, but I basically set the name of my drop down box as:

Expand|Select|Wrap|Line Numbers
  1. name="citysTest[]"
  2.  
Which seems to act as an array, and increment each time the ajax is called, so then when uploading all of the values through PHP, I'm able to reference
Expand|Select|Wrap|Line Numbers
  1. $citysTesting = $_POST['citysTest'];
  2.  
And then loop through uploading each value of the drop down boxes
Aug 23 '10 #22
Dormilich
8,658 Expert Mod 8TB
I'm new to all of this, so not sure the proper name, but I basically set the name of my drop down box as:

Expand|Select|Wrap|Line Numbers
  1. name="citysTest[]"
  2.  
yepp, that’s the way to tell PHP that it should put these elements in an array.
Aug 24 '10 #23

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Hal Halloway | last post by:
How do I fix this error message below? Thanks. Notice: Undefined index: key_word in C:\Program Files\Apache Group\Apache2\htdocs\search010.php on line 55 .... if( $_GET ) { // line 55 //...
6
by: jsgoodrich | last post by:
I am looking for some help if anyone can lend a hand. I have a simple php website that displays a table from my mysql database. To prep for my MCSE I moved my home server to Windows 2003...
3
by: number1yan | last post by:
Can anyone help me, i am creating a website and am using a php script that recomends the website to other people. I keep getting the same error and can not work out why. The error is: Notice:...
3
by: sickboy | last post by:
$channels=$_GET; if (empty($channels)) { $channels='blank'; } changechannels($channels); $theatre=$_GET; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre); $info=$_GET; if...
1
by: francsutherland | last post by:
Notice: Undefined index: send in D:\Domains\workingdata.co.uk\wwwroot\contact_text.php on line 7 Hi, I've started getting this error in the contact page form of my website. The web hosting...
10
by: FutureShock | last post by:
I have since recently turned up my error reporting on a production site to E_ALL to ensure I am using 'best practices' when writing out code. So far it has helped me discipline myself with...
11
by: stealthmode666 | last post by:
New to .php so need script help. I want to know how to stop this being displayed when I click submit. Notice: Undefined index: homeowner in E:\domains\r\...\user\htdocs\...\form.php on line 166 ...
4
by: complearn | last post by:
Do you know why I got these errors for status_bar.php in some webhost, but work perfectly on other webhost? Whats wrong? here are the codes from line 18, our webhost is running php5. ...
1
by: duffy832 | last post by:
I am making changes to a php framework I downloaded and am new to PHP. I have this error: Notice: Undefined index: dec in D:\Hosting\4156690\html\idingo\modules\groups\group_sort.php on line 49...
3
by: razvanel442 | last post by:
Hi all i am new here! I take a look on forum but i don't found a the answer for my problem ok this is my problem: Line47:$user = $_GET; Line48:$pass = $_GET; Line49:$char = $_GET;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.