Solved

Help with php mail function

Posted on 2008-06-09
2
146 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 500 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

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

752 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