Jump to content

Contact page


sandy1028

Recommended Posts

Hi,

 

I am facing problem in contact page when I send the mail in from this page, when i receive the mail inbox I get the sender's name as Apache.

The from email id is received in the body.

 

What is the problem in it

 

<html>
<head></head>
<body leftMargin=0 topMargin=0>
<img src = "./images/banner.jpg" border="0">
<div style ="position:absolute; left:30;width:730; top:70; background-color: #FfFfFF"><font size = 3  color="#003366" face = "Times new roman">
<p align = "center"><font size=4 color=#A41325><b>CONTACT US</b></font></p><br>

<?php
echo '<div style ="position:absolute; left:30; width:730; top:350; background-color: #FfFfFF"><font size = 3 >

<p><b>Any Queries Please submit here</b></p>
<form name="contactform" method="get" action="contact.php" onsubmit="return validate()">

<table width="75%" border="0">
  <tr>
    <td>Name: </td>
    <td>
      <input type="text" name="name">
    </td>
  </tr>
  <tr>
    <td>Address:</td>
      <td><textarea name="address"></textarea>
    </td>
  </tr>
  <tr>
    <td>Email ID:</td>
    <td>
      <input type="text" name="email">
    </td>
  </tr>
  <tr>
    <td>Subject:</td>
    <td>
      <input type="text" name="subject">
    </td>
  </tr>
  <tr>
    <td>Queries :</td>
    <td>
      <textarea name="query" ></textarea>
    </td>
  </tr>
</table>
<p>
  <input type="submit" name="submit" value="Submit Query">
  <input type="reset" name="reset" value="Reset">
</p>
</form>';
?>
</body>
<?
if(isset($_GET["submit"]))
   {    // fresh page opening
        $name = $_GET["name"];
  $address = $_GET["address"];
  $query = $_GET["query"];
  $emailfrom=$_GET["email"];
  $subject = $_GET["subject"];

mail("[email protected]", $subject, $query, $emailfrom);
}
?>
</html>
         

 

 

Link to comment
https://forums.phpfreaks.com/topic/81989-contact-page/
Share on other sites

try this:

 

<?php

if(isset($_GET["submit"]))
   {    // fresh page opening

// Receiving variables
$name = addslashes($_GET['name']);
$address = addslashes($_GET['address']);
$email = addslashes($_GET['email']);
$subject = addslashes($_GET['subject']);
$query = addslashes($_GET['query']);

//Sending Email to form owner
$pfw_header = "From: $email\n";
$pfw_subject = "$subject";
$pfw_email_to = "[email protected]";
$pfw_message = "$name\n"
. "$address\n"
. "$email\n"
. " $subject\n"
. "$query\n";

mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

}

?>

Link to comment
https://forums.phpfreaks.com/topic/81989-contact-page/#findComment-416642
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.