Forum Moderators: coopster
I have a PHP that generates a page with a .php extension.
I want to take that output .php page and display it in an .html file.
For instance: when you view the source on the php file you see all the html that was created by the php page and not the php code in the php file. I need the new html file to contain nothing but html no php.
I hope that makes sense...
My dilemma is such:
My client wants this page to generate a PDF, Their server doesn't have PHP 5+ (or else I'd just use dompdf...), so what I'm doing is just using a 3rd party html to PDF converter. It works great, but since I'm sending it a php page it tries to parse the PDF content and you get errors.
It may be worth speaking to the host to see about a php5 upgrade. This would certainly make things easier.
The main issue I see with converting php to html is that every page address and every link would change. This could be a maintenance headache and may cause a short term drop in se traffic.
Mack.
I know how to allow html files to run php code, but I want the html file to be free of php code. I'm trying to generate a static html page from a php file. I think it's easier then I'm making it sound.
In a simple breakdown:
Take the html that my .php page creates and generate a new .html page. The new .html page should not have any code in it, just the output.
If you simply let the browser access the .php URL then it will not have any PHP code in it. The purpose of the PHP script is to send a page of HTML to the browser. You can only see PHP code in the file if you use FTP to get at the source file. From the browser you will never see PHP code, because the PHP is actually "run" by the server to make a page of HTML.
If you want the user to be using .html URLs to see this content, then either
- set the server up so that .html files are parsed for PHP scripts, or
- set up a a server-internal rewrite so that users use .html URLs, but the server gets the content from the output of the .php script.