Results 1 to 6 of 6
  1. #1
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    How to do <a> tag type bookmarks in php?
    1) In html, you can use a bookmarl anchor tag like this on a page:
    <a name="special">

    2) Then you can point to it from another page / elsewhere like:
    http://www.do.com/stuff.html#special

    3) And get the visitor / display to jump down the page to the section where you placed the html bookmark (#1 above) into the page.

    How do you do that in php (for example, when the page renders as stuff.php (not as html))?

    I tried the html way and the "#special" part seems to just be ignored - perhaps php only looks for value pairs appended in the query string? Or perhaps I'm just not appending the bookmark tag's info correctly to the php url?

    Anyone know?

  2. #2
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    Shoot, meant to put this in the "CGI or PHP" subforum... Moderator, fix me?

  3. #3
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    Mod?

  4. #4
    Member SeanW's Avatar
    Join Date
    July 28th, 2005
    Posts
    69
    Quote Originally Posted by Donuts
    1) In html, you can use a bookmarl anchor tag like this on a page:
    <a name="special">

    2) Then you can point to it from another page / elsewhere like:
    http://www.do.com/stuff.html#special

    3) And get the visitor / display to jump down the page to the section where you placed the html bookmark (#1 above) into the page.

    How do you do that in php (for example, when the page renders as stuff.php (not as html))?

    I tried the html way and the "#special" part seems to just be ignored - perhaps php only looks for value pairs appended in the query string? Or perhaps I'm just not appending the bookmark tag's info correctly to the php url?

    Anyone know?
    None of the # handling is server side, it's all client side... What you've described should work... Are the tags getting mangled somehow?

    Sean

  5. #5
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    I don't know what I was doing wrong earlier, but it's working now, as I wanted it too.

    Thanks for the post - made me go back and try again to fiddle with it once you told me it should work.

    Am using it like this and it's working:
    www.do.com/stuff.php?sku=1234#special

    So I guess the #special tail doesn't interfere with the param string and it's detected as usual to jump visitors down the page. Who knew? (you did!)

  6. #6
    Member SeanW's Avatar
    Join Date
    July 28th, 2005
    Posts
    69
    Quote Originally Posted by Donuts
    So I guess the #special tail doesn't interfere with the param string and it's detected as usual to jump visitors down the page. Who knew? (you did!)
    Check your server logs, the # and stuff after aren't even sent to the server (at least in Firefox)

    Sean

  7. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. capturing referring page and querystring info from a php tracking type script
    By buyjewelry in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: March 31st, 2008, 05:22 PM
  2. How to do <a> tag type bookmarks in php?
    By Donuts in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: December 13th, 2005, 01:04 PM
  3. Jump.php type code... help!
    By TJ in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: July 23rd, 2003, 04:45 PM
  4. Smart Tag Meta Tag Not Working?
    By gettnthar in forum Suspicious Activity!
    Replies: 5
    Last Post: January 29th, 2002, 06:41 PM

Posting Permissions

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