Using PHP code on an htm page

21 posts by 2 authors in: Forums > CMS Builder
Last Post: April 23, 2010   (RSS)

By jsnook - April 22, 2010

How do i access your revised code?

Re: [jsnook] Using PHP code on an htm page

By Jason - April 22, 2010

Hi,

You should be able to see it above. If not, try this:
<script type="text/javascript">
window.location = "mypage.php";
</script>

---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By jsnook - April 22, 2010

Yes, this does work - making progress now. The only problem is that the php file occupies the entire window and I want it to fit into the exisiting web page in a defined area. Can this be modified

Re: [jsnook] Using PHP code on an htm page

By jsnook - April 22, 2010

I got a link but it was the same message as previously. Resend please?

Re: [jsnook] Using PHP code on an htm page

By Jason - April 22, 2010

Hi,

You should be able to insert your php into your existing design. Send me a link to your php page and attached the php file to this thread and I'll take a look at it for you.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [jsnook] Using PHP code on an htm page

By jsnook - April 23, 2010

I am trying to get this file (generated by your cms)

http://www.cottagenet.com/cms/barnes/content.php

showing in the blank space besidr the 4 photos on this htm page:

http://www.cottagenet.com/ventry-cottage.htm

Many thanks

By jsnook - April 23, 2010

Thanks, but it does not work as the html will not parse the php code. It does work in an ifram but the text is not "live"- see below:

http://www.cottagenet.com/ventry-cottage.htm



php File attached
Attachments:

content.php 2K

Re: [jsnook] Using PHP code on an htm page

By Jason - April 23, 2010 - edited: April 23, 2010

Hi,

A file with a .html (or .htm) extension will not execute php code. You need to have all of your code (html and php) in a file with a .php extension (example: ventry-cottage.php)

Now, I know you were worried about losing your search engine ranking. If you put the redirection code (and only that) inside your old .htm file to redirect to your new .php file, links to your old .htm files will still work.

First, just try to get all of your code (html and php) inside one .php file and get that to work.

Give it a try and let me know if you run into any issues.

P.S.
You can also look at this page for some more suggestions for getting the .htaccess file to work:
http://www.interactivetools.com/docs/cmsbuilder/file_extensions.html
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By jsnook - April 23, 2010

Thanks. I have already managed to get all the code to run on a php page. My site actually has about 300 htm pages that need to maintain their htm status (because of ranking) so your solution is not really practical. There must be a way of including the php file in the htm page without having to use an iframe. I have tried about every configuration of .htaccess (many from the internet) but none work as my server is a Zeus rather than apache.

We may be going round in circles now - sorry for that! I am making limited use of the cms Builder (using iframes where the lack of live text does not matter) but the example above needs to be live text. Any more ideas?