tags:

views:

41

answers:

3

Hello,

I have 2 files namely:

  1. uploading.php
  2. emaillinks.php

both include a file inc.php which has all the include files and initiate database connection.

a variable is declared in file uploading.php, i wanted to know how can i access it in emaillinks.php, i cant include uploading.php in emaillinks.php.

I want to avoid cookies because data is big and always different.

what is the best option to make it accessible by emaillinks.php?

Thank You.

A: 

Depending on what it is, you could put it into the database or into the session ($_SESSION)

Greg
A: 

If you can't include you'll need to go with session variables or cookies.

McAden
A: 

Reading your question the words "registry pattern" suddenly popped into my head. This might be a bit of overkill for your needs, but it might be worth looking into.

You'd probably have to do a lot of refactoring to make this solution available. So you'd probably be best using the session, database or some text file to store your variable.

Here is a good article on using a registry, though (if you're interested).

Kieran Hall