Author Topic: Contact Us page for your website  (Read 22 times)

October 17, 2019, 12:09:54 PM
Read 22 times


  • *****
  • Information Offline
  • Sr. Member
  • Administrator
  • Posts: 1214
  • Never stop questioning
    • View Profile
So this is a big thing nowadays because people are afraid of all the SPAM. I wouldn't personally call it the proper way to go about it but it is popular so here is an article that goes about making it.

I used a Linux format because of the hosting we use but there's also options for Window Server.

One is

HTML file: secure_email_form.php
Code: [Select]
<!DOCTYPE html>
<title>FeedBack Form With Email Functionality</title>
<link href="css/elements.css" rel="stylesheet">
<!-- Body Starts Here -->
<div class="container">
<!-- Feedback Form Starts Here -->
<div id="feedback">
<!-- Heading Of The Form -->
<div class="head">
<h3>FeedBack Form</h3>
<p>This is feedback form. Send us your feedback !</p>
<!-- Feedback Form -->
<form action="#" id="form" method="post" name="form">
<input name="vname" placeholder="Your Name" type="text" value="">
<input name="vemail" placeholder="Your Email" type="text" value="">
<input name="sub" placeholder="Subject" type="text" value="">
<label>Your Suggestion/Feedback</label>
<textarea name="msg" placeholder="Type your text here..."></textarea>
<input id="send" name="submit" type="submit" value="Send Feedback">
<h3><?php include "secure_email_code.php"?></h3>
<!-- Feedback Form Ends Here -->
<!-- Body Ends Here -->

PHP File: secure_email_code.php
Code: [Select]
// Checking For Blank Fields..
"Fill All Fields..";
// Check if the "Sender's Email" input field is filled out
// Sanitize E-mail Address
$email =filter_var($emailFILTER_SANITIZE_EMAIL);
// Validate E-mail Address
if (!
"Invalid Sender's Email";
$subject $_POST['sub'];
$message $_POST['msg'];
$headers 'From:'$email2 "rn"// Sender's Email
$headers .= 'Cc:'$email2 "rn"// Carbon copy to Sender
// Message lines should not exceed 70 characters (PHP rule), so wrap it
$message wordwrap($message70);
// Send Mail By PHP Mail Function
"Your mail has been sent successfuly ! Thank you for your feedback";

The rest are styling information.

This is a great way to have customers send you emails without knowing your actual email address. I wouldn't just copy and paste because you need to make it work on your site and also not just break copyrights is some are there.
"The true sign of intelligence is not knowledge but imagination." - Albert Einstein

There are no comments for this topic. Do you want to be the first?