sandy1028 Posted December 17, 2007 Share Posted December 17, 2007 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> Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 17, 2007 Share Posted December 17, 2007 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 ) ; } ?> Quote Link to comment Share on other sites More sharing options...
sandy1028 Posted December 17, 2007 Author Share Posted December 17, 2007 Hi, The problem is as attached image. The senders name is always displayed as Apache [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.