LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   php with css doesn't display properly (http://www.linuxquestions.org/questions/programming-9/php-with-css-doesnt-display-properly-635551/)

htamayo 04-15-2008 01:47 PM

php with css doesn't display properly
 
Hi, I've been programmed some php files, each of one send an html output, thinking in user navigation across these outputs I decided to use some "tabs" programmed with html+css. Ok, these tabs menus works ok in a browser, but from inside of Apache and using these css file embedded to the php output the tabs menus doesn't display properly. In fact the main problem -i think- is in displaying the images that the css files called. So I need your help because I don't know how to fix this, outside of Apache it works ok, but inside of it not.

Please look around this code, this is the output the php sends:
Code:

<HTML>
<HEAD><LINK type='text/css' rel='StyleSheet' href='nomina.css'>
</HEAD>
<BODY>
<DIV id='header'>
<ul>
<LI><a href='brapexpe.php'>Personal</a></LI>
<LI id='current'><a href='verplaza.php'>Plaza</a></LI>
<LI><a href='verbenef.php'>Beneficiarios</a></LI>
</ul>
</DIV>

here is the css script:
Code:

#header{
        float:left;
        width:100%;
        background:#DAE0D2 url('bg.gif') repeat-x bottom;
        font-size:93%;
        line-height:normal;
        }
#header ul{
        margin:0;
        padding:10px 10px 0;
        list-style:none;
        }
#header li{
        float:left;
        background:url('norm_left.gif') no-repeat left top;
        margin:0;
        padding:0 0 0 9px;
        }
#header  a, #header strong, #header span{
        display:block;
        background:url('norm_right.gif') no-repeat right top;
        padding:5px 15px 4px 6px;
        text-decoration:none;
        }

#header #current{
        background-image:url('norm_left_on.gif');
        text-decoration:none;
        }

#header #current a{
        background-image:url('norm_right_on.gif');
        padding-bottom:5px;
        text-decoration:none;
        }

here is the complete php code:
PHP Code:

<?php
session_start
();
if (@
$_SESSION['auth'] !="yes")
{
    
header("Location:     nologin.php");
    exit();
    }

else{    
include(
"vars.php");
$xidb=$_SESSION'curid' ];
$conn=mysqli_connect($host$user$password) or die("No se pudo establecer comunicacion");
$db=mysqli_select_db($conn$basedatos) or die("Error en la base de datos");

$sqlb2="SELECT * FROM $tabla2 WHERE id='$xidb'";    
$resultadob2=mysqli_query($conn$sqlb2) or die(mysqli_error($conn));
$filas=mysqli_num_rows($resultadob2);        
$xplaza mysqli_fetch_assoc($resultadob2);
}
?>
<HTML>
<HEAD><LINK type='text/css' rel='StyleSheet' href='nomina.css'>
</HEAD>
<BODY>
<DIV id='header'>
<ul>
<LI><a href='brapexpe.php'>Personal</a></LI>
<LI id='current'><a href='verplaza.php'>Plaza</a></LI>
<LI><a href='verbenef.php'>Beneficiarios</a></LI>
</ul>
</DIV>
<br>
<p align='center'>PLAZA</p>
<TABLE>
<?php
echo "<tr><td>Fecha de Ingreso</td><td><td>" $xplaza['fecing'] . "</td></tr>";
echo 
"<tr><td>Sistema de Pago</td><td><td>" $xplaza['sistpago'] . "</td></tr>";
echo 
"<tr><td>Salario Devengado</td><td><td>" $xplaza['sueldo'] . "</td></tr>";
echo 
"<tr><td>Cargo Nominal</td><td><td>" $xplaza['cargnom'] . "</td></tr>";
echo 
"<tr><td>cargo Funcional</td><td><td>" $xplaza['cargfun'] . "</td></tr>";
echo 
"<tr><td>Ubicacion<td><td>" $xempleado['ubic'] . "</td></tr>";
?>
</TABLE>
</BODY>
</HTML>

Thanks for your help

porzech 04-15-2008 04:02 PM

if you have problems loading images just try to put full url's to your images (they are located somewhere on your apache server right?) so type full url into css if this works just analyze difference between your links to images and links to pages and modify your url's in css to be relative

now your images must be in same folder as your php code

one more think if this php code is included from some other script your images must be put where the other file is

htamayo 04-15-2008 04:29 PM

thanks to porzech, I tried to modify my css with full path in the urls value but still doesn't work, the php files, css and images are all in the same folder, they are in the apache. I'm executing all this from Debian, is it neccesary to change some permissions to the css file? thanks a lot

graemef 04-15-2008 06:35 PM

apache must have at least read access to these files (php, css, images).


All times are GMT -5. The time now is 05:18 PM.