dean7 Posted August 20, 2011 Share Posted August 20, 2011 Hey all, I'm currently coding a Few Blacklists for my Website, in which I want to code it so I'll have all blacklists on one page so the URL would be like: localhost/blacklist.php?user localhost/blacklist.php?staff I've got a Blacklist coded which all works well, just I've attempted using the $_GET function to change the code to the blacklist that they clicked on... <?php session_start(); include ("includes/config.php"); include ("includes/functions.php"); logincheck(); $Username = $_SESSION['username']; ?> <table width='50%' cellpadding='0' cellspacing='0' border='1' class='table' align='center'> <tr> <td class='header' align='center' colspan='4'>Other Blacklists:</td> </tr> <tr> <td align='center'><a href='?user' target='mainFrame'>User Blacklist</a></td><td align='center'><a href='?money' target='mainFrame'>Most Money</a></td><td align='center'><a href='?racewins.php' target='mainFrame'>Race Wins</a></td><td align='center'><a href='?racelose' target='mainFrame'>Race Loses</a></td> </tr> <tr> <td align='center'><a href='?miles' target='mainFrame'>Most Miles</a></td><td align='center'><a href='?fosbl' target='mainFrame'>Faster Or Slower</a></td><td align='center'><a href='?police' target='mainFrame'>Police Chase</a></td> </tr> </table> <br /> <table width='20%' cellpadding='0' cellspacing='0' border='1' class='table' align='center'> <tr> <td colspan='2' align='center' class='header'>User Blacklist:</td> </tr> <tr> <td align='center' class='omg' width='5%'>Num:</td><td align='center' class='omg' width='10%'>Username:</td> </tr> <?php if ($_GET['user']){ $Query = mysql_query("SELECT * FROM users WHERE userlevel = '1' OR userlevel = '5' ORDER BY rep DESC LIMIT 25"); for ($Place < 25; $This = mysql_fetch_object($Query){ $Place = $Place+1; if ($This->username != $Username){ $Colour = "bgcolor=#424242"; }else{ $Colour = "bgcolor=#111111"; } print ("<tr><td width='5%' align='center' $Colour>$Place</td><td width='20%' align='center' $Colour><a href='profile.php?viewuser=".$This->username."'>$This->username</a></td></tr>"); } } ?> </table> <br /> Soon as I added the $_GET['user]{ it stopped showing the Blacklist completely. Sorry if it wasn't explained well, but hopefully you can catch what I'm trying to-do Thanks. Link to comment https://forums.phpfreaks.com/topic/245274-links-to-the-same-page/ Share on other sites More sharing options...
titan21 Posted August 20, 2011 Share Posted August 20, 2011 Try outputting print_r($_GET) to see what is actually being obtained from the get string. Can you post the output? Link to comment https://forums.phpfreaks.com/topic/245274-links-to-the-same-page/#findComment-1259746 Share on other sites More sharing options...
dean7 Posted August 20, 2011 Author Share Posted August 20, 2011 Try outputting print_r($_GET) to see what is actually being obtained from the get string. Can you post the output? I didn't get anything outputted. Didn't do anything when I added it into the code Link to comment https://forums.phpfreaks.com/topic/245274-links-to-the-same-page/#findComment-1259748 Share on other sites More sharing options...
titan21 Posted August 20, 2011 Share Posted August 20, 2011 ..which indicates that $_GET is not populated at all - is the url: something.php?user=me just checking that the page is being called correctly Link to comment https://forums.phpfreaks.com/topic/245274-links-to-the-same-page/#findComment-1259754 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.