• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
Old Gamess

Old Gamess

Free Games and Software Download

  • Home
  • Software
    • Antivirus
    • MS Office
    • ISO Tool
  • Windows OS
  • Mac OS
  • PC Games
  • Emulators
    • PlayStation 1 Emulator
    • PlayStation 2 Emulator
    • PlayStation 3 Emulator
    • Nintendo 64 Emulator
    • GameCube Emulator
  • Android
  • Code
  • Blog

PHP Contact Form Code

January 18, 2023 by Admin Leave a Comment

Basic code for PHP contact form

<form action="send_form_email.php" method="post">
  <label for="name">Name:</label>
  <input type="text" id="name" name="name"><br>

  <label for="email">Email:</label>
  <input type="email" id="email" name="email"><br>

  <label for="message">Message:</label>
  <textarea id="message" name="message"></textarea><br>

  <input type="submit" value="Submit">
</form>

You would also need to create a separate PHP file, “send_form_email.php”, to handle the form submission and send the email:

<?php
  $name = $_POST['name'];
  $email = $_POST['email'];
  $message = $_POST['message'];
  $to = "your@email.com";
  $subject = "Contact Form Submission";
  $headers = "From: $email";
  mail($to, $subject, $message, $headers);
?>

Share this:

  • Twitter
  • Facebook

Related

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe my YouTube Channel

Popular Posts

  • GTA Vice City Download For PC
  • GTA San Andreas Download For PC
  • Windows XP ISO Download
  • Top 10 Anime Websites to Watch Free Anime Online

Follow Us

  • Facebook
  • YouTube

Footer

HOME  |   ABOUT  |  DMCA  |  DISCLAIMER  |  PRIVACY  |  CONTACT
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright © 2023 ยท [oldgamess.com]