Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

FCKEditor solution – How to store full URL for images (Show absolute path)

Hello Friends,

Today i came across a problem with FCKEditor. When i upload an image from fckeditor Browser Server option, it uploads correctly and insert image in content as well. But if i will send this content in email (for newsletter) than image will not be there as fckeditor inserts relative path in source of image. There should be a complete URL for image if you are sending this content into email. I was trying to find the way that how to insert the full url path when image uploads from FCKEditor.

I was in urgency so i found the alternative solution to make this problem fixed(solved) right away. What i have done is , find the relative path and replace it with full URL path. Look at below line which replace the absolute path inplace of relative path in image source tag.

$msg = str_replace('src="/userfiles/','src="http://www.example.com/userfiles/',$msg);

Thats it.

If you find any problem in this than let me know by comment.

To know more about programming,JavaScript issues,jQuery,Expression Engine,MYSQL database and Open-source, enter your email address below. We will send you free tutorials.

Enter your email address:
Feel free to ask any question. Just leave your comment below and we will answer your comment with in 24 hours.


  • @Sushant — You need put this statement  once you will get the content from FCKEditor(took content in $msg). Data from FCKEditor contains the relative path. Once you will write the above statement it will replace relative path with absolute path. So if you send the content in mail than image will appear in email.

  • Joe

    No matter where to put this code, who can give me a tip? – I´ve searched for files with $msg, there are multiple and so don´t know to integrate to what file…

  • Greate article. Keep writing such kind of info on your
    site. Im really impressed by it.
    Hey there, You have done a great job. I’ll definitely digg it and for my part recommend to my friends. I’m
    confident they’ll be benefited from this site.

  • Thanks in support of sharing such a fastidious thinking, post
    is nice, thats why i have read it completely

Leave a Reply

Your email address will not be published.