473,378 Members | 1,479 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,378 software developers and data experts.

How to fix undefined index error in in line no3

1
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $iit1=$_POST['iit1'];
  4. $iit2=$_POST['iit2'];
  5. $iit3=$_POST['iit3'];
  6. $iit4=$_POST['iit4'];
  7. $iit5=$_POST['iit5'];
  8. $iit6=$_POST['iit6'];
  9. $iit7=$_POST['iit7'];
  10. $iit8=$_POST['iit8'];
  11. $iit9=$_POST['iit9'];
  12. $iit10=$_POST['iit10'];
  13.  
  14. $c1=$_POST['c1'];
  15. $c2=$_POST['c2'];
  16. $c3=$_POST['c3'];
  17. $c4=$_POST['c4'];
  18. $c5=$_POST['c5'];
  19. $c6=$_POST['c6'];
  20. $c7=$_POST['c7'];
  21. $c8=$_POST['c8'];
  22. $c9=$_POST['c9'];
  23. $c10=$_POST['c10'];
  24.  
  25. $te1=$_POST['te1'];
  26. $te2=$_POST['te2'];
  27. $te3=$_POST['te3'];
  28. $te4=$_POST['te4'];
  29. $te5=$_POST['te5'];
  30. $te6=$_POST['te6'];
  31. $te7=$_POST['te7'];
  32. $te8=$_POST['te8'];
  33. $te9=$_POST['te9'];
  34. $te10=$_POST['te10'];
  35.  
  36. $ai1=$_POST['ai1'];
  37. $ai2=$_POST['ai2'];
  38. $ai3=$_POST['ai3'];
  39. $ai4=$_POST['ai4'];
  40. $ai5=$_POST['ai5'];
  41. $ai6=$_POST['ai6'];
  42. $ai7=$_POST['ai7'];
  43. $ai8=$_POST['ai8'];
  44. $ai9=$_POST['ai9'];
  45. $ai10=$_POST['ai10'];
  46.  
  47. $cn21=$_POST['cn21'];
  48. $cn22=$_POST['cn22'];
  49. $cn23=$_POST['cn23'];
  50. $cn24=$_POST['cn24'];
  51. $cn25=$_POST['cn25'];
  52. $cn26=$_POST['cn26'];
  53. $cn27=$_POST['cn27'];
  54. $cn28=$_POST['cn28'];
  55. $cn29=$_POST['cn29'];
  56. $cn210=$_POST['cn210'];
  57.  
  58. $mf1=$_POST['mf1'];
  59. $mf2=$_POST['mf2'];
  60. $mf3=$_POST['mf3'];
  61. $mf4=$_POST['mf4'];
  62. $mf5=$_POST['mf5'];
  63. $mf6=$_POST['mf6'];
  64. $mf7=$_POST['mf7'];
  65. $mf8=$_POST['mf8'];
  66. $mf9=$_POST['mf9'];
  67. $mf10=$_POST['mf10'];
  68.  
  69. $co1=$_POST['co1'];
  70. $co2=$_POST['co2'];
  71. $co3=$_POST['co3'];
  72. $co4=$_POST['co4'];
  73. $co5=$_POST['co5'];
  74. $co6=$_POST['co6'];
  75. $co7=$_POST['co7'];
  76. $co8=$_POST['co8'];
  77. $co9=$_POST['co9'];
  78. $co10=$_POST['co10'];
  79.  
  80. $ps1=$_POST['ps1'];
  81. $ps2=$_POST['ps2'];
  82. $ps3=$_POST['ps3'];
  83. $ps4=$_POST['ps4'];
  84. $ps5=$_POST['ps5'];
  85. $ps6=$_POST['ps6'];
  86. $ps7=$_POST['ps7'];
  87. $ps8=$_POST['ps8'];
  88. $ps9=$_POST['ps9'];
  89. $ps10=$_POST['ps10'];
  90.  
  91. $dms1=$_POST['dms1'];
  92. $dms2=$_POST['dms2'];
  93. $dms3=$_POST['dms3'];
  94. $dms4=$_POST['dms4'];
  95. $dms5=$_POST['dms5'];
  96. $dms6=$_POST['dms6'];
  97. $dms7=$_POST['dms7'];
  98. $dms8=$_POST['dms8'];
  99. $dms9=$_POST['dms9'];
  100. $dms10=$_POST['dms10'];
  101.  
  102. $ds1=$_POST['ds1'];
  103. $ds2=$_POST['ds2'];
  104. $ds3=$_POST['ds3'];
  105. $ds4=$_POST['ds4'];
  106. $ds5=$_POST['ds5'];
  107. $ds6=$_POST['ds6'];
  108. $ds7=$_POST['ds7'];
  109. $ds8=$_POST['ds8'];
  110. $ds9=$_POST['ds9'];
  111. $ds10=$_POST['ds10'];
  112.  
  113. $u1=$_POST['u1'];
  114. $u2=$_POST['u2'];
  115. $u3=$_POST['u3'];
  116. $u4=$_POST['u4'];
  117. $u5=$_POST['u5'];
  118. $u6=$_POST['u6'];
  119. $u7=$_POST['u7'];
  120. $u8=$_POST['u8'];
  121. $u9=$_POST['u9'];
  122. $u10=$_POST['u10'];
  123.  
  124. $cg1=$_POST['cg1'];
  125. $cg2=$_POST['cg2'];
  126. $cg3=$_POST['cg3'];
  127. $cg4=$_POST['cg4'];
  128. $cg5=$_POST['cg5'];
  129. $cg6=$_POST['cg6'];
  130. $cg7=$_POST['cg7'];
  131. $cg8=$_POST['cg8'];
  132. $cg9=$_POST['cg9'];
  133. $cg10=$_POST['cg10'];
  134.  
  135.  
  136. $bc1=$_POST['bc1'];
  137. $bc2=$_POST['bc2'];
  138. $bc3=$_POST['bc3'];
  139. $bc4=$_POST['bc4'];
  140. $bc5=$_POST['bc5'];
  141. $bc6=$_POST['bc6'];
  142. $bc7=$_POST['bc7'];
  143. $bc8=$_POST['bc8'];
  144. $bc9=$_POST['bc9'];
  145. $bc10=$_POST['bc10'];
  146.  
  147. $se1=$_POST['se1'];
  148. $se2=$_POST['se2'];
  149. $se3=$_POST['se3'];
  150. $se4=$_POST['se4'];
  151. $se5=$_POST['se5'];
  152. $se6=$_POST['se6'];
  153. $se7=$_POST['se7'];
  154. $se8=$_POST['se8'];
  155. $se9=$_POST['se9'];
  156. $se10=$_POST['se10'];
  157.  
  158.  
  159. $ss1=$_POST['ss1'];
  160. $ss2=$_POST['ss2'];
  161. $ss3=$_POST['ss3'];
  162. $ss4=$_POST['ss4'];
  163. $ss5=$_POST['ss5'];
  164. $ss6=$_POST['ss6'];
  165. $ss7=$_POST['ss7'];
  166. $ss8=$_POST['ss8'];
  167. $ss9=$_POST['ss9'];
  168. $ss10=$_POST['ss10'];
  169.  
  170. $d1=$_POST['d1'];
  171. $d2=$_POST['d2'];
  172. $d3=$_POST['d3'];
  173. $d4=$_POST['d4'];
  174. $d5=$_POST['d5'];
  175. $d6=$_POST['d6'];
  176. $d7=$_POST['d7'];
  177. $d8=$_POST['d8'];
  178. $d9=$_POST['d9'];
  179. $d10=$_POST['d10'];
  180.  
  181. $sad1=$_POST['sad1'];
  182. $sad2=$_POST['sad2'];
  183. $sad3=$_POST['sad3'];
  184. $sad4=$_POST['sad4'];
  185. $sad5=$_POST['sad5'];
  186. $sad6=$_POST['sad6'];
  187. $sad7=$_POST['sad7'];
  188. $sad8=$_POST['sad8'];
  189. $sad9=$_POST['sad9'];
  190. $sad10=$_POST['sad10'];
  191.  
  192.  
  193.  
  194. $j1=$_POST['j1'];
  195. $j2=$_POST['j2'];
  196. $j3=$_POST['j3'];
  197. $j4=$_POST['j4'];
  198. $j5=$_POST['j5'];
  199. $j6=$_POST['j6'];
  200. $j7=$_POST['j7'];
  201. $j8=$_POST['j8'];
  202. $j9=$_POST['j9'];
  203. $j10=$_POST['j10'];
  204.  
  205.  
  206. $ada1=$_POST['ada1'];
  207. $ada2=$_POST['ada2'];
  208. $ada3=$_POST['ada3'];
  209. $ada4=$_POST['ada4'];
  210. $ada5=$_POST['ada5'];
  211. $ada6=$_POST['ada6'];
  212. $ada7=$_POST['ada7'];
  213. $ada8=$_POST['ada8'];
  214. $ada9=$_POST['ada9'];
  215. $ada10=$_POST['ada10'];
  216.  
  217. $cn1=$_POST['cn1'];
  218. $cn2=$_POST['cn2'];
  219. $cn3=$_POST['cn3'];
  220. $cn4=$_POST['cn4'];
  221. $cn5=$_POST['cn5'];
  222. $cn6=$_POST['cn6'];
  223. $cn7=$_POST['cn7'];
  224. $cn8=$_POST['cn8'];
  225. $cn9=$_POST['cn9'];
  226. $cn10=$_POST['cn10'];
  227.  
  228. $sim1=$_POST['sim1'];
  229. $sim2=$_POST['sim2'];
  230. $sim3=$_POST['sim3'];
  231. $sim4=$_POST['sim4'];
  232. $sim5=$_POST['sim5'];
  233. $sim6=$_POST['sim6'];
  234. $sim7=$_POST['sim7'];
  235. $sim8=$_POST['sim8'];
  236. $sim9=$_POST['sim9'];
  237. $sim10=$_POST['sim10'];
  238.  
  239. ?>
Sep 10 '12 #1
2 1724
Rabbit
12,516 Expert Mod 8TB
An undefined index error means that they key you're using, in this case 'iit1' doesn't exist in the array you're trying to access, in this case $_POST. Basically, it's saying the page that called that PHP page didn't pass any variable named iit1.
Sep 10 '12 #2
Here's my own function for dealing with this... and works with ANY array

$iit1=read_from_array[$_POST, 'iit1'];

Expand|Select|Wrap|Line Numbers
  1. /*
  2.  * READ A VALUE FROM AN ARRAY
  3.  * param array - array from where to read
  4.  * param string - key to read from the array
  5.  * param string - default_value to return if the key does not exist or the it is not a valid array
  6.  * param php_function - php function to execute using the key value
  7.  * return string
  8.  *
  9. **/
  10.     function read_from_array($array, $key, $default_value='', $php_function='')
  11.     {
  12.         if(is_array($array))
  13.         {
  14.             if (array_key_exists($key, $array))
  15.             {
  16.                 $str = str_replace('\\', '/', trim($array[$key]));
  17.                 if(!empty($php_function))
  18.                 {
  19.                     return call_user_func($php_function, $str);
  20.                 }
  21.                 else
  22.                 {
  23.                     return $str;
  24.                 }
  25.             }
  26.         }
  27.         return $default_value;
  28.     }
  29. }
Sep 20 '12 #3

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

Similar topics

11
by: Chris | last post by:
I have a simple search feature that searches 3 fields in 3 separate tables in a MySQL db, and I'm getting an 'undefined index' error, but only in the first section (first table)of the results. The...
1
by: shalini11 | last post by:
Hello, I am using a page that has a dropdown list. when the user selects an item from the list and click on submit button, it opens a new page and displays the selected item. I've used as method...
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: JJM0926 | last post by:
I've got a contact form with a submit button where users have to enter their support information. Some fields are required some are not. When I test out the form if I leave everything blank I get...
7
by: ridgedale | last post by:
I wonder if anyone can help resolve an issue I've come across in making a customer's website live when it has tested fine in my own hosting space. I am getting the following errors: Notice:...
7
by: Philth | last post by:
Hey there, it has to be said that I am a complete novice in PHP, I know this is a common error and has probably been covered to some degree already - but my head really does hurt - so I couldn't...
1
by: jason1987 | last post by:
I keep getting the undefined index error on the bottom two rows of my code simparent and equtype - the other two work fine yet there is no difference in my code. equtypeid is even from the same table...
6
by: nadomt | last post by:
Happy friday to all! I am getting the below error when visiting my user filter page. i have gone to line 68, but cant see what the problem is...can anyone assist? advanced THANK YOU! Error:...
3
by: furqi | last post by:
hi i am actually having problem in this code i am trying to check the value in the if condition in the very last lines of the code but i am facing an error of "undefined index" can anybody tell me so...
3
by: mediator | last post by:
Hello I have a php contact email form on my a ecommerce shop website ! I am getting a Undefined index error messages coming from the top of the php code, the email form its self works fine, ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.