You did not select a file to upload.尽管我选择了要上传的文件,但在尝试上传文件时收到错误消息。我正在使用使用引导程序样式的输入文件。这是问题吗?我按照Codeigniter用户指南中的说明进行文件上传。谁能帮助我,并确定我的代码中的错误?
谢谢
控制者
public function create()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('userfile'))
{
echo "Upload failed";
}
else
{
$data = array('upload_data' => $this->upload->data());
}
$data = array(
'category' => $this->input->post('category');
'name' => $this->input->post('recipename'),
'ingredients' => $this->input->post('ingredients'),
'directions' => $this->input->post('directions'),
'date' => date("Y/m/d")
);
$this->model->insert($data);
redirect('', 'refresh');
}
Run Code Online (Sandbox Code Playgroud)
视图
<form action="<?php echo base_url();?>home/create" method="POST" role="form" multipart>
<legend>New Recipe</legend>
<div class="form-group">
<label for="">Category</label>
<select name="category" id="input" …Run Code Online (Sandbox Code Playgroud) 我的图书馆来自
并按照说明进行操作
http://biostall.com/demos/google-maps-v3-api-codeigniter-library/
但我收到一条错误信息
遇到 PHP 错误
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; Googlemaps has a deprecated constructor
Filename: libraries/Googlemaps.php
Line Number: 16
Backtrace:
File: C:\xampp\htdocs\test_map\application\controllers\Welcome.php
Line: 25
Function: library
File: C:\xampp\htdocs\test_map\index.php
Line: 292
Function: require_once
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?