Solved

Help with php mail function

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Insert values are dynamic 11 41
PHP Form Calculate Total Price 10 42
Cpanel file manager 8 23
What does != "" mean in programming 8 30
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
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.

773 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