Web Analytics Made Easy -
StatCounter Cant send total variable to email - CodingForum


No announcement yet.

Cant send total variable to email

  • Filter
  • Time
  • Show
Clear All
new posts

  • Cant send total variable to email


    I've got a simple shopping cart at

    When you go to the checkout how do i send the "Total $" amount to my email when i submit the form.

    my form allready works. it sends me the name email etc - just won't send me the $totalCost variable. Heres is the PHP that the form goes to when submit is clicked.




    include ("db.php");

    __//create short variable names





    __$toaddress = '[email protected]';

    __$subject = 'Feedback from web site';

    __$mailcontent = 'Customer name: '.$name."\n"

    _________________.'Customer email: '.$email."\n"

    _________________."Customer comments: \n".$feedback."\n"

    ________________ ."Customer price: \n".$totalCost."\n";

    __$fromaddress = 'From: [email protected]';

    __mail($toaddress, $subject, $mailcontent, $fromaddress);




    __<title>Bob's Auto Parts - Feedback Submitted</title>



    <h1>Feedback submitted</h1>

    <p>Your feedback has been sent.</p>




  • #2
    where is the totalCost variable coming from ? is it a field in your form ? if so check it is being populated/spelt correctly/not duplicated etc

    though really you should be calculating your costs at the scripts runtime & not relying on the form input as someone can quite easily spoof that with their own idea of the right cost
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)