Page 1 of 1

Problem with PHP in template!

Posted: Sat Jul 02, 2011 6:40 pm
by laits
I have read up on the forum about how to do this, and understand that I need to put my php inside either {php} tags (and enable in config) or put in a UDT.

The first problem i'm having is that every time I try and submit either I get a 403 Forbidden. But it seems only when I am including php in either the template or UDT???

Obviously I'm falling at the first hurdle here...

Secondly the developer ( for a real estate listing website) has said:-
The code contained in the index.php file will need to be placed in the containing element where you wish the results to be display except for the first and last lines which will need to be placed on the first and last lines of your document.
These first and last lines are:-

Code: Select all

<!--place this on line 1-->
<? ob_start(); ?>
<!--place this on line 1-->

Code: Select all

<!--place this on last line-->
<? ob_flush(); ?> 
<!--place this on last line-->
Should I just wrap them in {php} tags and put then in on first and last lines of template (respectively), or will this not work.

Thirdly (and lastly) there is also a config.php for this script, where should i put this and how do i link it. in the first line of the main script there is the line:-

Code: Select all

require("config.php");
if i make this a full path to the directory where i place the config.php, will this work? If not how can I do this?

I obviously can't try the trial and error method, as I can't even complete step one :-(

I have built about 50 sites on cmsms and never needed an ounce of php knowledge (I know a little bit), so please forgive my lack of detailed understanding of both php and trying to intergrate it into cmsms.

Worst case scenario I'll have to build a page outside of the cms, but thats a bit of a cop out in my opinion.

Any help/direction much appreciated.

Rich