Welcome Guest, Not a member yet? Register   Sign In
help please...with scandir() and CI
#1

[eluser]Asinox[/eluser]
Hello, im trying to usin jquery + Agile Carousel Agile Carouse Examples and i hav a problem...with the path to the images, i dont know what happen, if my problem is CI of the Agile Carousel, but i need to give the path to the image folder in javascript variable..and php read the variable usin POST (litter ajax), but when i think all is fine , i cant see the images... and when there is problem the problem always is with SCANDIR() function about "cant read the directory"...

im trying the path in any way.... like:
"../sliders"
"sliders"
"with base_url()./public/sliders"
"../../public/slider"

in any way.... Sad

here is the JS code
Code:
script src="public/js/carousel_behavior.js"
script src="public/js/jquery-ui.min.js"
script src="public/js/jquery.js" type="text/javascript"
    

    
$('#slide_holder').agile_carousel({
    first_last_buttons: "yes",
    hover_next_prev_buttons: "yes",
    next_prev_buttons: "yes",
    pause_button: "yes",
    slide_buttons: "yes",
    slide_captions: "JQuery Carousel Plugin111111|Agile Slide Types|JQuery UI Effects Available|Agile Settings|Carousel That's Built to Order",
    slide_directory: "../../slides",
     slide_links: "http://code.google.com/p/agile-carousel/downloads/list,http://code.google.com/p/agile-carousel/downloads/list,http://code.google.com/p/agile-carousel/downloads/list,http://code.google.com/p/agile-carousel/downloads/list,http://code.google.com/p/agile-carousel/downloads/list",
    slide_number_display: "yes",
    timer_length: "7000",
    transition_duration: 1000,
    transition_easing: "easeOutBack",    
    transition_type: "carousel",
    water_mark: "no"
     });

The PHP CODE NEX REPLAY
#2

[eluser]Asinox[/eluser]
Code:
function has_no_emailheaders($text)
{
   return preg_match("/(
|
|\\n+|\\r+)(content-type:|to:|cc:|bcc:)/i", $text) == 0;
}
foreach ($_POST as $field)
if(!has_no_emailheaders($field))
exit("invalid content");

// require('FirePHPCore/fb.php');

//ob_start();

//fb('Hello World');

filter_var($_POST["slide_captions"], FILTER_SANITIZE_STRING);

$first_last_buttons         = filter_var($_POST["first_last_buttons"], FILTER_SANITIZE_STRING);
$first_slide_is_intro       = filter_var($_POST["hover_next_prev_buttons"], FILTER_SANITIZE_STRING);
$hover_next_prev_buttons    = filter_var($_POST["hover_next_prev_buttons"], FILTER_SANITIZE_STRING);
$next_prev_buttons          = filter_var($_POST["next_prev_buttons"], FILTER_SANITIZE_STRING);
$pause_button               = filter_var($_POST["pause_button"], FILTER_SANITIZE_STRING);
$slide_buttons              = filter_var($_POST["slide_buttons"], FILTER_SANITIZE_STRING);
$slide_directory            = filter_var($_POST["slide_directory"], FILTER_SANITIZE_STRING);
$doctype                    = filter_var($_POST["doctype"], FILTER_SANITIZE_STRING);
$slide_links_list           = filter_var($_POST["slide_links_list"], FILTER_SANITIZE_STRING);
$slide_number_display       = filter_var($_POST["slide_number_display"], FILTER_SANITIZE_STRING);
$slide_captions             = filter_var($_POST["slide_captions"], FILTER_SANITIZE_STRING);
$water_mark                 = filter_var($_POST["water_mark"], FILTER_SANITIZE_STRING);

echo "<div id='slide_holder_inner'>";

if ($hover_next_prev_buttons == "yes") {
    echo "<div id='hover_prev_button' class='prev_button hover_button'><span>prev</span></div>";
    echo "<div id='hover_next_button' class='next_button hover_button'><span>next</span></div>";
}
if ($water_mark != "no") {
    echo "<div id='water_mark' class='water_mark'><span>". $water_mark ."</span></div>";
}
echo "<div id='row_of_slides'>";

if($doctype == 'html'){
    $close_tag = '>';
} elseif($doctype == 'xhtml'){
    $close_tag = '/>';
} else {
    $close_tag = '>';
}

$slide_links     = (explode(",",$slide_links_list));
$slide_dir       = scandir($slide_directory); //HERE IS THE SCANDIR
$counter         = 1;

foreach ($slide_dir as $slide_file) {
    if (preg_match('/^.*\.jpe?g$|^.*\.gif$|^.*\.png$/i', $slide_file)) {
        $slide_type = 'image_slide';
    }
    else if (preg_match('/^.*\.htm$|^.*\.html$/i', $slide_file)) {
        $slide_type = 'html_slide';
    }

the file is too long..but the problem is here $slide_dir = scandir($slide_directory); //HERE IS THE SCANDIR

I dont know...bacause in localhost all is fine...but in the server...i cant see the images with any path.....and the directory have 777 permission

Thanks u

sorry with my english

CI have something that help me with this?




Theme © iAndrew 2016 - Forum software by © MyBB