Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Needs Help With Emailing Results Using PHP
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Needs Help With Emailing Results Using PHP

 Post Reply Post Reply
Author
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Topic: Needs Help With Emailing Results Using PHP
    Posted: 09 October 2008 at 9:03pm

I love to use ASP. But I cannot use ASP on one of my clients' web hosting plans because it doesn't support ASP so I have to use PHP. I don't know that much PHP. :( I am sure that there are some people on this forum that know PHP.

Please look at http://www.stellohomeservices.com/contact.htm. This form is supposed to post to a PHP file. I got a simple PHP file, but it doesn't submit all of the results.

Here's the simple PHP File I have so far:

<?php
$to = "misty@you.com";
$subject = "Test Email From PHP Contact Me Form";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>

I would like for all of the fields such as the check boxes to be included in the results. I would like for there to be a <br> tag between each field. I also would like for the email that is sent to show the person's name and the email address as from on the email.

Back to Top
iSec View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 February 2005
Status: Offline
Points: 1140
Post Options Post Options   Thanks (0) Thanks(0)   Quote iSec Quote  Post ReplyReply Direct Link To This Post Posted: 12 October 2008 at 1:57am
Like this?
 
<?php
$to = misty@you.com;
$subject = "The Test Email From PHP Contact Me Form";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your email message below was sent successfully"; }
else
{print "Sorry, We encountered an error sending your mail below. Please hit the back button on your browser and try again!"; }?>
<br />
<p>
<b>Name</b>: <?php echo $_POST["txtName"]; ?>.<br />
<b>Address</b>: <?php echo $_POST["txtAddress"]; ?>
<b>City</b>: <?php echo $_POST["txtCity"]; ?>.<br />
<b>State</b>: <?php echo $_POST["SelState"]; ?>.<br />
<b>Zip</b>: <?php echo $_POST["txtZip"]; ?>.<br />
<b>Phone</b>: <?php echo $_POST["txtPhone"]; ?>.<br />
<b>Email Address</b>: <?php echo $_POST["txtEmail"]; ?>.<br />
<b>Type of Project</b>: <?php echo $_POST["chkbox[]"]; ?>.<br />
<b>Details on Project</b>: <?php echo $_POST["txtaProjectType"]; ?>.<br />


Edited by iSec - 12 October 2008 at 2:43am
"When it gets dark enough, you can see the stars"
-Charles A. Beard
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.