I retrieve three pieces of information from the database, one integer, one line and one date.
I repeat them to check if the variables contain data.
When I use variables to populate the three input fields on the page, they do not fill out correctly.
The following steps do not work:
id: <input type="text" name="idtest" value=$idtest>
Yes, the variable must be inside <? php var? > so that it is visible.
So:
id: <input type="text" name="idtest" value=<?php $idtest ?> />
The field displays / .
When I get out of quotes,
id: <input type="text" name="idtest" value=\"<?php $idtest ?>\" />
the field displays \"\" .
With single quotes
id: <input type="text" name="idtest" value='<?php $idtest ?>' />
the field does not display anything or is empty.
If single quotes are escaped,
id: <input type="text" name="idtest" value=\'<?php $name ?>\' />
\'\' displayed in the field.
With a slash (I know itβs not right, but to exclude it from the discussion)
id: <input type="text" name="idtest" value=/"<?php $name ?>/" />
the field displays /"/" .
Double quotes, avoid double quotes, avoid double quotes only on the left side, etc. does not work.
I can set an input field for a string. I have not tried using a session variable as I prefer to avoid this.
What am I missing here?