SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    622
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    bookmarks with <a> tag in php not working

    hi all

    i have this below url in the form action=""

    PHP Code:
    manage.php?dealer=9&category=1&subcatg=6#av606 
    then in the page i have

    Code:
    <a name='av606' /></a>
    on submitting the form the page should move to this place where a tag is placed

    but it doesnt.

    vineet

  2. #2
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Uhm, no it shouldn't... you have a valid URL, it's going to go to that URL and not on the current page. good lord, WHY would you want it to do that?!?

    When the submit fires it will reload the URL, even if it's the current one. What you are asking for doesn't even make sense (and really has nothing to do with PHP either, this is a HTML question).

  3. #3
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Code:
    <a name='av606' /></a>
    This looks invalid to me. Shouldn't it be
    Code:
    <a name='av606' />
    or
    Code:
    <a name='av606'></a>
    depending on what version of (X)HTML you're using?

  4. #4
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    This looks invalid to me.
    Yer right on that, good catch -- it should be the LAST of those you listed, but this:

    Quote Originally Posted by guido2004 View Post
    Shouldn't it be
    Code:
    <a name='av606' />
    That is NOT valid -- EVER, even in XHTML -- because A is not a "empty element" -- only empty elements can use the /> closing.

    ... and just because the anchor has no content doesn't mean it's an 'empty element' -- empty elements by the meaning in the specification are those that CANNOT have content, as opposed to those that simply don't have content... meaning the valid "empty elements" which are eligble for the "short form" closing are:

    BR, HR, META, LINK, BASE, IMG, EMBED, PARAM, AREA, COL, BASEFONT, ISINDEX and INPUT.

    NO other tags can use the <tag /> form and be valid code... which is why you still have to do <script></script> as <script /> is ALWAYS invalid.

    Though I stopped using anchors and the name attribute for hash links LONG ago -- that's ID's job now!

  5. #5
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by deathshadow60 View Post
    That is NOT valid -- EVER, even in XHTML -- because A is not a "empty element" -- only empty elements can use the /> closing.

    ... and just because the anchor has no content doesn't mean it's an 'empty element'
    You're right. Should have thought a bit more before answering

  6. #6
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,259
    Mentioned
    245 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by guido2004 View Post
    You're right. Should have thought a bit more before answering
    Off Topic:

    Ah... but you can think?

    *yes, people, yes... I like to live a dangerous life... one of these days I'll be killed for my bad jokes and because I'm filling the forum with fluff.... muahahahaa*


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •