Jump to content

Include PHP program into HTML table???


DRB184

Recommended Posts

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.

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.