Where are the quotes?
Good evening!
Do the registration form. The user sends the data to the website, they are checked, and if something is wrong, the user is shown the same form, but the fields are filled in correctly, zapolnenie remain and not disappear. Do:
<input type="text" value="<?" echo $filledfields['name']; ?> name="name">
$filledFields['name'] contains the correct user name. The idea is that the browser should look something like this:
<input type="text" value="zavr" id="inputName" name="name">
(zavr not in quotes, because I simply not added). But, looking at the page code in chrome, I see:
<input type="text" value="zavr" id="inputName" name="name">
That is, a name surrounded by quotes, why? This property of PHP, Chrome, or browsers will do that?
Discovered when you wrote <? echo ('\"'.$filledFields['name'].'\"'); ?>
and saw a name in the form of unnecessary quotation marks.
Thank you!
UPD: looks like it adds itself Chrome because the response from the server contains no quotes i.e. value=zavr.
UPD2: everything is clear, no need to put \ before " in PHP. thank you all
1 answer
You just look at the Ctrl+U and not F12?
Find more questions by tags PHPValidation