issue with mail function
am 04.08.2009 17:43:35 von Allen McCabe--001636427659daeca0047052bfe3
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
I have recently been working a lot lately with arrays and printing them into
html tables for email (like a user survey for example). I have been seeing
odd things with the table lately, each unique to it's sending php file. I
will get a space in a random spot. In one, I used an array to rename the
Name values of input fields to more readable ones, "whatadd" becomes "What
to Add", only the word 'Add' is spelled 'Ad d'. With my recent mail script
(submitting a customer profile change), I get it in a similar area, a Name
value renamed and I get "Emp loyee" in the table cell. The adjacent cell is
fine though, reading "Needs Handicap Accommodations". I will post some of my
code to show that I haven't misplaced a space:
[code]
1.
2.
3. //CHECKS TO SEE IF FIELDS WERE PROPERLY COMPLETED AND ASSIGNS
VARIABLES TO INPUTS - OTHERWISE AN ERROR MESSAGE IS PRINTED
4.
5. $Employee = $_POST['Employee'];
6.
7. $fields2 = array();
8.
9. $fields2{"Employee"} = "Employee";
10. $fields2{"IsHandicappedAccommodations"} = "Needs Handicap
Accommodations";
11.
12. $body = "We have received the following
information:\n\n
13.
14.
15. //FOREACH LOOP
16.
17. $headerlabel = '0';
18.
19. foreach ($fields as $x => $y) {
20. $headerlabel = $headerlabel +1;
21. $body .= "

22. }
23.
24.
25. $body .= "
26.
27. foreach ($fields2 as $x => $y)
28. $body .= "
29.
30. $body .= "
31.
32. foreach ($fields2 as $x => $y)
33. $body .= "
34.
35. $body .= "
36.
37. foreach ($fields as $a => $b) {
38. $body .= sprintf("%s\n",$b);
39. }
40.
41. $body .= "
";
42.
43. foreach ($fields as $a => $b) {
44. $body .= sprintf("%s\n",$_POST[$a]);
45. }
46.
47. $body .= "
48.
49. //END FOREACH LOOPS
[/code]
This is all the code I think is really relevant, but if you think I left
something out I'll be happy to share with you all the code.
This is not a major issue for me, it is just so strange, and if someone
could provide some insight, it would be great.
--001636427659daeca0047052bfe3--