Include file

Status
Not open for further replies.

triviata

New Member
Messages
4
Reaction score
0
Points
0
I am new to X10 and have been trying to put together a simple site using the SiteReptile builder. This has been driving me nuts.

I have created a basic page layout from one of the templates and want to include a spearate file (which will change regularly) as the main body of one of the pages.

I have tried both :-

<!--#include file='web_documents/filename.shtml' --> and
<?php include('web_documents/filename.html'); ?>

Neither works. Both files exist in the web_documents subdirectory of public_html. I have tried combinations of full fiepaths, no filepath at all and single/double quotes. The statements appear in the source code when I view the webpage, but are seemingly not being executed. I have also tried a php echo "hello" statement just to see if php works - same result.

I understand from the SiteReptile documentation that I should do this from a 'include code' page, but I cannot find this opion anywhere. I did find that the 'paste html code' button seemed to do the same thing - stored the include statements somewhere and referred to them with a {%paste_filename%} in the body of the page - but nothing appears.

Any suggestions would be welcome.

The page in question is http://www.triviatime.x10hosting.com/index.php?p=1_4_Latest-Scores

Many thanks.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
triviata said:
I have tried both :-


<?php include('web_documents/filename.html'); ?>

The statements appear in the source code when I view the webpage, but are seemingly not being executed. I have also tried a php echo "hello" statement just to see if php works - same result.

If

Code:
<?php include('web_documents/filename.html'); ?>

shows up in the page output, you are doing something very wrong.

Please post the code where the above is supposed to be executed.
 

triviata

New Member
Messages
4
Reaction score
0
Points
0
Thans for the replies, sorry if not posting the actual filename confused the issue. I didn't think it important given that I am having difficulty getting any php code executed.

In my latest attempt I have stopped trying to include a file - to eliminate any issies with pathnames etc. and just used a simple bit of php.

I am using SiteReptile, so I am not putting much actual code in.I created a subpage using a template, and in the box that represents the 'user code' part of the page I clicked on the 'paste html' button and inserted the following :-

name - testphp
code - <?php echo "Hello There"; ?>

what appeaers in the actual document within ~SiteReptile is :-

{%paste_phptest%}

when I view tha tactual page ( http://www.triviatime.x10hosting.com/index.php?p=1_4_Latest-Scores ) the 'hello there' statement doesn't appear, looking that the source code I get the following section of code :-

<td height="100%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="28" valign="top"><IMG SRC="images/d016_07.jpg" WIDTH=28 HEIGHT=284 ALT=""></td>
<td valign="top" class="content"><?php echo "Hello There"; ?></td>
<td width="28" valign="top"><IMG SRC="images/d016_10.jpg" WIDTH=28 HEIGHT=284 ALT=""></td>
</tr>
</table></td>

I won't post the code from the entire page .. it's a bit lengthy.

many thanks.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
Thans for the replies, sorry if not posting the actual filename confused the issue. I didn't think it important given that I am having difficulty getting any php code executed.

In my latest attempt I have stopped trying to include a file - to eliminate any issies with pathnames etc. and just used a simple bit of php.

I am using SiteReptile, so I am not putting much actual code in.I created a subpage using a template, and in the box that represents the 'user code' part of the page I clicked on the 'paste html' button and inserted the following :-

name - testphp
code - <?php echo "Hello There"; ?>

what appeaers in the actual document within ~SiteReptile is :-

{%paste_phptest%}

when I view tha tactual page ( http://www.triviatime.x10hosting.com/index.php?p=1_4_Latest-Scores ) the 'hello there' statement doesn't appear, looking that the source code I get the following section of code :-

<td height="100%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="28" valign="top"><IMG SRC="images/d016_07.jpg" WIDTH=28 HEIGHT=284 ALT=""></td>
<td valign="top" class="content"><?php echo "Hello There"; ?></td>
<td width="28" valign="top"><IMG SRC="images/d016_10.jpg" WIDTH=28 HEIGHT=284 ALT=""></td>
</tr>
</table></td>

I won't post the code from the entire page .. it's a bit lengthy.

many thanks.

HTML:
<td valign="top" class="content"><?php echo "Hello There"; ?></td>

Seems like it's there but something is messed up with SiteReptile :S
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
triviata said:
what appeaers in the actual document within ~SiteReptile is :-

{%paste_phptest%}

Try removing this line and replacing it with <?php echo "Hello There"; ?>

The problem is, I have no idea how SiteReptile works. index.php clearly controls the site, but if all it does is put together pieces/templates with some basic template substitution, it may never run the final page through PHP.
 
Last edited:

TonnyORG

I Code Things
Community Support
Messages
5,907
Reaction score
16
Points
38
THREAD CLOSED

I believe that this issue has been resolved. If you need further support, please re-open this thread.
 
Status
Not open for further replies.
Top