0

Hi Once again!
I don`t Know. In a page I have a contact form in that The fields are ike name, email, subject, message.
All are mandatory.
I wont store in database. After clicking submit query , it should go to admin mail how to do?
tell me with example?

3
Contributors
3
Replies
27
Views
2 Years
Discussion Span
Last Post by Squiva
-1

Try this:

<?php
$from = $_POST["name"];
$mailer = $_POST["email"];
mail("someemail@something.com", "Contents", "Subject", $from);
?>

and this HTML to follow(Note: this is from a website I made, so keep in mind that is is quite raw):

<html>
<head>
  <title>Abby Phillips</title>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  <script>
    $(document).ready(function() {
      $("#ld1").css('background-color', 'blue');
      $("#ld2").css('background-color', 'blue');
      $("#ld3").css('background-color', 'blue');

      $("#ld1").hover(function() {
        $("#ld1").css('background-color', 'white');
      }, function(){
          $("#ld1").css('background-color', 'blue');
      });

      $("#ld2").hover(function() {
        $("#ld2").css('background-color', 'white');
      }, function(){
          $("#ld2").css('background-color', 'blue');
      });

      $("#ld3").hover(function() {
        $("#ld3").css('background-color', 'white');
      }, function(){
          $("#ld3").css('background-color', 'blue');
      });

    });
  </script>
</head>
<body background="bg.png" style="background-size:cover;">
<p>&nbsp;</p>
<center>
<table>
<tbody>
<tr>
<td id="mainTable">
<div id="ld1" class="linkDiv"><a id="mainMenu" href="index.html">Home</a></div>
</td>
<td id="mainTable">
<div id="ld2" class="linkDiv"><a id="mainMenu" href="cont.html">Info</a></div>
</td>
<td id="mainTable">
<div id="ld3" class="linkDiv2"><a id="mainMenu" href="sched.html"><span style="font-size: 300%;">Schedule</span></a></div>
</td>
</tr>
</tbody>
</table>
<div id="mainDiv"><center>
<div style="background: blue; width: 400; height: 500; border-radius: 20px; border: 5px solid white;">
<p style="padding-top: 20;">&nbsp;</p>
<div style="background-color: grey; width: 300; border-radius: 20px;"><form action="mailed.php" method="post"><label>Name: <em><img src="req.png" alt="" width="10" height="10" /></em></label><input name="name" required="" type="text" placeholder="John Doe" />
<p>&nbsp;</p>
<label><label>Email: <em><img src="req.png" alt="" width="10" height="10" /><input name="email" required="" type="text" placeholder="example@mail.com" /></em></label></label>
<p>&nbsp;</p>
<label><label><em>Comment: <textarea style="height: 80;" name="comment" placeholder="No comment"></textarea></em></label></label>
<p>&nbsp;</p>
<label><em><input type="submit" /> </em></label></form></div>
</div>
</center></div>
</center>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.