Location: PHPKode > scripts > LinkExchange > linkexchange/links.php
<?php
require ("LinkExchange.class.php");
$links = new LinkExchange_class;
$category_id = ( isset ($_GET['cid'])) ? (int) $_GET['cid']: 1;

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Links page</title>
</head>

<body>
<form action="links.php" method="get">
<div style="text-align: right;">
<select name="cid" onchange="document.forms[0].submit();">
<?php $categories = $links->getCategoriesList(); for ($i = 0; $i < $links->counter; $i++) {
	if ($categories[$i]['category_id'] == $category_id) $selected = ' selected="selected"'; else $selected = '';
	echo '<option value="'.$categories[$i]['category_id'].'"'.$selected.'>'.$categories[$i]['category_id'].'. '.stripslashes ($categories[$i]['name']).'</option>';
} ?>
</select>
</div>
</form>


<table>
<?php
$links_array = $links->getLinksOfCategory ($category_id);
for ($i = 0; $i < $links->counter; $i++) {
	echo '<tr><td>';
	echo stripslashes ($links_array[$i]['link_source']);
	echo '</td></tr>';
}
?>
</table>
</body>
</html>
Return current item: LinkExchange