Inky1231;10998146 wrote:I don't think I need the implode function, but where should I put the [man]print_r/man or [man]var_dump/man on $_POST['tape'] ? I feel dumb to admit I have never used it before.
It's just a debugging technique you can use to dump an array out to the screen so that you can visually inspect it and make sure it contains what you think it contains. As such, it really doesn't matter where you put either of those function calls - just use them somewhere and look in the source code of the page in your browser and find the output.
Inky1231;10998149 wrote:this is the error I got
PHP Warning: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in C:\Inetpub\wwwroot\DACC\ssc\accommodations3.php on line 292
That would seem to suggest a problem with the $_POST['tape'] variable, which makes the request for a print_r() or var_dump() output all the more relevant and/or needed in order for us to determine the problem.
Inky1231;10998156 wrote:Now I just have one last question I have a LOT of checkboxes on this form and I don't think it would be the best way to do it to do the implode command for each checkbox set
Why not? Aren't you going to list them separately in the e-mail? Or are you just going to combine the values selected from all of the "sets" into one single list of values in the e-mail?
If the latter is true, then you could indeed do some intelligent looping with only a few statements to cover all of the "sets." The same could be set for keeping them separate (e.g. $tape would be a list of values for the 'tape' set of checkboxes, $foo for the 'foo' set of boxes, etc. etc. for all sets), but we probably need to get more information about the structure of this form as well as how you intend to represent the values selected in the e-mail message you're constructing.
Inky1231;10998156 wrote:can I just do something like the following
$tape = implode(', ', $_POST['$efield']);
and have it go through the $efield array?
No, because '$efield' is literally a dollar sign followed by the word/characters "efield" (since you used single quotes; recall that variable interpolation does not occur within strings delimited with single quotes).
Even if you had used double quotes, the index of an associative array must be a string, not another array, so $POST["$efield"] wouldn't make any sense either. Instead, you'll need to implement the logic that does what you're trying to get PHP to do automatically, e.g. looping through the $efield array and accessing the appropriate $POST indexes one-by-one in the body of that loop.