dbradbury Posted April 7, 2010 Share Posted April 7, 2010 $l = ($_GET($row['forum_id'])); would that work? EDIT: it isnt is it? as $_GET gets the info from the url lol.. sorry my dumb moment lol Quote Link to comment Share on other sites More sharing options...
br0ken Posted April 7, 2010 Share Posted April 7, 2010 This would work if $row['forum_id'] contain a string that was also a parameter name in the query string but I doubt it is what you're trying to do. What are you trying to achieve? Quote Link to comment Share on other sites More sharing options...
dbradbury Posted April 7, 2010 Author Share Posted April 7, 2010 im trying to change my urls.. from my forum.. sounds weird lol.. i have a forum that runs a site, and it contains lyrics.. letters, artist, albums, tracks, lyrics all one inside another like all artists beginning with a will be in forum A lol.. and so on.. i got it to work with the forum id number but i want to change to url to the actual letters, artists and so on, its just rather hard.. i can do it up to after the letter, its displaying the albums part i get stuck on, as if the artist is more then two words, i use urlencode to add a + to it then gotta decode it to get the albums, and its confusing me typing it... this may be easier to figure it out what im trying to do, my code below, and the site is http://seunlimited.hostei.com/lyrics.php?letter=11&artist=48&album=49&track=9 then want to change the url to: http://seunlimited.hostei.com/lyrics.php?letter=A&artist=Ashley+Tisdale&album=Guilty+Pleasure&track=Acting+Out <div class="lyrics" align="center"> <?php include("connect1.php"); mysql_select_db("a6867437_db") or die("No Database!"); $l = $_GET['l']; $a = urlencode($_GET['a']); $al = $_GET['al']; $t = $_GET['t']; $getletter = mysql_query("SELECT forum_name FROM phpbb_forums WHERE parent_id='4' ORDER BY forum_name ASC"); $lettercount = mysql_num_rows($getletter); ?> <table width="100%" border="0"> <tr> <td colspan="3" class="tableletters" align="bottom right"> <div class="extend"></div> <div class="righttext"> Please note that some lyrics may be explicit so view at your own risk<br><br> Also SEUnlimited are looking for lyric writers, Interested? <a href="/contactus.php">Click Here</a><br> <br> </div> <?php if($lettercount==0) { echo "There are no letters as of yet"; } else { $displayletters = mysql_query("SELECT * FROM phpbb_forums WHERE parent_id='4' ORDER BY forum_name ASC"); while($row = mysql_fetch_assoc($displayletters)) { echo ' [<a href=lyrics1.php?l='.$row['forum_name'].'>'.$row['forum_name'].'</a>]'; } } ?> </td> <td valign="top" class="tableartwork" width="50%" height="250"> <?php /* $getimageurl = mysql_query("SELECT * FROM phpbb_forums WHERE forum_id='$album'"); $countimage = mysql_num_rows($getimageurl); if($countimage==0) { print ''; } else while($row7 = mysql_fetch_assoc($getimageurl)) { if ($row7['forum_image'] != '') { print '<center><img src=http://phpbb.seunlimited.hostei.com/'.$row7['forum_image'].' width=250 height=250><br><br></center>'; } else { print '<u>No Album Art Yet!<u><br><br>'; } } */ ?> </td> </tr> <tr> <td width="18%" valign="top" class="tableartists"> <?php if(isset($_GET['l'])) { $letter = mysql_query("SELECT * FROM phpbb_forums WHERE forum_name='$l'"); $letter = mysql_fetch_assoc($letter); $letter = $letter['forum_id']; $getartist = mysql_query("SELECT * FROM phpbb_forums WHERE parent_id='$letter' ORDER BY forum_name ASC"); $artistcount = mysql_num_rows($getartist); echo 'Artist starting with: '.$l.' '.$letter.'<br><br>'; if($artistcount==0) { echo ("There are no artists beginning with that letter as of this moment"); } else { $displayartists = $getartist; while($row1 = mysql_fetch_assoc($displayartists)) { echo '<a href=lyrics1.php?l='.$l.'&a='.urlencode($row1['forum_name']).'>'.$row1['forum_name'].'</a><br>'; } } } else { echo "Please select a letter above!"; } ?> </td> <td width="18%" valign="top" align="left" class="tablealbums"> <div class="scrollable"> <?php if(isset($_GET['a'])) { $adecode = urldecode($a); $artist = mysql_query("SELECT * FROM phpbb_forums WHERE forum_name='$adecode'"); $artist = mysql_fetch_assoc($artist); $artist = $artist['forum_id']; $getalbums = mysql_query("SELECT * FROM phpbb_forums WHERE parent_id='$artist' ORDER BY forum_desc DESC"); $albumcount = mysql_num_rows($getalbums); echo 'Albums by: '.$adecode.' '.$artist.'<br><br>'; if($albumcount==0) { echo "No albums by that artist!"; } else { while($row2 = mysql_fetch_assoc($getalbums)) { echo '<a href=lyrics1.php?l='.$l.'&a='.$a.'&al='.$row2['forum_name'].'>'.$row2['forum_name'].'</a><br>'; } } } else { echo "<-- Please select an artist!"; } ?> </div> </td> <td width="25%" valign="top" class="tabletracks"> <div class="scrollable"> <?php if(isset($_GET['album'])) { $albumtracks = mysql_query("SELECT * FROM phpbb_forums WHERE forum_id='$album'"); $albumtracks = mysql_fetch_assoc($albumtracks); $albumtracks = $albumtracks['forum_name']; $gettracks = mysql_query("SELECT * FROM phpbb_topics WHERE forum_id='$album' ORDER BY topic_title ASC"); $trackcount = mysql_num_rows($gettracks); echo 'Tracklisting of: '.$albumtracks.'<br><br>'; if($trackcount==0) { echo 'No tracks on album yet!'; } else { $displaytracks = $gettracks; while ($row3 = mysql_fetch_assoc($displaytracks)) { echo '<a href=lyrics.php?letter='.$letter.'&artist='.$artist.'&album='.$album.'&track='.$row3['topic_id'].'>'.substr_replace($row3['topic_title'], "", 0, 3).'</a><br>'; } } } else { echo "<-- Please select an album"; } ?> </div> </td> <td valign="top" class="tablelyrics"> <div class="scrollable"> <?php if(isset($_GET['track'])) { $getlyrics = mysql_query("SELECT * FROM phpbb_posts WHERE topic_id='$track'"); $lyriccount = mysql_num_rows($getlyrics); if($lyriccount==0) { echo "No lyrics for that song yet!"; } else { $displaylyrics = $getlyrics; while ($row4 = mysql_fetch_assoc($displaylyrics)) { ?><u><?php print substr_replace($row4['post_subject'], "", 0, 3); ?></u><br><br><?php print strtolower(nl2br($row4['post_text'])); ?><br><br><?php $getposterid = $row4['poster_id']; $getpostername = mysql_query("SELECT * FROM phpbb_users WHERE user_id='$getposterid'"); while ($row5 = mysql_fetch_assoc($getpostername)) { print "Posted by: "; print $row5['username']; } } } } ?> </div> </td> </tr> </table> </div> Quote Link to comment Share on other sites More sharing options...
br0ken Posted April 7, 2010 Share Posted April 7, 2010 That is a little confusing! I won't pretend to know what you're trying to achieve but I did notice that you're trying to use the $album variable in your query, but you haven't actually initialised it yet. Where you have: if(isset($_GET['album'])) { Change it to if($album = isset($_GET['album'])) { Quote Link to comment Share on other sites More sharing options...
dbradbury Posted April 7, 2010 Author Share Posted April 7, 2010 my bad.. is suppsed to be if(isset($_GET['al'])) { albums work now.. gonna try the rest, ill let you know how it works out... 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.