Strings with words

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am passing  a  string with words delimited by spaces as a parameter
through  the query string using the following code in PHP.

"<a href=testpage.php?Department="."$Department"."</a>";

When I try to retrieve the value of the parameter using $_GET
['Department'], only the first word is returned and the rest of the
string is truncated. E.g. if $Department = "Information Technology",
$_GET['Department'] returns only "Information" and not the whole
string. Is it possible to retrieve all the words in a string using
$_GET, even though the string may have words delimited with spaces?

Re: Strings with words

anu schrieb:
Quoted text here. Click to load it

Why you enclose a variable ($Department) with doublequotes? Its absolute

If you pass string into a url you have to use url_encode() for mask
special meaning url chars. But thats not a php-problem. Its a
html-problem. So you have to teach you first some HTML skills before you
use it.

regards, Ulf

Re: Strings with words

Quoted text here. Click to load it

Try changing the spaces to + or _ or %20 so for Information Technology
you would get Information+Technology

Kev Wells / /
ICQ 238580561 Best sellers and new releases.

Re: Strings with words

Quoted text here. Click to load it

URL strings don't allow spaces. Yes IE may be nice and enter a %20 to
replace the space for you but you don't know what ancient browser your
users may be using or how they will handle these spaces. Why not have
send department=3Dtypea then on your result page have typea =
"Information Technology";


Site Timeline