Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- populating rad chk inputs with posted data


Habtom - 5:02 am on Aug 13, 2007 (gmt 0)


I couldn't get the point why you have declared that many global variables. Unless you have a different purpose for them, the following function should do it all:

<?php
function popActivities($a)
{
if (isset($_POST['chkActivities']))
{
foreach($_POST['chkActivities'] AS $activity)
{
if ($activity == 'New Puppies' ¦¦ $activity == 'Adult Dobermans' ¦¦ $activity == 'Trained Dobermans' ¦¦ $activity == 'Stud Service' ¦¦ $activity == 'Doberman Rescue')
{
$chk_status = "checked='checked'";
}
}
}
echo $chk_status;
}
?>

You need to change those "¦¦" to the appropriate vertical ones.


Thread source:: http://www.webmasterworld.com/php/3419496.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com