close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Form data not correct when sent via email.

Thread began 10/01/2009 1:55 am by jasonkline326722 | Last modified 8/16/2010 1:50 pm by Jason Byrnes | 2493 views | 5 replies |

jasonkline326722

Form data not correct when sent via email.

sendreq.php

Appointment Information shows up in email like this:

Consultation Request Form Appointment Information Best day: 10/15/2009

Consultation Request Form Appointment Information Best times: Array

Consultation Request Form group Confirm by: Array

I am not sure why.

Sign in to reply to this post

Eric Mittman

It looks like you are just sending the looped over posted values in the message. This is one way to get a forms information sent but as you can see it does not always give you the desired result. The problem with the values that are showing up as arrays is because only the name of the variable was referenced and not a subscript of the array.

For the 'best times' this is a multi select list on your page so the information will be contained in an array, the same goes for the checkboxes for confirm by.

To get around this you can use the php implode function on the array to get the values into a single string. Here is a link to the function page:

php.net/implode

If the script that is doing the mailing is not one that you have any access to for editing I would suggest that you try a different approach for sending the info. The Universal Email tool that we offer will allow you to craft the message in DW and use the bindings like you would normally use. You can then update the code to implode the array or loop over it and print the values out one at a time. Another function that would list the contents of the array is var_dump(), but it is not very clean looking and is normally used for debugging purposes.

Sign in to reply to this post

jasonkline326722

Thank you Eric...

I used this code below and it's working:

echo $a = implode(",", $Consultation_Request_Form_Appointment_Information_Best_times)
echo $a = implode(",", $Consultation_Request_Form_group_Confirm_by)

Sign in to reply to this post

Eric Mittman

Sounds like you were able to edit the mailing script that was being used. That is great to hear that you got it worked out, using arrays in PHP gives you alot of power and flexibility. Knowing how to manipulate these arrays lets you do some neat stuff.

Sign in to reply to this post

rob294118

I have a couple list items where I use IMPLODE and it works fine.

I try to create another list field on my form and the form tells me the list does not support multiple list items. The implode statement does NOT work on this new field.

$MailBody = $MailBody . ((isset($_POST["Appointment_request_group_Type_of_event[]"]))?implode(", ", $_POST["Appointment_request_group_Type_of_event[]"]):"");


This program has been nothing but a headache.

Sign in to reply to this post

Jason ByrnesWebAssist

this question was answered in the following thread:
showthread.php?p=71296

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...