Easy thing, cant figure out..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hello123
Forum Newbie
Posts: 3
Joined: Thu Jan 08, 2009 4:14 pm

Easy thing, cant figure out..

Post 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!!
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Easy thing, cant figure out..

Post by Syntac »

urlencode() and urldecode().
hello123
Forum Newbie
Posts: 3
Joined: Thu Jan 08, 2009 4:14 pm

Re: Easy thing, cant figure out..

Post by hello123 »

thank you! but where should I put that?
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Easy thing, cant figure out..

Post by Syntac »

Code: Select all

$criteria = urlencode($_POST["criteria"]);
hello123
Forum Newbie
Posts: 3
Joined: Thu Jan 08, 2009 4:14 pm

Re: Easy thing, cant figure out..

Post by hello123 »

thank you very much!
Post Reply