Salve è meglio che chiedo a voi..

Ho questa situazione

Codice PHP:
  <?php
  session_start
();
require_once(
$_SERVER['DOCUMENT_ROOT'].'/includes/costanti.php');
require(
DRPHP.'uservar.php');
if ((
$accesso==TRUE)&&($utente!=''))
{
define(ADVPAG,$_SERVER['PHP_SELF'].'?fold=galls');
define (DRG,DRRA.'gallery/');
define (PG,PARA.'gallery/');

       
?>
  <script>
    $(function() {
        $( "#tabs" ).tabs();
    });
    </script>
        <script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
  $("a[rel^='prettyPhoto']").prettyPhoto({
            animation_speed: 'slow', /* fast/slow/normal */
            slideshow: 10000, /* false OR interval time in ms */
            autoplay_slideshow: false, /* true/false */
            opacity: 0.80, /* Value between 0 and 1 */
            show_title: false, /* true/false */
            allow_resize: true, /* Resize the photos bigger than viewport. true/false */
            default_width: 500,
            default_height: 344,
            counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
            theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
            horizontal_padding: 20, /* The padding on each side of the picture */
            hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
            wmode: 'opaque', /* Set the flash wmode attribute */
            autoplay: true, /* Automatically start videos: True/False */
            modal: false, /* If set to true, only the close button will close the window */
            deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */
            overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
            keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
            changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
            callback: function(){}, /* Called when prettyPhoto is closed */
            ie6_fallback: true,
                        social_tools: ''

                });
    });
</script>


<h1> Galleria</h1>
<div id="tabs">
    <div id='htab'>
        <ul>
    [*][url="#tabs-1"][img]<?php echo PAIMG.[/img]' alt='View Profile'/>[/url]
    [*][url="#tabs-2"][img]<?php echo PAIMG.[/img]' 
alt='Edit Profile'/>[/url]         
        [/list]
        </
div>
        <
div id='ctab'>
    <
div id="tabs-1">
<
div id='avvisi'>
  <?
php
       
include(DRPAGRA.'gallery/pubblica.php');
       
?>
</div>
</div>
<div id="tabs-2">
<div id='avvisi'>
  <?php
  
include(DRPAGRA.'gallery/privata.php');
       
?>
</div>
</div>
</div>
</div>
</div>
    <?php
}
else
{
header("Location: ".PAPAGES."reservedarea/main.php");
}
?>
Con i due file da includere che sono simili:

Pubblica
Codice PHP:
<?php
if (isset($_GET['cartellapu']))
{
$tempdir=$_GET['cartellapu'];
    
cartelle(DRGALLS.$tempdir.'/',DRGALLS,PAGALLS,ADVPAG,'cartellapu');
}
else
{
    
cartelle(DRGALLS,DRGALLS,PAGALLS,ADVPAG,'cartellapu');    
}
?>
Privata
Codice PHP:
<?php 
if (isset($_GET['cartellapr']))
{
$tempdir=$_GET['cartellapr'];
    
cartelle(DRG.$tempdir.'/',DRG,PG,ADVPAG,'cartella');
}
else
{
    
cartelle(DRG,DRG,PG,ADVPAG,'cartella');
}
?>
Funzione Cartelle
Codice PHP:

function cartelle($cartella,$std,$pa,$reto,$posta)
{
   echo  
"<div id='headadv'>";
    echo 
"<div id='foldadv'>";
    
$startdir=$std;
    
$cartella=str_ireplace("_"," ",$cartella);
    
$directories array_filter(glob($cartella.'*',GLOB_ONLYDIR ));
       if(
$startdir!=$cartella)
    {
        
$parentdir=dirname($cartella);
        if ((
$parentdir.'/')==$startdir)
        {
            echo 
"[url='".$reto."'][img]".PAIMG."folderup.png[/img]<h6>..</h6>[/url]";
        }
        else
        {
        
$dirup=str_ireplace($startdir''$parentdir); 
echo 
"[url='".$reto."&$posta=".$dirup."'][img]".PAIMG."folderup.png[/img]<h6>..</h6>[/url]";
        }
    }
    foreach (
$directories as $key => $value)  
       {
        
$dirstr_ireplace($startdir,'',$value);
        
$dirx=str_ireplace($_GET[$posta].'/','',$dir);
        
$dir=str_ireplace(" ","_",$dir);
        
        echo 
"[url='".$reto."&$posta=".$dir."'][img]".PAIMG."folder.png[/img]<h6>$dirx</h6>[/url]";
     
    
       }
 
echo 
"</div>";
echo 
"<div id='titlefold'>";

if (
$cartella!=$startdir)
{
$h3 =str_ireplace($parentdir,'',$cartella);
$h3=str_ireplace('/','',$h3);
$h2='HOME - ';
if (
$parentdir.'/' !=$startdir)
{
$temph=str_ireplace($startdir,'',$parentdir);
$bcexplode('/',$temph);
foreach (
$bc as $k=>$v)
{
$h2.=strtoupper($v).' - ';    
}

}
}

else
{
    
$h2='';
    
$h3="HOME";
}
$h2=substr($h2,0,strlen($h2)-3);
echo 
"<h2>".$h2."</h2>";
echo 
"<h3>".$h3."</h3>";    

echo 
"</div>";
echo 
"</div>";
echo 
"<div id='imggalls'>";
$imggalls=array_filter(glob($cartella.'*.{png,jpg}'GLOB_BRACE)); 
echo 
"<ul class='gallery clearfix'>";
                     foreach (
$imggalls as $key => $value)  
   {
    
$imgv=str_ireplace($cartella,'',$value);
        
$value=str_ireplace($cartella,'',$value);
$cart=str_ireplace($startdir,$pa,$cartella);    
$imgurl=$cart.$value;
  echo 
"[url='$imgurl'][img]$imgurl[/img][/url]";

   }    
echo 
"[/list]";
echo 
"</div>";
echo 
"</div>";
}
?> 
Il Problema è che nel primo funziona correttamente sia il php che il css mentre nel secondo no e non riesco a capire l'errore..