1function display_user_urls($url_array) 2{ 3// display the table of URLs 4 5 // set global variable, so we can test later if this is on the page 6global$bm_table; 7$bm_table=true; 8?> 9<br /> 10<form name=‘bm_table‘ action=‘delete_bms.php‘ method=‘post‘> 11<table width=300 cellpadding=2 cellspacing=0> 12<?php 13$color="#cccccc"; 14echo"<tr bgcolor=‘$color‘><td><strong>Bookmark</strong></td>"; 15echo"<td><strong>Delete?</strong></td></tr>"; 16if (is_array($url_array) &&count($url_array)>0) 17 { 18foreach ($url_arrayas$url) 19 { 20if ($color=="#cccccc") 21$color="#ffffff"; 22else 23$color="#cccccc"; 24// remember to call htmlspecialchars() when we are displaying user data 25echo"<tr bgcolor=‘$color‘><td><a href=\"$url\">".htmlspecialchars($url)."</a></td>"; 26echo"<td><input type=‘checkbox‘ name=\"del_me[]\" 27 value=\"$url\"></td>"; 28echo"</tr>"; 29 } 30 } 31else 32echo"<tr><td>No bookmarks on record</td></tr>"; 33?> 34</table> 35</form> 36<?php 37}