Note that there are some explanatory texts on larger screens.

plurals
  1. POform POST array issue in codeigniter
    primarykey
    data
    text
    <p>I am posting a simple form in codeigniter. When I submit the form and echo the $_POST array, it shows me the following:</p> <pre><code>Array ( [first_name] =&gt; First Name [last_name] =&gt; Last Name [zip] =&gt; Zip Code [phone] =&gt; Phone [email] =&gt; e-mail [area_interest] =&gt; [terms] =&gt; terms [x] =&gt; 14 [y] =&gt; 8 ) </code></pre> <p>The last two fields are really mysterious. I don't know from where they are coming. Any ideas?</p> <p>This is my form code:</p> <pre><code>&lt;?PHP $attributes=array('method'=&gt;'post'); echo form_open('request-information',$attributes);?&gt; &lt;table height="180" width="220"&gt; &lt;tr&gt; &lt;td&gt; &lt;input type="text" name="first_name" id="first_name" class="form-text1 inputfieldform1" value="First Name" onBlur="if(this.value=='') this.value='First Name'" onFocus="if(this.value =='First Name' ) this.value=''" style="width:95px;" /&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" name="last_name" id="last_name" class="form-text1 inputfieldform1" value="Last Name" onBlur="if(this.value=='') this.value='Last Name'" onFocus="if(this.value =='Last Name' ) this.value=''" style="width:95px;" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;input type="text" id="zip_code" name="zip" class="form-text1 inputfieldform1" value="Zip Code" onBlur="if(this.value=='') this.value='Zip Code'" onFocus="if(this.value =='Zip Code' ) this.value=''" style="width:95px;"/&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" id="phone_number" class="form-text1 inputfieldform1" value="Phone" onBlur="if(this.value=='') this.value='Phone'" onFocus="if(this.value =='Phone' ) this.value=''" style="width:95px;" name="phone"/&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;input type="text" name="email" id="email" class="form-text1 inputfieldform1" value="e-mail" onBlur="if(this.value=='') this.value='e-mail'" onFocus="if(this.value =='e-mail' ) this.value=''" style="width:205px"/&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;select style="width:208px; height:20px;" id="interest_area" name="area_interest" class="top2select" &gt; &lt;option value="" selected=""&gt;Select Area of Interest&lt;/option&gt; &lt;option value="Arts/Design/Fashion"&gt;Arts/Design/Fashion&lt;/option&gt; &lt;option value="aviation"&gt;Aviation&lt;/option&gt; &lt;option value="Beauty/Cosmetology"&gt;Beauty/Cosmetology&lt;/option&gt; &lt;option value="Business"&gt;Business&lt;/option&gt; &lt;option value="Communication &amp; Mass media "&gt;Communication &amp; Mass media &lt;/option&gt; &lt;option value="Criminal Justice"&gt;Criminal Justice&lt;/option&gt; &lt;option value="Culinary Arts"&gt;Culinary Arts&lt;/option&gt; &lt;option value="Education"&gt;Education&lt;/option&gt; &lt;option value="Engineering"&gt;Engineering&lt;/option&gt; &lt;option value="Funeral &amp; Mortuary Sciences"&gt;Funeral &amp; Mortuary Sciences&lt;/option&gt; &lt;option value="Health Care"&gt;Health Care/Human Services&lt;/option&gt; &lt;option value="Hospitality"&gt;Hospitality&lt;/option&gt; &lt;option value="Interdisciplinary Studies"&gt;Interdisciplinary Studies&lt;/option&gt; &lt;option value="Legal &amp; Paralegal "&gt;Legal &amp; Paralegal &lt;/option&gt; &lt;option value="Liberal Arts"&gt;Liberal Arts&lt;/option&gt; &lt;option value="Massage/ Wellness"&gt;Massage/ Wellness&lt;/option&gt; &lt;option value="Trade/Vocational"&gt;MBA&lt;/option&gt; &lt;option value="Nursing"&gt;Nursing&lt;/option&gt; &lt;option value="Sciences"&gt;Sciences&lt;/option&gt; &lt;option value="Social Sciences"&gt;Social Sciences&lt;/option&gt; &lt;option value="Technology/Computer/IT"&gt;Technology/Computer/IT&lt;/option&gt; &lt;option value="Trade/Vocational"&gt;Trade/Vocational&lt;/option&gt; &lt;option value="undecided"&gt;Undecided&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;input type="checkbox" checked="true" value="terms" name="terms"&gt;&amp;nbsp;&amp;nbsp;I accept &lt;a href="#" style="text-decoration:underline"&gt;terms &amp; conditions&lt;/a&gt; &lt;/td&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" style="text-align:center"&gt; &lt;input type="image" src="&lt;?PHP echo base_url();?&gt;images/frontend/bg/search_button1.png"&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p></p> <p>Regards, Mrinal</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload