I am using CodeIgniter 2.1.0 and the MySQL database. I uploaded the image through the form and successfully saved it in the uploads directory, and I also successfully saved the full path to the image in my database. but I had a problem displaying the image, calling the full path from my database.
Here is my download code:
$image_path = realpath(APPPATH . '../uploads'); $config = array( 'allowed_types' => 'jpeg|png|gif|jpg', 'upload_path' => $image_path, 'max_size' => 2097152, 'overwrite' => TRUE, 'file_name' => '_' . $i . '_' ); $this -> load -> library('upload', $config);
When I save the full path to the image in my database, it looks something like this.
C:/wamp/www/my_project/uploads/_1_.jpg
If i try
<img src="<?php echo $data['screenshot'];?>" /> //($data['screenshot'] refers to the image location retrieved from database)
it is in my view file, the image is not displayed. What am I doing wrong? Please tell me someone. What is the standard procedure?
Shabib
source share