A good parameter php file, want to get the final display of the HTM file, in the background how can do?
Reply to discussion (solution)
Save the results of the PHP program output to a file
Save the results of the PHP program output to a file
What do you do in the background? Could you elaborate on that, please?
Like a PHP
<?php echo $title;? >
Other PHP files are also included, $title set in other files, and other include files
What do I do if I want to get the HTM file from the last browser?
Ob_start (' HTML ');
function html ($s) {
File_put_contents (basename ($_server[' php_self '). '. htm ', $s);
}
//......
Using the template engine
What does LZ mean by "display"?
If the client display code is in HTML format, then PHP simply uses echo.
If the client sees a URL that is an HTML extension, it can be used pseudo-static or directly in Apache to specify PHP parsing *.html
What does LZ mean by "display"?
If the client display code is in HTML format, then PHP simply uses echo.
If the client sees a URL that is an HTML extension, it can be used pseudo-static or directly in Apache to specify PHP parsing *.html
For example, I now have a a.php?p1=a&p2=b, I want to generate an HTM file that shows the contents of the previous PHP file with the parameters.
Just want to get a browser like PHP as the effect of the HTM, I would like to have done a bit of guidance
The moderators have already said
You check these 3 functions Ob_start ob_get_contents file_put_contents
echo file_get_contents (' http://www.domain.com/index.php?action=xxx '); Get the generated HTML directly
Generate an HTM file when calling A.php?p1=a&p2=b, then you can access the page with the HTM directly, see # #
Call a.php?p1=a&p2=b directly display the HTM file page, the direct echo
Are you trying to say, pseudo-static?
Rewrite ^ (. *)/index_ (\d+) _ (\d+) _ (\d+). html$ $1/index.php?val1=$2&val2=$3&val3=$4 last;
This is mainly to transform/index.php?val1=121&val2=222&val3=232 into/index_121_222_232.html form.
You use IE (Chrome) to open the PHP site, do not want to see HTML is not.
Rewriteengine on
AddType application/x-httpd-php. html. htm
Use
Htaccess, use the above statement to change all PHP to a static suffix.