Page 1 of 1
'Nother Question
Posted: Fri May 28, 2004 2:48 pm
by SilverMist
Okie, here's my problemo. I can make a page like page.php?pid=1 but here is what I need: page.php?pid=1&name=Page&cat=3 because I am making a lyric website, so I'm going to make it so when someone clicks on "Keith, Toby" and his CD Shock N' Y'All, then song Whiskey Girl, the page has to be k.php?name=keithtoby&cd=shocknyall&song=whiskeygirl. Okay? Please help

Re: 'Nother Question
Posted: Fri May 28, 2004 2:52 pm
by Weirdan
SilverMist wrote:Okay?
Ok. What's the question?

Posted: Fri May 28, 2004 2:53 pm
by kettle_drum
You just create the links to do so:
Code: Select all
<a href="page.php?artist=keith-toby">Keith, Toby</a>
<a href="page.php?artist=keith-toby&album=Shock-n-yall">Shock N All</a>
<a href="page.php?artist=keith-toby&album=Shock-n-yall&song=whiskeygirl">Whiskeygirl</a>
Can all be done one a single page that just looks to see if there is an artist/album/song in the url, and if there is show the correect listing.
Posted: Fri May 28, 2004 3:25 pm
by SilverMist
Yes BUT, I need the code so that I can place all the page content. Like I need the code so that when they click Shock N' Y'all, I need to put a list of all the songs on that disk, then, when selected, can proceed to the song page. If you need more info, just ask, I'm not that good at explaining things.

Posted: Fri May 28, 2004 5:35 pm
by kettle_drum
Code: Select all
if(isset($_GET['artist'])){
//show albums
}else if(isset($_GET['album'])){
//show songs
}else if(isset($_GET['song'])){
//show lyrics
}else{
//show artists
}
If this is going to be a large database of lyrics then your best off using ID's for artists/albums/songs so that you can link to a direct song or album as there are many that have the same name. So all you need to do really is have a database like:
Code: Select all
id
type #will be either artist/album/song
value
parent
Then just first of all show a list of all artists - where type = artist. Then when the user clicks on that - say the id is '777' you list all type = album where parent = '777', then when the user clicks on an album - the id = '12345', do the same process again and again until you get to the song, and grab the lyrics.
Posted: Fri May 28, 2004 8:30 pm
by SilverMist
Heh, thank you!! But there is still a problem

Here is my code:
Code: Select all
<?php
{
echo "Hello there. This is me, testing a page!";
}
if(isset($_GET['artist'])){
//show albums
echo "I guess this is the artists page!!";
}else if(isset($_GET['album'])){
//show songs
echo "Weeee 'nother page!";
}else if(isset($_GET['song'])){
//show lyrics
echo "Wee yet another page!";
}else{
//show artists
}
?>
So, when I go to the page, I get the whole "Hello there. This is me, testing a page!" thing, which is wonderful

But here's the problem. When I go page.php?artists I get "Hello there. This is me, testing a page!I guess this is the artist's page!" which, as you can prolly tell, is not what I want

Posted: Fri May 28, 2004 8:34 pm
by kettle_drum
Yes as you echo it at the top and its not in any conditional statement - hense it is run everytime the page is called. You can add it to the final else to show that the page is working fine - as something will always be echoed on the page no matter what data is in the url.
Posted: Fri May 28, 2004 8:43 pm
by maqmus
Code: Select all
<?php
if(isset($_GET['artist'])){
//show albums
echo "I guess this is the artists page!!";
}else if(isset($_GET['album'])){
//show songs
echo "Weeee 'nother page!";
}else if(isset($_GET['song'])){
//show lyrics
echo "Wee yet another page!";
}else{
echo "Hello there. This is me, testing a page!";
}
?>
In this case if $_GET is empty you'l get "Hello there...."
Posted: Fri May 28, 2004 10:00 pm
by SilverMist
Well I tried all this and I'm getting an error on line 4.
Posted: Fri May 28, 2004 10:14 pm
by Illusionist
well... waht is line 4?? We can't just guess at what you have. It might help if you just post what you currently have ...