url variables in php??

forcer

OSNN Senior Addict
#1
i need to work something out for my site.

i have looked at tutorials online but they go over board for the simplicity i need.

for example, i have a page artists.php

this page will have list of artists

example,

Trancemaster
Willmsjay
Jobro
Guyver
Airgate
ect...

then say some1 clicks Jobro, the link will then display:


artists.php?artist=jobro

and the jobro page will load

is there any simple way of working this out because most tutorials just baffle me
 

SPeedY_B

I may actually be insane.
#2
Something like this should do the job :)
Code:
<?php
switch ($artist) {
case Trancemaster:
print "trancemasters info here";
break;
case Willmsjay:
print "Willmsjay info here";
break;
case Jobro:
print "Jobro info";
break;
//etc
default:
print "Invalid Artist Specified, please go to the <a href=\"index.php\">index page</a> and try again";
}
?>
 

forcer

OSNN Senior Addict
#3
cool thanx that works. 1 more question though.

what will the link be:

PHP:
<p><a href="artists.php?artist=Trancemaster">Trancemaster</a></p>
???? or will it be different?
 

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,975
Messages
673,316
Members
89,017
Latest member
Rowdanger