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

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

By Jason - April 23, 2010

Hi,

To put your php into an html design, you need to do the following:

- Copy all of your html code and put it in a .php file.
- Near the top of your file make sure you have a line that looks like this (you'll find it in the code generated by cmsb)
<?php require_once("cmsAdmin/lib/viewer_functions.php"); ?>

- After that, you can put <?php ?> tags directly into the html content. For example:
<div>
<?php echo $record['content']; ?>
</div>


So, to put the content generated by cmsb beside your pictures, just set up html code as if you were going to type the content in yourself, then place the php code where you want the content to be.

I can't actually see the .php code you're using, so if you run into any more trouble, just attach the file you're working with and I'll take a look at it for you.

Hope this helps,
---------------------------------------------------
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, 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

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?