DRB184 Posted September 19, 2007 Share Posted September 19, 2007 Here's the situation. I have a site using HTML - nothing fancy, because I am NOT a programmer. The site is made up of pages that have a couple of tables that has data etc in them. I don't want to change the site completely, but in upgrading it, I have come across a fabulous program written in PHP that does what I want. What I want to do (if it can be done) is run the PHP program within the table in the HTML page. Let me stress, that I am no programmer so please keep that in mind and keep answers simple...please. I have done some research (although what I have read has mostly gone over my head) but I can tell you that renaming the page to a .php is out of the question - it has to remain a SHTML as it is one page of a site that all runs server side includes. So, is it possible to load the HTML page, with the PHP program running within one of the tables and have the PHP continue to run within this table, independant of the HTML page....and if so...how? Thanks in advance for your help, David. Quote Link to comment https://forums.phpfreaks.com/topic/69859-include-php-program-into-html-table/ Share on other sites More sharing options...
trq Posted September 19, 2007 Share Posted September 19, 2007 If your running your site on an Apache server you can add the following... AddType application/x-httpd-php .html to your .htaccess file. This will process all .html files as php. You can then simply use php to include the script wherever you need it. eg; <table><?php include 'phpscript.php'; ?></table> Quote Link to comment https://forums.phpfreaks.com/topic/69859-include-php-program-into-html-table/#findComment-350919 Share on other sites More sharing options...
DRB184 Posted September 19, 2007 Author Share Posted September 19, 2007 Thanks for the quick reply. I did exactly this and there was nothing. Yes I did change the "phpscript.php" to the correct path and file name. I also made sure the table content worked by putting in a picture, but this program did nothing. David. Quote Link to comment https://forums.phpfreaks.com/topic/69859-include-php-program-into-html-table/#findComment-350991 Share on other sites More sharing options...
trq Posted September 19, 2007 Share Posted September 19, 2007 Did the php code itself display within the table? Quote Link to comment https://forums.phpfreaks.com/topic/69859-include-php-program-into-html-table/#findComment-350998 Share on other sites More sharing options...
Sorthy359 Posted September 19, 2007 Share Posted September 19, 2007 you can try using an html iframe with no borders to a seperate .php file but that might be dumb. also make sure your hosting supports php. Quote Link to comment https://forums.phpfreaks.com/topic/69859-include-php-program-into-html-table/#findComment-351004 Share on other sites More sharing options...
DRB184 Posted September 19, 2007 Author Share Posted September 19, 2007 My host does support PHP - my host is at www.servage.net where you can see all their technical details. I also don't understand what you mean by html iframe. To answer Thorpe - nothing displayed, not even the code. Thanks, David. Quote Link to comment https://forums.phpfreaks.com/topic/69859-include-php-program-into-html-table/#findComment-351490 Share on other sites More sharing options...
trq Posted September 19, 2007 Share Posted September 19, 2007 We need to see some code. Quote Link to comment https://forums.phpfreaks.com/topic/69859-include-php-program-into-html-table/#findComment-351503 Share on other sites More sharing options...
MmmVomit Posted September 20, 2007 Share Posted September 20, 2007 If your running your site on an Apache server you can add the following... AddType application/x-httpd-php .html to your .htaccess file. This will process all .html files as php. You can then simply use php to include the script wherever you need it. eg; <table><?php include 'phpscript.php'; ?></table> Try this, and let us know what happens. <table><tr><td><?php echo "One plus two equals " . (1 + 2) ?></td></tr></table> Quote Link to comment https://forums.phpfreaks.com/topic/69859-include-php-program-into-html-table/#findComment-351575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.