Forum Replies Created
- AuthorPosts
shorthills11
ParticipantThat works!
Thank you!shorthills11
ParticipantAnd to rule out a problem with my calculation code I added the $sample variable with some string data to the custom code section to see if I could get this data to appear on the emailed form.
// Custom code section #1 - see documentation for examples $sample = "this is sample data"; /* get year, month, day data from object */ .....
and then I tried to push the data to the form:
// Add the visitor IP to the email $config['extra']['IP address'] = Quform::getIPAddress(); $config['extra']['Calculated Age'] = $calcAge; // not showing up in the email $config['extra']['Sample Data'] = $sample; // not showing up in the email
Any help figuring this out would be greatly appreciated!
Thanks!shorthills11
ParticipantOk so the form processes, butI can’t get the calculation to post in the email.
What I did was
a) I restored the original age section back to normal (though I pulled it off the .html end of the form)
b) I added the calculation code to the “custom code section #1”
c) I then used the advice at the URL below about how to add an item to the end of the form. I’m able to successfully show the field “Calculated Age” on the email. However, I can’t see the value of the $calcAge variable.Is this statement legal:
$config['extra']['Calculated Age'] = $calcAge;
shorthills11
ParticipantSo I did some more digging and I was able to get the form to process.
I’m developing locally so I have to test via SMTP, but this runs:/* $age = new Quform_Element('age', 'Age'); */ /* get year, month, day data from object */ $year = $form->getValue('dob_year'); $month = $form->getValue('dob_month'); $day = $form->getValue('dob_day'); /* create $dob time string */ $dob = strtotime("$year-$month-$day"); /* calculate age from $dob */ $age = floor((time() - strtotime($dob)) / 31556926); $age .= "variable test"; /* adding "variable test" to $age to test that it's working. */ $age = new Quform_Element('age'); // added this line $form->addElement($age);
Note I commented out the original $age declaration, and made a new one.
shorthills11
ParticipantSo I switched to SMTP and the form now processes, but I get no email. And the host verified all is fine on their end.
The only thing I can think of is that I’m leaving the encryption parameter blank because they said there’s no encryption setting needed. If I leave
/*’encryption’ => ” */
blank or commented out, will that cause it not to send email?
thanks!shorthills11
ParticipantTHanks for your quick replies — I really appreciate it! I’m working with my host now…
shorthills11
ParticipantThanks for your reply. I changed process.php to “mail” and it was fine. But when I changed process2.php then it still throws the error. Process2.php is around 20 fields whereas process1.php is around 4. Could that be making the difference? the amount of data being passed?
for whatever it’s worth if I turn off mail (e.g. make it false) then the script processes — so clearly it’s in the mail function.
But my host says it’s the script because one works and one doesn’t.
What’s the best way to proceed?
Thanks.- AuthorPosts