Classic error, you are not quoting the string value correctly in your html.
The best way to understand fully what is going on is to look at the source code of your form.
Correctly formatted html should look like this:
Code:
<input type=text name = "a_name" value = "I just don't care" />
You probably have
[code]
<input type=text name = "a_name" value = I just don't care />
[code]
In that example the name attribute actually does not need quoting because it contains no spaces, whereas the value attribute does, so needs to be correctly quoted - either single or double quotes will do.
So you just add some extra quotes, HOWEVER, dont end up with this: (single quotes containing a single quote)
Code:
<input type=text name = 'a_name' value = 'I just don't care' />
Something like this:
PHP Code:
echo '<td><input type=text name=third value="' . $record['third'] . '" /></td>';
Look into using something to correctly escape the values you are outputting to correctly escape double quotes too.
So you need to plan carefully which quotes you will be outputting where. Investigate other ways of doing it, my preference would be to use single quotes in PHP to join up the values, and output double quotes in HTML. I does not matter much which system you adopt but the thing is to stick with only one scheme.
Look at the string section of the manual for a fuller explanation as well as here for a discussion on sprintf, heredoc and templates.
Bookmarks