• 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Page Not Found

#1
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.p...slideshows

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


http://127.0.0.1/CompanyGiondaCI/index.p...ile/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> 
" If I looks more intelligence please increase my reputation."
Reply

#2
I also have that funny error message when I click your links
Reply

#3
You just posted a localhost address...
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply

#4
Looks like you have not set your base url in config.php if your using CI3 versions you must set this value.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply

#5
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.
" If I looks more intelligence please increase my reputation."
Reply

#6
http://www.codeigniter.com/user_guide/he...elper.html
Reply

#7
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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.