msaz87 Posted October 19, 2009 Share Posted October 19, 2009 Hey all, I've been having trouble with anchor tags and was hoping you guys might be able to help. I've got some links that sort a table by pushing a few variables through, but I also want when the page reloads and sorts for it to be shot down to where the table is. My code is: <a href=\"hof.php?mvpsort=team&mvporder=ASC#mvp\" class=\"white\" title=\"Sort Ascending\">Δ</a> But the only browser it seems to work on is Safari... both Firefox and IE seem to ignore the anchor. You can see the page at http://www.fasports.com/az/phx/hof.php and if you click the "show/hide" on "League MVP History". Any help is greatly appreciated... thanks! Link to comment https://forums.phpfreaks.com/topic/178194-anchor-tags-while-passing-variables-not-working/ Share on other sites More sharing options...
Gayner Posted October 19, 2009 Share Posted October 19, 2009 Seems more then just php issue,.. I could help but i dont see any php issue here, lol maybe u can move this topic or make 1 in the appropriate forum and i bet u will find help Link to comment https://forums.phpfreaks.com/topic/178194-anchor-tags-while-passing-variables-not-working/#findComment-939515 Share on other sites More sharing options...
msaz87 Posted October 19, 2009 Author Share Posted October 19, 2009 I just figured it was a PHP issue because there's nothing wrong related to sorting the database or anything like that.. the problem (I assume), lies within passing that anchor in the same code as the other variables... but if it sounds more appropriate in a different section I can definitely move it -- I just don't know what a better fit would be? Thanks! Link to comment https://forums.phpfreaks.com/topic/178194-anchor-tags-while-passing-variables-not-working/#findComment-939518 Share on other sites More sharing options...
trq Posted October 19, 2009 Share Posted October 19, 2009 Firstly, you haven't posted enough code for us to be helpful. Is the code you have posted echo'd via php or what? Link to comment https://forums.phpfreaks.com/topic/178194-anchor-tags-while-passing-variables-not-working/#findComment-939527 Share on other sites More sharing options...
msaz87 Posted October 19, 2009 Author Share Posted October 19, 2009 Firstly, you haven't posted enough code for us to be helpful. Is the code you have posted echo'd via php or what? Yes... sorry... here's more, I'm just trying to cut out the excess, but I suppose too much is better than too little... <a name="mvp"></a> <?php $mvpsort = $_REQUEST['mvpsort']; $mvporder = $_REQUEST['mvporder']; switch ($mvpsort) { case "year": $result = mysql_query("SELECT * FROM arizona ORDER BY year ".$mvporder."") or die(mysql_error()); break; case "season": $result = mysql_query("SELECT * FROM arizona ORDER BY season ".$mvporder."") or die(mysql_error()); break; case "day": $result = mysql_query("SELECT * FROM arizona ORDER BY day ".$mvporder."") or die(mysql_error()); break; case "division": $result = mysql_query("SELECT * FROM arizona ORDER BY division ".$mvporder."") or die(mysql_error()); break; case "name": $result = mysql_query("SELECT * FROM arizona ORDER BY name ".$mvporder."") or die(mysql_error()); break; case "team": $result = mysql_query("SELECT * FROM arizona ORDER BY team ".$mvporder."") or die(mysql_error()); break; default: $result = mysql_query("SELECT * FROM arizona") or die(mysql_error()); } $rowclass = 0; // Print out the contents of the entry echo "<center><table class=\"records\"><tr>"; echo " <td bgcolor=\"#003366\"> <div style=\"width: 50%; float: left; color: white; font-weight: bold\">Year</div> <div style=\"width: 50%; float: right; color: white; font-weight: bold\" align=\"right\"> <a href=\"hof.php?mvpsort=year&mvporder=ASC#mvp\" class=\"white\" title=\"Sort Ascending\">Δ</a> <a href=\"hof.php?mvpsort=year&mvporder=DESC#mvp\" class=\"white\" title=\"Sort Descending\">∇</a></div> </td>"; echo " <td bgcolor=\"#003366\"> <div style=\"width: 50%; float: left; color: white; font-weight: bold\">Season</div> <div style=\"width: 50%; float: right; color: white; font-weight: bold\" align=\"right\"> <a href=\"hof.php?mvpsort=season&mvporder=ASC#mvp\" class=\"white\" title=\"Sort Ascending\">Δ</a> <a href=\"hof.php?mvpsort=season&mvporder=DESC#mvp\" class=\"white\" title=\"Sort Descending\">∇</a></div> </td>"; echo " <td bgcolor=\"#003366\"> <div style=\"width: 50%; float: left; color: white; font-weight: bold\">Day</div> <div style=\"width: 50%; float: right; color: white; font-weight: bold\" align=\"right\"> <a href=\"hof.php?mvpsort=day&mvporder=ASC#mvp\" class=\"white\" title=\"Sort Ascending\">Δ</a> <a href=\"hof.php?mvpsort=day&mvporder=DESC#mvp\" class=\"white\" title=\"Sort Descending\">∇</a></div> </td>"; echo " <td bgcolor=\"#003366\"> <div style=\"width: 50%; float: left; color: white; font-weight: bold\">Division</div> <div style=\"width: 50%; float: right; color: white; font-weight: bold\" align=\"right\"> <a href=\"hof.php?mvpsort=division&mvporder=ASC#mvp\" class=\"white\" title=\"Sort Ascending\">Δ</a> <a href=\"hof.php?mvpsort=division&mvporder=DESC#mvp\" class=\"white\" title=\"Sort Descending\">∇</a></div> </td>"; echo " <td bgcolor=\"#003366\"> <div style=\"width: 50%; float: left; color: white; font-weight: bold\">Name</div> <div style=\"width: 50%; float: right; color: white; font-weight: bold\" align=\"right\"> <a href=\"hof.php?mvpsort=name&mvporder=ASC#mvp\" class=\"white\" title=\"Sort Ascending\">Δ</a> <a href=\"hof.php?mvpsort=name&mvporder=DESC#mvp\" class=\"white\" title=\"Sort Descending\">∇</a></div> </td>"; echo " <td bgcolor=\"#003366\"> <div style=\"width: 50%; float: left; color: white; font-weight: bold\">Team</div> <div style=\"width: 50%; float: right; color: white; font-weight: bold\" align=\"right\"> <a href=\"http://www.fasports.com/az/phx/hof.php?mvpsort=team&mvporder=ASC#mvp\" class=\"white\" title=\"Sort Ascending\">Δ</a> <a href=\"hof.php?mvpsort=team&mvporder=DESC#mvp\" class=\"white\" title=\"Sort Descending\">∇</a></div> </td>"; echo "</tr>"; while($row = mysql_fetch_array($result)){ ?> <tr class="row<?= $rowclass ?>"><td><? echo ($row['year']); ?></td> <td><? echo ($row['season']); ?></td> <td><? echo ($row['day']); ?></td> <td><? echo ($row['division']); ?></td> <td><a href="http://www.fasports.com/az/phx/images/mvps/<? echo ($row['photourl']); ?>" class="blue" title="View <? echo ($row['name']); ?>'s Photo" target="_blank"><? echo ($row['name']); ?></a></td> <td><? echo ($row['team']); ?></td></tr> <? $rowclass = 1 - $rowclass; ?> <? } echo "</table>"; ?> The above is all the relevant code on that page, which is included into the greater hof.php file... Link to comment https://forums.phpfreaks.com/topic/178194-anchor-tags-while-passing-variables-not-working/#findComment-939531 Share on other sites More sharing options...
msaz87 Posted October 19, 2009 Author Share Posted October 19, 2009 Just an update... I moved the anchor tag from the file being included to the greater file and the problem was resolved in Firefox... but still doesn't seem to work in IE... Any help is appreciated.. thanks! Link to comment https://forums.phpfreaks.com/topic/178194-anchor-tags-while-passing-variables-not-working/#findComment-940006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.