Hi all 🙂. Have a confusing problem that's been stumping me for awhile (just got back to doing PHP after a year, and some things are slow getting back)
First off, at the first page, select "Bivoli Tempari" from the drop down list so you get some of the options where the problem lies. The ammount doesn't matter, haven't gotten to that part yet
http://members.lycos.co.uk/swgclaire/test/
After you selected "Bivoli Tempari", you'll get a page listing information pulled from a text file .
The overall function of the program is to determine how long it will take to make an item in StarWars Galaxies, and select the best times to make the components needed, so the finished product is completed by the earliest date.
I wanted to add some flexibiliy to the program, so say if someone had already crafted one of the components (ie. Carbosyrup in Bivoli), they could choose not to include it in the calculations.
There in lies the problem. I don't know how to "align" the "components" field (either hidden or a select box), with the "include_components" field (the checkboxes) using a loop (since the fields are an array, I figure that would be the best option)
You can see this by checking all components, except Carbosyrup and going to the next page. It says that carbosyrup is selected, and the tissue is not.
Here's the code that displays the last page:
echo count($_POST['components'])." Components Total - ".count($_POST['include_components'])." Conponents Included<br>";
for($i="0";$i < count($_POST['components']); $i++){
echo $glo_itemname[$_POST['components'][$i]]." - Include? <font color=#ff0000>".$_POST['include_components'][$i]."</font> (ID: ".$_POST['components'][$i].")<br>";
}
What I'm looking for is how to "align" the component and include_component fields properly. The "on" in red is what the HTML itself is passing, so I'm wondering if checkboxes are the right option or what.
Sorry if I confused the heck out of you!