Languages :: PHP :: How to send '&' as a parmeter value? |
|||
| By: PHP newbee |
Date: 15/03/2003 00:00:00 |
Points: 125 | Status: Answered Quality : Excellent |
|
I need to send values like var1=w&c but I get an error when I try to do this using the get method... What can i do? |
|||
| By: VGR | Date: 15/03/2003 07:36:00 | Type : Answer |
|
| urlencode() the parameters line (full url if you want)before sending, urldecode after receiving or I guess & could be escaped && or \& (I don't know, never had this problem and I'm too lazy to check the PHP dox ;-) |
|||
| By: sumotimor | Date: 15/03/2003 07:37:00 | Type : Comment |
|
| Pass %26 instead of & |
|||
| By: TheFalklands | Date: 15/03/2003 08:10:00 | Type : Comment |
|
| VGR is right. You URLENCODE the values and in the next page you get the correct values w&c. |
|||
| By: VGR | Date: 15/03/2003 08:31:00 | Type : Comment |
|
| I mean, %26 is a good solution, but urlendode/decode is good practice and is more general : it solves a lot of problems |
|||
| By: sumotimor | Date: 15/03/2003 10:24:00 | Type : Comment |
|
| Agreed. |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








