Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help with php mail function

Posted on 2008-06-09
2
Medium Priority
?
150 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
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

824 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