php - Empty values inserted to databaseGet the solution ↓↓↓
You forgot the
name attribute in your
<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 using
var_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 done
echo $query and saw there were no values. This is all basic debugging skills.
Share solution ↓
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.
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.