0

i put in top of my include / external page any line for prevent Remote File Inclusion. this checked include file / extrenal load only in my index page . now when i load this (external page) in colorbox lightbox with iframe method this not work and i see blank page. if i remove this line worked ! how to fix this problem ? any way ?

top php page :

if (!defined('INDEX_ROOT') || (defined('INDEX_ROOT') && INDEX_ROOT != 'true')) die();

html & colorbox :

<script>$(document).ready(function(){ $(".iframe").colorbox({ iframe:true,scrolling:false,width:665,height:600});});</script>

<a class="iframe" href="test.php">load frame</a>

thanks

4

1 に答える 1

0

これはあなたのシステムの構造でなければなりません

config.php

//config.php
<?php

const INDEX_ROOT = "INDEX_ROOT";

?>

protected.php

<?php

if (! defined ( 'INDEX_ROOT' ) || (defined ( 'INDEX_ROOT' ) && INDEX_ROOT != 'true')) {
    die ();
}

function someFunction(){
    echo " Protected" ;
}   

?>

sampleA.php //これは機能します

<?php

require 'config.php';
echo "Hello World"

?>

sampleB.php //これは機能します

<?php

require 'config.php';
require 'protected.php';

echo "Hello Sample B" , someFunction() ;

?>

sampleC.php //これは機能しません

<?php

require 'protected.php';
echo "Hello Sample C" , someFunction() ;

?>
于 2012-04-14T09:37:35.530 に答える