English 中文(简体)
未创建隐藏窗体字段
原标题:Hidden form field not created

我试图在代码Igniter中创建一个名为“就业”的HIDDEN字段。 我看过医生并跟踪了他们,但是这个字段并没有进入。

我的代码如下...

<?php $EMPLOYEES_id = array( EMPLOYEES_id  => $message[0]->EMPLOYEES_id); ?>
<?php $attributes = array( class  =>  well form-horizontal );?>
<?=form_open( messages/create , $attributes,   ,$EMPLOYEES_id)?>

字段不是以我的形式出现的。我假定是因为在 form_open 中添加了额外的数组。

最佳回答

建议作两处修改:

  • The hidden field array is supposed to be the third parameter, not the fourth.
  • 尝试执行完整的 ;?php回声 而不是

问题回答

如果您仍然想要尝试窗体- 开放方法, 那么首先, 跟随 Yan s 的想法, 因为数组应该是第三个参数, 而不是第四个参数 。

第二,当你通过两个班级的时候, 科迪尼特可能不喜欢这样。

也许试试看:

$attributes = array( class  =>  well ,  class  =>  form-horizontal );

虽然我更怀疑这不是问题 但值得一试...

给你:

您的代码 :

<?=form_open( messages/create , $attributes,   ,$EMPLOYEES_id)?>

隐藏的输入是第三个参数, 您正在通过它作为输出, 它应该是 :

<?=form_open( messages/create , $attributes, $EMPLOYEES_id)?>
$initial_pump = array(
                     name  =>  EMPLOYEE_id ,
                     id  =>  EMPLOYEE_id ,
                     value  => $message[0]->EMPLOYEES_id)
                );
echo form_hidden($initial_pump);




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签