Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help with php mail function

Posted on 2008-06-09
2
Medium Priority
?
148 Views
Last Modified: 2008-06-11
I have the script below that is two pages
contact.php
 <style type="text/css">
<!--
.titleA {font-size: 14px; font-weight:bold; color:#000066;}
.titleB {font-size: 11px; font-weight:bold; color:#000066;}
.styletitle {font-size: 11px; text-align: left; font-weight:bold; color:#000066;}
-->
</style>
   <form method="post" action="recieved">
<table width="200" border="0" cellspacing="2" cellpadding="0">
   <tr>
    <th scope="row" span class="styletitle">Name:</th>
    <td><input type="text" size="27" name="name" value="<?php print $_GET['name']; ?>"/></td>
  </tr>
  <tr>
    <th scope="row" span class="styletitle">E-Mail Address:</th>
    <td><input type="text" size="27" name="email" value="<?php print $_GET['email'];?>"  /></td>
  </tr>
  <tr>
    <th scope="row" span class="styletitle">Message:</th>
    <td><textarea name="message" cols=21 rows=7 value="<?php print $_GET['message'];?>" /></textarea></td>
  </tr>
  <tr>
    <th scope="row" span class="styletitle">&nbsp;</th>
    <td style="float:right"><input type="submit" value="send" /></td>
  </tr>
</table>
   </form>
   
------- recieved.php  
<?php
echo"<p>Thank you, <b>".$_POST["name"]."</b>, for your message!</p>";
echo"<p>Your e-mail address is: <b>".$_POST["email"]."</b>.</p>";
echo"<p>Your message was:<br/>";
echo $_POST["message"]."</p>";
//start building the mail string
$msg = "Name:  ".$_POST["name"]."\n";
$msg = "E-mail: ".$_POST["email"]."\n";
//set up mail
$recipient = "customerservice@bayparkcapital.com";
$subject = "Form Submission Results";
$mailheaders = "From: BayParkCapital.com";
$mailheaders .= "Reply-To: " .$_POST["email"];
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>

I am using php include with contact.php on the index page

bayparkcapital.com

When an email is submitted I would like the index page to refresh, and the message from recieved to appear above the Contact input fields.(the "box/table" will automatically stretch to fit additional contect)

The scripts work seperatly if they are not included - check bayparkcapital.com/contact.php

Thanks for the help
0
Comment
Question by:derekstattin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 2000 total points
ID: 21746390
try replacing the $_GET with $_REQUEST for contact.php so both $_GET and $_POST are used regardingless of the submission type of the form
0
 

Author Comment

by:derekstattin
ID: 21764213
I still have not had any luck. When I type in info and hit send I am directed to

bayparkcapital.com/reveived

I have no idea why, is this some default?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question