简体   繁体   English

如何在PHP中提交表单时提供href链接

[英]How to give a href link while submitting a form in php

Actually while inserting the data into database iam passing the link to redirect that to another page but it is not submitting the form can any one help me regarding that...Please find the below link which i used 实际上,在将数据插入数据库iam时,通过链接将其重定向到另一页,但它没有提交表单,对此有何人可以帮助我...请找到我使用的以下链接

<div>
<textarea  name="comments"  rows="2" cols="100" placeholder="comments..."></textarea><br/>
</div>

<a class="btn btn-default pull-right"  
    href="<?php echo button_link."/details&cusid=".$orderdetail['customer_order_id'];?>" role="button">Submit</a>

/details&cusid= is incorrect, should be /details?cusid= /details&cusid=不正确,应该是/details?cusid=

First query string parameter comes after ? 第一个查询字符串参数后面是? sign, not after & sign. 签署,而不是在&签署之后。 That is why your /details page is not seeing cusid value. 这就是为什么您的/details页面看不到cusid值的原因。

Change your url: 更改您的网址:

"/details&cusid=".$orderdetail['customer_order_id'] to "/details?cusid=".$orderdetail['customer_order_id']

If you want to display the data use $id = $_GET['cusid']; 如果要显示数据,请使用$id = $_GET['cusid'];

Select * FROM tablename WHERE fieldname = $id;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM