Suppose i have a form like the following.......
if(isset($_GET['daysinweekly'])){
$days = $_POST['days'];
echo"<form name='' method='POST' action='weekly.php?submitweekly=$days'>";
echo"<input type='text' name='pplcount'>"; <<<<<<-----------this is my problem
for($today=1;$today<=$days;$today++){
echo"Total Customers: <input type='text' name='m_customers".$today."'>";
echo"Total for today: $ <input type='text' name='m_total".$today."'>";
}
echo"<input type='submit' name='' value='Submit'></form>";
}
which effectively gives form fields for a chosen amount of days.
When this form is submitted, I can get the results and echo them out with the following.
foreach( $_POST AS $title => $value ){
$$title = stripslashes( $value );
echo"$$title : $value<br>";
}
However, I also have the 'pplcount' field (bolded above) that is used for 'all' days not each one, so I need to output that first and then loop through the rest without echoing out that form field result for everyday....
In other words it needs to output like below....
Person count : $_POST[pplcount]
Day 1
Customers : $POST[m_customers1]
Total : $POST[m_total1]
Day 2
Customers : $POST[m_customers2]
Total : $POST[m_total2]
And so on.....................
I hope someone can help because im totally stuck.
(btw ive used the above as an example, my form is much larger than this so i really do need to loop through the results for each day.)