Forum Moderators: coopster
I want users to be able to upload an image (easy peasy) and then have the script spit out the <img...> tag so the user can just past it into the form and it will appear by magic! The problem is, I have my root directory defined in a variable on every page (i.e. $root_path = "./../../../"; for example) and I want the form to pick this up. At the moent, if I paste something like....
<img src=\"". $root_path . "features/news/images/dartvador.jpg\">
into the form, it just prints the $root_path variable as "$root_path". How can I get it to replce it? It works fine if I just define it as a seperate variable (i.e. not from the form).
Basically, what I'm trying to do is have an editor upload an image via a form and then get back the piece of html.php code which they just need to paste into a form and submit as part of the rest of their story. The difficult bit is that I want all image links to start at the root directory.