Remove base_url() from whole URL |
[eluser]Zimooon[/eluser]
Hey guys, I have an onclick copy ( i display images and user can click on them and the URL of the image written into a textfield) . The problem is : i just want siteurl not the full url. f.e.: image url: www.example.com/images/asd.jpg this url get copied into my textfield and saved like this into my DB. Now i want only this part: /images/asd.jpg get saved to my DB. Is there any way to substract the base_url() from the full url? this is my js function: [removed] function clicked(address) { document.getElementById('copy_img').value = address.src; }[removed] and i call it via: onclick="clicked(this)" best regards
[eluser]Zimooon[/eluser]
Oh was easy just thought about too hard ways: for everyone : $image = uri_string($this->input->post('image')); Uri_string. CI ftw , userguide ftw ![]() first read than post . |
Welcome Guest, Not a member yet? Register Sign In |