I’m struggling with something that I thought would be more straightforward. Hopefully it is and I’m just being a bit slow today.
I want to use HTML2PDF to generate a PDF on the fly with the stock details based on a specific ID.
I have a page that generates the required HTML so that if I open the URL html_generator.php?stockID=1 I get the HTML code that would be required to generate the PDF.
Problem I’m having is getting that stockID into play with a second page pdf_generator.php which passes the html to the html2pdf class and outputs the PDF.
If I use $html=file_get_content(html_generator.php?stockID=1) it looks for that exact URL rather than seeing the get part separately. Same problem if I include that URL.
If call pdf_generator.php?stockID=1 and try to assign $id=$_GET[‘stockID’], I get an error message relating to headers already being set.
If anyone has any ideas for finding a solution to this, it would be very much appreciated.
Thanks in advance.