CoderZone.org
Pages: 1 « previous     next »
  Print  
Author Topic: How to make this variable global?  (Read 4592 times) Bookmark and Share
Flynn
Newbie
*
Posts: 9



View Profile
« on: Dec 20, 2010, 08:52:25 am »

I'm writing an app that sets ups some config variables. One of the variables is a file path setting,  $image_path.

As part of the app, images are streamed to the browser like this:

<img src="show_image.php?file=1234.jpg">

The $image_path variable doesn't appear to be accessible from inside the show_image.php file, however. Is there a way to add it to the $GLOBALS array or make it accessible in the show_image.php file?

Logged
phpMan2010
Newbie
*
Posts: 32



View Profile
« Reply #1 on: Dec 23, 2010, 06:57:22 am »

use an include file to include global variables

use sessions to share the values between pages

it is accessible in show_image.php - using the $_GET or $_SERVER['QUERYSTRING'] variables
Logged
Tags:
Pages: 1
  Print  
 
Jump to: