Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Help with <a href . . . </a>

  1. #1
    Join Date
    May 2007
    Location
    South Africa
    Posts
    175
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Help with <a href . . . </a>

    Hi FOlks,

    I have this script which deos not work properly when inserting the <a href . . tag


    PHP Code:
    echo '</td>
    <td bgcolor="#FFFFFF"><font style="font-size:10px" color="#00008B" face="Arial">'
    ;
    echo 
    '<option value="'.$row['surname'].', '.$row['name'].'">'.$row['surname'].', '.$row['name'].'</option>';

    echo 
    '</td><td align="center" bgcolor="#FFFFFF"><font style="font-size:10px" color="#FF0000" face="Arial">';
    echo <
    a href=$row['email']</a>;

    Which is in need of attention.

    I would like to know how I can get it to work on the two lines reflected above?

    Regards
    Rob 

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Don't use echos for html...

    PHP Code:
    </td>
    <td bgcolor="#FFFFFF"><font style="font-size:10px" color="#00008B" face="Arial">';
    <option value="<?php echo $row['surname'].', '.$row['name']; ?>"> <?php echo $row['surname'].', '.$row['name'] ;?></option>
    </td><td align="center" bgcolor="#FFFFFF"><font style="font-size:10px" color="#FF0000" face="Arial">
    <a href="<?php echo $row['email']; ?>"></a>;
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    May 2007
    Location
    South Africa
    Posts
    175
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question

    Hi,

    It didnt like the replacement.

    Offers a blank screen

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    PHP Code:
    </td>
    <td bgcolor="#FFFFFF"><font style="font-size:10px" color="#00008B" face="Arial">';
    <option value="<?php echo "$row['surname'], $row['name']"?>"> <?php echo "$row['surname'], $row['name']" ;?></option>
    </td><td align="center" bgcolor="#FFFFFF"><font style="font-size:10px" color="#FF0000" face="Arial">
    <a href="<?php echo $row['email']; ?>"><?php echo $row['email']; ?></a>
    How about this? Is the database being executed?
    Corrections to my coding/thoughts welcome.

  5. #5
    Join Date
    May 2007
    Location
    South Africa
    Posts
    175
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    Here is the balance of the script.

    Can be veiwed at this link

    PHP Code:
    <?php

    $connect 
    mysql_connect("localhost""e*****""H********") or

    die (
    "Hey loser, check your server connection.");

    mysql_select_db("*****_Members");

    $query1="select * from _Form_Nr_2";

    $result=mysql_query($query1) or die(mysql_error());

    ?>
    <!--------THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE------------->

    <table border=2 width="85%" bordercolor="#D3E2FE" bordercolorlight="#FFFFFF" bordercolordark="#AFBCDB" style="font-size:12px" cellspacing=0>

    <caption><b><font style="font-size:14px" color="#00008B" face="Arial">
    MEMBERSHIP DETAILS</font><b><caption>

    <tr>

    <th bgcolor="#D6D6D8"><b><font style="font-size:11px" color="#00008B" face="Arial">CELL NUMBER</font></b></th>

    <th bgcolor="#D6D6D8"><b><font style="font-size:11px" color="#00008B" face="Arial">FULL SURNAME</font></b></th>

    <th bgcolor="#D6D6D8"><b><font style="font-size:11px" color="#00008B" face="Arial">EMAIL</font></b></th>



    </tr>

    <?php

    while($row=mysql_fetch_array($result)){


    echo 
    '</td><td align="center" bgcolor="#FFFFFF"><font style="font-size:10px" color="#00008B" face="Arial">';
    echo 
    $row['cell_phone'];

    echo 
    '</td>
    <td bgcolor="#FFFFFF"><font style="font-size:10px" color="#00008B" face="Arial">'
    ;
    echo 
    '<option value="'.$row['surname'].', '.$row['name'].'">'.$row['surname'].', '.$row['name'].'</option>';

    echo 
    '</td><td align="center" bgcolor="#FFFFFF"><font style="font-size:10px" color="#FF0000" face="Arial">';
    echo 
    $row['email'];

    echo 
    "</td></tr>";

    if(!isset(
    $counter[$firstNAsAString]))
    $counter[$firstNAsAString] = 0;
    else
    $counter[$firstNAsAString]++;
    $last_surname $row['surname'];

    $i++;
    echo
    '</td></tr>';

    }

    echo 
    "</table>";

    ?>

  6. #6
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    How about this


    PHP Code:
    <?php
    $connect 
    mysql_connect("localhost""e*****""H********") or
    die (
    "Hey loser, check your server connection.");
    mysql_select_db("*****_Members");
    $query1="select * from _Form_Nr_2";
    $result=mysql_query($query1) or die(mysql_error());
    ?>
    <style type="text/css">
    .result_cell{
    font-size:10px;
    color:#00008B;
    font-family:Arial, Helvetica, sans-serif;
    }
    .head_cell{
    background:#D6D6D8;
    font-weight:bold;
    color:#00008B;
    font-family:Arial, Helvetica, sans-serif;
    font-size:11px;
    }
    h1{ 
    color:#00008B;
    font-family:Arial, Helvetica, sans-serif;
    font-size:14px;
    }
    .c_align{
    text-align:center;
    }
    .back_color {
    background:#FFFFFF;
    }
    .cell_other{
    font-size:10px;
    color:#FF0000;
    font-family:Arial, Helvetica, sans-serif;
    }
    </style>
    <!--------THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE------------->
    <table border=2 width="85%" bordercolor="#D3E2FE" bordercolorlight="#FFFFFF" bordercolordark="#AFBCDB" style="font-size:12px;" cellspacing=0>
    <span class="heading">MEMBERSHIP DETAILS</span>
    <tr>
    <th class="head_cell">CELL NUMBER</th>
    <th class="head_cell">FULL SURNAME</th>
    <th class="head_cell">EMAIL</th>
    </tr>
    <?php
    while($row=mysql_fetch_array($result)) {
        
    ?>
        <tr>
        <td class="result_cell c_align">
        <?php echo $row['cell_phone'];?>
        </td>
        <td class="cell_other c_align back_color">
        <option value="<?php echo $row['surname'] . ', ' $row['name'];?>"><?php echo $row['surname'] . ', ' $row['name'];?></option>
        </td>
        <td>
        <?php echo $row['email'];?>
        </td></tr>
        <?php
        
    if(!isset($counter[$firstNAsAString])) {
            
    $counter[$firstNAsAString] = 0;
        } else {
            
    $counter[$firstNAsAString]++;
            
    $last_surname $row['surname'];
            
    $i++;
            
    ?></td></tr>
        <?php
        
    }
    }
    ?>
    </table>
    Corrections to my coding/thoughts welcome.

  7. #7
    Join Date
    May 2007
    Location
    South Africa
    Posts
    175
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks will give it a look and get back to you later

    Regards
    Rob

  8. #8
    Join Date
    May 2007
    Location
    South Africa
    Posts
    175
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    I have made the changes - we have changed the fonts and colours but not got the effect of <a href . . . .</a>

    in that it does not underline the text

    result can be seen at www.gnjgf.co.za/stevie/players.php

  9. #9
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    don't use tables for layout, see http://howtocreate.co.uk for more information

  10. #10
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Oh, haha forgot about that, the link code wasnt in your reposted code. Try this one though:

    PHP Code:
    <?php
    $connect 
    mysql_connect("localhost""e*****""H********") or
    die (
    "Hey loser, check your server connection.");
    mysql_select_db("*****_Members");
    $query1="select * from _Form_Nr_2";
    $result=mysql_query($query1) or die(mysql_error());
    ?>
    <style type="text/css">
    .result_cell{
    font-size:10px;
    color:#00008B;
    font-family:Arial, Helvetica, sans-serif;
    }
    .head_cell{
    background:#D6D6D8;
    font-weight:bold;
    color:#00008B;
    font-family:Arial, Helvetica, sans-serif;
    font-size:11px;
    }
    h1{ 
    color:#00008B;
    font-family:Arial, Helvetica, sans-serif;
    font-size:14px;
    }
    .c_align{
    text-align:center;
    }
    .back_color {
    background:#FFFFFF;
    }
    .cell_other{
    font-size:10px;
    color:#FF0000;
    font-family:Arial, Helvetica, sans-serif;
    }
    </style>
    <!--------THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE------------->
    <table border=2 width="85%" bordercolor="#D3E2FE" bordercolorlight="#FFFFFF" bordercolordark="#AFBCDB" style="font-size:12px;" cellspacing=0>
    <span class="heading">MEMBERSHIP DETAILS</span>
    <tr>
    <th class="head_cell">CELL NUMBER</th>
    <th class="head_cell">FULL SURNAME</th>
    <th class="head_cell">EMAIL</th>
    </tr>
    <?php
    while($row=mysql_fetch_array($result)) {
        
    ?>
        <tr>
        <td class="result_cell c_align">
        <?php echo $row['cell_phone'];?>
        </td>
        <td class="cell_other c_align back_color">
        <option value="<?php echo $row['surname'] . ', ' $row['name'];?>"><?php echo $row['surname'] . ', ' $row['name'];?></option>
        </td>
        <td>
        <a href="mailtto:<?php echo $row['email'];?>"><?php echo $row['email'];?></a>
        </td></tr>
        <?php
        
    if(!isset($counter[$firstNAsAString])) {
            
    $counter[$firstNAsAString] = 0;
        } else {
            
    $counter[$firstNAsAString]++;
            
    $last_surname $row['surname'];
            
    $i++;
            
    ?></td></tr>
        <?php
        
    }
    }
    ?>
    </table>
    Corrections to my coding/thoughts welcome.

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
  •