• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Php Syntax not working on this line

So I'm new here i now that because of this basic problem, once hi everyone and thats my problem in php framework in codeigniter.
I'm using Netbeans ide and wamp server.

this is my controller codes I'm have a database like Id Picture Profile and more. so i put in data in database and i want to uptade my Picture coloumn like this.
PHP Code:
public function Picture_Upload($id){
        public function Save_picture($id){
['upload_path'         './upload/';
               $config['allowed_types'       'gif|jpg|png';
               $config['max_size'            100;
               $config['max_width'           1024;
               $config['max_height'          768;


               if ( ! $this->upload->do_upload('Picture'))
                       $this->session->set_flashdata("msj","Someting goes wrong try again".$error);
                       $upload_data $this->upload->data();


here is my Database_model

PHP Code:
  public function update_data($tablo,$data,$id){
               return true;

and this is the form of all of this.

PHP Code:

<div id="page-wrapper">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-4">
                        <h1 class="page-header">Add</h1>
                        <?php if($this->session->flashdata("msj")) { ?>
                         <div class="alert alert-info">
                             <a href="#" class="alert-danger">Sometings Go Wrong</a>
                        <?php ?>
                        <form  method="POST" enctype="multipart/form-data" action="<?=base_url()?>admin/product/Save_Picture/<?=$id?>" >
                            <div class="form-group">
                            <label for="exampleInputEmail1">Save Picture</label>
                            <input type="file" class="form-control" id="pic" required name="pic"  >
                          <button type="submit" class="btn btn-primary">Send</button>
                    <!-- /.col-lg-12 -->
                <!-- /.row -->
            <!-- /.container-fluid -->

this is all to my codes so now i cant get to id like this 
browser give me error like that : 
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: id

Filename: admin/add_product_picture.php

Line Number: 20

and i can not get it to image id so i cant uptade to data base but the picture comes from to uploads file so database not updating. there are still empty. when i was write to <?php $id ?> there is a no error around but so still i cant get to id and name of image in database.

if you know and tell me i will thanks a lot for this. thanks for helping or trying to this if you want i can share my code in github.

i'm student of computer engineering in Turkey, and sorry for my Bad English.

Messages In This Thread
Php Syntax not working on this line - by Redwoodcutter - 12-10-2017, 04:22 AM
RE: Php Syntax not working on this line - by ZoRg - 12-10-2017, 10:26 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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