Cpages/addslideshows.php
PHP Code:
public function addslideshows() {
$data['images'] = $this->Mpages->call_gallery();
$this->load->view('addslideshows', $data);
}
views/addslideshows.php
PHP Code:
<table>
<tr>
<td>
<?php /* <div class="form-group"> */ ?>
<div class="row">
<b>ADD NEW PICTURE</b><br><br>
<div class="col-md-12">
<input type="text" name="title">
</div>
</div>
</td>
<td>
<div style="margin-left: 80px;">
<div class="row">
<br><br>
<div class="col-md-12">
<label for="filename" class="control-label">Select File to Upload</label>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-12">
<input type="file" name="filename" size="20" />
<span class="text-danger"><?php if (isset($error)) { echo $error; } ?></span>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-12">
<input type="submit" class="edit" value="Upload File" class="btn btn-primary"/>
</div>
</div>
</div>
</div>
<?php /* </div> */ ?>
</td>
</tr>
</table>
controllers/Cuploadfile.php
PHP Code:
//file upload function
function upload()
{
//set preferences
$config['upload_path'] = 'uploads/';
$config['allowed_types'] = 'jpg|gif';
$config['max_size'] = '500000';
//load upload class library
$this->load->library('upload', $config);
if (!$this->upload->do_upload('filename'))
{
// case - failure
$upload_error = array('error' => $this->upload->display_errors());
// $this->load->view('upload_file_view', $upload_error);
$this->load->view('addslideshows', $upload_error);
}
else
{
// case - success
$upload_data = $this->upload->data();
$data['success_msg'] = '<div class="alert alert-success text-center">Your file <strong>' . $upload_data['file_name'] . '</strong> was successfully uploaded!</div>';
// $this->load->view('upload_file_view', $data);
$this->Mpages->add_slideshow();
$this->load->view('addslideshows', $data);
}
}
I also have this folder: CompanyCIGionda/uploads
The point is to place all files to that uploads folders.
After I click "Upload File" -->
http://127.0.0.1/CompanyGiondaCI/index.p...ile/upload
This error appears:
404 Page Not Found
The page you requested was not found.
This is strange to me. Why it does not carries me to addslideshows ?
" If I looks more intelligence please increase my reputation."