简体   繁体   中英

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.

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.

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.

In invoice.php , redirect it the success page or back to the page using header() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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