Emailed form data has

tidusx18 19 Oct, 2009
Hi,

I have my form set up to email the submitted form data to various users from CB based on a drop down box selection. Everything works fine except that when I get the emailed form data, some fields have the word "Array" right before what was submitted as if the user typed it in, but obviously they didn't.

Here's a sample email...Any ideas how to remove the word "Array"?

------Contact Details------

Name: Arraydaniel Arrayvictoriano
Company name: Arraytest
Street address: Array123
City: Arraymiami
State: ArrayAL
Zip code: Array33333
Phone: Array305-333-3333
Other Phone: Array
Fax: Array
Email: [email]Arraydvictoriano@bellsouth.net[/email]
Preferred contact method: ArrayPhone

------Basic specifications------

Type: Bookmarks
Width: 4
Height: 6
Paper type: 10pt
Paper selects: Book, Cover, Glossy
Quantity: 100
Color: 4/0
Folding options: None
Proof type required: No proofs required
Need order in: ASAP!
Will accept closest match?: No
Other services needed: Graphic design, Mailing service Shipping address: 123
Comments: none

Thanks.
GreyHead 19 Oct, 2009
Hi tidusx18,

What is actually in the Email template? You get 'Array' shown when you try to echo or print an array but you don't usually get the values as well.

Bob
tidusx18 19 Oct, 2009
Bob,

I'm using the code shown below in the OnSubmit after box to send the emails...

<?php
$category = "Printing";
$today = date("F j, Y, g:i a");
$message = "
To ensure you receive future notifications, please add
info@ineedapricequote.com to your Safe Sender list.

Hello,

A new lead has been submitted in the $category category. Please be sure to save this email for your reference. To receive leads for a different category, please change you category selection in your profile page under the business info tab. 

Lead submitted on $today

------Contact Details------

Name: $_REQUEST$_REQUEST[First_name] $_REQUEST$_REQUEST[Last_name]
Company name: $_REQUEST$_REQUEST[Company_name]
Street address: $_REQUEST$_REQUEST[Address]
City: $_REQUEST$_REQUEST[City]
State: $_REQUEST$_REQUEST[State]
Zip code: $_REQUEST$_REQUEST[Zip_code]
Phone: $_REQUEST$_REQUEST[Phone]
Other Phone: $_REQUEST$_REQUEST[Other_phone]
Fax: $_REQUEST$_REQUEST[Fax]
Email: $_REQUEST$_REQUEST[Email]
Preferred contact method: $_REQUEST$_REQUEST[Preferred_contact_method]

------Basic specifications------

Type: $_REQUEST[select_a_category]
Width: $_REQUEST[Flat_width]$_REQUEST[Width]
Height: $_REQUEST[Flat_height]$_REQUEST[Height]
Paper type: $_REQUEST[Paper_type]
Paper selects: $_REQUEST[paper_selects]
Quantity: $_REQUEST[Quantity]$_REQUEST[Quantity_notepads]
Color: $_REQUEST[Color_type]
Folding options: $_REQUEST[Folding_options]
Proof type required: $_REQUEST[Proof_type]
Need order in: $_REQUEST[Need_order_within]
Will accept closest match?: $_REQUEST[accept_closest_match]
Other services needed: $_REQUEST[other_services_required]
Shipping address: $_REQUEST[shipping_address]
Comments: $_REQUEST[comments]



------Multi page material specifications (magazines, catalogs, calendars, etc)------

Number of pages: $_REQUEST[Number_of_pages]
Binding type: $_REQUEST[Binding_type]



------Additional specifications------
$_REQUEST[perforation]
$_REQUEST[scoring]
$_REQUEST[metallics]
$_REQUEST[tabs]
$_REQUEST[Pockets]
$_REQUEST[Business_card_slits] $_REQUEST[Business_card_slit_selects]
$_REQUEST[CD_slits]
$_REQUEST[Hole_drill_size] $_REQUEST[Hole_location] $_REQUEST[Hole_drill_selects]
$_REQUEST[numbering]
$_REQUEST[Padding]
$_REQUEST[flaps]
$_REQUEST[envelope_window]
";

    $subject = "A new $category lead has been submitted";
    $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers = 'FROM: info@ineedapricequote.com' . "\r\n";

    $db =& JFactory::getDBO();
    $query ="
      SELECT `cb_email`
        FROM `jos_comprofiler`
        WHERE `cb_selectacategory` = '$category' ;
    ";
    $db->setQuery($query);
    $subscribers = $db->loadObjectList();

    foreach ( $subscribers as $subscriber ) {
      mail($subscriber->cb_email, $subject, $message, $headers);
    }
    ?>
GreyHead 19 Oct, 2009
Hi tidusx18,

It's the repeat of $_REQUEST that does it, the first one tries to show the whole $_REQUEST array and gives you the 'Array' message, the second one give you the value.

Change for example $_REQUEST$_REQUEST[Last_name] to $_REQUEST[Last_name] all the way through.

Bob
tidusx18 19 Oct, 2009
lol didn't see that๐Ÿ˜›

Were you by any chance able to find a simpler way to fix the hidden fields still validation problem? Sorry I keep badgering you.

PS: Your solution did work though its just that I have about 22 different selections with different fields being hidden for each selection. Going through all of those and any future similar forms will take a very long time. I was even thinking of switching back to an earlier version of chrono forms.

regards,
Daniel
GreyHead 19 Oct, 2009
Hi tidusx18,

It's on my list to look at - but there are a few other things on there too.

Bob
tidusx18 20 Oct, 2009
Thank you! ๐Ÿ˜€
This topic is locked and no more replies can be posted.