--- Leelakh Ran <[EMAIL PROTECTED]> wrote:

> Here have two pages; page1.php and page2.php.
> 
> I defiend  a variable in page1.php as $storedfrom = $_SERVER["HTTP_HOST"] .
> $_SERVER["REQUEST_URI"];
> 
> I want to access $storedfrom variable from page2.php without passing it
> through URL link.
> 
> How it can access by using session variable or global variable?
> 
> Expecting yours' valuable suggestion.
> 
> Rgds, Leelakh Ran


This is a job for session variables.

On both pages you should place the following on the first line in the first
character position of the file -- before anything else is printed or any static
HTML is output to the browser.  The "_____" is not part of the file:

_____
<?php 
  session_start();


In your first script you can put a value in a session variable like this:

  $_SESSION['variable_name'] = $value;

This should also be done before any printing or static HTML.



The second script can obtain a value using:

  $variable = $_SESSION['variable_name'];


James

Reply via email to