Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
txp:php inside txp:hide on a page hangs
When I put <txp:hide><txp:php> [php stuff] </txp:php></txp:hide>
on a page (with php on pages allowed in admin), then the entire server locks up when the web page is accessed. Even the admin side gets hung up. I am running 4.8.8. Is this a known thing? I’m going to put the php into a form to avoid this issue, but this is php code that is going to only ever be used on this one page.
Offline
Re: txp:php inside txp:hide on a page hangs
skewray wrote #339750:
When I put
<txp:hide><txp:php> [php stuff] </txp:php></txp:hide>
on a page (with php on pages allowed in admin), then the entire server locks up when the web page is accessed. Even the admin side gets hung up. I am running 4.8.8. Is this a known thing? I’m going to put the php into a form to avoid this issue, but this is php code that is going to only ever be used on this one page.
what happens if you add the php this way :
<?php //Code goes here... ?>
…. texted postive
Offline
Re: txp:php inside txp:hide on a page hangs
bici wrote #339751:
what happens if you add the php this way :
<?php //Code goes here... ?>
You can’t do that, as far as I recall. Pretty sure we outlawed it but I might be wrong.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: txp:php inside txp:hide on a page hangs
skewray wrote #339750:
When I put
<txp:hide><txp:php> [php stuff] </txp:php></txp:hide>
on a page (with php on pages allowed in admin), then the entire server locks up when the web page is accessed.
Not seen that before but then I’ve not put php inside a hide block. Why are you doing that? To prevent it running?
If you want it to run, but still be “hidden”, you should probably use (untested)
<txp:hide process>
<txp:php> [php stuff] </txp:php>
</txp:hide>
Otherwise, yeah, farm it out to a form and call it as a shortcode, an override form, or use <txp:output_form>
.
Last edited by Bloke (2025-05-31 21:47:09)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: txp:php inside txp:hide on a page hangs
I wanted to clip out the php while I was testing, so it wouldn’t run. The documentation for <txp:hide> and/or <txp:php> should probably have a few words about this potentially not working as expected. Then, if any idiot like me every tries it again, you can say, “RTFM”.
(Four or five times now I’ve tweaked the php and consequently hung up the entire server; can’t even ssh in. Hang-up lasts for about a minute. This is making me gun-shy about tinkering with my old php. I don’t know if it’s a Txp thing, a Php thing, or a my-C-code thing. The C-code is runtime and size limited, so that’s the least likely.)
Offline
Re: txp:php inside txp:hide on a page hangs
Ah right okay. We’ll have to check why it’s doing this? I wonder if it’s due to the content or if it’ll hang if we just comment out hello world?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: txp:php inside txp:hide on a page hangs
Bloke wrote #339755:
Ah right okay. We’ll have to check why it’s doing this? I wonder if it’s due to the content or if it’ll hang if we just comment out hello world?
For what it’s worth… I added this to a page and nothing bad happens
<txp:hide><txp:php> <?php echo "Hello World!"; ?> </txp:php></txp:hide>
BUT adding this causes an error
<txp:php> <?php echo "Hello World!"; ?> </txp:php>
Last edited by bici (2025-06-01 19:52:38)
…. texted postive
Offline
Offline
Re: txp:php inside txp:hide on a page hangs
As was 99% likely, it is somehow my fault. If I ever figure out what stupid thing I am doing, I’ll post here.
Offline