简体   繁体   English

PHP和href-链接执行2个动作

[英]Php and href - link executing 2 actions

I would like that a link in admin page to generate two actions at once. 我想要管理页面中的链接一次生成两个动作。 First one is creating an invoice for an order( which it does today) and secondly put it in a certain status, which we have numbered 1-6. 首先是为订单创建发票(今天完成),然后将其置于特定状态,我们将其编号为1-6。

Here is the code which today create an invoice: 这是今天创建发票的代码:

echo '<a target="_blank" onClick="window.location.href=window.location.href" href="invoice.php?createInvoice&container=ALL&orderId='.$row['id'].'">Create Invoice</a>';

What I would like is to make use of this code when I click the link is: 我想要的是在单击链接时使用此代码:

?showorder&status=6&id

To put it in a status 6. 使其处于状态6。

Is it possible to add it somehow or do I have to do something else? 是否可以以某种方式添加它,还是必须做其他事情?

onClick="window.location.href=window.location.href"

Remove this segment because there is no need for you to reload it when you're already hrefing it to your PHP. 删除此段,因为当您已经将其引导到PHP时不需要重新加载它。

In invoice.php , redirect it the success page or back to the page using header() . invoice.php ,将其重定向到成功页面或使用header()返回到页面。

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

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