Help with PHP Contact Form

Hello everyone!

I’m looking for a bit of help with a custom contact form. One of the form’s fields provides a running total of the customer’s prints (it’s a photography order form). I need to figure out how to incorporate the running total field into the message that arrives. I’ve attached the PHP code – I would appreciate any help I can get. The system wouldn’t let me post it here in PHP tags because it’s too long, so I uploaded it to Pastebin:

http://pastebin.com/epBBX6Pz

Here’s the page in question (it’s a test site):

http://theamericanliberal.com/production/looseprints.html

Thanks!

Let me know if you need the HTML code…

Can anyone help?

Sure… We can help you here…

First, you have a huge number of options, like 100… For the picture options.
I suggest changing this to a dynamic display. If one is selected, a second one appears below that one.
This can be done with dynamic DIV’s or iFrames…

Also, I liked the “looseprints” display, I think there is something in that one… It was “cute”…

But, anyways, to scan thru the POSTs, you can use this type of code:’
[php]
foreach($_POST as $name => $value) {
print “$name : $value
”;
}
[/php]
So, basically, you can look at each $_POST value and do what you need to with them.
You can sort thru a 100 picture options and use the data by “$name” and “$value”…
I think this will help you out… Good luck…

Thank you for the reply! However, I don’t think I was clear. The form already generates the running total – see the bottom of the page for the “Total Prints” field. What I need to do is get the number generated by the field into the email delivered to our inbox.

Presently the email includes each ordered print as well as the value of the “Message” field, but it does not include the “Total” field which is automatically calculated when the customer selects his prints.

Thanks!

??? Well, if you already create the total field, just post it in the email… How do you create the TOTAL field? There was no total field showed in the code you posted in the link… Just a lot of fields… If the total field is there, just post it into the email…

I looked at the code you posted again and it still makes no sense to a programmer. Nobody would post 100 fields or inputs in that code. Why isn’t this code just a “FOR” loop or whatever? But, your code you posted did not show any type of structure or database access. So, where is this info being held? There must be a place for the data to be held and then your can query or whatever to pull the TOTAL of the data.

Otherwise, with individual inputs, you would have to add each to a running total. At the end of each input add it to the total and at the end of them, display it. But, you say it is already there… Where?

I guess, not really sure of your question… Doubt this helps, but, re-ask again…

Sponsor our Newsletter | Privacy Policy | Terms of Service