【发布时间】:2014-01-14 17:35:21
【问题描述】:
我创建了 user.php 的控制器名称,我在本地主机上测试了完整的项目,它工作正常,但是当我在网站上在线上传时它显示错误,我提交表单,然后表单加载名为 user.php 的控制器并在第一个错误我检查了它称为解析错误的行,但您仍然会建议。
<?php
class User extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->helper('form');
$this->load->helper('url');
}
public function create_user()
{
// field name, error message, validation rules
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
$this->form_validation->set_rules('city', 'City', 'trim|required');
if($this->form_validation->run() == FALSE)
{
$this->load->view('ar_signup');
}
else
{
$this->load->model('Users_model');
if($this->input->post("language")=="ar")
{
$this->load->view('ar_thanks');
}
else
{
$this->load->view('en_thanks');
}
if($query = $this->Users_model->create_member())
{
$this->load->view('ar_thanks');
}
}
}
}
【问题讨论】:
-
指定详细错误
-
这个问题似乎是题外话,因为它是关于
-
@Formal 你需要提供错误发生的详细信息,Parse error 是错误的类型但你没有指定错误是什么。
-
Adarsh 我只是在这个文件中得到错误解析错误:语法错误,意外 $end in,这就是为什么我共享文件的完整代码,因为我结束了 php 和所有大括号,但仍然显示错误。
-
**解析错误:语法错误,意外 $end in ** 这个错误来自 web 我提交表单。
标签: php codeigniter