LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-15-2008, 02:47 PM   #1
htamayo
Member
 
Registered: Jan 2005
Location: san salvador, el salvador
Distribution: Debian Stable, UbuntuStudio Karmic Koala
Posts: 190

Rep: Reputation: 30
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
 
Old 04-15-2008, 05:02 PM   #2
porzech
Member
 
Registered: Jan 2007
Distribution: Suse, Ubuntu
Posts: 31

Rep: Reputation: 15
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
 
Old 04-15-2008, 05:29 PM   #3
htamayo
Member
 
Registered: Jan 2005
Location: san salvador, el salvador
Distribution: Debian Stable, UbuntuStudio Karmic Koala
Posts: 190

Original Poster
Rep: Reputation: 30
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
 
Old 04-15-2008, 07:35 PM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS/HTML/PHP/OBJECT Question br00tal Programming 3 04-10-2008 11:37 PM
Apache parsing css files for php scripting. dickohead Programming 1 09-14-2006 05:40 AM
X will not display properly!!! sg_Kbot Ubuntu 2 03-27-2006 09:24 PM
Problem loading css in php Runnerdave Programming 6 07-26-2005 09:27 PM
Survey: fav program for PHP/HTML/CSS coding xervious Linux - Software 8 03-16-2005 11:04 AM


All times are GMT -5. The time now is 04:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration