You could do this with radio buttons or JavaScript as facebook does.
Obviously we wont write this script for you but here is how it generally works.
<?php
// Run query to retreive gifts
$get_gifts = mysql_query("SELECT * FROM `gifts`");
if( @mysql_num_rows( $get_gifts ) > 0 ) {
echo "<form method=\"submit\" action=\"#\">";
while( $row = mysql_fetch_array( $get_gifts ) ) {
echo "<img src=\"...\" alt=\"...\" />" . $row['title'] . '<input type="radio" name="gift" value="' . $row['title'] . '" />';
}
echo '<input type="submit" name="send" value="Ok" />';
echo "</form>";
}
if( isset( $_POST['send'] ) ) {
$gift = mysql_real_escape_string( $gift );
// Need the user receiving the gifts id etc.
$user_id = "...";
$query = mysql_query("INSERT INTO `received_gifts` (id, gift) VALUES ('$user_id', '$gift')");
echo "<p>Gift sent</p>";
}
?>
Something allong those general lines.