Re: Another way to send variables

From: Date: Fri, 13 Jun 2008 22:02:04 +0000
Subject: Re: Another way to send variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-275371@lists.php.net to get a copy of this message
On Fri, Jun 13, 2008 at 5:49 PM, R B <rbpphp@gmail.com> wrote: > Hello. > > I have this script (script1.php): > > <?php > $a = "Hello"; > header("Location: script2.php"); > ?> > > I need to send the $a variable to script2.php, but i don´t want to send it > in the url. > > Is there another method? <?php // script1.php session_start(); $_SESSION['a'] = "Hello"; header("Location: script2.php"); exit(0); ?> <?php // script2.php session_start(); $a = $_SESSION['a']; echo $_SESSION['a']; ?> -- </Daniel P. Brown> Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo.

« previous php.general (#275371) next »