Click to See Complete Forum and Search --> : [SOLVED] bold in my PHP code, how?


aeav
02-15-2005, 09:53 AM
Well I have a script calendar, it print all days of the week but I want to put bold where there are data, like it:

day 5 [consult database] - if donŽt have any data it donŽt print the bold, if yes it print.


Can someone help-me?

the part of code is it:

while (checkdate($mes, $dia, $ano)){
if ($testa == false)
print( '<tr>' );

/*
Print the days
*/
while ($dia_semana < 7 AND checkdate($mes, $dia, $ano)){

print( '<td><b><a href="abre.php?dia='.$dia.'&mes='.$mes.'&ano='.$ano.'">'.$dia.'</a></b></td>' );

$dia++;
$dia_semana++;
} // while 2

$dia_semana = 0;
$testa = false;
print( '</tr>' );

} // while

print( '</table>' );

ph34r
02-15-2005, 11:02 AM
Check the variable that holds your data to see if it is null, if it is then don't use the <b> tags, if it has data then use them.

aeav
02-15-2005, 11:32 AM
I think that I understood...
Thank you

IŽll try it...

aeav
02-15-2005, 11:48 AM
It functioned!!!
Thank you...

was easy... :D

bwkaz
02-15-2005, 07:37 PM
<Web design nitpick>

Replace all <b> tags in your script with <strong>. If you're strongly emphasizing the contained text, then this is the Right Way to do it. If you're not, then you should probably put it into a <span> and use CSS to make the font-weight bold.

Semantic markup...

</nitpick>

aeav
02-17-2005, 05:40 AM
great idea!
IŽll put it, to see it functioning...