《PHP和MySQL Web开发》(第三版) Source
源代码在线查看: keywords.php
// keywords.php include_once('include_fns.php'); if (!check_auth_user()) { login_form(); } else if(check_permission($_SESSION['auth_user'], $_REQUEST['story'])) { $handle = db_connect(); $story_code = $_REQUEST['story']; $story = get_story_record($story_code); echo "Keywords for {$story['headline']} 10 9 8 7 6 5 4 3 2 1 "; $query = "select * from keywords where story = $story_code order by weight desc, keyword"; $result = $handle->query($query); if ($result->num_rows) { echo ''; echo 'KeywordWeight'; while ($keyword = $result->fetch_assoc()) { echo " {$keyword['keyword']} {$keyword['weight']} [ echo urlencode($keyword['keyword']); echo "'>del] "; } echo ''; } } ?>