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.
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)