On Fri, Apr 17, 2009 at 1:01 PM, 9el <le...@phpxperts.net> wrote:
> If you play with jQuery its easy.
> And if you talk about JavaScript's urlencode functionality you wont ask
> about 'how to remove the + sign'
> I'm not very good yet on jQuery or else I would have shown you the codes.

jQuery doesn't make this much easier than vanilla Javascript in this
case. I don't see why JS is necessary at all, in fact.

<form action="http://lmgtfy.com"; method="get">
  <input type="text" name="q" />
  <input type="submit" value="Search" />

No URLEncoding necessary, no JS, no PHP... just HTML. Were you to pass
pre-conceived search strings to it, it's as easy as this:

$s = 'search for this';
header('Location: http://lmgtfy.com?q=' . urlencode($s));

And you're done!


// Todd

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to