View Full Version : variable

03-11-2007, 11:22 PM
I have a link and the variable to be passed sometimes contains to words with a space between them.If but the variable is one word it works perfectly but if the variable has more than one word only the first word is passed.

Here's the code.What can i do to pass the whole variable. I feel i should put the variable in quotes or single quotes but that didnt work for me!


$link = "updatecheck.php?whichdept=" . $var;

03-11-2007, 11:29 PM
But as long as the link has quotes around it when you output it, it should work.

03-11-2007, 11:40 PM
using the urlencode() method it is still only showing the first word of the variable??

03-12-2007, 12:20 AM
whats the code look like that prints out $link?
Is the first word the only part being output or is it the only one being passed when you click the link itself?
whats the code look like that defines var also?