thinkphp5url跳转传参
<formaction="{:url('index/seek/bind'}"method='post'><divclass="weui-cellsweui-cells_f...
<form action="{:url('index/seek/bind'}" method='post'>
<div class="weui-cells weui-cells_form">
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">学号</label></div>
<div class="weui-cell__bd">
<input class="weui-input" type="text" name="kh" value="" placeholder="请输入学号">
</div>
</div>
</div>
<div class="weui-btn-area">
<a href="{:url('index/seek/bind','kh=1')}" class="weui-btn weui-btn_primary">确定</a>
</div>
</form>
我想在{:url('index/seek/bind'}生成的url后面加上input文本框里的值,应该怎么做? 展开
<div class="weui-cells weui-cells_form">
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">学号</label></div>
<div class="weui-cell__bd">
<input class="weui-input" type="text" name="kh" value="" placeholder="请输入学号">
</div>
</div>
</div>
<div class="weui-btn-area">
<a href="{:url('index/seek/bind','kh=1')}" class="weui-btn weui-btn_primary">确定</a>
</div>
</form>
我想在{:url('index/seek/bind'}生成的url后面加上input文本框里的值,应该怎么做? 展开
1个回答
展开全部
method='post' 改成 method='get'
get会在地址栏里显示传递的参数。
post不会在地址栏里显示。
追问
改成get也没有带参数,能麻烦帮我写个完整demo吗?
追答
<form action="{:url('index/seek/bind')}" method='get'>
<div class="weui-cells weui-cells_form">
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">学号</label></div>
<div class="weui-cell__bd">
<input class="weui-input" type="text" name="kh" value="" placeholder="请输入学号">
</div>
</div>
</div>
<div class="weui-btn-area">
<a href="{:url('index/seek/bind','kh=1')}" class="weui-btn weui-btn_primary">确定</a>
<input type="submit" value="提交">
</div>
</form>
method=get
submit按钮
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询