Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-08-24 11:49:55

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Code snippet disables save

This is really weird – but it might be my inexpertise in this area not understanding something simple.

I have an existing and functional TXP install hosted on my Dreamhost account
Wanting to have a ‘feed’ of an associated PunBB forum on the front page, so I went to add this snippet of code (gleaned from another thread here) in a page template:
<code>
<txp:php>
$ch = curl_init(“http://xxxxxxxx.org/forum/extern.php?action=active&show=5”);
curl_exec($ch);
curl_close($ch);
</txp:php>
</code>

When I try to save the page template, I get a 503 error (database unavailable or busy).
I tried saving it in a form. Same thing.

Everything else works fine. The site works, I can read/save from the TXP backend – except for a page or form with that piece of code in it. If I remove the code snippet, it saves fine.

I got around it by inserting the code directly into the db via phpmyadmin, but I am very curious as to what is happening to cause this.
Oh, and it was the same in FF and IE6, and after a reboot (unrelated).

If it helps, I’m running PHP ver5.x.x and MySQL 4.x.x

Thanks for any pointers.


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

#2 2006-08-24 13:13:08

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,340
Website GitHub Mastodon

Re: Code snippet disables save

Perhaps a mod_security related phenomenon?

Offline

#3 2006-08-24 14:43:11

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

Re: Code snippet disables save

Neil, this is what I do on one of my sites:
<code><?php include ‘http://phpxref.net/extern.php?action=new&show=10&fid=3’; ?></code>
I have it in a form that’s called from a page template, works ok.

Offline

#4 2006-08-24 20:11:32

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Re: Code snippet disables save

wet wrote:

Perhaps a mod_security related phenomenon?

Thanks Wet. Interesting reading. Haven’t tried playing with .htaccess, because I figure I was seeing the right error message.
I’ll have to go and search through my hosts wiki for clues.


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

#5 2006-08-24 20:13:26

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Re: Code snippet disables save

hcgtv wrote:

Neil, this is what I do on one of my sites:
<code><?php include ‘http://phpxref.net/extern.php?action=new&show=10&fid=3’; ?></code>
I have it in a form that’s called from a page template, works ok.

Thanks Bert, but Dreamhost don’t allow includes for security reasons. The code snippet I use is actually their alternative – not that I understand Curl at all.

Cheers


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

#6 2006-08-24 23:39:46

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

Re: Code snippet disables save

Neil,

An alternative would be to use PunBB’s RSS script, which is what I use in certain cases, and then use a plugin like bit_rss to read in the feed, which adds the ability to cache it.

You could use extern.php and output it as RSS but rss.php does a better job of formatting the output for a proper feed. I use rss.php to feed the latest comments on hcgtv from PunBB’s associated forum, it’s on the side menu under News feeds.

Last edited by hcgtv (2006-08-24 23:43:45)

Offline

#7 2006-08-25 00:12:35

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Re: Code snippet disables save

Thanks Bert, that gives me a few options to look at.

The snippet of Curl is actually working (having pasted it in via phpmyadmin), so I’ll see how it goes, and play around with the RSS options on the side.

Cheers


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

Board footer

Powered by FluxBB