Can someone help me with this PHP Code (add variable into input form value)?

yogibear7

New member
What I'm trying to do is load a variable from a cookie, and make that variable the value for the input checkbox. Code is below:

<?php

$username = $_COOKIE['ID_my_site'];

echo '<b>Add me as:</b><br>';
echo '<div align="left"><br>';
echo '<input type="checkbox" name="camera"
value="<?php echo $username; ?>" > Camera<br>';
echo '<input type="checkbox" name="commentator" value="<?php echo $username; ?>"> Commentator<br>';
echo '</div>';
echo '<br>';
echo '<input type="submit" value="Sign up" >';
echo '</form>';
?>
 
Back
Top