Variable help!

Discussion in 'PHP' started by debz89uk, Mar 18, 2010.

  1. #1
    I am creating a system which contains classes. Each class has its own page, and on each of these pages I have saved as a variable which table in MySQL the information is stored. For example... on the class page called "English", I have $table = "English" ( as this is what the table is called in MySQL), and on the Maths page i have $table = "Maths". However, on each of these pages is a link (no need to go into detail about what is does) but all the classes link to the one page (uploads.php) and I want the variable in this page to change to whatever page it was clicked from. For example, if I am on the english page and i click the uploads link, i want $table = "English" on the uploads php page, also if i am on the Maths page and i click the uploads link, i want its to change to $table = "maths".


    Sorry if I'm not explaining this very well, but I am sure its just a simple bit of code after "$table" on the upload.php page that I need. Any help would be greatly appreciated.
     
    debz89uk, Mar 18, 2010 IP
  2. bozghiyy

    bozghiyy Peon

    Messages:
    19
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you can use $_SERVER["HTTP_REFERER"] that will return :
    another way is to send through $_GET:
    Make all the links to upload.php with a upload.php?t=english (this is good if you want to use mod rewrite)
     
    bozghiyy, Mar 18, 2010 IP
  3. guardian999

    guardian999 Well-Known Member

    Messages:
    376
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #3
    maybe you can use hidden field
     
    guardian999, Mar 18, 2010 IP