Creative Electronics - Debt Consolidation - Web Advertising - Debt Consolidation - High Paying Adsense List

PDA

View Full Version : how to pass a + sign to php


darkmessiah
Dec 1st 2007, 8:43 am
I'm having a terible time doing this


var somevalue = "variable+variable";
var somevalue = 'val+val';
var somevalue = 'val\+val';


none of these work

php reads that as "variable variable" I need the + sign in there some how. If I escape the + sign with \, the browser complains that some other variable isn't declared. Javascript shows the +, but php is being a pain.

php is reading that with $_GET['somevar'];

please help, Thanks.

darkmessiah
Dec 1st 2007, 8:53 am
nevermind, in php i just needed to use urldecode on the javascript that had var val='val1%2Bval2';

darkmessiah
Dec 2nd 2007, 10:12 am
My other fix is to read the javascript string and convert the + to %2b, and pass that to php.