SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What function to escape hash # character

    Hey guys I feel like a bit of a noob here but I can't figure this one out.

    What solution do ppl out there use to escape the hash # character. Users of one of my cms's keeps entering that character in one of my form input fields.

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    erf um...whats it being used in? As far as i know # has no special meaning in PHP.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Zealot
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm using this piece of code to create a directory for an image gallery

    PHP Code:
    $dir=  $_SERVER['DOCUMENT_ROOT'].'/images/'.$_REQUEST['title']; 
    $_REQUEST['title'] is the form inputted data.

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Oh a url scheme # indicates a fragment.

    use urlencode on $_REQUEST['title']
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    SitePoint Zealot
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you logic_earth


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
  •