WordPress.org

Ready to get started?Download WordPress

Forums

Bug? Link won't show $100? (5 posts)

  1. AlisonMooreSmith
    Member
    Posted 4 years ago #

    I think I found a bug today on this page:

    http://pix2brix.com/faq/

    That first FAQ item--that is all linked text--actually says, "Can I really get 10 years of linked advertising for only $100 – or less?" But you'll notice the view only says, "...for only o or less..."

    I tested this a bit and found:

    When I put "100" in the link, it works.
    When I put "$" in the link, it works.
    When I put "$1" in the link, nothing shows up.
    When I put "$10" in the link, nothing shows up.
    When I put "@100" in the link, "o" shows up.

    Can't figure out what is going on. Anyone?

  2. stvwlf
    Member
    Posted 4 years ago #

    Try using this & # 3 6 ; instead of the dollar sign

    remove the spaces between the characters - they were necessary to keep the forum software from displaying a $ instead of the character code

  3. AlisonMooreSmith
    Member
    Posted 4 years ago #

    Thanks, stvwlf. That will fix it. I'm just wondering why this happened. I don't think I've seen this in all my years of coding. Anyone know what's going on? Is this a WP issue?

  4. whooami
    Member
    Posted 4 years ago #

    its just character encoding.

    http://us3.php.net/manual/en/function.htmlentities.php and whatnot.

    its done because its the safe way to craft links. its not new, at all.

    fwiw, in PHP, the dollar sign is special. it denotes a variable. (consider what I said above regarding the safe way to craft links.)

  5. stvwlf
    Member
    Posted 4 years ago #

    Actually, Alison, continuing on with what whoami said, in PHP when you enclose strings in double quotes, anything within that string that starts with a dollar sign is seen as a variable - PHP replaces the variable with the variable's value. If the variable doesn't exist it is replaced with an empty string. When strings are enclosed in single quotes, they are seen as literals and not interpreted. '$100' would be seen as $100.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags