Remove base_url() from whole URL

#1
[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

#2
[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 Smile
first read than post .


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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