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

socket makes browser hang...
I have a socket server, and I am having a problem at the moment...

A browser sends a http hea

Greek characters in php
Hi,

I'm making a script and I m using for first time greek characters.
I started to write

Parse Error
Hi Guys,

I have a function in my class which returns a string link variable. The problem is i

line breaks in between fetched file names
Hi,

I have this code:
Code: <?php
if($dir = opendir('files')){
while (($f

php web service error
hey guys,
I'm working on a project requires the use of web services. I've been trying a few tutor

AutoChoosing a CSS file based on URL
Hey everyone,

I have a site that has multiple URLs and CSS files.

Based on the URL tha

Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter

Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

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