B
B
bulbazaur2013-07-18 17:32:20
PHP
bulbazaur, 2013-07-18 17:32:20

Where do quotation marks come from?

Good evening!

I am making a registration form. The user submits the data to the site, it is checked, and if something is wrong, the same form is shown to the user, but the fields that are filled in correctly remain filled, and do not disappear. Do:

<input type="text" value=<? echo $filledFields['name']; ?> name="name">

$filledFields['name'] contains the correct username. In theory, the browser should get something like this:

<input type="text" value=zavr id="inputName" name="name">
(zavr is not surrounded by quotes, because I simply did not add them). But, looking at the page code in Krom, I see:

<input type="text" value="zavr" id="inputName" name="name">
That is, the name is surrounded by quotes, the question is why? Is this a property of PHP, Chrome, or will all browsers do this?

I found out when I wrote <? echo ('\"'.$filledFields['name'].'\"'); ?>and saw the name in the form with extra quotes.

Thank you!

UPD: it seems that Crom himself adds them, because the response from the server does not contain any quotes, i.e. value=zavr.
UPD2: everything is clear, no need to put \ in front of " in php. thanks everyone

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Urvin, 2013-07-18
@bulbazaur

Are you sure you're looking at Ctrl+U and not F12?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question