Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-07-31 12:49:25

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,504
Website

Re: Error 406 Not Acceptable

gilibaus wrote #318899:

@jakob thanks for your suggestion. Tried to save the form and got the same 406 error :(

Right. That does sound like maybe your host is filtering out such code. You’re on Textpattern 4.7+? How about:

  • Export your current theme to disk from the Presentation › Themes panel so that you have the most recent version on your server as files.
  • Upload your <txp:php>…</txp:php> code as a file called get_show_stats.txp in the /themes/your-theme/forms/misc/ folder.
  • From the Presentation › Themes panel, update/import the files into your database. I’m hoping that the host won’t scan that during the import procedure.
  • Now try the output_form in your article body:
<txp:output_form form="get_show_stats" />

TXP Builders – finely-crafted code, design and txp

Offline

#12 2019-07-31 14:27:17

gilibaus
Member
From: Milan, Italy
Registered: 2013-08-14
Posts: 67
Website

Re: Error 406 Not Acceptable

Thank you. Unfortunately I am on Textpattern 4.5.7 but after reading your suggestion a light bulb turned on in my head. I created the form directly in the database via phpMyadmin, and it worked. Filter bypassed. Now there is a new issue though: when I load the file called file.php, which is a file I use to test the php code, it works fine and the resulting number updates (if that’s the case). The same code but in the get_show_stats form does NOT update the resulting number when I refresh the page the form is inserted into. Any idea why?

Last edited by gilibaus (2019-07-31 14:32:03)

Offline

#13 2019-07-31 14:44:57

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,504
Website

Re: Error 406 Not Acceptable

gilibaus wrote #318914:

Thank you. Unfortunately I am on Textpattern 4.5.7 …

Ah I misunderstood you that it was working on Textpattern 4.5.7 (but not on a newer version), rather than you are using Textpattern 4.5.7.

… after reading your suggestion a light bulb turned on in my head. I created the form directly in the database via phpMyadmin, and it worked. Filter bypassed.

Yep, I would have suggested that too.

Now there is a new issue though …the same code but in the get_show_stats form does NOT update the resulting number when I refresh the page the form is inserted into. Any idea why?

Hmm, not off hand except that the source data may not have changed.


TXP Builders – finely-crafted code, design and txp

Offline

#14 2019-07-31 17:14:41

gilibaus
Member
From: Milan, Italy
Registered: 2013-08-14
Posts: 67
Website

Re: Error 406 Not Acceptable

Another piece of information that maybe can help understand what is happening: for testing purposes I have put <txp:output_form form="get_show_stats" /> in two different sections of my website, Contacts and Podcast. The output value updates in Contacts everytime I refresh the page, whereas in Podcast it updates only the first time the page gets refreshed and then stops updating. A caching issue?

Last edited by gilibaus (2019-07-31 17:16:06)

Offline

#15 2019-08-01 12:23:06

gilibaus
Member
From: Milan, Italy
Registered: 2013-08-14
Posts: 67
Website

Re: Error 406 Not Acceptable

I confirm it was a caching issue, now fixed. Thanks everyone for your help.

Offline

Board footer

Powered by FluxBB