在codeigniter中形成POST数组问题

时间:2012-06-15 07:20:28

标签: php forms codeigniter

我在codeigniter中发布了一个简单的表单。当我提交表单并回显$ _POST数组时,它会显示以下内容:

Array
(
    [first_name] => First Name
    [last_name] => Last Name
    [zip] => Zip Code
    [phone] => Phone
    [email] => e-mail
    [area_interest] => 
    [terms] => terms
    [x] => 14
    [y] => 8
)

最后两个领域真的很神秘。我不知道他们来自哪里。 有什么想法吗?

这是我的表单代码:

<?PHP 
$attributes=array('method'=>'post');
echo form_open('request-information',$attributes);?>
<table height="180" width="220">
<tr>
    <td>
        <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;" />
    </td>
    <td>
        <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;" />
    </td>
    </tr>
 <tr>
     <td>
       <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;"/>
      </td>
     <td>
       <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"/>
      </td>
 </tr>
   <tr>
      <td colspan="2">
      <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"/>
      </td>
      </tr>
      <tr>
    <td colspan="2">
         <select style="width:208px; height:20px;" id="interest_area" name="area_interest" class="top2select" >
          <option value="" selected="">Select Area of Interest</option>
          <option value="Arts/Design/Fashion">Arts/Design/Fashion</option>
          <option value="aviation">Aviation</option>
          <option value="Beauty/Cosmetology">Beauty/Cosmetology</option>
          <option value="Business">Business</option>
          <option value="Communication & Mass media ">Communication & Mass media </option>
          <option value="Criminal Justice">Criminal Justice</option>
          <option value="Culinary Arts">Culinary Arts</option>
          <option value="Education">Education</option>
          <option value="Engineering">Engineering</option>
          <option value="Funeral & Mortuary Sciences">Funeral & Mortuary Sciences</option>
          <option value="Health Care">Health Care/Human Services</option>
          <option value="Hospitality">Hospitality</option>
          <option value="Interdisciplinary Studies">Interdisciplinary Studies</option>
          <option value="Legal & Paralegal ">Legal & Paralegal </option>
          <option value="Liberal Arts">Liberal Arts</option>
          <option value="Massage/ Wellness">Massage/ Wellness</option>
          <option value="Trade/Vocational">MBA</option>
          <option value="Nursing">Nursing</option>
          <option value="Sciences">Sciences</option>
          <option value="Social Sciences">Social Sciences</option>
          <option value="Technology/Computer/IT">Technology/Computer/IT</option>          
          <option value="Trade/Vocational">Trade/Vocational</option>
          <option value="undecided">Undecided</option>
           </select>
    </td>
</tr>
<tr>
<td colspan="2">
<input type="checkbox" checked="true" value="terms" name="terms">&nbsp;&nbsp;I accept <a href="#" style="text-decoration:underline">terms & conditions</a>
</td>
</td>
</tr>
<tr>

<td colspan="2" style="text-align:center">
<input type="image" src="<?PHP echo base_url();?>images/frontend/bg/search_button1.png">

</td>
</tr>

此致 Mrinal

2 个答案:

答案 0 :(得分:3)

X和Y变量来自图像输入。

这些是用户点击的坐标。

阅读here

答案 1 :(得分:0)

通过放置'/'

来编辑它
 <input type="image" src="<?PHP echo base_url();?>/images/frontend/bg/search_button1.png">

我认为x,y是图像的坐标,如@Yan所说