创建一个带有评级系统的(简单)flash游戏网站


Creating a (simple) flash game website with rating system

各位,

对于学校,我需要做一个网站,在那里你可以玩flash游戏,通过文本形式和使用数字系统的投票系统(即1 =非常糟糕,10 =非常好)来评价游戏。

现在我想做的是:

每个游戏类别都有一个索引页,用户可以点击游戏名称并被引导到脚本加载游戏的另一个页面。

到目前为止,我已经为索引(母版)页编写了以下代码:
    <!DOCTYPE html>
    <?php
        include("dbconnect.php");
    ?>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Master page</title>
    </head>
    <body>
        <?php
            //Place all data from this mySQL query in $result.
            $result = mysql_query("SELECT * FROM gamesDB");
            //While a row of data exists, put that row in $data as an associative array.
            while($data = mysql_fetch_assoc($result)) {
                //Echo a link to all the games in the MySQL database.
                echo "<a href='detail.php?id=" . $data['ID'] . "'>";
                    //Echo the games name in the url.
                    echo $data['Spel'];
                //Echo the closing tags
                echo "</a>";
                echo "<br />";
            }
        ?>
    </body>
</html>

这是游戏(细节)页面。

    <!DOCTYPE html>
    <?php
        include("dbconnect.php");
    ?>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Detail page</title>
    </head>
    <body>
        <?php
            //Place all data out of the database, with the ID number retrieved out of the url into $result.
            $result = mysql_query("SELECT * FROM gamesDB WHERE id = '" . $_GET['id'] . "'");
            //While a row of data exists, put that row in $data as an associative array.
            while($data = mysql_fetch_assoc($result)) {
                //Retrieve the files name from the database and place it in the <embed> tags as src="...".
                echo "<embed width='800' height='512' src='" . $data['file'] . "' type='application/x-shockwave-flash'></embed>";
                //Echo the games name
                echo "Spel: " . $data['Spel'] . "<br />";
                //Echo the points (not yet functional)
                echo "Punten: " . $data['Punten'] . "<br />";
                //Echo all reactions from users regarding this game.
                echo "Reacties: " . $data['Reactie'] . "<br />";
            }
        ?>
    </body>
</html>

当我点击主页中的链接时,我被重定向到详细页面,但不幸的是,游戏没有加载。

在我的MySQL数据库中,我将文件名添加到ID为1的第一行。我想,当我在标签中查询文件名时,它会加载游戏,但它说(当我右键单击游戏应该显示的框时)"影片未加载……"

有谁能帮我把这个修好吗?是我想错了,还是我走对了方向?

因为是学校的作业,所以不需要担心任何SQL注入漏洞。

谢谢!

我实际上忘记在文件列中添加一个条目。既然我在"<embed>"上遇到的问题已经解决了,我想把重点放在如何将用户评论添加到我的"评论"列上,并显示每个评论。我想找到自己的代码尽可能多,所以你可以只是反应我的问题与指针,而不是写完整的代码,我将非常感激。