Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/04/2009, 23:45
Avatar de jamesjara
jamesjara
 
Fecha de Ingreso: mayo-2008
Ubicación: san jose
Mensajes: 449
Antigüedad: 16 años
Puntos: 7
Respuesta: Como debo llamar correctamente estilos css desde php?

te lo pongo todo por si no sabes
Código PHP:

$hostname_program 
"localhost";
$database_program "database";
$username_program "program";
$password_program "xxxxxxxxxxxx";
$program mysql_pconnect($hostname_program$username_program$password_program) or trigger_error(mysql_error(),E_USER_ERROR); 

$tem_Recordset1 "-1";
if (isset(
$_POST['temaid'])) {
  
$tem_Recordset1 $_POST['temaid'];
}

mysql_select_db($database_program$program);
$query_Recordset1 sprintf("SELECT url_tema FROM temas Where tema_id = %s "GetSQLValueString($tem_Recordset1"text"));
$Recordset1 mysql_query($query_Recordset1$program) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);



al final de todo free
mysql_free_result
($Recordset1); 
SI ES UNA URL
entre los heads pones
<link href="temas/default/estilos/<?php echo $row_Recordset1['url_tema']; ?>" rel="stylesheet" type="text/css" />

y debe quedar asi:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<link href="temas/default/estilos/<?php echo $row_Recordset1['url_tema']; ?>" rel="stylesheet" type="text/css" />
</head>


SI ESTA EN PURO TEXTO
suponiendo url_tema es el texto ccs, que entre los heads pones

<style type="text/css">
<?php echo $row_Recordset1['url_tema']; ?>
}
</style>


y debe quedar asi:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<style type="text/css"><?php echo $row_Recordset1['url_tema']; ?></style>
</head>


creo que te referias a esto
__________________
X7CLOUD El webservice latino!
Compatible
con mysql,sql,sqlitte.
Compatible con extjs , sencha , smargwt, Gwt , Jquery , Charts, Streaming.

Última edición por jamesjara; 07/04/2009 a las 00:01