CodeIgniter Forums
Page Not Found - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Page Not Found (/showthread.php?tid=65794)



Page Not Found - davy_yg - 07-25-2016

views/addslideshows.php


PHP Code:
<div class="col-md-6 col-md-offset-3 well">
 
       <br>
 
       <?php echo form_open_multipart('Cuploadfile/upload');?>
        
        <label><b>PHOTO GALLERY 1</b></label><br><br>
        
        <div style="margin-left: 35px">
        <fieldset>
        <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>    
            
            
        </fieldset>
        </div>    
        
        <?php foreach ($images as $images_item): ?>
        
        <br><br>
        <table style="padding: 10px;">
        <tr>
        <td><b>EDIT CAPTION</b></td>
        <td><center><b>IMAGES</b></td>
        <td><b>DELETE</b></center></td>
        </tr>
        <tr>
        <td><input type="text" name="caption" value=""></td>
        <td><img src="<?php echo base_url('uploads/'.base_url($images_item['src'])); ?>" height="300" width="400"></td>
        <td><button class="delete">DELETE</button></td>
        </tr>
        <tr>
        <td><input type="text" name="caption" value=""></td>
        <td><img src="<?php echo base_url('uploads/pic2.jpg'); ?>" height="300" width="400"></td>
        <td><button class="delete">DELETE</button></td>
        </tr>
        </table>
    </div> 



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);
                        
 
       }
        
                
 
   


Models/Mpages.php

PHP Code:
public function add_slideshow()
    {
        
        
$data = array(
         
   'slideshow_image' => $this->input->post('filename'),
            
'image_id' => $this->input->post('image_id'), // auto
            
'title' => $this->input->post('title')            
        );
    
        return 
$this->db->insert('slideshow'$data);
        
    } 


http://127.0.0.1/CompanyGiondaCI/index.php/cpages/addslideshows

Hello,  I have this funny error message when I click Upload File Button:


http://127.0.0.1/CompanyGiondaCI/index.php/Cuploadfile/upload

404 Page Not Found
The page you requested was not found.

views/addslideshows.php

PHP Code:
   <div class="col-md-6 col-md-offset-3 well">
 
       <br>
 
       <?php echo form_open_multipart('Cuploadfile/upload');?>
        
        <label><b>PHOTO GALLERY 1</b></label><br><br>
        
        <div style="margin-left: 35px">
        <fieldset>
        <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> 



RE: Page Not Found - Ivo Miranda - 07-25-2016

I also have that funny error message when I click your links


RE: Page Not Found - albertleao - 07-25-2016

You just posted a localhost address...


RE: Page Not Found - wolfgang1983 - 07-25-2016

Looks like you have not set your base url in config.php if your using CI3 versions you must set this value.


RE: Page Not Found - davy_yg - 07-25-2016

I wonder what's the difference between:

base_url();

and site_url();

example: site_url('cpages/addslideshows');

index.php/cpages/addslideshows (site_url to add more url next to index.php)

If I define base_url(); will it gives any effects to site_url(); I try configuring the base_url(); and many of my navigation shows error.


RE: Page Not Found - ciadmin - 07-25-2016

http://www.codeigniter.com/user_guide/helpers/url_helper.html


RE: Page Not Found - InsiteFX - 07-26-2016

site_url adds index.php base_url does not

I mean come on sit down and take the time to read the CodeIgniter Users Guide.