1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Why would it do that?

Discussion in 'PHP' started by nfzgrld, Jan 20, 2005.

  1. #1
    When the following is output from a var :

    '<a class="category-top" "href=/index.php?main_page=index&' . $box_categories_array[$i]['path'] . '">';
    Code (markup):
    It returns the this:

    href=/index.php?main_page=index&cPath=5"
    Code (markup):
    Note that the ending quote is there, but the beginning quote at "href" is not. The result is when you mouse over the link the ending quote is treated like part of the path in the status bar. Also, I'm sure search engines prefer it if your links are properly delimited. I know mine does. Anyone have any idea why this would happen? I do this kind of thing all the time and I've never seen this happen before. I don't know if I'm screwing up somewhere, or if it's just some strange thing in PHP.
     
    nfzgrld, Jan 20, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Put your opening quote after href=, instead of before.
     
    digitalpoint, Jan 20, 2005 IP
  3. nfzgrld

    nfzgrld Peon

    Messages:
    524
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Here's another question: Why does it seem so easy to solve the really hard problems, and something so obviously simply as this I can stare at for an hour and never see it! :eek:
     
    nfzgrld, Jan 20, 2005 IP
  4. justicewhite

    justicewhite Well-Known Member

    Messages:
    240
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    138
    #4
    Not enough sleep,
    Too much SEO,
    Bush winning the US elections ;)
     
    justicewhite, Jan 21, 2005 IP
  5. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Blame Canada!
     
    T0PS3O, Jan 21, 2005 IP
  6. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Also, use &amp; in URLs:

    href="/index.php?main_page=index&amp;cPath=5"

    J.D.
     
    J.D., Jan 22, 2005 IP
  7. nfzgrld

    nfzgrld Peon

    Messages:
    524
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I always do use &amp; and other htmlentities type stuff. I was in the middle of rewriting the links for this app and just hadn't gotten around to that yet. Anyway, Bush winning the election isn't a problem for me. I actually like freedom and I understand it, so no problem there. Not enough sleep? Blame that one on my wife. If too much SEO were the problem I'd have higher PR! No, I think the problem was definitly brain freeze, or something like that. No matter how I looked at that thing I just couldn't see that one simple little problem. Geez, what a pain!
     
    nfzgrld, Jan 29, 2005 IP