dcart Posted May 31, 2006 Share Posted May 31, 2006 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>";} Quote Link to comment https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/ Share on other sites More sharing options...
poirot Posted May 31, 2006 Share Posted May 31, 2006 OK, what do you want to use as link title?Let's say you have a field called "title":[code]echo "<a href='$PHP_SELF?id=$therow[id]'>Read $therow[title]</a>...";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/#findComment-40425 Share on other sites More sharing options...
dcart Posted May 31, 2006 Author Share Posted May 31, 2006 Thank you for such a prompt asnwer!I'm sorry for not being too detailed, I'm really clueless with PhP. I wanted the title to have the same link as the "Read.." Is that what the code you just gave me will do? The title is a title of an article.Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/#findComment-40430 Share on other sites More sharing options...
dcart Posted June 2, 2006 Author Share Posted June 2, 2006 One more question, how can make that title to be a certain color? (different than everything else on the site)Thank you!echo "<a href='$PHP_SELF?id=$therow[id]'>$therow[title]</a>..."; Quote Link to comment https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/#findComment-41064 Share on other sites More sharing options...
poirot Posted June 2, 2006 Share Posted June 2, 2006 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 Link to comment https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/#findComment-41065 Share on other sites More sharing options...
dcart Posted June 2, 2006 Author Share Posted June 2, 2006 [!--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! Quote Link to comment https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/#findComment-41101 Share on other sites More sharing options...
poirot Posted June 2, 2006 Share Posted June 2, 2006 [code]echo "<a style='color: #660000' href='$PHP_SELF?id=$therow[id]'>Read $therow[title]</a>...";[/code]or[code]echo "<a style=\"color: #660000\" href='$PHP_SELF?id=$therow[id]'>Read $therow[title]</a>...";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/#findComment-41160 Share on other sites More sharing options...
dcart Posted June 3, 2006 Author Share Posted June 3, 2006 awesome! Thank you! I hate to do this again but what about making the title bigger. How can I change the font size? Quote Link to comment https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/#findComment-41356 Share on other sites More sharing options...
poirot Posted June 3, 2006 Share Posted June 3, 2006 [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 Quote Link to comment https://forums.phpfreaks.com/topic/10814-help-with-this-code-making-title-a-link/#findComment-41377 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.