How to save multiple chexkboxes from form in SESSION

Need to save multiple checkboxes from an html form in SESSION. I cannot change the name="" because it is being used by mailer software.

Form->1AutoWiz->page displaying POST with hidden form submitting to Google Spreadsheets.

I’m submitting form fields to online shoppingcart then to page (this is almost instantaneous) on webserver displaying info and having customer confirm (realy justs another form sending the info to google spreadsheets)

I cannot use the name="" because it is being used my newsletter software. Can I get info using an id?

this is how I have it now.

[code]

Silent Auction / Raffle Prizes

Goodie Bag Items

1st, 2nd, 3rd Place Prizes

All Inclusive Mulligan Package

On course contest prizes

Accessories (Tournament Plaques, Trophies, etc…)[/code]

[php]$n = 1;
if(is_array($_POST[‘products’])) foreach($_POST[‘products’] as $value){
$_SESSION[$n][‘products’] = $value;
$n++
}[/php]

Would something like this work? Have not tested or anything.

Cant edit last post but just realized your checkbox name is Product not products.
[php]$n = 1;
if(is_array($_POST[‘Product’])) foreach($_POST[‘Product’] as $value){
$_SESSION[$n][‘Product’] = $value;
$n++
}[/php]

And change name=“Product” to name=“Product[]” instead of the ID

I have changed the name to name=“Product[]” but now the I am not able to bring up the value on form processing page.

I added ; to $n++ on the code you posted because it was giving me an error. Let me know if that’s correct.

processing page is

[code]<?php
session_start();

$_SESSION[‘name’] = $_POST[‘Name’];
$_SESSION[‘email2’] = $_POST[‘Email1’];
$_SESSION[‘workphone’] = $_POST[‘Workphone’];
$_SESSION[‘address’] = $_POST[‘Address1’];
$_SESSION[‘city’] = $_POST[‘City’];
$_SESSION[‘state’] = $_POST[‘State’];
$_SESSION[‘zip’] = $_POST[‘Zip’];
$_SESSION[‘date’] = $_POST[‘Date’];
$_SESSION[‘tournamentname’] = $_POST[‘Title’];
$_SESSION[‘fees’] = $_POST[‘Fees’];
$_SESSION[‘count’] = $_POST[‘Count’];
$_SESSION[‘product’] = $_POST[‘Product’];
$_SESSION[‘qualifier’] = $_POST[‘qualifier’];
$_SESSION[‘description’] = $_POST[‘description’];
$_SESSION[‘prapproval’] = $_POST[‘PRApproval’];
$_SESSION[‘decisionmaker’] = $_POST[‘decisionmaker’];

echo $_SESSION[‘name’];
echo ‘
’;
echo $_SESSION[‘email2’];
echo ‘
’;
echo $_SESSION[‘workphone’];
echo ‘
’;
echo $_SESSION[‘address’];
echo ‘
’;
echo $_SESSION[‘city’];
echo ‘
’;
echo $_SESSION[‘state’];
echo ‘
’;
echo $_SESSION[‘zip’];
echo ‘
’;
echo $_SESSION[‘date’];
echo ‘
’;
echo $_SESSION[‘tournamentname’];
echo ‘
’;
echo $_SESSION[‘fees’];
echo ‘
’;
echo $_SESSION[‘count’];
echo ‘
’;
echo $_SESSION[‘product’];
echo ‘
’;
echo $_SESSION[‘qualifier’];
echo ‘
’;
echo $_SESSION[‘description’];
echo ‘
’;
echo $_SESSION[‘prapproval’];
echo ‘
’;
echo $_SESSION[‘decisionmaker’];
echo ‘
’;

$n = 1;
if(is_array($_POST[‘Product’])) foreach($_POST[‘Product’] as $value){
$_SESSION[$n][‘Product’] = $value;
$n++;
}

?>[/code]

Do I need to change $_POST[‘Product’] to $_SESSION[‘Product’] on code you posted?

Please remember the values are not being posted from form page to processing page right away. formposts to hosted email service like iContact, 1AutoWiz, Constant Contact and they redirect person that filled out the form to processing page.

<form name="form1" method="post" action="https://www.mcssl.com/app/contactsave.asp"> <input name="merchantid" type="hidden" id="merchantid" value="XXXXX"> <input name="ARThankyouURL" type="hidden" id="ARThankyouURL" value="http://www.XXXXXXXXX.com/charity-test2.php"> <input name="copyarresponse" type="hidden" id="copyarresponse" value="1"> <input name="defaultar" type="hidden" id="defaultar" value="0"> <input name="allowmulti" type="hidden" id="allowmulti" value="0"> <input name="visiblefields" type="hidden" id="visiblefields" value="Name,Email1,Workphone,Address1,City,State,Zip"> <input name="requiredfields" type="hidden" id="requiredfields" value="Name,Email1,Workphone,Address1,Zip">

I apologize in advance if I am not explaining myself correctly.

Just tested it out and $_SESSIONS act different to arrays apparently.
Do this instead.

[php]$_SESSION[‘Product’] = $_POST[‘Product’]; // On the form processing page[/php]

To test whats in there use
[php]print_r($_SESSION[‘Product’]);[/php]

Then to show the contents where $n is the array key on your display page
[php]echo $_SESSION[‘Product’][$n];[/php]

Will count the entries stored in the session so you can loop an output
[php]count($_SESSION[‘Product’]);[/php]

So you dont have access to the form page and where its processed?
Then $_SESSION[‘Product’] is already set?
Then just show it with $_SESSION[‘Product’][$n];

I have access to the form and processing page. Code works when I go from form to processing page. I realized it does not work when I go from form ->1AutoWiz->processing page.

I don’t think this process will work with my email software(1AutoWiz) I think I need to eliminate this process.

**Does session save the post info before it send it to processing page?

Sponsor our Newsletter | Privacy Policy | Terms of Service