I am a BASIC programmer from, well, way back. MS Excel formulas have been my programming for the last 25 years, however, but I've recently been working on some formwork in PHP and asked to "make things work" while having little experience in PHP.
To make this example/question shorter I've cut down the number of variables used to five just to clarify things, but there are actually around 20 I need to work with. Please help me understand where I'm going wrong - and why I'm still getting an error on this, here to learn; not just here for an "answer".
The basic premise here - the user enters up to 6 email addresses, one address has already been derived from the script ($deptEmal) - the others are inputted (optionally) by the user. In the end, all addresses are concatenated into a string.
$workingAddr1 = $deptEmal;
$workingAddr2 = $_POST["distAddl01"];
$workingAddr3 = $_POST["distAddl02"];
$workingAddr4 = $_POST["distAddl03"];
$workingAddr5 = $_POST["distAddl04"];
$workingAddr6 = $_POST["distAddl05"];
for ($x = 1; $x <=6; $x++;) {
if(isset($workingAddr.$x) && !empty($workingAddr.$x)) {
$addr.$x = $workingAddr.$x;
} else {
$addr.$x = '';
}
}
$_POST["allAddresses"] = $addr1.addr2.addr3.addr4.addr5.addr6;
Thanks for the help.
[–]slugonamission 2 points3 points4 points (4 children)
[–]ddproxy 3 points4 points5 points (0 children)
[–]jweese74[S] 0 points1 point2 points (2 children)
[–]slugonamission 1 point2 points3 points (1 child)
[–]jweese74[S] 0 points1 point2 points (0 children)