Page 1 of 1
HTML HEAD: Cannot add script in template
Posted: Fri 30. Dec 2005, 04:35
by LPWV
Anytime I try to place a <script> into the HTML Head section of a template I get this error...It is really restricting my design...Any clues?
I checked permissions and they are 755 (tried 777 too)...
Code: Select all
Forbidden
You don't have permission to access /phpwcms.php on this server.
--------------------------------------------------------------------------------
Apache/1.3.33 Ben-SSL/1.55 Server at www.lpwv.org Port 80
Re: HTML HEAD: Cannot add script in template
Posted: Fri 30. Dec 2005, 07:40
by DeXXus
LPWV wrote:Anytime I try to place a <script> into the HTML Head section of a template I get this error...
What is in the script? More info is necessary on your part, no?
Javascript, PHP script, CSS <style> tags, phpWCMS Replacement tags, etc.
Could it maybe be a path error? Message ("permission to access") could be trying to access "/phpwcms.php" (document_root) when ~your~ actual is "/wcms/phpwcms.php" ?
Posted: Fri 30. Dec 2005, 15:32
by LPWV
This is what I am trying to insert:
Code: Select all
<script type="text/javascript" language="JavaScript">
<!--
function calcHeight()
{
var the_height=document.getElementById('the_iframe').contentWindow.document.body.scrollHeight; //find the height of the internal page
document.getElementById('the_iframe').style.height=the_height; //change the height of the iframe
}
//-->
</script>
My WCMS is in my root folder...so /phpwcms.php should be the right path...
I just checked...It is happening anytime I try to add a script...
For example, I just tries to add an HTML content part to one of my article pages using this and got the same error:
Code: Select all
<script language="JavaScript1.2">
//Random iframe content- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, and Terms Of use, visit http://dynamicdrive.com
//This credit MUST stay intact for use
var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
//Specify IFRAME display attributes
var iframeprops='width=130 height=130 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"'
//Specify random URLs to display inside iframe
var randomcontent=new Array()
randomcontent[0]="random1.htm"
randomcontent[1]="random2.htm"
randomcontent[2]="random3.htm"
randomcontent[3]="random4.htm"
//No need to edit after here
if (ie||dom)
document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>')
function random_iframe(){
if (ie||dom){
var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
iframeobj.src=randomcontent[Math.floor(Math.random()*randomcontent.length)]
}
}
window.onload=random_iframe
</script>
Also, I can make regualr changes...Use replacement tags and tables etc and the changes occur just fine...
Hmmm...The mystery of it all...Anyway, thanks in advance for looking into this for me...
Posted: Fri 30. Dec 2005, 20:43
by DeXXus
Both your code and where you placed them... works fine for me (as far as "inserting" without error message). Maybe host is detecting/disabling IFRAME code (for security reasons)?
Hmmmm! Try disabling any frontend init and render files you may have enabled. Are your source files "pristine" or have you "modded" some of the core files, in some way that interferes ?
Posted: Sat 31. Dec 2005, 00:30
by LPWV
The only changes I made were too install the Cal Mod and the Gallery Mod...
I do not know how to detect/disable Frontend Init and render files...could you please explain...or is there somewhere I can go and hard enter the <script> I am needing...
Thanks...
Posted: Sat 31. Dec 2005, 02:04
by DeXXus
LPWV wrote:The only changes I made were too install the Cal Mod and the Gallery Mod...
I have no experience with them -or- whether they would have this effect.
LPWV wrote:I do not know how to detect/disable Frontend Init and render files...could you please explain
Then they cannot be an issue.
(BTW: they are in "config.inc.php")
Code: Select all
// other stuff
$phpwcms["allow_ext_init"] = 1; //allow including of custom external scripts at frontend initialization
$phpwcms["allow_ext_render"] = 1; //allow including of custom external scripts at frontend rendering
LPWV wrote:...or is there somewhere I can go and hard enter the <script> I am needing...
Thanks...
I'm not sure what you mean. "Hard entering" is the way you've tried.
The other way to try is more involved. You would make a .JS file with all your callable functions. place it in a sub-folder of phpWCMS root (for example "/include/inc_js/" ) and then use:
Code: Select all
<script language="JavaScript" type="text/javascript" src="include/inc_js/iFramefunct.js"></script>
-OR-
Use the form block in frontend setup: page layout
javascript: onload: include/inc_js/iFramefunct.js
-OR-
Use the form block in edit template: TemplateName
js onload: include/inc_js/iFramefunct.js
To call them into the page as it's being built and then the HTML would contain the javascript function calls. That's harder... to divide up the process.
I guess we have to keep in mind THOUGH that this is an error message from THE SERVER. I don't ~think~ "caching" would cause any problems. It may be CPanel settings...like certain account name(s) do/don't have Read/Write/Edit/Delete privilege -or- ".htaccess" file overriding CHMOD settings of folders. I always suggest turning on all errors & notices in "php.ini" if you can... to see if PHP is throwing up any errors. All else may lie with contacting TS @ host and asking them what the logs may show or what might be happening? Sorry to be of so little help.
Posted: Sat 31. Dec 2005, 13:48
by LPWV
I checked config.inc.php and both are set to 1 (I assume this is correct)...
I tried creating the .js file but had no success getting the script to call correctly...
I will play with this a bit later...
Thanks for the help!
Loving the script overall...can be a little tricky through for a novice...