passing integer from one page to another

I am trying to reduce an output from a MySQL search. I want to have page(1) pass an integer to the query page(2) for inclusion into the query stream. I do not want to pass via url and &_get. I have tried $_post and $_session with no luck, all variables show null on page(2). is the php code restricted as to where it goes in a page? - page1 only has php to define the variable (added to an existing html page.) The query on page(2) is inserted into an existing html page also.

I can get the $_post[‘var’] and $_session[‘var’] to echo on page(1) but it never passes to page(2). what does good code on page(2) look like?

Don

Do you start the session handler on page 2?
session_start ()

code:

page 1

session_start();
$to_be_passed = 1;
$_SESSION[‘mfg’] = $to_be_passed;

page 2

session_start();
$from_pg1 = $_SESSION[‘mfg’];

put an echo on pg one and you get 1
put an echo on pg two and get a blank

Sponsor our Newsletter | Privacy Policy | Terms of Service