php - Empty values inserted to database

Solution:
You forgot thename
attribute in your<input>
fields:
<input type="text" name="name" id="name" placeholder="Name">
<input type="text" name="email" id="email" placeholder="Email">
FYI, you could have easily caught this by usingvar_dump($_POST)
at the top of your file or using a tool like Firebug to see no values were being sent to the server. You also could have doneecho $query
and saw there were no values. This is all basic debugging skills.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: string literal contains an unescaped line break
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.