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("abc@xyz.in", $subject, $query, $emailfrom);
}
?>
</html>
         

 

 

Link to comment
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 = "abc@xyz.in";
$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.