Passing String value cross pages using $_GET[]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dv_evan
Forum Commoner
Posts: 42
Joined: Wed Apr 09, 2008 8:23 am

Passing String value cross pages using $_GET[]

Post by dv_evan »

Hello All,

I am having a problem passing a string value in a variable to another page. Only the first word in the string is being output in the other page. Here is the code snippet.

$output=mysql_result($result,$i,"Name_of_Co");
echo " $output ";
echo "<a href=Edit.php?Name_of_Co=$output> Click here to edit</a>";


As you can see I am trying to passing the name of companies in the $output variable. The problem is if the company name is a single word the word will be pass and output on the Edit page. But is there is space between the names of two of more words only the first word of the name will be pass and display.
I would like to pass the full companies name if its one word or more.

Can you kindly help me, I am at a lost here.

Thanks
Dave
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Passing String value cross pages using $_GET[]

Post by onion2k »

Use urlencode() on it.
dv_evan
Forum Commoner
Posts: 42
Joined: Wed Apr 09, 2008 8:23 am

Re: Passing String value cross pages using $_GET[]

Post by dv_evan »

Onion_2K,

Thanks you very much it works.
Dave
Post Reply