Make the title of post it's link.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harman30
    New Member
    • Sep 2015
    • 19

    Make the title of post it's link.

    Below is a code in which title of post is displayed as link for opening the whole post, it works fine when using this way
    Code:
    <?php 
     // some code to get title and other stuff from db
    
     echo "<h2><a href='blog.php?blogId=" . $row['blogs_id'] . "'>$title</a></h2>";
    ?>
    but now I have made some changes in my code and for that changes to take effect I have to call title by row like this
    Code:
    <h2><?php echo $row['title']; ?></h2>
    so I want to know he right way in which I can make the title of post a link means I want to add
    Code:
    <a href='blog.php?blogId=" . $row['blogs_id'] . "'
    to
    Code:
    <h2><?php echo $row['title']; ?></h2>
Working...