Connecting Tech Pros Worldwide Help | Site Map

post/request value in php

xxoulmate's Avatar
Member
 
Join Date: May 2007
Posts: 61
#1: 4 Weeks Ago
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
best answer - posted by Dormilich
& has a special meaning in URLs, it denotes the next parameter. you need to use the %-escape (%26)
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: 4 Weeks Ago

re: post/request value in php


& has a special meaning in URLs, it denotes the next parameter. you need to use the %-escape (%26)
xxoulmate's Avatar
Member
 
Join Date: May 2007
Posts: 61
#3: 4 Weeks Ago

re: post/request value in php


what do you mean use the %-escape
is it like this:
<a href='home.php?a=hello%26&world'>hello</a>
xxoulmate's Avatar
Member
 
Join Date: May 2007
Posts: 61
#4: 4 Weeks Ago

re: post/request value in php


tnx i got it.,
<a href='home.php?a=hello%26world'>hello</a>
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#5: 4 Weeks Ago

re: post/request value in php


&amp; would also work, I believe.

Mark.
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#6: 4 Weeks Ago

re: post/request value in php


Quote:

Originally Posted by Markus View Post

&amp; would also work, I believe.

it won’t in XHTML (and possibly in HTML too), since you must escape the non-entity ampersands.
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#7: 4 Weeks Ago

re: post/request value in php


Quote:

Originally Posted by Dormilich View Post

it won’t in XHTML (and possibly in HTML too), since you must escape the non-entity ampersands.

Of course. Silly me :(
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#8: 4 Weeks Ago

re: post/request value in php


Quote:

Originally Posted by Markus View Post

Of course. Silly me :(

I just happened to read RFC 1738 recently.
xxoulmate's Avatar
Member
 
Join Date: May 2007
Posts: 61
#9: 4 Weeks Ago

re: post/request value in php


how about the apostrophe (') how to escape it.
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 913
#10: 4 Weeks Ago

re: post/request value in php


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!
Reply