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... Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.