Page 1 of 1

Global variables between pages

Posted: Tue Mar 11, 2008 8:17 am
by samuelmoneill
Hi am quite new to PHP,

I am building a website using HTML forms PHP and a mySQL database.

I have alot of inter-connected pages using HTML drop-down menus.
Once an option is selected from the menu you are redirected to a new page.
This new page contains PHP code $variable = $_GET['dropdownmenuname']; from the previous page. But I get to a stage where I do this several times and I need the selection variable from the first page to create a mySQL query in the cuurent page.

Firstly you select say "Branch" from "Branch, Client, Owner, Property for Rent, Staff or Viewing. This passes "Branch to a variable $selectDelete.
This then directs you t another page.
This page contains a drop-down menu containing specific options relevent only to previous selection. Say you select "B7". This is passed to another variable $selectRow. Once you select an option from this page it passes variables from the first page say $selectDelete and the second page say $selectRow to a new variable for mySQL $query = delete from $selectDelete where Bno ='$selectRow';

This example is on my website
http://student.cs.ucc.ie/~smon1/dreamho ... delete.php

Is it possible to pass variables like this

Sorry if this is confusing.

Re: Global variables between pages

Posted: Tue Mar 11, 2008 8:37 am
by Christopher
You can pass them in hidden inputs, or save them in the session.