SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    I need help with the code in a script.

    I have tried and tried but I have not been able to get it to do what I want it to.

    Please see,
    http://www.ironstone.f2s.com/guestbook/guestbook.php

    This is what I am trying to do.
    [list=1][*]Remove the url address and the email address from the left column[*]Keep the Icons (anchor and letter)[*]Have the Icons act as the url address and email address SO IF a visitor clicks on them they will be taken to the "entrants" homepage or the mail client will open.[/list=1]

    The full "addentry.php" file is located at,
    http://www.ironstone.f2s.com/addentry.txt
    I had to give it a "txt" ext in order to get it to show on the web. The file actually has a "php" ext.

    The part of that file which needs editing is the one below
    Code:
    <?php
    if ($email) {
      echo " <tr><td><img src=\"mail.gif\" width=20 height=17></td><td class=\"font2\">
      <a href=\"mailto:$email\">$email</a></td></tr>\n";
    }
    if ($url) {
      echo " <tr><td><img src=\"url.gif\" width=20 height=20></td><td class=\"font2\">
      <a href=\"$url\" target=\"_blank\">$url</a></td></tr>\n";
    }
    ?>
    Please anybody help me.

    Appreciate any and all responses.

    WP
    Webbing Along!!!

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php
    Code:
    <?
    if ($email) {
      echo " <tr><td>
                     <a href=\"mailto:$email\">
                          <img src=\"mail.gif\" width=20 height=17 border=0>
                    </a>
                 </td><td></td></tr>\n";
    }
    if ($url) {
      echo " <tr><td>
                    <a href=\"$url\" target=\"_blank\">
                         <img src=\"url.gif\" width=20 height=20 border=0>
                    </a>
                </td><td></td></tr>\n";
    }
    ?>
    That should work. Note that the indenting is just to help you understand the HTML. you can squish it all back up again in your final code if you want.

    Also note that I've added border=0 to the img tags so that you don't get a hyperlink border around the image.

    <<edited>>
    Just noticed that you need two cells in each row so I put one back in.
    Last edited by freakysid; Apr 4, 2001 at 07:02.

  3. #3
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    Thank you for taking the time to respond to my problem "freakysid".

    I made the corrections you first suggested and all is working well (in IE, I haven't tested it with NS 4.76 or NS 6.0 yet).

    Actually I needed to make similar changes to the "guestbook.php" file in this program. I did not know it at the time I posted the problem.

    Because of how you responded to the question, I was able to make the needed corrections to the "guestbook.php" as well.

    Thanks again.

    WP
    Webbing Along!!!


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
  •