| | |
Sending form email
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2004
Posts: 1
Reputation:
Solved Threads: 0
I have created an online gift certificate order from.
I have an html to allow user to create order,
and two php pages to:
1) display order back to browser window,and
2) send email with order info to restaurant owner and myself
and redirect to thanks.htm page.
I cannot get the order details to display in the e-mail message.
This happens despite my coding the quantity variables as
{$_POST['totalqty']} and {$_POST['totalamount']} .
Anyway, can anyone help me?
Here is my code...
THANKS!
<?php
if ($_POST['radio_group_1'] == 'A')
{
$mail_msg = "
Porters Restuarant Gift Certificate Order Form\n
Customer has ordered $_POST['twofiveqty']} gift certificates for ${$_POST['totalamount']}. \n
";
/*
$mail_msg = "Porters Restuarant Gift Certificate Order Form\n\n";
$mail_msg .= "Customer has ordered {$_POST['twofiveqty']} gift certificates for ${$_POST['totalamount']}.\n\n";
*/
$name = "Tom Fitzsimmons";
$email = "t4632@erieinsurance.com";
$subject = "Porter's Gift Certificate Order";
mail( "cookies@micro-link.net,psutom@micro-link.net", $subject,
$mail_msg, "From: $name <$email>" );
header( "Location: http://www.portersrestaurant.net/thanks.htm" );
}
else
{
?>
<html>
<head>
<title>Porter's Restaurant</title>
<style>
a { text-decoration: none; color: #0000FF; }
</style>
<script language="JavaScript">
function turnOn(currentLink) {
currentLink.style.color = "#990000";
currentLink.style.textDecoration = "underline";
}
function turnOff(currentLink) {
currentLink.style.color = "#0000FF";
currentLink.style.textDecoration = "none";
}
</script>
</head>
<body bgcolor="#f5f5f5" link="#000033" vlink="#000033" alink="#000033" background="MarbleB2.jpg">
<table border="0" width="60%" align="center">
<tr>
<td><center><a href="about.htm" style="color:#483d8b"
onmouseover="this.style.fontWeight='bold';" onmouseout="this.style.fontWeight='normal';">About Us</a></center></td>
<td><center><font color="#483d8b">|</font></center></td>
<td><center><a href="mailto:cookies@micro-link.net?subject=Porter's Restaurant" style="color:#483d8b"
onmouseover="this.style.fontWeight='bold';" onmouseout="this.style.fontWeight='normal';">E-mail
us!</a></center></td>
<td><center><font color="#483d8b">|</font></td>
<td><center><font color="#483d8b"><a href="menu.htm" style="color:#483d8b"
onmouseover="this.style.fontWeight='bold';" onmouseout="this.style.fontWeight='normal';">
Menus</a></font></td>
<td><center><font color="#483d8b">|</font></td>
<td><center><a href="index.html" style="color:#483d8b" onmouseover="this.style.fontWeight='bold';"
onmouseout="this.style.fontWeight='normal';">Home</a></center></td>
<td><center><font color="#483d8b">|</font></td>
<td><center><a href="banquets.htm" style="color:#483d8b"
onmouseover="this.style.fontWeight='bold';" onmouseout="this.style.fontWeight='normal';">
Banquets</font></td>
</tr>
</table>
<br>
<table border="0" width="65%" cols="1" align="center">
<tr>
<td align="center">
<img src="Porters_Logo.jpg" alt="Porter's Restaurant" border="0" width="132" height="124">
</a>
</td>
</tr>
</table>
<br>
<table align="center">
<tr>
<td>
<h3>Sorry you have cancelled your order.</h3>
<td>
</tr>
<tr><td> </td></tr>
<tr>
<td align="center"><a href="index.html"><h4>HOME</h4></a></td>
</tr>
</table>
</h2>
<p align="center"><FONT COLOR="#483d8b" SIZE=-1>
Contents ©2004 < Porters Restaurant, Inc. > All rights reserved.
</FONT>
</body>
</html>
<?
}
?>
I have an html to allow user to create order,
and two php pages to:
1) display order back to browser window,and
2) send email with order info to restaurant owner and myself
and redirect to thanks.htm page.
I cannot get the order details to display in the e-mail message.
This happens despite my coding the quantity variables as
{$_POST['totalqty']} and {$_POST['totalamount']} .
Anyway, can anyone help me?
Here is my code...
THANKS!
<?php
if ($_POST['radio_group_1'] == 'A')
{
$mail_msg = "
Porters Restuarant Gift Certificate Order Form\n
Customer has ordered $_POST['twofiveqty']} gift certificates for ${$_POST['totalamount']}. \n
";
/*
$mail_msg = "Porters Restuarant Gift Certificate Order Form\n\n";
$mail_msg .= "Customer has ordered {$_POST['twofiveqty']} gift certificates for ${$_POST['totalamount']}.\n\n";
*/
$name = "Tom Fitzsimmons";
$email = "t4632@erieinsurance.com";
$subject = "Porter's Gift Certificate Order";
mail( "cookies@micro-link.net,psutom@micro-link.net", $subject,
$mail_msg, "From: $name <$email>" );
header( "Location: http://www.portersrestaurant.net/thanks.htm" );
}
else
{
?>
<html>
<head>
<title>Porter's Restaurant</title>
<style>
a { text-decoration: none; color: #0000FF; }
</style>
<script language="JavaScript">
function turnOn(currentLink) {
currentLink.style.color = "#990000";
currentLink.style.textDecoration = "underline";
}
function turnOff(currentLink) {
currentLink.style.color = "#0000FF";
currentLink.style.textDecoration = "none";
}
</script>
</head>
<body bgcolor="#f5f5f5" link="#000033" vlink="#000033" alink="#000033" background="MarbleB2.jpg">
<table border="0" width="60%" align="center">
<tr>
<td><center><a href="about.htm" style="color:#483d8b"
onmouseover="this.style.fontWeight='bold';" onmouseout="this.style.fontWeight='normal';">About Us</a></center></td>
<td><center><font color="#483d8b">|</font></center></td>
<td><center><a href="mailto:cookies@micro-link.net?subject=Porter's Restaurant" style="color:#483d8b"
onmouseover="this.style.fontWeight='bold';" onmouseout="this.style.fontWeight='normal';">E-mail
us!</a></center></td>
<td><center><font color="#483d8b">|</font></td>
<td><center><font color="#483d8b"><a href="menu.htm" style="color:#483d8b"
onmouseover="this.style.fontWeight='bold';" onmouseout="this.style.fontWeight='normal';">
Menus</a></font></td>
<td><center><font color="#483d8b">|</font></td>
<td><center><a href="index.html" style="color:#483d8b" onmouseover="this.style.fontWeight='bold';"
onmouseout="this.style.fontWeight='normal';">Home</a></center></td>
<td><center><font color="#483d8b">|</font></td>
<td><center><a href="banquets.htm" style="color:#483d8b"
onmouseover="this.style.fontWeight='bold';" onmouseout="this.style.fontWeight='normal';">
Banquets</font></td>
</tr>
</table>
<br>
<table border="0" width="65%" cols="1" align="center">
<tr>
<td align="center">
<img src="Porters_Logo.jpg" alt="Porter's Restaurant" border="0" width="132" height="124">
</a>
</td>
</tr>
</table>
<br>
<table align="center">
<tr>
<td>
<h3>Sorry you have cancelled your order.</h3>
<td>
</tr>
<tr><td> </td></tr>
<tr>
<td align="center"><a href="index.html"><h4>HOME</h4></a></td>
</tr>
</table>
</h2>
<p align="center"><FONT COLOR="#483d8b" SIZE=-1>
Contents ©2004 < Porters Restaurant, Inc. > All rights reserved.
</FONT>
</body>
</html>
<?
}
?>
![]() |
Similar Threads
- Sending a form to an email address - please help (HTML and CSS)
- Sending form data in an email (PHP)
- CDOSYS Form to Email Formatting (ASP)
- need help with dynamic form in asp (ASP)
- Newbie Needs Form Help (PHP)
- form-to-email in Dreamweaver (Community Introductions)
Other Threads in the PHP Forum
- Previous Thread: Starers Script
- Next Thread: Good PHP Tutorial
| Thread Tools | Search this Thread |
5.2.10 action apache api array beginner beneath binary broken cakephp checkbox class classes cms code cron curl database date destroy display dynamic echo echo$_get[x]changingitintovariable... email encode error fcc file files folder form forms function functions google header howtowriteathesis href htaccess html image images include insert ip javascript joomla limit link local login mail memberships menu mlm mod_rewrite multiple multipletables mysql mysqlquery neutrality oop open passwords paypal pdf php provider query radio random record remote rss script search server sessions sockets source space sql strip_tags syntax system table template thesishelp tutorial update upload url validator variable video voteup web window.onbeforeunload=closeme; youtube





