Page 1 of 1

Easy thing, cant figure out..

Posted: Thu Jan 08, 2009 4:19 pm
by hello123
Hi!

I have this code posting to a variable:

Code: Select all

//postcriteria
$criteria=$_POST["criteria"];
So if "hello hello" is input in the text box, the $critiera variable will contain "hello hello". But how do I make it so that itt will be stored as "hello+hello" instead.. with the "+"-sign instead of space..

Any idea?

Thanks!!

Re: Easy thing, cant figure out..

Posted: Thu Jan 08, 2009 4:23 pm
by Syntac
urlencode() and urldecode().

Re: Easy thing, cant figure out..

Posted: Thu Jan 08, 2009 4:28 pm
by hello123
thank you! but where should I put that?

Re: Easy thing, cant figure out..

Posted: Thu Jan 08, 2009 4:53 pm
by Syntac

Code: Select all

$criteria = urlencode($_POST["criteria"]);

Re: Easy thing, cant figure out..

Posted: Thu Jan 08, 2009 4:55 pm
by hello123
thank you very much!