graham23s Posted January 17, 2009 Share Posted January 17, 2009 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 More sharing options...
Mark Baker Posted January 17, 2009 Share Posted January 17, 2009 /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 Link to comment https://forums.phpfreaks.com/topic/141210-printing-invoice-problem/#findComment-739071 Share on other sites More sharing options...
graham23s Posted January 17, 2009 Author Share Posted January 17, 2009 Thanks Mark that worked perfectly cheers Graham Link to comment https://forums.phpfreaks.com/topic/141210-printing-invoice-problem/#findComment-739084 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.