Ugh! I have a PHP echo statement from hell?!
I am trying to make the following Radio Buttons “sticky” but can’t get the echo syntax figured out…
// Display Friend-Requests.
echo "<li>
<a href='/account/profile.php?user=$username&tab=about-me'>
$username<br />
<img src='/uploads/" . $photoName . "' width='80' alt='Thumbnail of ' . $username />
</a>
<fieldset id='friendRequestDecision'>
<input id='" . $requestorID . "_1' name='friendRequestDecision[" . $requestorID . "]' type='radio' value='0' checked='checked' />
<label for='" . $requestorID . "_1'>Decide Later</label>
<input id='" . $requestorID . "_2' name='friendRequestDecision[" . $requestorID . "]' type='radio' value='1' />
<label for='" . $requestorID . "_2'>Accept</label>
<input id='" . $requestorID . "_3' name='friendRequestDecision[" . $requestorID . "]' type='radio' value='2' />
<label for='" . $requestorID . "_3'>Decline</label>
</fieldset>
</li>\
";
I am trying to get this new code to work…
// Display Friend-Requests.
echo "<li>
<a href='/account/profile.php?user=$username&tab=about-me'>
$username<br />
<img src='/uploads/" . $photoName . "' width='80' alt='Thumbnail of ' . $username />
</a>
<fieldset id='friendRequestDecision'>
<input id='" . $requestorID . "_1' name='friendRequestDecision[" . $requestorID . "]' type='radio' value='0' "
. (isset($friendRequestDecision[$requestorID]]) && $friendRequestDecision[$requestorID] == '0') ? "checked='checked'" : "") . " />
<label for='" . $requestorID . "_1'>Decide Later</label>
<input id='" . $requestorID . "_2' name='friendRequestDecision[" . $requestorID . "]' type='radio' value='1' />
<label for='" . $requestorID . "_2'>Accept</label>
<input id='" . $requestorID . "_3' name='friendRequestDecision[" . $requestorID . "]' type='radio' value='2' />
<label for='" . $requestorID . "_3'>Decline</label>
</fieldset>
</li>\
";
Could someone please help me figure this out?
Thanks,
Debbie