Hello;
I'm trying to get the variable appended to the URL below to output into a text box on Page.php.
It should output "jones & bones". Instead, it chops off the term beginning with the ampersand. It outputs only "jones".
I can put the variable in a hidden field and convey it by a form post and it outputs in the text box just fine.PHP Code:http://www.mydomain.com/Page.php?Name=jones%20&%20bones
// ---- text input box on Page.php
// trying to output the above variable $Name into text box below.
<input type="text" name="Name" value="$Name">
// Here's what it outputs
<input type="text" name="Name" value="jones ">
// I'm trying to get it to output this:
<input type="text" name="Name" value="jones & bones">
//I've tried enclosing the $Name variable in htmlspecialchars() like so:
htmlspecialchars($Name)
//or
<input type="text" name="Name" value="htmlspecialchars($Name)">
// but it still chops off the "& bones" part of the variable.
I would appreciate if anyone could spot the problem.PHP Code:// this works ok.
<input type="hidden" name="Name" value="jones & bones">
// It outputs like I want it to on the next page.
<input type="text" name="Name" value="jones & bones">
Thanks.




Bookmarks