Hidden variables question

jonmullen

Platinum Member
Jun 17, 2002
2,517
0
0
When I try to use a hidden text field to hold a string variable (i.e. "Some thing that contains several words") it will only hold up to the first space. For example If the text in the hidden text field was "How are you doing?" then it will only come out as "How". How can I get it to keep the whole sentence?
 

yoda291

Diamond Member
Aug 11, 2001
5,079
0
0
I'm fairly certain this is not the appropriate forum, but just in case (since html really isn't a programming language)

<input type=hidden name=boo value="whatever you want"> <- correct
<input type=hidden name=bob value=this is no good> <-wrong

Don't forget the quotes.
 

jonmullen

Platinum Member
Jun 17, 2002
2,517
0
0
Originally posted by: yoda291
I'm fairly certain this is not the appropriate forum, but just in case (since html really isn't a programming language)

<input type=hidden name=boo value="whatever you want"> <- correct
<input type=hidden name=bob value=this is no good> <-wrong

Don't forget the quotes.

I have the quotes, I am actually passing a php variable.

the forum is like this.
<?php
echo '<form action="bot.php" method="post">
<input type=hidden name=boo value=';
echo "$variable" ;
echo '>'
?>

Ugly, I know, but that is why I am looking for a better way to do it.
 

jonmullen

Platinum Member
Jun 17, 2002
2,517
0
0
Oh wait, nevermind you were right, I just got lost in my quotes i did not see that I forgot to add those. OK

<?php
echo '<form action="bot.php" method="post">
<input type=hidden name=boo value=';
echo "\"$variable\"";
echo '>'
?>


That should work