无法使 href link 工作
Cannot make a href link to work
我正在尝试在网站上添加分页,但遇到了这个问题。
我有以下行,但我必须输入 index.php?view_vehicles
.
而不是 index.php
这是行:
echo "<a href='index.php?page=$next'>Next</a> ";
第一次遇到这个问题,不知道怎么解决。
您应该在回显的字符串中连接变量 $next:
echo "<a href='index.php?page=".$next."'>Next</>";
来自评论:
"It must be something like this: <a href='index.php?view_vehicles?page=$next'>Next</a>
but it's now working this way. – AndreiCT
,额外的 GET 参数需要在第一个参数之后 &
,而不是 2x ?
.
<a href='index.php?view_vehicles&page=$next'>Next</a>
我正在尝试在网站上添加分页,但遇到了这个问题。
我有以下行,但我必须输入 index.php?view_vehicles
.
index.php
这是行:
echo "<a href='index.php?page=$next'>Next</a> ";
第一次遇到这个问题,不知道怎么解决。
您应该在回显的字符串中连接变量 $next:
echo "<a href='index.php?page=".$next."'>Next</>";
来自评论:
"It must be something like this:
<a href='index.php?view_vehicles?page=$next'>Next</a>
but it's now working this way. – AndreiCT
&
,而不是 2x ?
.
<a href='index.php?view_vehicles&page=$next'>Next</a>