uploading picture |
To me your url is not good. Set it using localhost instead of IP
Code: $config['base_url'] = 'http://localhost/companygiondaci/'; Use localhost instead of ip address. And for your project folder rename it to lower case Code: www > companygiondaci On your uploads Code: $config['upload_path'] = '.uploads/'; // like Routes Code: $route['cuploadfile/upload'] = 'cuploadfile/upload'; // lower case
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
I just tried it and still having the same error message after uploading file:
404 Page Not Found The page you requested was not found.
" If I looks more intelligence please increase my reputation."
(08-30-2016, 12:38 AM)davy_yg Wrote: I just tried it and still having the same error message after uploading file: Did you try it with index.php in URL Code: http://localhost/companygiondaci/index.php/cuploadfile/upload Also name the file and class with first letter upper case ONLY as required Code: controllers/Cuploadfile.php
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
controllers/Cuploadfile.php
PHP Code: class Cuploadfile extends CI_Controller { I tested the upload picture. It stays on the same page yet it does not copy the picture to folder /uploads/
" If I looks more intelligence please increase my reputation."
Have you fix your form tag as it was wrong in one of your first post.
you posted: PHP Code: <?php echo form_open_multipart('uploadfile/upload');?> It should be: PHP Code: <?php echo form_open_multipart('cuploadfile/upload');?> A good decision is based on knowledge and not on numbers. - Plato
How to fix this error message?
Another error message appears:
A PHP Error was encountered Severity: Notice Message: Undefined variable: images Filename: views/addslideshows.php Line Number: 103 Backtrace: File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\application\views\addslideshows.php Line: 103 Function: _error_handler File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\application\controllers\Cuploadfile.php Line: 36 Function: view File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\index.php Line: 315 Function: require_once A PHP Error was encountered Severity: Warning Message: Invalid argument supplied for foreach() Filename: views/addslideshows.php Line Number: 103 Backtrace: File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\application\views\addslideshows.php Line: 103 Function: _error_handler File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\application\controllers\Cuploadfile.php Line: 36 Function: view File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\index.php Line: 315 Function: require_once ------------------------------------------------- views/addslideshows.php PHP Code: <?php foreach ($images as $images_item): ?> controllers/Cpages.php PHP Code: public function addslideshows() {
" If I looks more intelligence please increase my reputation."
your call to :
PHP Code: $data['images'] = $this->Mpages->call_slideshow(); Does not return what you expect. What is the code for the method? A good decision is based on knowledge and not on numbers. - Plato
(08-30-2016, 01:45 AM)davy_yg Wrote: How to fix this error message? Try on controller PHP Code: <?php You should var_dump your model function in your return of model you may need to use return $query->result_array() PHP Code: <?php if ($images) {?>
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
http://localhost/companygiondaci/index.p...alleries/2
array(1) { ["gallery"]=> array(1) { [0]=> array(2) { ["galleries_id"]=> string(1) "2" ["galleries_name"]=> string(8) "gallery1" } } } controllers/Cpages.php public function editgalleries() { $id = $this->uri->segment(3); $data['gallery'] = $this->Mpages->edit_gallery($id); var_dump($data); // Check if any results are actually there. $this->load->view('editgalleries', $data); }
" If I looks more intelligence please increase my reputation."
|
Welcome Guest, Not a member yet? Register Sign In |