Results 1 to 4 of 4

Thread: Posting a # (pound sign) in a URL as # not & # 35 ;

  1. #1
    Join Date
    Jan 2007

    Posting a # (pound sign) in a URL as # not & # 35 ;

    I'm building a web page (spreadsheet)
    [ a date ] [ Bill Smith ]
    [ a date ] [ Open ]
    [ a date ] [ Open ]

    which makes the page long. I have a floating select/option list for person select. In an effort to save the person doing the scheduling from having to scroll and scroll.... I've added ie "<a name=#W47.." to "Open" with the idea that I click on "Open" I get the URL of mypage/schedule.php?date=03May,#W23 I then parse out "03May", pull the persons name and update the database. My problem is the URL comes in as 03May,%23W23 and I get line one of the webpage. If I manually change the %23 to "#" and hit return - Ta-Da - it works, so I know it can be done. However I've tried backslash, quotes, # no mater what I try I can't get a "#" in the URL.


  2. #2
    Join Date
    Mar 2011
    I'm not sure exactly what you're doing, but the root of the issue is that browsers don't send the URL fragment (the '#W23' part at the end) to the server in the HTTP request. The browser retains it to display the page and, once loaded, uses it to scroll the page as desired, but that's all. One solution would be to include that information in your URLs twice: once as a part of the query string and once as the URL fragment. For example:


    An alternative would be to include some JavaScript on the page to examine the query string and scroll the page. You'd get prettier URLs like:


    But the only way to get the information to the PHP script is to include it as a query string parameter.
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Mar 2007
    You would send the HTML code for a sign, # is a hash sign and not a sign

    &#163; is the entity

    &pound; is the entity name

    You could send some numbers of the ASCII and have the server convert that ASCII in to the the character.
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  4. #4
    Join Date
    Jan 2007
    I ended up switching from <input type=button ... to <a href=... #W17>Open. Something with <form vs <a href where form encodes and href doesn't. Any how, the use said "I like it.". The floating select/option box never moves from it's 3 oclock position and as she assigns people to a date the page refreshes down to the last entry.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Recent Articles