我正在用以下重定向php页面
<a href='invoice_details.php?ppid=".$row['sno']."'..
但我想用其他条件重定向这个可以吗
<a href='invoice_details.php?ppid=".$row['sno']." and 'invoice_details.php?pinv=".$row['invno']."'
您可以使用:
<a href="yourscript.php?variable1=one&variable2=two&variable3=three">Link</a>
然后在php:中
$variable1 = $_GET['variable1']; // one
$variable2 = $_GET['variable2']; // two
$variable3 = $_GET['variable3']; // three
在您的示例中:
<a href='invoice_details.php?ppid=".$row['sno']."&pinv=".$row['invno']."'>link</a>
这里有一个关于&
表示法的小解释:编码问题,覆盖&;到&使用php的html最好用实体&
编写html链接,而不是简单的&
。
获取更多文档:http://php.net/manual/en/reserved.variables.get.php.请记住对您的get值进行一些检查,不要直接在网站上保存/发布它们,因为这可能会产生一些安全问题
用户amerpsand向您的url添加参数:
<a href='invoice_details.php?ppid=".$row['sno']."&pinv=".$row['invno']."'....