Welcome Guest, Not a member yet? Register   Sign In
uploading picture
#11

(This post was last modified: 08-30-2016, 12:34 AM by wolfgang1983.)

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!
Reply
#12

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."
Reply
#13

(This post was last modified: 08-30-2016, 12:44 AM by wolfgang1983.)

(08-30-2016, 12:38 AM)davy_yg Wrote: 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.

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!
Reply
#14

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."
Reply
#15

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

Reply
#16

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() {

            
        $data
['images'] = $this->Mpages->call_slideshow();
        
        $this
->load->view('addslideshows'$data); 
    
    

" If I looks more intelligence please increase my reputation."
Reply
#17

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

Reply
#18

(This post was last modified: 08-30-2016, 05:13 AM by wolfgang1983.)

(08-30-2016, 01:45 AM)davy_yg Wrote: 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() {

            
        $data
['images'] = $this->Mpages->call_slideshow();
        
        $this
->load->view('addslideshows'$data); 
    
    



Try on controller


PHP Code:
<?php

class Cuploadfile extends CI_Controller {

public function 
__construct() {
 
  parent::__construct();
 
  $this->load->model('mpages');
}

public function 
index() {

}

public function 
addslideshows() {

    $data['images'] = array();

    $results[] = $this->mpages->call_slideshow();

    var_dump($results); // Check if any results are actually there.

    $data['images'] = $results;

    $this->load->view('addslideshows'$data);

}




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) {?>

    <?php foreach ($images as $images_item) { ?>
          <?php echo $images_item['name'];?>
    <?php ?>

<?php ?>
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#19

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."
Reply




Theme © iAndrew 2016 - Forum software by © MyBB