wldwmn64 Posted November 30, 2019 Share Posted November 30, 2019 The PHP code sends me an email from the server, but the user input is empty or "blank". I only receive: "From: \ Email: \ Subject: \ Message: " and that's it. How do I fix my PHP and/or HTML code to receive user input from the form? Attached is my existing HTML and PHP code that doesn't send me any "user input" from the form. Thanks to anyone who can help!! Quote Link to comment https://forums.phpfreaks.com/topic/309599-form-question-to-include-html-php-code-i-get-email-but-it-doesnt-have-user-input-from-website/ Share on other sites More sharing options...
gizmola Posted November 30, 2019 Share Posted November 30, 2019 In your form, your form element name= parameters need to match the $_POST[] variable names. They don't match. For example: <input type="text"... name="Name"> and $_POST['name']. The form element name should be name="name". Quote Link to comment https://forums.phpfreaks.com/topic/309599-form-question-to-include-html-php-code-i-get-email-but-it-doesnt-have-user-input-from-website/#findComment-1572007 Share on other sites More sharing options...
requinix Posted November 30, 2019 Share Posted November 30, 2019 Also, if you submit the form and see the form data in the URL, that means it isn't being sent to the server the right way... Quote Link to comment https://forums.phpfreaks.com/topic/309599-form-question-to-include-html-php-code-i-get-email-but-it-doesnt-have-user-input-from-website/#findComment-1572020 Share on other sites More sharing options...
gizmola Posted November 30, 2019 Share Posted November 30, 2019 4 hours ago, requinix said: Also, if you submit the form and see the form data in the URL, that means it isn't being sent to the server the right way... Yeah I missed that key point as well. Your form tag needs to specify method="post"! <form method="post" target=...etc > Quote Link to comment https://forums.phpfreaks.com/topic/309599-form-question-to-include-html-php-code-i-get-email-but-it-doesnt-have-user-input-from-website/#findComment-1572033 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.