I am creating a web app that accepts input of news items (title, article, url). It has a page news.php which creates a summary of all news items inputted for specified dates, like so:
News
4/25/2010
Title 1
[URL 1]
Article 1
Title 2
[URL 2]
Article 2
and so on...
I have two other pages, namely preview.php and send.php , both of which call news.php through a file_get_contents() call.
Everything works fine except when the URL contains spaces. During Preview, the urls get opened (FF: spaces are spaces, Chrome: spaces are %20). However, during Send, when received as emails, the urls don't get opened, because the spaces are converted into + signs.
For example:
1. Preview in FF: http://www.example.com/this is the link.html
2. Preview in Chrome: http://www.example.com/this%20is%20the%20link.html
3. Viewed as email in both browsers: http://www.example.com/this+is+the+link.html
Only #3 doesn't work (link doesn't get opened).
Why are the spaces in the urls correct (spaces or %20) when previewed, but incorrect (+) when received in the emails, when in fact, the same page is generated by the same news.php?
Any help appreciated :)