Page 1 of 1

Problem modify an echo "<a href=\"", newbie in php?

Posted: Fri Nov 14, 2008 3:40 am
by Chacapamac
I have a code:

Code: Select all

echo "<a href=\"" . sefRelToAbs($indexalphacontent) . "\" style=\"font-weight:" . $ac_weighttitleindex . ";font-size:" . $ac_sizetitleindex."px\">" . $directoryname . "</a>";
I want to take away the ability in the code to control the appearance of the font (font-weight and size) add a css class of my own in there to be able to controle the font appearance by css...

Do you see any problem doing so?

First post Here.

Hello! everybody :D

Re: Problem modify an echo "<a href=\"", newbie in php?

Posted: Fri Nov 14, 2008 4:09 am
by Paul Arnold
You'll find it a lot easier using ' instead of " to display your blocks of html code.

Eg:

Code: Select all

 
echo '<a href="' . sefRelToAbs($indexalphacontent) . '" style="font-weight:' . $ac_weighttitleindex . ';font-size:' . $ac_sizetitleindex.'px">' . $directoryname . '</a>';
 
Also, you might be better off using PHP to select a certain CSS class rather than using inline CSS properties as you have in your example but I'd need to know more about how you intend it to work.

Re: Problem modify an echo "<a href=\"", newbie in php?

Posted: Fri Nov 14, 2008 9:30 am
by Chacapamac
I want to just add a class to the php function, taking out the two function that control the weight and size in php.

After that a master.css file will control that typo.