post/request value in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xxoulmate
    New Member
    • May 2007
    • 77

    post/request value in php

    how can i include & sign in posting.

    eg. <a href='home.php? a=hello&world'> hello</a>

    when i retrieve a
    its value is just hello.,

    how can i retrieve all value of a
    which is a = hello&world
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    & has a special meaning in URLs, it denotes the next parameter. you need to use the %-escape (%26)

    Comment

    • xxoulmate
      New Member
      • May 2007
      • 77

      #3
      what do you mean use the %-escape
      is it like this:
      <a href='home.php? a=hello%26&worl d'>hello</a>

      Comment

      • xxoulmate
        New Member
        • May 2007
        • 77

        #4
        tnx i got it.,
        <a href='home.php? a=hello%26world '>hello</a>

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          &amp; would also work, I believe.

          Mark.

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            Originally posted by Markus
            &amp; would also work, I believe.
            it won’t in XHTML (and possibly in HTML too), since you must escape the non-entity ampersands.

            Comment

            • Markus
              Recognized Expert Expert
              • Jun 2007
              • 6092

              #7
              Originally posted by Dormilich
              it won’t in XHTML (and possibly in HTML too), since you must escape the non-entity ampersands.
              Of course. Silly me :(

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                Originally posted by Markus
                Of course. Silly me :(
                I just happened to read RFC 1738 recently.

                Comment

                • xxoulmate
                  New Member
                  • May 2007
                  • 77

                  #9
                  how about the apostrophe (') how to escape it.

                  Comment

                  • TheServant
                    Recognized Expert Top Contributor
                    • Feb 2008
                    • 1168

                    #10
                    Don't see where it is in your reference but it's: %27
                    Have a look here for all the characters.

                    Just keep in mind, people don't remember characters. Using these characters in URLs is not good for users, unnecessary for URLs, and probably get spiders doing funny things. But that URL encoding reference sheet should give you all the characters you need!

                    Comment

                    Working...