Welcome Guest, Not a member yet? Register   Sign In
[Solved] how to hide a part of url?
#7

[eluser]Mr-H[/eluser]
thanks pickupman ,i got it
but the thing is in the uri segment.
her is my code ,i wish that can help some body
Code:
function link($id)
    {

        if($id)
        {
            //initialise the uri
            $image = $this->uri->segment(3);
            $sub_folder = $this->uri->segment(4);
            $orig_name = $this->uri->segment(5);
            $query = $this->db->get_where('img_uploader',array('id'=>$image,'sub_folder' => $sub_folder ,'orig_name' =>$orig_name));
            //make sure if the image existe in db
            if($query->num_rows() > 0)
            {
                
                $imageArray = $query->row_array();
                $image ='uploads/'.$imageArray['sub_folder'].'/'.$imageArray['orig_name'];
                header('Content-type: image/jpeg');
                 echo file_get_contents($image);//.$imageArray['sub_folder'].'/'.$imageArray['orig_name']);

            }
            else{
                echo "You enter an invalide url ";
            }
        }
        else{
                echo " No image found";
            }
    }
my url looks like this : http://localhost/myscript/controller/link/12/skljd06/myfile.ext
12 is the id
skljd06 is the subfolder (for every file uploaded i create a folder with random name )
myfile.ext is the name of the file with extension
friendly url ;-)


Messages In This Thread
[Solved] how to hide a part of url? - by El Forum - 05-16-2010, 01:22 PM
[Solved] how to hide a part of url? - by El Forum - 05-16-2010, 01:52 PM
[Solved] how to hide a part of url? - by El Forum - 05-16-2010, 02:30 PM
[Solved] how to hide a part of url? - by El Forum - 05-16-2010, 06:54 PM
[Solved] how to hide a part of url? - by El Forum - 05-17-2010, 08:09 AM
[Solved] how to hide a part of url? - by El Forum - 05-17-2010, 08:40 AM
[Solved] how to hide a part of url? - by El Forum - 05-22-2010, 05:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB