tags:

views:

34

answers:

3

Hello,

The table below works well. However, I am trying to pass $row["username"] along as a GET variable on the second hyperlink (the hyperlink in the second row that is class "sitename2" below). When I hover over this hyperlink, everything is blank after the "profile="... there is no $row["username"] to be passed along. Any idea why the $row["username"] is not being appended to the end of this URL?

Thanks in advance,

John

EDIT: Sorry, I missed a simple mistake here. Thanks for the help... sorry for taking your time.

<?php


$sqlStr = "SELECT s.loginid, s.title, s.url, s.displayurl, l.username
             FROM submission AS s,
                  login AS l
            WHERE s.loginid = l.loginid
         ORDER BY s.datesubmitted DESC
            LIMIT 10";


$result = mysql_query($sqlStr);

$arr = array(); 
echo "<table class=\"samplesrec\">";
while ($row = mysql_fetch_array($result)) { 
    echo '<tr>';
    echo '<td class="sitename1"><a href="http://www.'.$row["url"].'"&gt;'.$row["title"].'&lt;/a&gt;&lt;/td&gt;';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="sitename2"><a href="http://www..../sandbox/members/index.php?profile="&gt;'.$row["username"].'&lt;/a&gt;&lt;/td&gt;';
    echo '</tr>';
    }
echo "</table>";    




?>
A: 

Because you're only putting it in the anchor?

Try:

echo '<td class="sitename2"><a href="http://www.foo.com/sandbox/members/index.php?profile=' . $row["username"] . '">'.$row["username"].'</a></td>';
Matthew Flaschen
Whoops... sorry for wasting your time. :)
John
+1  A: 

Because in your code, there is nothing after profile, see ?profile="

echo '.../index.php?profile=">'.$row["username"].'</a></td>';

You could add like this

echo '.../index.php?profile='.$row["username"].'">'.$row["username"].'</a></td>';
S.Mark
+1  A: 

Try:

echo '<td class="sitename2"><a href="http://www.foo.com/sandbox/members/index.php?profile='.$row["username"].'"&gt;'.$row["username"].'&lt;/a&gt;&lt;/td&gt;';
echo '</tr>';
Chacha102