Re: [PHP] Strings with Spaces in URLS
On Wednesday 22 August 2001 03:05, Chris Aitken wrote: I have come up with a bit of a problem I have a little funky search form on a page, and when I send the search data on as a URL, anything with a space is screwed up example $search = This is a test; echo a href=http://www.blah.com/foo.php?search=$search; and when the link is clicked (or even when the mouse is put over the link), the URL in the browser is - http://www.blah.com/foo.php?search=This leaving out all words after the first space. http://php.net/urlencode http://php.net/rawurlencode -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strings with Spaces in URLS
I have come up with a bit of a problem I have a little funky search form on a page, and when I send the search data on as a URL, anything with a space is screwed up example $search = This is a test; echo a href=http://www.blah.com/foo.php?search=$search; and when the link is clicked (or even when the mouse is put over the link), the URL in the browser is - http://www.blah.com/foo.php?search=This leaving out all words after the first space. If I simply throw the while thing using the following header statement header(Location: http://www.blah.com/foo.php?search=$search;); then it brings it up properly in the browser. Any suggestions ? Cheers Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ *** Big Brother *** It just shows that the dull will rule the world. And we will be watching it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strings with Spaces in URLS
$search = This is a test; echo a href=http://www.blah.com/foo.php?search=$search; You'll want this: echo a href=http://www.blah.com/foo.php?search=.urlencode($search).; ^^ Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strings with Spaces in URLS
$search= urlencode ($search); urlencode - have a look on the php site. -Original Message- From: Chris Aitken [mailto:[EMAIL PROTECTED]] Sent: August 22, 2001 9:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strings with Spaces in URLS I have come up with a bit of a problem I have a little funky search form on a page, and when I send the search data on as a URL, anything with a space is screwed up example $search = This is a test; echo a href=http://www.blah.com/foo.php?search=$search; and when the link is clicked (or even when the mouse is put over the link), the URL in the browser is - http://www.blah.com/foo.php?search=This leaving out all words after the first space. If I simply throw the while thing using the following header statement header(Location: http://www.blah.com/foo.php?search=$search;); then it brings it up properly in the browser. Any suggestions ? Cheers Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ *** Big Brother *** It just shows that the dull will rule the world. And we will be watching it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]