jjmusicpro Posted July 12, 2007 Share Posted July 12, 2007 I wanted people to go to www.mysite.com/index.php?groupid=1 So when the page is displayed, it should go into my DB and get the valudes from metroareas, and then dispaly some data from the DB. I cant get seem to get it to do that, here is what i got: <?php if($_SERVER['REQUEST_METHOD'] == "POST"){ $groupid = $_GET['groupid']; while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $site = $row['groupname'] ; } echo $row['groupname'];} ?> Thanks for the help everyone...ima noob!@ Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 12, 2007 Share Posted July 12, 2007 check first if the condition you have run your query like put some echo 'test' inside the condition or if that si not effective then show your query Quote Link to comment Share on other sites More sharing options...
jjmusicpro Posted July 12, 2007 Author Share Posted July 12, 2007 This is what i have and it seems to work right off the bat when i go to www.mysite.com/index.php?groupid=1 but when i run a search from that page, and it posts back to itself, it wont display it anymore <?php require_once ('connect.php'); require_once ('opendb.php'); $groupid_sent = $_GET['groupid']; $query = "SELECT * FROM metrogroups WHERE groupid='$groupid_sent'"; $result = @mysql_query ($query); $count = mysql_num_rows($result); //number of results while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $groupname = $row['groupname'] ; echo $groupname; } ?> Quote Link to comment Share on other sites More sharing options...
jjmusicpro Posted July 13, 2007 Author Share Posted July 13, 2007 i think i see whats going on, i am not passing the id anymore in the url, how do i pass this again after? when i start out i go to www.mysite.com/index.php?groupid=1 then when i run a search function, it sends me back to index.php, so how can i attached or hide that value of groupid? Quote Link to comment Share on other sites More sharing options...
jjmusicpro Posted July 13, 2007 Author Share Posted July 13, 2007 How do i pass the id on the end of redirect? echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=nf.php\">"; like echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=nf.php <?php $groupid_sent = $_GET['groupid']; echo $groupid_sent ?>\">"; ??? dosnt seem to work Quote Link to comment Share on other sites More sharing options...
Oldiesmann Posted July 13, 2007 Share Posted July 13, 2007 echo "<meta http-equiv=\"Refresh\" content=\"0;url=nf.php?" . $_GET['groupid'] . "\">"; Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 13, 2007 Share Posted July 13, 2007 echo '<meta http-equiv="refresh" content="0; url=nf.php?groupid='.$_GET['groupid'].'?>">'; Try that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.