我一直在尝试为我正在建设的这个网站加载一些模型.但是,由于未知原因,它将带来以下错误:
An Error Was Encountered
Unable to locate the model you have specified: logon_model
Run Code Online (Sandbox Code Playgroud)
现在,我做了我的研究.问题是IC处理小写的文件名.但是,我的文件和文件调用都是小写的,如下所示:
echo "VALIDATING";
// Validation passed. Off we go to account info verification from AA's database. God help us all.
$this->load->model('logon_model');
echo "FOUND MODEL";
$res = $this->logon_model->verify_user($this->input->post('username'),$this->input->post('password'));
echo $this->input->post('username');
echo $this->input->post('password');
Run Code Online (Sandbox Code Playgroud)
执行没有达到"FOUND MODEL",因此在模型加载时停止.我试过用:
$this->load->model(site_url('logon_model'));
Run Code Online (Sandbox Code Playgroud)
没有结果.需要提一下模型文件是否正确放置在正确的模型文件夹中?
我怎样才能解决这个问题 ?
编辑:模型文件的标题:
class Logon_model extends CI_Model {
....
Run Code Online (Sandbox Code Playgroud) 请看下面的代码:
$this->session->set_flashdata('message', 'This is a message.');
var_dump($this->session->flashdata('message'));
Run Code Online (Sandbox Code Playgroud)
它回来了bool(false).
我希望这不会NEED一个redirect()是后撤换,因为有些时候我需要在一个视图中设置flashdata后马上打电话.
在venkat的评论之后编辑
$this->session->set_flashdata('message', 'This is a message.');
$this->session->keep_flashdata('message');
var_dump($this->session->flashdata('message'));
Run Code Online (Sandbox Code Playgroud)
不幸的是没有区别.
我正在寻找一种方法来查看生成的查询字符串,但不执行它.
请注意,之前尚未执行查询.(我不想要$this->db->last_query();)
我希望有一个方法,其名称就像$this->db->echo_query_string($table_name = '');使用完全相同 $this->db->get($table_name = ''); 但只 get()执行代码,但echo_query_string()只是在不执行的情况下回显查询字符串.
经过大量的谷歌搜索和Stackoverflowing,我仍然不清楚,因为许多文章和问题/答案太笼统(包括403 Forbidden vs 401 Unauthorized HTTP响应,这不是专门针对我的用例).
问题:当用户未登录并请求查看仅应向登录用户显示的某些页面时,正确的HTTP状态代码是什么?
你知道我在谈论filter_varPHP 5中的功能.
我访问过http://php.net/manual/en/filter.filters.sanitize.php,但我仍有疑问:
有什么确切的区别?
请提供一个示例,以便更容易澄清.
我有一个"事件"表.为简单起见,您可以想象它应该像分层类别.它使用嵌套集模型(感谢Mark Hillyer在http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/上的帖子)
我的代码:
$query =
"LOCK TABLE event WRITE;
SELECT @ParentRight := parent.rgt, @Level := parent.level FROM event AS parent WHERE parent.id = '{$data['parent_id']}';
UPDATE event SET rgt = rgt + 2 WHERE rgt > @ParentRight;
UPDATE event SET lft = lft + 2 WHERE lft > @ParentRight;
INSERT INTO event(lft, rgt, level) VALUES(@ParentRight, @ParentRight + 1, @Level);
UNLOCK TABLES;";
mysqli_multi_query($this->db->conn_id, $query);
$data['id'] = $this->db->insert_id();
return $this->db->update('event', $data);
Run Code Online (Sandbox Code Playgroud)
之后我将用更新最后插入的对象 $this->db->update('event', $data)
$data 是用户填充的数组.
问题1: …
我用下面的代码有相同的高度rightpos,leftpos并middlepos申报单:
<script>
jQuery.noConflict();
jQuery(document).ready(function($){
// Find the greatest height:
maxHeight = Math.max($('#rightpos').height(), $('#middlepos').height());
maxHeight = Math.max(maxHeight, $('#leftpos').height());
// Set height:
$('#rightpos').height(maxHeight);
$('#middlepos').height(maxHeight);
$('#leftpos').height(maxHeight);
})
</script>
Run Code Online (Sandbox Code Playgroud)
使用这种方式为http://yaskawa.ir/的主页确定最高的div 在Firefox中运行良好,但在Chrome中有问题.
Sparky672回答后更新1:
我可以看到,使用此代码,alert('test here');最后不起作用.
<script>
jQuery.noConflict();
//jQuery(document).ready(function($){});
jQuery(window).load(function($){
// Find the greatest height:
maxHeight = Math.max($('#rightpos').height(), $('#middlepos').height());
maxHeight = Math.max(maxHeight, $('#leftpos').height());
// Set height:
$('#rightpos').height(maxHeight);
$('#middlepos').height(maxHeight);
$('#leftpos').height(maxHeight);
alert('test here');
})
</script>
Run Code Online (Sandbox Code Playgroud)

我需要一个(php)正则表达式来匹配雅虎的用户名规则:
使用4到32个字符并以字母开头.您可以使用字母,数字,下划线和一个点(.).
据我所知,jQueryUI本身不支持RTL语言.有官方或至少稳定的解决方案吗?
我不需要任何特别的东西.只想拥有干净的从右到左的页面,而不是从左到右的正常页面.
php ×5
codeigniter ×3
css ×3
mysql ×2
validation ×2
activerecord ×1
css3 ×1
filter ×1
html-input ×1
html5 ×1
jquery ×1
jquery-ui ×1
model ×1
multi-query ×1
mysqli ×1
regex ×1
sanitization ×1
session ×1
window-load ×1
yahoo ×1