如何知道点击了哪个广告并将该数据发送到单身页面
How to know which ad was clicked and send that data to a singles page
我正在练习一个类似模拟分类网站的 flask 网站。在浏览页面上,我显示了用户搜索的所有结果。我如何跟踪用户点击了哪个广告,以便我可以将他们重定向到 'singles' 页面,该页面将更详细地显示他们点击的项目...?
我的第一直觉是使用会话,但我不太明白其中的逻辑。我正在动态呈现数据,在 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>
向 link 添加一些参数 - 即 href="/iLike/?ad_number=1"
或 href="/iLike/1"
(第二个版本需要 route/function 中的参数)
我正在练习一个类似模拟分类网站的 flask 网站。在浏览页面上,我显示了用户搜索的所有结果。我如何跟踪用户点击了哪个广告,以便我可以将他们重定向到 'singles' 页面,该页面将更详细地显示他们点击的项目...?
我的第一直觉是使用会话,但我不太明白其中的逻辑。我正在动态呈现数据,在 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>
向 link 添加一些参数 - 即 href="/iLike/?ad_number=1"
或 href="/iLike/1"
(第二个版本需要 route/function 中的参数)