Something like this (I didn't actually try this so you'll have to excuse me if there's some small error:
Code:
$memlist = '';
foreach ( $_POST as $name => $value) {
if ((stristr($name,'membership')) && ($value !=0 ) ) {
// Check to See if Member
$check_if_member=$db->query_first("SELECT MemberID, DateExpire FROM ~~~~~ WHERE MemberID = $value");
if ($check_if_member){
$membership_number=$value;
$Expire_Date=$check_if_member['DateExpire'];
}
else
{
$membership_number=$value;
$Expire_Date="" ;
}
print_r ($check_if_member) ;
//echo "<br /> $name, $value <br />" ;
eval('$memlist .= "' . fetch_template('membership_template') . '";');
}
eval('print_output("'. fetch_template('rsoc_member_check_output') . '");');
I added the parts in red. The small template (which I called 'membership_template' but you can of course call whatever you want) can probably be created by taking the corresponding part out of the 'rsoc_member_check_output' template.
In fact, if you wanted you could just use
Code:
$memlist .= "<br /> $membership_number, $Expire_Date<br />";
(or whatever HTML you want) in place of the 'eval' line and not use a template.
In any case, in your 'rsoc_member_check_output' template just put $memlist where you want the list.
--------------- Added [DATE]1258324902[/DATE] at [TIME]1258324902[/TIME] ---------------
Sorry, I realized that you want to use $membership_number and $Expire_Date instead of $name and $value (which I guess were in the echo call for debugging?) so I changed the above.