Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-10-02 11:47:16
- bo5ton
- New Member
- Registered: 2006-07-31
- Posts: 8
Javascript in a form saving problem.
Hey everyone.
I’ve just recently moved over to using Textpattern and I am quite happy with it.
This is pretty much the only problem I’ve run into so far.
I’ve wanted to implement two javascript modules, google ads and analytics. So far I haven’t been able to do either and I’m assuming there is a problem with my install or server or something.
All I do is either try and save the script in a form or a page, but it just goes to the site’s 404 and doesn’t save.
Diagnostics:
Textpattern version: 4.0.3 (r1188)
Last Update: 2006-07-24 15:08:31/2006-07-24 14:53:24
PHP version: 4.4.3
Server Local Time: 2006-10-02 06:45:49
MySQL: 4.1.21-standard
Locale: en_GB.UTF-8
Server: Apache 3 – HOSTMerit
PHP Server API: cgi
Server OS: Linux 2.6.17.13
.htaccess file contents:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]
RewriteRule ^(.*) index.php </IfModule>#php_value register_globals 0
————————————
Any help is appreciated.
Offline
#2 2006-10-02 12:12:15
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Javascript in a form saving problem.
Otherwise your form/pages saves properly? or does it not save regardless of what you put in it?
Offline
#3 2006-10-02 12:29:44
- bo5ton
- New Member
- Registered: 2006-07-31
- Posts: 8
Re: Javascript in a form saving problem.
Yeah, otherwise it’s fine. I’ve built two full websites fine. But with both websites I’ve got the same problem.
Example, i’m trying to put the analytics in:
< script src=“http://www.google-analytics.com/urchin.js” type=“text/javascript”>
</script>
< script type=“text/javascript”>
_uacct = “UA-188959-6”;
urchinTracker();
</script>
When I try to save, it goes to the 404.
This:
< src=“http://www.google-analytics.com/urchin.js” type=“text/javascript”>
</script>
< type=“text/javascript”>
_uacct = “UA-188959-6”;
urchinTracker();
</script>
Saves fine…
Last edited by bo5ton (2006-10-02 12:31:16)
Offline
Re: Javascript in a form saving problem.
This is probably a mod_security related phenomenon.
To verify this, try:
- rename .htaccess in the root of your Textpattern site to something else
- Try to post your js code
- An error page might occur, revealing a “real” server error code
If this is true, talk to your hosting company for further support (they might disable mod_security for just the ../textpattern folder)
Offline
#5 2006-10-02 17:11:48
- bo5ton
- New Member
- Registered: 2006-07-31
- Posts: 8
Re: Javascript in a form saving problem.
Definately looks like somethings up…
“Forbidden
You don’t have permission to access /textpattern/index.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. “
What sort of permissions should the pages and folders in txp have?
Last edited by bo5ton (2006-10-02 17:12:57)
Offline
Re: Javascript in a form saving problem.
This is no file permission problem but one of the web server restricting access to the posting URL of textpattern.
Which, in turn, is an effect of mod_security blocking your attempt to post “malicious” javascript code. You will have to talk to your hosting provider and ask them if they can establish more relaxed security settings for the ./textpattern subfolder. They (hopefully) have the knowledge to apply such a setting on a per-folder base if their policy allows it.
Offline
#7 2006-10-02 18:05:57
- bo5ton
- New Member
- Registered: 2006-07-31
- Posts: 8
Re: Javascript in a form saving problem.
The same thing is happening to the sidebar.php on my wordpress install on another site. This hasn’t always been the problem. Fortunately I can edit this through cPanel.
Offline
Re: Javascript in a form saving problem.
<i>“Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.”</i>
You may want to check you cpanel for an ErrorDocument setting. Looks like there aren’t any ErrorDocuments available (with nice error messages instead of a standard 404 response), but the webserver still tries to use them and fails. This doesn’t have anything to do with fixing the textpattern problem though.
Offline
Pages: 1