I retrieve three pieces of information from the database. 1 integer, 1 string, 1 date. I echo them out to verify the variables contain the data.
When I then use the variables to populate three input boxes on the page, they do not populate correctly.
The following do not work:
id: <input type="text" name="idtest" value=$idtest>
yes, the variable must be inside for it to be visible
so
id: <input type="text" name="idtest" value=<?php $idtest ?> />
the field displays /
When I escape the quotes
id: <input type="text" name="idtest" value=\"<?php $idtest ?>\" />
the field then displays \"\"
With single quotes
id: <input type="text" name="idtest" value='<?php $idtest ?>' />
The field displays nothing or blank
With single quotes escaped
id: <input type="text" name="idtest" value=\'<?php $name ?>\' />
The field displays \'\'
with a forward slash (I know that's not correct, but to eliminate it from discussion)
id: <input type="text" name="idtest" value=/"<?php $name ?>/" />
The field displays /"/"
double quotes, escape double quotes, escape double quotes on left side only, etc do not work.
I can set a input box to a string. I have not tried using a session variable as I prefer to avoid do that.
What am I missing here?