passing data from one page to another


Posted on 16th Feb 2014 07:03 pm by admin

hey guys
i have the follwoing code to get information from one page and place on another:

(1st page) page to get info from:
Code: <?php session_start();
$_SESSION['data'] = "blah blah blah"; ?>

(2nd page) page to show info on:
Code: <?php session_start();
$data= $_SESSION['data'];?> // at top of page

<?php echo $data; ?>
i would like to use this code to show an error report, but the thing is that once the information has been called on the second page it stays there,
i would like it so if the page is reloaded the info will be reset/not show until the 1st page is loaded again.

can anyone help me please?

thanks everyone

No comments posted yet

Your Answer:

Login to answer
329 Like 28 Dislike
Previous forums Next forums
Other forums

Get word number x from string?
How can I use a function to loop through a string, and "have a look at" every word in the

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

Got A Free Server :(
So I was given a free server

http://shopping.yahoo.com/p:Compaq%20ProLiant%201500%20Server:1

Curl timeout breaks script
So im having difficulties with skipping timeout error in curl
my script calls different functions

php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecur

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

am I using this for loop correctly
Dear buddies!

Right now I am generating a report with some details for all the dealers.

use an array from 1 class in a second class
I have a class that adds data to an array

Then I have a second class and I need to check if t

Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash