Support ⇒ Troubleshootings ⇒ Q. Access to the URL that you requested Is Forbidden.. ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexTroubleshootings

Q. Access to the URL that you requested Is Forbidden.. Reply to topic


Hello all, i have a dumb as question, (It's a dumb question because i know i have solved it before... but have forgotten how)

Now, as always, i have been editing themes. This time, I'm making an image change every time the page is loaded. (I have done this before, my Signature on my site runs it)
Either way, I've put the PHP file that controls which image loads in the theme, and wouldn't you know it....

Access to the URL that you requested, /themes/PH2_Blue/images/Header3/bg_rotate/bg_rotate.php, is forbidden.


how do i allow access to the file?

www.srvmc.com/themes/P...rotate.php

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
DebianLenny / Apache2.2.9 / MySQL5.0.51a-24+lenny3-log / PHP5.2.6-1+lenny8 / Dragonfly 9.2.1


direct access to php files outside of the main dir is not allowed by default by the .htaccess file.

My suggestion is to include that file in your theme.php file as a function:

function random_image_header(){

$random_number=ranomcode();

$image_string = '/images/headers/'.$random_number.'.jpg';

return $image_string;
}

then call that function when assigning vars to the template object:

'S_RANDOM_IMAGE' => random_image_header(),


and in your template file
<img src="{S_RANDOM_IMAGE}" />

or move that php file to your main directory.
/themes/PH2_Blue/images/Header3/bg_rotate/bg_rotate.php
to /

www.greenday2k.net

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


greenday2k wrote
or move that php file to your main directory.
/themes/PH2_Blue/images/Header3/bg_rotate/bg_rotate.php
to /


That was the easiest option Smile
thanks!

www.srvmc.com
and it works Smile the header changes background on every load.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
DebianLenny / Apache2.2.9 / MySQL5.0.51a-24+lenny3-log / PHP5.2.6-1+lenny8 / Dragonfly 9.2.1

All times are UTC


Jump to: