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

want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for up

Contents of variable not echoing
Hey guys, hopefully this is an easy one...

In this line, the variables are not echoing out. T

UDS 4.0 Datatype issue
UDS 4.0.322 -- connecting to NI Labview 9.0

When using connection method: Cache with live

Will an XHTML DOCTYPE interfere with my PHP if I'm not experienced enough?
I've read this article here: http://friendlybit.com/html/why-xhtml-is-a-bad-idea/

In a nutshe

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

Get content from table into a list, without repeating.
Alright this is kinda an odd thing, so I need some help.

I have a table "quote" wit

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

upload image name with extension using php
hi frds..

<input id="file1" type="file" name="file[]" &a

ClientScript.RegisterClientScriptBlock Issue
This is what I haveview plaincopy to clipboardprint?Protected Sub posrback_Click(ByVal sender As Obj

Using mysql_real_escape_string for displayed content
On my website users can input data into a textarea and it will store it in the mysql database. But,

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