SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    england
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    text string change to link

    Hi all
    i am writing a simple guestbook i want to change the homepage text, and email text to be output as a link . this is the code iam using at the moment.

    echo " <table border=\"1\" width=\"600\" height=\"111\" cellspacing=\"0\" cellpadding=\"0\">
    <tr>
    <td valign=\"top\" bgcolor=\"$tblcolor\" height=\"21\" width=\"249\"><b>&nbsp;Name</b>
    : ".$gbook['name']."<br>
    <b>&nbsp;Date</b> : ".$gbook['date']."<br>
    <b>&nbsp;Email</b> : ".$gbook['email']."</td>
    <td valign=\"top\" bgcolor=\"$tblcolor\" height=\"21\" width=\"264\"><b>Site Title</b>
    : ".$gbook['city']."<br>
    <b>category id</b> : ".$gbook['category']."<br>
    <b>Homepage</b> : ".$gbook['homepage']."</td>

    </tr>
    <tr>
    <td valign=\"top\" bgcolor=\"$tblcolor\" width=\"513\" colspan=\"2\"><br>
    <b>&nbsp;Message</b> : ".$gbook['message']."<br>
    &nbsp;</td>
    </tr>
    </table><p>";

    thanks paul

  2. #2
    SitePoint Wizard silver trophy Jelena's Avatar
    Join Date
    Feb 2005
    Location
    Universum, 3rd Corner
    Posts
    3,001
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Do you need something like this?
    PHP Code:
    echo " <table border=\"1\" width=\"600\" height=\"111\" cellspacing=\"0\" cellpadding=\"0\">
    <tr>
    <td valign=\"top\" bgcolor=\"
    $tblcolor\" height=\"21\" width=\"249\"><b>&nbsp;Name</b>
    : "
    .$gbook['name']."<br>
    <b>&nbsp;Date</b> : "
    .$gbook['date']."<br>
    <b>&nbsp;Email</b> : <a href=\"mailto:"
    .$gbook['email']."\">".$gbook['email']."</a></td>
    <td valign=\"top\" bgcolor=\"
    $tblcolor\" height=\"21\" width=\"264\"><b>Site Title</b>
    : "
    .$gbook['city']."<br>
    <b>category id</b> : "
    .$gbook['category']."<br>
    <b>Homepage</b> : <a href=\""
    .$gbook['homepage']."\">".$gbook['homepage']."</a></td>

    </tr>
    <tr>
    <td valign=\"top\" bgcolor=\"
    $tblcolor\" width=\"513\" colspan=\"2\"><br>
    <b>&nbsp;Message</b> : "
    .$gbook['message']."<br>
    &nbsp;</td>
    </tr>
    </table><p>"

    Btw, I would strongly suggest that you separate html from php as much as possible. I would do something like this:
    PHP Code:
    <table border="1" width="600" height="111" cellspacing="0" cellpadding="0">
    <tr>
    <td valign="top" bgcolor="$tblcolor" height="21" width="249"><b>&nbsp;Name</b>
    <?php echo $gbook['name'];?><br>
    <b>&nbsp;Date</b> : <?php echo $gbook['date']?><br>
    <b>&nbsp;Email</b> : <a href="mailto:"<?php echo $gbook['email'];?>><?php echo $gbook['email'];?></a></td>
    <td valign="top" bgcolor="$tblcolor" height="21" width="264"><b>Site Title</b>
    <?php echo $gbook['city']?><br>
    <b>category id</b> : <?php echo $gbook['category'];?><br>
    <b>Homepage</b> : <a href="<?php echo $gbook['homepage'];?>"><?php echo $gbook['homepage'];?></a></td>
    </tr>
    <tr>
    <td valign="top" bgcolor="<?php echo $tblcolor;?>" width="513" colspan="2"><br>
    <b>&nbsp;Message</b> : <?php echo $gbook['message']?><br>
    &nbsp;</td>
    </tr>
    </table><p>
    -- Jelena --

  3. #3
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    england
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Hi.
    i love this forum always get a quick response and always very helpfull
    thankyou
    paul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •