Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Yesterday 09:37:15

astick360
Member
Registered: 2022-05-05
Posts: 21

Site can't render in browser

Hello,

I have a problem about rendering html code with javascript and php on my site.

I added php code and javascript code into forms and try to use them. JavaScript alone, sorta works, slider shows up and html reads correctly.

But as soon as I add php form to the site, the wole html code and JavaScript stops working and displays in one big <pre> tag. Php code works great, it does what it should by taking data from the database as we can see displayed ( i called it in head tag). How to make it work?

Offline

#2 Yesterday 09:42:52

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,717
Website

Re: Site can't render in browser

Can you show us how you are including it in your page template or form?

Maybe you just need to wrap it in <txp:php>…</txp:php>. PS: The code printed is missing an opening <script> tag.


TXP Builders – finely-crafted code, design and txp

Offline

#3 Yesterday 13:21:49

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 237
Website

Re: Site can't render in browser

Do you have this kind of stuff in the page template:

<txp:header name="Content-Type" value="application/json; charset=utf-8" />

Offline

Board footer

Powered by FluxBB