Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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.
Offline
Re: Code snippet disables save
Perhaps a mod_security related phenomenon?
Offline
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.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
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.
Offline
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
Offline
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)
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
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
Offline
Pages: 1