Jump to content

Printing invoice problem


graham23s

Recommended Posts

Hi Guys,

 

In my ecommerce site i have a button called "Print Invoice" when i click it i use a little javascript to goto: www.mysite.com/invoice.php

 

that works great, it shows the invoice page fine, when i try to append the order id number i get:

 

Not Found

 

The requested URL /v2/invoice.php&order-id=109 was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

my onclick code:

 

function print_invoice(order_id) {
var l = screen.availWidth / 2 - 450;
var t = screen.availHeight / 2 - 320;
var win = window.open('http://www.site.co.uk/v2/invoice.php&order-id='+order_id, 'orderInvoice', 'width=900,height=650,left='+l+',top='+t+',scrollbars=1');
//var win = window.open('http://www.site.co.uk/v2/invoice.php', 'orderInvoice', 'width=900,height=650,left='+l+',top='+t+',scrollbars=1');
}

 

i'm not sure if this is a javascript or PHP question as i use both for it to work lol

 

the minutei appends the url i get not found but if i take away that it shows up fine.

 

thanks for any help guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/141210-printing-invoice-problem/
Share on other sites

/v2/invoice.php&order-id=109

should be

/v2/invoice.php?order-id=109

& is used to separate parameters within the URL, but it needs a ? to split the script name from the parameters, otherwise the & and what follows is treated as part of the filename... hence a 404 error

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.