Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-04 23:22:37

scdoody
Member
Registered: 2006-10-18
Posts: 129

Include file in a static article

I have an article which is set to static – it is for my contact page. I want to have a form on this page. So I decided to make another page – contact.php – and then just do an include within my article.

How do I do an include within my article? I tried this, but it does not work:

<?include_once(“contact.php”);?>

Thanks!!!!!!!!!!!!!!!!!

Offline

#2 2006-11-04 23:35:28

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Include file in a static article

You have to use txp:php

Offline

#3 2006-11-04 23:45:55

scdoody
Member
Registered: 2006-10-18
Posts: 129

Re: Include file in a static article

Perfect – thanks so much!!!

This is my code in my article:

<txp:php> include_once(“contact.php”);
</txp:php>

But – this is the error I get on my article page:

Parse error: parse error, unexpected ‘&’ in /home/virtual/site115/fst/var/www/html/textpattern/publish/taghandlers.php(2688) : eval()’d code on line 2

I checked that taghandeler file – and the second line just has a bunch of php comments.

Has anyone seen this error before?

Offline

#4 2006-11-05 00:36:20

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Include file in a static article

FAQ

Offline

#5 2006-11-05 01:29:11

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Include file in a static article

…eval()’d code on line 2…

That means the error is in your contact.php file.

Offline

#6 2006-11-05 17:45:59

scdoody
Member
Registered: 2006-10-18
Posts: 129

Re: Include file in a static article

As a test, I made content.php just a totally blank file and I still get the error:

Parse error: parse error, unexpected ‘&’ in /home/virtual/site115/fst/var/www/html/textpattern/publish/taghandlers.php(2688) : eval()‘d code on line 2

Does anyone have any other ideas?

Thanks!!!

Offline

#7 2006-11-06 17:29:57

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Include file in a static article

Sorry, Textile is monkeying with the tag. Do:

notextile. <txp:php>include_once('contact.php');</txp:php>

Offline

#8 2006-12-14 16:17:34

cellseven
Member
From: St. Louis
Registered: 2006-12-05
Posts: 20
Website

Re: Include file in a static article

I’ve tried the same thing many times over with notextile. and notextile.. include, include_once, nothing, article set to do not format, nothing seems to want to pull in a page, I get the same errors.

@scdoody: Did you ever get this working?


jack [at] cell7*orgCRAP

Offline

#9 2006-12-15 13:49:11

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Include file in a static article

…nothing seems to want to pull in a page, I get the same errors.

The formatting once it is included has zero to do with actually including the file; you will have to check the contents of your file for errors. Without actually seeing your file and the errors you’re getting, that’s as far as we can help.

Offline

Board footer

Powered by FluxBB