Page 1 of 1

Need Help

Posted: Tue Nov 28, 2006 4:19 pm
by darkfreaks
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


ok i need help with the code i have so far it sends the email but it comes up blank so my thing isnt working right?
it should add up the quantity times the price to give a total. but i cant make it work. same with total quamtity which adds up all the items and displays a total item count. and when its mailed i want it to echo "your order has been sent thanks for shopping at lilyshop!"

Code: Select all

<?php

if ($_POST) { 
if (ctype_alpha($_POST['email'])) { $email = $_POST['email']; }
else $mailerror = "You must enter a valid email!<br />"; }
if (ctype_alpha($_POST['name'])) { $name = $_POST['name']; }
else $nerror = "You must enter a valid email!<br />"; 
if (ctype_alpha($_POST['qty'])) { $qty = $_POST['qty']; }
if (ctype_alpha($_POST['submit'])) { $submit = $_POST['submit']; }

define("NECKLACEOFTHENIGHTSKY", 50);
define("CHAINAILEFANCYBEADEDNECKLACE", 50);
define("ANTIQUEKEYNECKLACE", 30);
define("CHAINMAILEFANCYNECKLACE", 50);
define("CHAINMAILEVNECKLACE", 50);


$totalqty = 0;
$totalamount =  0.00;

$totalqty = $NNSQTY+$CBFNQTY+$AKNQTY+$CFNQTY+$CVNQTY ;

$totalamount = $NNSQTY * NECKLACEOFTHENIGHTSKY
               +$CBFNQTY * CHAINAILEFANCYBEADEDNECKLACE
			   +$AKNQTY * ANTIQUEKEYNECKLACE
               +$CFNQTY *CHAINMAILEFANCYNECKLACE
               +$CVNQTY* CHAINMAILEVNECKLACE;
if (mail('mowtripleh@example.com',"From: $name <$email>","Total Amount:$totalamount","Quantity Ordered:$qty")) 
{ 
          echo ("<p>Thank you for shopping at Lillys Shop! Your OrderHas Been Sent!</p>"); 
}else{ 
           echo ("Email did not send Please Contact Lily!");
} 


?>

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]