Jump to content

Recommended Posts

hi. I am trying to passon data using session from one page to another but not having any luck.

At top of page one im doing this

 

page1.php

<?php

session_start();

  $_SESSION['referrer'] = $_SERVER['REQUEST_URI'];

?>

 

 

and in page2.php at very top

<?php

        echo "Referrer = ".$_SESSION['referrer'];

?>

 

Basically I want to use 'referrer' to send user back to previous page.

I assume that I only have to call session_start() just once in page1 .

 

I am using wamp, apache 2.2.8 , php 5.2.6, Windows Vista

 

Please correct me as what I am doing wrong.

Any help will be appreciated.

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/111933-solved-session-help/
Share on other sites

I assume that I only have to call session_start() just once in page1

In programming ASSUME means: To make an ASS out of U and ME. Don't assume anything in programming. Read the manual. The examples under both the Session Handling section and under the session_start() function show how to use them.

Link to comment
https://forums.phpfreaks.com/topic/111933-solved-session-help/#findComment-574503
Share on other sites

I assume that I only have to call session_start() just once in page1

In programming ASSUME means: To make an ASS out of U and ME. Don't assume anything in programming. Read the manual. The examples under both the Session Handling section and under the session_start() function show how to use them.

 

Actually, that's what it means to The Odd Couple. =)

Link to comment
https://forums.phpfreaks.com/topic/111933-solved-session-help/#findComment-574546
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.