url variables in php??

Discussion in 'Web Design & Coding' started by forcer, Apr 1, 2003.

  1. forcer

    forcer OSNN Senior Addict

    Messages:
    413
    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
     
  2. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    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";
    }
    ?>
    
     
  3. forcer

    forcer OSNN Senior Addict

    Messages:
    413
    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?
     
  4. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Yup, it'll be like that. :)