Jump to content


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


Mixinf HTML with PHP

Recommended Posts

I'm trying to make the title and date text in the following link bold. How do I do this? It is part of a blog script.

[a href=\"http://www.tainted-rose.com/blog/display.php\" target=\"_blank\"]http://www.tainted-rose.com/blog/display.php[/a]

<? include("http://www.tainted-rose.com/header.php")?>
// Put database connection variables here
$user="";    //user name to access database
$pass= "";    //password    
$dbase="";    //database name

$connection = mysql_connect("$hostname" , "$user" , "$pass") or die ("Cannot connect to MySQL");
$db = mysql_select_db($dbase , $connection) or die ("Cannot select database.");

$q = "SELECT * from blog order by date desc ";
$result= mysql_query($q, $connection) or die  
("Could not execute query : $q." . mysql_error());

// dynamic navigation variables
$rows_per_page=1;         // adjust the number here to display number of entries per page  
$pages = ceil($total_records / $rows_per_page);

$screen = $_GET["screen"];
if (!isset($screen))
$start = $screen * $rows_per_page;
$q .= "LIMIT $start, $rows_per_page";
$result= mysql_query($q, $connection) or die  
("Could not execute query : $q." . mysql_error());

while ($row=mysql_fetch_array($result))


    <table width="80%" border="0" cellspacing="1" cellpadding="0">
    <td><?php echo "$title"; ?></td>
    <p><img src="<?php echo "$icon"; ?>" alt="icon" align="center"><?php echo "$entry"; ?></p>
    <p>Posted by <a href="mailto:<?php echo "$email"; ?>"><?php echo "$name"; ?> on <?php echo "$date"; ?>.</p>
    <p align="right">
    $query = "select id from blog_comments where blog_id='$id' ";
    $ret = mysql_query($query) or die (mysql_error());
    $comment_num = mysql_num_rows($ret);
    // display number of comments
    echo "<a href=\"http://www.tainted-rose.com/blog/readcomments.php?id=$id\">$comment_num</a>";
} #while
<div align=center>


// Display dynamic navigation here

// create the dynamic links
if ($screen > 0) {
$j = $screen - 1;
$url = "display.php?screen=$j";
echo "<a href=\"$url\">Prev</a>";

// page numbering links now

for ($i = 0; $i < $pages; $i++) {
$url = "display.php?screen=" . $i;
$j = $i + 1;
echo " | <a href=\"$url\">$j</a> | ";

if ($screen < $pages-1) {
$j = $screen + 1;
$url = "display.php?screen=$j";
echo "<a href=\"$url\">Next</a>";


<? include("http://www.tainted-rose.com/footer.php")?>

Share this post

Link to post
Share on other sites
Lots of options:


<td><b><?php echo $title; ?></b></td>

<td style='font-weight:bold;'><?php echo $title; ?></td>

<td class='bold'><?php echo $title; ?></td> <!--obviously you would need a css class for this one-->


Just a few ways among many others.

Share this post

Link to post
Share on other sites


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.