How can I connect HTML message send to server through PHP? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can I connect HTML message send to server through PHP?

I have created a message send form in index.html package and I need to connect it to back-end via PHP and I do not know how! Code in HTML Form is like below!!! <form action="message.php" method="post"> <input type="text" placeholder="name" class="box"> <input type="email" placeholder="email" class="box"> <input type="number" placeholder="number" class="box"> <textarea name="" placeholder="message" id="" cols="30" rows="10"></textarea> <input type="submit" class="btn" value="send message"> </form>

3rd Jan 2022, 10:24 PM
Ani Narzullo
Ani Narzullo - avatar
4 Answers
+ 1
with a local apache server, you will also need to create an account on some SMTP server to use it as a gateway and use those credentials in your script. there are a lot of solutions, check Github for php email.
4th Jan 2022, 8:34 AM
Bahhaⵣ
Bahhaⵣ - avatar
+ 1
your form action uses "message.php" so the code to retrieve all the variables and send their content should be in that file. in the same directory where index.html is, create message.php and put your code there. what server are you using?
4th Jan 2022, 12:09 AM
Bahhaⵣ
Bahhaⵣ - avatar
+ 1
Understand. Thanks a lot bro!
4th Jan 2022, 12:20 PM
Ani Narzullo
Ani Narzullo - avatar
0
Okay. Thanks for response. Yeah, honestly, I am using an Apache HTTP Server
4th Jan 2022, 2:24 AM
Ani Narzullo
Ani Narzullo - avatar