Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 11:45 am EST
Geeklog Forums
can't create staticpage with php code sample
kyngchaos
Anonymous
I'm trying to put a PHP code sample on a staticpage and it seems like geeklog is trying to execute it right away or something - I get a server error that "The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.".
The same example works posting in a story (html mode, old-fashioned non-wysiwyg editor). Am I missing some trick? Bug in staticpages?
This is how I'm trying to add it to the staticpage (hopefully it will work in the forum):
dl("php_mapscript.so" );<br>
phpinfo();<br>
?></code></p>
The same example works posting in a story (html mode, old-fashioned non-wysiwyg editor). Am I missing some trick? Bug in staticpages?
This is how I'm trying to add it to the staticpage (hopefully it will work in the forum):
Text Formatted Code
<p><code><?php<br>dl("php_mapscript.so" );<br>
phpinfo();<br>
?></code></p>
9
11
Quote
kyngchaos
Anonymous
Oh, yeah - Geeklog 1.4.0sr2
10
11
Quote
kyngchaos
Anonymous
sorry to keep responding to myself. I have the option to NOT execute PHP selected.
And that's on my webhost's server (Dreamhost). PHP 4.4.2 CGI, MySQL 4.1.14
I just tried on another server where I work (also GL 1.4.0sr2) and it works. PHP 4.4.0 CGI, MySQL 4.1.9.
I think this is the right error from the httpd error log:
And that's on my webhost's server (Dreamhost). PHP 4.4.2 CGI, MySQL 4.1.14
I just tried on another server where I work (also GL 1.4.0sr2) and it works. PHP 4.4.0 CGI, MySQL 4.1.9.
I think this is the right error from the httpd error log:
Text Formatted Code
[error] mod_security: Access denied with code 503. Pattern match "(chr|fwrite|fopen|system|echr|passthru|popen|proc_open|shell_exec|exec|proc_nice|proc_terminate|proc_get_status|proc_close|pfsockopen|leak|apache_child_terminate|posix_kill|posix_mkfifo|posix_setpgid|posix_setsid|posix_setuid|phpinfo)(.*);" at POST_PAYLOAD. [hostname "www.kyngchaos.com"] [uri "/admin/plugins/staticpages/index.php"]
9
9
Quote
kyngchaos
Anonymous
I noticed that. But I'm not trying to execute any PHP. It's just some text in the page I'm trying to add. And it doesn't get blocked when I add the same text as a story.
Is there something different the way staticpages and stories pass html from the client to the server that could be the problem?
Is there something different the way staticpages and stories pass html from the client to the server that could be the problem?
8
8
Quote
kyngchaos
Anonymous
OK. But then, why is it working with a story post (in html mode)? Can the static pages plugin be made to work the same way?
9
9
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Hmm, good point. So either I was wrong (which is quite possible) or it's because there's an additional level of indirection with stories, as they are run through the template engine before they're displayed (static pages don't use templates).
bye, Dirk
bye, Dirk
9
11
Quote
kyngchaos
Anonymous
Possibly. But I'm thinking it's on the other end - nothing ever makes it to the database, so there is nothing to display yet, in a template or not. So something is happening when the form posts to the geeklog staticpages.php.
Just a quick look at the html source on the client end:
Story uses a form with an enctype="multipart/form-data", while the staticpages doesn't set the enctype. I don't know much about enctype, maybe this could affect the POST data?
Story uses a textarea form item, so does staticpages but adds the wrap=virtual tag. I don't think that affects it since the text lines posted are short enough that no wrapping is needed.
I haven't looked at the PHP for stories and staticpages to see what happens on the server side.
Just a quick look at the html source on the client end:
Story uses a form with an enctype="multipart/form-data", while the staticpages doesn't set the enctype. I don't know much about enctype, maybe this could affect the POST data?
Story uses a textarea form item, so does staticpages but adds the wrap=virtual tag. I don't think that affects it since the text lines posted are short enough that no wrapping is needed.
I haven't looked at the PHP for stories and staticpages to see what happens on the server side.
9
9
Quote
kyngchaos
Anonymous
Bingo!
Adding the enctype to the staticpages form did the trick. In particular, in the system/non-public GL stuff, plugins/staticpages/templates/admin/editor.thtml, add enctype="multipart/form-data" to the "frmstory" form. Now my PHP sample goes thru just like it does in a story post, without getting blocked by the server.
Adding the enctype to the staticpages form did the trick. In particular, in the system/non-public GL stuff, plugins/staticpages/templates/admin/editor.thtml, add enctype="multipart/form-data" to the "frmstory" form. Now my PHP sample goes thru just like it does in a story post, without getting blocked by the server.
10
9
Quote
All times are EST. The time is now 11:45 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content