【发布时间】:2013-07-25 01:12:17
【问题描述】:
我收到了这个错误:
遇到 PHP 错误 严重性:警告消息:strip_tags() 期望参数 1 是字符串,给定文件名的数组: inscription/loginform3.php 行号:19
代码如下:
echo form_open_multipart('user/register_step_3');
// Loop through the POST variables passed from the previous page
foreach ($_POST as $key => $value){
$value = htmlentities(stripslashes(strip_tags($value)));
echo form_hidden($key, $value);
}
还有第 19 行的代码:
$value = htmlentities(stripslashes(strip_tags($value)));
请帮我解决这个问题。
【问题讨论】:
-
你能打印_r($value) 并粘贴到这里吗?
-
$value是一个数组,它可能还有其他元素如$value[0] -
你看过CodeIgniter的input class和
$this->input->post吗? -
@karan ashar 你这是什么意思?我必须添加 print_r($value) 吗?
-
$value 在这里不是一个字符串。它是一个数组。把它变成一个字符串。请向我们展示 print_r($_POST); 之类的值;
标签: php html mysql codeigniter