Jump to content

Help with this code (making title a link)


dcart

Recommended Posts

I have the following code and I would like the title to be a link not only the "Read.." section but I can't seem to get it work. Is it doable? Thank you in advance!

{
echo "<b>";
printf($therow["title"]);
echo "</b><br><i>";
printf($therow["date"]);
echo "</i><br>";
printf($therow["summary"]);
echo "<br><a href=\"$PHP_SELF?id=";
printf($therow["id"]);
echo "\">Read</a>...";
echo "<br><br>";
}
Link to comment
https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/
Share on other sites

[!--quoteo(post=379226:date=Jun 1 2006, 10:16 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 1 2006, 10:16 PM) [snapback]379226[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I'd need to know how this title is stored in the database or whatever it is its storing method to give you an answer.

Anyways... To change it's color, you must use normal HTML/CSS, like:

<a style="color: white"...
[/quote]

The code for title that you gave me works very nicely, it displays exactly what I wanted. As to the color, can I use the folowing? (I would like to use a color numbe #660000)

echo "<a style="color: #660000" href='$PHP_SELF?id=$therow[id]'>Read $therow[title]</a>...";

Thank you so much for your help!
[code]"<a style=\"color: #660000\" href='$PHP_SELF?id=$therow[id]'>Read $therow[title]</a>...";[/code]

to

[code]"<a style=\"color: #660000; font-size: 15pt\" href='$PHP_SELF?id=$therow[id]'>Read $therow[title]</a>...";[/code]

Will set the font-size to 15pt

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.