Mordent 0 Report post Posted May 29, 2008 (edited) While my site's more PHP based than straight HTML, the problem I'm having is with trying to do the following: <a href="page.php?variable=foo "bar" foo">foo "bar" foo</a>Assuming I have a variable set to foo "bar" foo which I want as both the destination of the link to contain and the actual link itself to look like, how can I make it show as such? Currently, the first quote (just before the first bar) is closing the href element (I believe that's the right word, yes?), meaning the link instead points to 'page.php?variable=foo '. The link is displayed on screen correctly. I tried adding slashes to the variable (page.php?variable=foo \"bar\" foo), but that didn't work at all (it still closes before the bar and now I have slashes to look at in the link). Other than using single quotes instead of double ones, is there a way to escape the double quote character? This problem's most likely ridiculously trivial, I'm probably just having a mind blank (or brain fart, as some people I know call them ), so any help would be appreciated. - Mordent Edited May 29, 2008 by Mordent (see edit history) Share this post Link to post Share on other sites
faulty.lee 0 Report post Posted May 29, 2008 <a href="page.php?variable=foo "bar" foo">foo "bar" foo</a>Just change the outer double quote to single quote would do<a href='page.php?variable=foo "bar" foo'>foo "bar" foo</a> I've just tested on firefox3rc1. It should works on other browser as well Share this post Link to post Share on other sites
Mordent 0 Report post Posted May 29, 2008 Other than using single quotes instead of double ones... Anyway, after much tinkering I managed to solve my own problem. The answer was to use " instead of ". As the link was created dynamically, I did this using htmlspecialchars() (using PHP). It prints correctly, and the link points to the right place. Share this post Link to post Share on other sites