insert a variable into link tag
Posted: Fri Apr 25, 2008 12:40 am
I need to insert a variable into the href of the link tag to read a stylesheet. I was able to insert it and it read it ok, but ignore the format on <h1> and <div>, if I change the variable and write the correct path eveything is been formated ok. Some ideas of what Im doing wrong. Thanks so much in advanced, here is the code
Code: Select all
<?php
if (($_COOKIE[personal]=="")||($_COOKIE[loca]=="")){
header("Location: index.html");
exit;
}else if(($_COOKIE[personal]!="")&&($_COOKIE[loca]!="")){
}else{
header("Location: index.html");
exit;
}
$nvaloca=str_replace(' ',"_",$_COOKIE[loca]);
?>
<HTML>
<HEAD>
<TITLE>Personal</TITLE>
<?
echo "<link href=\"formato_".$nvaloca.".css\" rel=\"stylesheet\" type=\"text/css\">"
?>
</HEAD>
<BODY>
<div id="menuprincipal">
<p>Usuario:<?echo $_COOKIE[personal];?></p>
<p>Localidad:<?echo $_COOKIE[loca];?></p>
<P>MENU Personal</p>
</div>
<div id="doccentro">
<p>Some text</p>
</div>
</BODY>
</HTML>