Hi all,
My first question here. Hopefully this is fairly simple.
I'm trying to pull a file name which is stored in the database, then create a link to that file. The problem I run into is when the file name has a space in it. I can not make the link to the file work.
I thought to use the urlencode function which has worked for me on php pages but it won't work in this case as the page is .html
Here is the code I have:
$uploadLink ="<a href=http://www.mysite.com/upload/".urlencode($upload)." target='_blank'>".$upload . "</a>";
What happens is when you click the link for something like "Moving Prices.pdf" the url becomes www.mysite.html/upload/Moving+Prices.pdf So I need the + to be an actual space for the link to work correctly.
Any help is very much appreciated.
Thanks,
Tom