Re: Let me google that for you.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 17, 2009 at 1:01 PM, 9el <lenin@xxxxxxxxxxxxx> 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.

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


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:

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


And you're done!

HTH,

-- 
// Todd

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux