itachi77 Posted August 1, 2010 Share Posted August 1, 2010 Hi, having a really strange problem, i have a form like this: <form method='post' action='addcart.php'> echo $name //prints both parts of name separated by space <input type='hidden' value='$name' name='na' and then in the addcart.php echo $_POST['na'] //only prints first half of name So for example, if $name was "Product One" when i print the value in first script it prints Product One fine but when i print in the other script it only prints "Product". This then leads onto only half the name being copied into a database. I'm sure this was working fine before, not sure what the problem here is... Link to comment https://forums.phpfreaks.com/topic/209512-php-two-words-problem/ Share on other sites More sharing options...
monkeytooth Posted August 1, 2010 Share Posted August 1, 2010 I'm gonna have to say its not that simple, theres some code somewhere your not showing us that could make all the difference to help us answer your question Link to comment https://forums.phpfreaks.com/topic/209512-php-two-words-problem/#findComment-1093865 Share on other sites More sharing options...
dezkit Posted August 1, 2010 Share Posted August 1, 2010 when viewing the first scripts page, check the source code to see if it shows full product name in the hidden value, if it shows full give us more relevant code Link to comment https://forums.phpfreaks.com/topic/209512-php-two-words-problem/#findComment-1093866 Share on other sites More sharing options...
itachi77 Posted August 1, 2010 Author Share Posted August 1, 2010 ah sorry guys, the code i had was like this : echo "<input type='hidden' value=".$name."name='na'/>" The reason why it wasn't working was because i forgot the ' ' around the $name so like echo "<input type='hidden' value='".$name."'name='na'/>" really silly of me, thanks for the effort. Link to comment https://forums.phpfreaks.com/topic/209512-php-two-words-problem/#findComment-1093867 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.