Nov 22, 2009

Creating Links With Quotes (")

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Designing > Web Design and HTML

Creating Links With Quotes (")

Mordent
While my site's more PHP based than straight HTML, the problem I'm having is with trying to do the following:

CODE
<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 tongue.gif ), so any help would be appreciated.

- Mordent

 

 

 


Comment/Reply (w/o sign-up)

faulty.lee
CODE
<a href="page.php?variable=foo "bar" foo">foo "bar" foo</a>

Just change the outer double quote to single quote would do

CODE
<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

Comment/Reply (w/o sign-up)

Mordent
QUOTE
Other than using single quotes instead of double ones...

wink.gif

Anyway, after much tinkering I managed to solve my own problem. The answer was to use &quot; 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. smile.gif

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Creating Links Quotes

  1. Find Out Dead Links In Your Site Automatically - Want to see a dead link on your site? (11)
    If you try to go to http://www.dead-links.com you will be asked for your domain or url. Enter it
    and the bot will find any dead links that you might not have seen. Have a nice day......
  2. Free Links Exchange: Promote & Increase Page Rank - (9)
    Hi guys,     For all the aspiring web-designer and webmasters out there - this deals with one of the
    most commonly overlooked fact about increasing your page rank. Most of us after putting up a new
    site, are satisfied with simple submitting our site to multiple search engines using some of the
    free submission engines. After that it's a long long wait till the crawlers come over to our
    page and starts indexing them. Even then it doesn't work out that well. And we always keep
    wondering WHY our sites don't show up on higher ranks on search engines.     One of t...
  3. To Display Images With Links In A Rotating Sequence Without Refreshing The Page! - how to rotate images with links in a sequence automatically without ha (0)
  4. Sounds With Links - how do you do it? (6)
    I was wondering to myself the other day, "some websites, when you hover over one of their links,
    make a sound like a bleep or something. Wouldn't that be good to have". So, I want to know if
    anyone knows how to do it! /biggrin.gif' border='0' style='vertical-align:middle'
    alt='biggrin.gif' /> ...
  5. Creating Expanding Menu Tree In A Web Page - sharing my knowledge (7)
    hey guys... im here to share some tricks i picked up along the way in creating or designing web
    pages... this trick is making an expanding tree menu like the one you can find in the Windows
    Explorer.. very cool eh! the trick is done by using javascript and some of its objects.. so here we
    go Lets say for example you want to create this tree menu Fruits Apple Small
    Medium Large Grapes With seeds Seedless Banana Green Yellow and
    you want to make this menu collapse or expand when click the first we do is encode this smal...
  6. Creating Forms? :s? Help! - (2)
    Hi seeing as i SUCK at web building i need help. ok what i'm trying to do is, if i press a link,
    a new small window will show up in which there is a form In the form you have to enter the
    following details FirstName: Last Name: Account Number: (starting with RVRP) Date Deposited (format
    MM/DD/YYYY) Date Completed (format MM/DD/YYYY) Email Address: Amazon: (choice between Amazon.com ,
    Amazon.ca , Amazon.co.uk) drop down menu would be good for this. and a submit button which will
    send the details to my email. once its done, a "warning" type window should show up sa...
  7. Applying Css Through Links. - Different CSS through different links? (10)
    I work on a website, and on this there are three different colour schemes. These are currently
    selected by clicking on the desired colour in a flash shockwave object on a page. This requires
    that there are three large directories on the server, blue, pink and orange. Each one contains a
    coloured copy of the website. The things in each directory are: HTML pages, a css giving it
    it's colour and flash buttons that were coloured the three different colours when they were
    made. As you can imagine, this is a nightmare to update, as it requires that each page is copied t...
  8. Interesting Ways Of Creating Web Pages - Do you have any good ones? (14)
    I'm curious as to how you guys put together web pages. Me, I just use an interesting
    combination. First I go into Microsoft Word and save the document as a blank HTML file, then I add
    the code in Notepad (that's why I'm able to complete my web sites so quickly). Do you have
    any interesting ways of doing things?...
  9. Creating Dhtml Menu - do you know how to create cool menu? (2)
    I've searching for a while, but never could find the best solutions for menu design. could
    anyone tell me where to find the best site that provide DHTML menu creation?....
  10. Creating Framework For A Website - How do I re-use page with different data (1)
    I'm working on the outline for a new website, the theme is in place, framework based on CSS.
    One of the problems I have is with recurring data. I have an index listing multiple objects. The
    objects are similar and the descriptions are similar. So for me to have that data in this format
    and diplay using as little resources as possible: Object one, description 1 Object 2, description
    2 Object 3, description 3 all have the same format. The object is a picture and description is
    -duh- description. Page layout are the same for each page it's just the data changi...
  11. When Creating An Sql Connection Using Sql Server Y - (0)
    Configure the server alias Create the SQL connection. Configure the Server alias Open SQL
    Server Client Network Utility. When Client Network Utility opens, click on the Alias tab. Click
    on the Add button. In the Server Alias text box enter a name for your SQL connection. Select
    TCP/IP under Network libraries Enter the IP address of the Server your SQL database is located on,
    in the Server name text box. Click on the OK button. Your Server alias will now be configured,
    click on the Apply button. Click on the OK button....
  12. Creating Cool Web Sites with HTML, XHTML and CSS - (0)
    Whether you're building a sophisticated commercial Web site or just creating an online spot to
    call home, good Web site development is about a lot more than just HTML nowadays, and Creating Cool
    Web Sites spends lots of time exploring the nuances of xhtml and Cascading Style Sheets in a way
    you're sure to understand. Incorporating the best of Creating Cool HTML 4.0 Web Pages and
    Dynamic HTML Weekend Crash Course, this book adds tons of critical new and updated information on
    xhtml, CSS, JavaScript, page validation, weblogs and weblog tools, optimal search engine ...



Looking for creating, links, quotes,

See Also,

*SIMILAR VIDEOS*
Searching Video's for creating, links, quotes,
advertisement



Creating Links With Quotes (")

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com