Solved

Help with php mail function

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now