www.webdeveloper.com
Results 1 to 4 of 4

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

  1. #1
    Join Date
    Jan 2007
    Posts
    3

    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.

    Thanks

  2. #2
    Join Date
    Mar 2011
    Posts
    1,133
    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:

    mypage/schedule.php?date=03May&foobar=W23#W23

    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:

    mypage/schedule.php?date=03May&foobar=W23

    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
    Location
    localhost
    Posts
    2,138
    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.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  4. #4
    Join Date
    Jan 2007
    Posts
    3
    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.

    Thanks

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