如何知道点击了哪个广告并将该数据发送到单个页面

时间:2016-10-02 05:14:25

标签: python flask e-commerce

我正在练习一个烧瓶网站,这是一个模拟分类网站。在浏览页面上,我显示用户搜索的所有结果。如何跟踪用户点击的广告,以便我可以将其重定向到“单身”页面,更详细地显示他们点击的项目...?

我的第一直觉是使用会话,但我无法弄清楚逻辑。我正在动态呈现数据,在HTML模板中,数据包含所有查询结果:

<ul class="list">

                    {% for row in data %}

                            <a href="/iLike/">
                                <li>
                                    <img src="{{ url_for('static', filename='images/logo.png') }}"
                                         title="" alt=""/>
                                    <section class="list-left">

                                        <h5 class="title">{{ row[1] }}</h5>

                                        <p class="catpath">
                                            <Strong>Condition</strong>: {{ row[3] }}</p>
                                        <p class="catpath"><Strong>details</strong>: {{ row[2] }}</p>
                                        <p class="catpath"><strong>Looking for</strong>: {{ row[5] }}</p>
                                    </section>

                                    <section class="list-right">
                                        <span class="date">{{ transType }}</span>

                                    </section>
                                    <div class="clearfix"></div>
                                </li>
                            </a>

1 个答案:

答案 0 :(得分:1)

为链接添加一些参数 - 即href="/iLike/?ad_number=1"href="/iLike/1"(路由/函数中的第二个版本需要参数)