Using PHP code on an htm page
21 posts by 2 authors in: Forums > CMS Builder
Last Post: April 23, 2010 (RSS)
Re: [jsnook] Using PHP code on an htm page
By Jason - April 22, 2010
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
Re: [jsnook] Using PHP code on an htm page
By jsnook - April 22, 2010
Re: [jsnook] Using PHP code on an htm page
By Jason - April 22, 2010
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
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
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
http://www.cottagenet.com/ventry-cottage.htm
php File attached
Re: [jsnook] Using PHP code on an htm page
By Jason - April 23, 2010 - edited: April 23, 2010
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
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?