How do I output information from a PHP page to an HTML page?
I have a .php web page with these lines:
Code:
//gather all the comments How can I transfer this number over? |
You can have php modify the html file.
You can create a link to the html file with GET vars in the link, then have something like javascript in the html file display the GET vars. Is there a reason that html file needs to be an html file? This may be a lot easier if it were a php file. You know, you can simply rename a .html file to a .php file & it will display the same.... then you can write php code iside of a php tag in the file & it will work the way you may expect. |
if it does need to be a .html file (for whatever reason, such as SEO [.html file is better than xyz.php?a=b&c=d&e=f etc...] ) but want to insert .php in there, then either
a) enable mod_rewrite and tweak around or b) add .html to this line in your apache configuration "AddType application/x-httpd-php .php .phtml .php3" while b) is faster / simpler, a) in the end is cleaner, and also has other benefits |
Hi -
The whole point of PHP is that it lets you modify your HTML before you send it to the server! Suggestion: name *all* the pages on your site ".php". Even if they're pure HTML. For example: Code:
<html> Code:
<html> PS: Please consider the suggestion about looking at bulletin board software I made in the previous post. But I'm glad your looking at mySQL to store your comments, and it looks like you're making great progress! |
All times are GMT -5. The time now is 05:18 PM. |